TP_JO2024/home/dist/component/display/display.module.min.js.map
2024-03-27 17:19:37 +01:00

1 line
No EOL
4.3 KiB
Text

{"version":3,"file":"display.module.min.js","sources":["../../../.config/config.js","../../../src/core/api.js","../../../src/component/display/script/display/display-selector.js","../../../src/component/display/script/display/display.js","../../../src/component/display/index.js","../../../src/component/display/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 DisplaySelector = {\n DISPLAY: api.internals.ns.selector('display'),\n RADIO_BUTTONS: `input[name=\"${api.internals.ns('radios-theme')}\"]`,\n FIELDSET: api.internals.ns.selector('fieldset')\n};\n","import api from '../../api.js';\nimport { DisplaySelector } from './display-selector.js';\n\nclass Display extends api.core.Instance {\n static get instanceClassName () {\n return 'Display';\n }\n\n init () {\n this.radios = this.querySelectorAll(DisplaySelector.RADIO_BUTTONS);\n\n if (api.scheme) {\n this.changing = this.change.bind(this);\n for (const radio of this.radios) radio.addEventListener('change', this.changing);\n this.addDescent(api.scheme.SchemeEmission.SCHEME, this.apply.bind(this));\n this.ascend(api.scheme.SchemeEmission.ASK);\n } else {\n this.querySelector(DisplaySelector.FIELDSET).setAttribute('disabled', '');\n }\n }\n\n get scheme () {\n return this._scheme;\n }\n\n set scheme (value) {\n if (this._scheme === value || !api.scheme) return;\n switch (value) {\n case api.scheme.SchemeValue.SYSTEM:\n case api.scheme.SchemeValue.LIGHT:\n case api.scheme.SchemeValue.DARK:\n this._scheme = value;\n for (const radio of this.radios) {\n radio.checked = radio.value === value;\n }\n this.ascend(api.scheme.SchemeEmission.SCHEME, value);\n break;\n }\n }\n\n change () {\n for (const radio of this.radios) {\n if (radio.checked) {\n this.scheme = radio.value;\n return;\n }\n }\n }\n\n apply (value) {\n this.scheme = value;\n }\n\n dispose () {\n for (const radio of this.radios) radio.removeEventListener('change', this.changing);\n }\n}\n\nexport { Display };\n","import api from './api.js';\nimport { Display } from './script/display/display.js';\nimport { DisplaySelector } from './script/display/display-selector.js';\n\napi.display = {\n Display: Display,\n DisplaySelector: DisplaySelector\n};\n\nexport default api;\n","import api from './index.js';\n\napi.internals.register(api.display.DisplaySelector.DISPLAY, api.display.Display);\n\nexport default api;\n"],"names":["api","window","DisplaySelector","DISPLAY","internals","ns","selector","RADIO_BUTTONS","FIELDSET","Display","core","Instance","instanceClassName","init","this","radios","querySelectorAll","scheme","changing","change","bind","radio","addEventListener","addDescent","SchemeEmission","SCHEME","apply","ascend","ASK","querySelector","setAttribute","_scheme","value","SchemeValue","SYSTEM","LIGHT","DARK","checked","dispose","removeEventListener","display","register"],"mappings":";AAAA,MCCMA,EAAMC,OAAuB,KCCtBC,EAAkB,CAC7BC,QAASH,EAAII,UAAUC,GAAGC,SAAS,WACnCC,cAAe,eAAeP,EAAII,UAAUC,GAAG,oBAC/CG,SAAUR,EAAII,UAAUC,GAAGC,SAAS,aCFtC,MAAMG,UAAgBT,EAAIU,KAAKC,SAClBC,+BACT,MAAO,UAGTC,OAGE,GAFAC,KAAKC,OAASD,KAAKE,iBAAiBd,EAAgBK,eAEhDP,EAAIiB,OAAQ,CACdH,KAAKI,SAAWJ,KAAKK,OAAOC,KAAKN,MACjC,IAAK,MAAMO,KAASP,KAAKC,OAAQM,EAAMC,iBAAiB,SAAUR,KAAKI,UACvEJ,KAAKS,WAAWvB,EAAIiB,OAAOO,eAAeC,OAAQX,KAAKY,MAAMN,KAAKN,OAClEA,KAAKa,OAAO3B,EAAIiB,OAAOO,eAAeI,UAEtCd,KAAKe,cAAc3B,EAAgBM,UAAUsB,aAAa,WAAY,IAItEb,aACF,OAAOH,KAAKiB,QAGVd,WAAQe,GACV,GAAIlB,KAAKiB,UAAYC,GAAUhC,EAAIiB,OACnC,OAAQe,GACN,KAAKhC,EAAIiB,OAAOgB,YAAYC,OAC5B,KAAKlC,EAAIiB,OAAOg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