1 line
No EOL
8.2 KiB
Text
1 line
No EOL
8.2 KiB
Text
{"version":3,"file":"password.nomodule.min.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 './password-emission.js';\n\nclass PasswordLabel extends api.core.Instance {\n static get instanceClassName () {\n return 'PasswordLabel';\n }\n\n init () {\n this.addDescent(PasswordEmission.ADJUST, this.adjust.bind(this));\n }\n\n adjust (value) {\n const valueREM = Math.ceil(value / 16);\n this.node.style.paddingRight = valueREM + 'rem';\n }\n}\n\nexport { PasswordLabel };\n","import api from './api.js';\nimport { PasswordToggle } from './script/password/password-toggle.js';\nimport { Password } from './script/password/password.js';\nimport { PasswordSelector } from './script/password/password-selector.js';\nimport { PasswordInput } from './script/password/password-input.js';\nimport { PasswordLabel } from './script/password/password-label.js';\n\napi.password = {\n Password: Password,\n PasswordToggle: PasswordToggle,\n PasswordSelector: PasswordSelector,\n PasswordInput: PasswordInput,\n PasswordLabel: PasswordLabel\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.password.PasswordSelector.INPUT, api.password.PasswordInput);\napi.internals.register(api.password.PasswordSelector.PASSWORD, api.password.Password);\napi.internals.register(api.password.PasswordSelector.TOOGLE, api.password.PasswordToggle);\napi.internals.register(api.password.PasswordSelector.LABEL, api.password.PasswordLabel);\n\nexport default api;\n"],"names":["const","api","window","PasswordEmission","TOGGLE","internals","ns","emission","ADJUST","PasswordToggle","staticAccessors","instanceClassName","init","this","listenClick","ascend","width","isSwappingFont","_isChecked","isChecked","prototypeAccessors","style","getComputedStyle","node","parentNode","parseInt","checked","value","handleClick","swapFont","families","core","Instance","Password","addAscent","toggle","bind","adjust","descend","PasswordSelector","PASSWORD","selector","INPUT","LABEL","TOOGLE","PasswordInput","addDescent","_isRevealed","hasAttribute","listen","capslock","isRevealed","setAttribute","event","getModifierState","attr","removeAttribute","PasswordLabel","valueREM","Math","ceil","paddingRight","password","register"],"mappings":";yBAAAA,ICCMC,EAAMC,OAAuB,KCCtBC,EAAmB,CAC9BC,OAAQH,EAAII,UAAUC,GAAGC,SAAS,WAAY,UAC9CC,OAAQP,EAAII,UAAUC,GAAGC,SAAS,WAAY,WCD1CE,qPACJC,EAAWC,iCACT,MAAO,8BAGTC,gBACEC,KAAKC,cACLD,KAAKE,OAAOZ,EAAiBK,OAAQK,KAAKG,OAC1CH,KAAKI,gBAAiB,EACtBJ,KAAKK,WAAaL,KAAKM,WAGzBC,EAAIJ,qBACFhB,IAAMqB,EAAQC,iBAAiBT,KAAKU,KAAKC,YACzC,OAAOC,SAASJ,EAAML,QAGxBI,EAAID,yBACF,OAAON,KAAKU,KAAKG,SAGnBN,EAAID,uBAAWQ,GACbd,KAAKK,WAAaS,EAClBd,KAAKE,OAAOZ,EAAiBC,OAAQuB,gBAGvCC,uBACEf,KAAKM,WAAaN,KAAK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