/** * @file * Password confirm widget template overrides. */ ((Drupal) => { Object.assign(Drupal.user.password.css, { passwordWeak: 'is-weak', widgetInitial: 'is-initial', passwordEmpty: 'is-password-empty', passwordFilled: 'is-password-filled', confirmEmpty: 'is-confirm-empty', confirmFilled: 'is-confirm-filled', }); /** * Constructs a password confirm message element. * * @param {object} passwordSettings * An object containing password related settings and translated text to * display. * @param {string} passwordSettings.confirmTitle * The translated confirm description that labels the actual confirm text. * * @return {string} * Markup for the password confirm message. */ Drupal.theme.passwordConfirmMessage = ({ confirmTitle }) => { const confirmTextWrapper = ''; return `
${confirmTitle} ${confirmTextWrapper}
`; }; /** * Constructs a password strength message. * * @param {object} passwordSettings * An object containing password related settings and translated text to * display. * @param {string} passwordSettings.strengthTitle * The title that precedes the strength text. * * @return {string} * Markup for the password strength indicator. */ Drupal.theme.passwordStrength = ({ strengthTitle }) => { const strengthBar = '
'; const strengthText = ''; return `
${strengthBar}
${strengthTitle} ${strengthText}
`; }; /** * Constructs password suggestions tips. * * @param {object} passwordSettings * An object containing password related settings and translated tex t to * display. * @param {string} passwordSettings.hasWeaknesses * The title that precedes tips. * @param {Array.} tips * Array containing the tips. * * @return {string} * Markup for the password suggestions. */ Drupal.theme.passwordSuggestions = ({ hasWeaknesses }, tips) => `
${ tips.length ? `${hasWeaknesses}` : '' }
`; })(Drupal);