TP_JO2024/home/dist/component/toggle/toggle.nomodule.js.map
2024-03-27 17:19:37 +01:00

1 line
No EOL
5.1 KiB
Text

{"version":3,"file":"toggle.nomodule.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/toggle/script/toggle/toggle-input.js","../../../src/component/toggle/script/toggle/toggle-status-label.js","../../../src/component/toggle/script/toggle/toggle-selector.js","../../../src/component/toggle/index.js","../../../src/component/toggle/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\nclass ToggleInput extends api.core.Instance {\n static get instanceClassName () {\n return 'ToggleInput';\n }\n\n get isChecked () {\n return this.node.checked;\n }\n}\n\nexport { ToggleInput };\n","import api from '../../api.js';\nimport { ToggleInput } from './toggle-input.js';\n\nclass ToggleStatusLabel extends api.core.Instance {\n static get instanceClassName () {\n return 'ToggleStatusLabel';\n }\n\n init () {\n this.register(`input[id=\"${this.getAttribute('for')}\"]`, ToggleInput);\n this.update();\n this.isSwappingFont = true;\n }\n\n get proxy () {\n const scope = this;\n return Object.assign(super.proxy, {\n update: scope.update.bind(scope)\n });\n }\n\n get input () {\n return this.getRegisteredInstances('ToggleInput')[0];\n }\n\n update () {\n this.node.style.removeProperty('--toggle-status-width');\n const checked = this.input.isChecked;\n\n const style = getComputedStyle(this.node, ':before');\n let maxWidth = parseFloat(style.width);\n this.input.node.checked = !checked;\n\n const style2 = getComputedStyle(this.node, ':before');\n const width = parseFloat(style2.width);\n if (width > maxWidth) maxWidth = width;\n this.input.node.checked = checked;\n\n this.node.style.setProperty('--toggle-status-width', (maxWidth / 16) + 'rem');\n }\n\n swapFont (families) {\n this.update();\n }\n}\n\nexport { ToggleStatusLabel };\n","import api from '../../api.js';\n\nexport const ToggleSelector = {\n STATUS_LABEL: `${api.internals.ns.selector('toggle__label')}${api.internals.ns.attr.selector('checked-label')}${api.internals.ns.attr.selector('unchecked-label')}`\n};\n","import api from './api.js';\nimport { ToggleStatusLabel } from './script/toggle/toggle-status-label.js';\nimport { ToggleSelector } from './script/toggle/toggle-selector.js';\n// import { ToggleInput } from './script/toggle/toggle-input.js';\n\napi.toggle = {\n ToggleStatusLabel: ToggleStatusLabel,\n ToggleSelector: ToggleSelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.toggle.ToggleSelector.STATUS_LABEL, api.toggle.ToggleStatusLabel);\n\nexport default api;\n"],"names":["const","super","let"],"mappings":";;;;;EAAAA,IAAM,MAAM,GAAG;EACf,EAAE,MAAM,EAAE,IAAI;EACd,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,YAAY,EAAE,SAAS;EACzB,EAAE,OAAO,EAAE,QAAQ;EACnB,CAAC;;ECJDA,IAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;ECCpC,IAAM,WAAW;;;;;;;;;;;;IACf,gBAAW,oCAAqB;EAClC,IAAI,OAAO,aAAa,CAAC;EACzB,IAAG;AACH;EACA,EAAE,mBAAI,4BAAa;EACnB,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;EAC7B;;;;;;IAP0B,GAAG,CAAC,IAAI,CAAC;;ECCnC,IAAM,iBAAiB;;;;;;;;;;;;IACrB,gBAAW,oCAAqB;EAClC,IAAI,OAAO,mBAAmB,CAAC;EAC/B,IAAG;AACH;EACA,8BAAE,wBAAQ;EACV,IAAI,IAAI,CAAC,QAAQ,mBAAc,IAAI,CAAC,YAAY,CAAC,KAAK,EAAC,WAAM,WAAW,CAAC,CAAC;EAC1E,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;EAClB,IAAI,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;EAC/B,IAAG;AACH;EACA,EAAE,mBAAI,wBAAS;EACf,IAAIA,IAAM,KAAK,GAAG,IAAI,CAAC;EACvB,IAAI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