TP_JO2024/home/dist/component/password/password.module.js.map

1 line
10 KiB
Text
Raw Normal View History

2024-03-27 17:19:37 +01:00
{"version":3,"file":"password.module.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/password/script/password/password-emission.js","../../../src/component/password/script/password/password-toggle.js","../../../src/component/password/script/password/password.js","../../../src/component/password/script/password/password-selector.js","../../../src/component/password/script/password/password-input.js","../../../src/component/password/script/password/password-label.js","../../../src/component/password/index.js","../../../src/component/password/main.js"],"sourcesContent":["const config = {\r\n prefix: 'fr',\r\n namespace: 'dsfr',\r\n organisation: '@gouvfr',\r\n version: '1.11.2'\r\n};\r\n\r\nexport default config;\r\n","import config from './config.js';\nconst api = window[config.namespace];\nexport default api;\n","import api from '../../api.js';\n\nexport const PasswordEmission = {\n TOGGLE: api.internals.ns.emission('password', 'toggle'),\n ADJUST: api.internals.ns.emission('password', 'adjust')\n};\n","import api from '../../api.js';\nimport { PasswordEmission } from './password-emission.js';\n\nclass PasswordToggle extends api.core.Instance {\n static get instanceClassName () {\n return 'PasswordToggle';\n }\n\n init () {\n this.listenClick();\n this.ascend(PasswordEmission.ADJUST, this.width);\n this.isSwappingFont = true;\n this._isChecked = this.isChecked;\n }\n\n get width () {\n const style = getComputedStyle(this.node.parentNode);\n return parseInt(style.width);\n }\n\n get isChecked () {\n return this.node.checked;\n }\n\n set isChecked (value) {\n this._isChecked = value;\n this.ascend(PasswordEmission.TOGGLE, value);\n }\n\n handleClick () {\n this.isChecked = !this._isChecked;\n }\n\n swapFont (families) {\n this.ascend(PasswordEmission.ADJUST, this.width);\n }\n}\n\nexport { PasswordToggle };\n","import api from '../../api.js';\nimport { PasswordEmission } from './password-emission.js';\n\nclass Password extends api.core.Instance {\n static get instanceClassName () {\n return 'Password';\n }\n\n init () {\n this.addAscent(PasswordEmission.TOGGLE, this.toggle.bind(this));\n this.addAscent(PasswordEmission.ADJUST, this.adjust.bind(this));\n }\n\n toggle (value) {\n this.descend(PasswordEmission.TOGGLE, value);\n }\n\n adjust (value) {\n this.descend(PasswordEmission.ADJUST, value);\n }\n}\n\nexport { Password };\n","import api from '../../api.js';\n\nexport const PasswordSelector = {\n PASSWORD: api.internals.ns.selector('password'),\n INPUT: api.internals.ns.selector('password__input'),\n LABEL: api.internals.ns.selector('password__label'),\n TOOGLE: `${api.internals.ns.selector('password__checkbox')} input[type=\"checkbox\"]`\n};\n","import api from '../../api.js';\nimport { PasswordEmission } from './password-emission.js';\n\nclass PasswordInput extends api.core.Instance {\n static get instanceClassName () {\n return 'PasswordInput';\n }\n\n init () {\n this.addDescent(PasswordEmission.TOGGLE, this.toggle.bind(this));\n this._isRevealed = this.hasAttribute('type') === 'password';\n this.listen('keydown', this.capslock.bind(this)); // for capslock enabled\n this.listen('keyup', this.capslock.bind(this)); // for capslock desabled\n }\n\n toggle (value) {\n this.isRevealed = value;\n this.setAttribute('type', value ? 'text' : 'password');\n }\n\n get isRevealed () {\n return this._isRevealed;\n }\n\n capslock (event) {\n if (event && typeof event.getModifierState !== 'function') return;\n if (event.getModifierState('CapsLock')) {\n this.node.parentNode.setAttribute(api.internals.ns.attr('capslock'), '');\n } else {\n this.node.parentNode.removeAttribute(api.internals.ns.attr('capslock'));\n }\n }\n\n set isRevealed (value) {\n this._isRevealed = value;\n this.setAttribute('type', value ? 'text' : 'password');\n }\n}\n\nexport { PasswordInput };\n","import api from '../../api.js';\nimport { PasswordEmission } from './pas