1 line
4.4 KiB
Text
1 line
4.4 KiB
Text
|
{"version":3,"file":"display.nomodule.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":["const","api","window","DisplaySelector","DISPLAY","internals","ns","selector","RADIO_BUTTONS","FIELDSET","Display","staticAccessors","instanceClassName","init","this","radios","querySelectorAll","scheme","changing","change","bind","addEventListener","addDescent","SchemeEmission","SCHEME","apply","ascend","ASK","querySelector","setAttribute","prototypeAccessors","_scheme","value","SchemeValue","SYSTEM","LIGHT","DARK","radio","checked","dispose","removeEventListener","core","Instance","display","register"],"mappings":";yBAAAA,ICCMC,EAAMC,OAAuB,KCCtBC,EAAkB,CAC7BC,QAASH,EAAII,UAAUC,GAAGC,SAAS,WACnCC,6BAA8BP,EAAII,UAAUC,GAAG,qBAC/CG,SAAUR,EAAII,UAAUC,GAAGC,SAAS,aCFhCG,0NACJC,EAAWC,iCACT,MAAO,uBAGTC,gBAGE,GAFAC,KAAKC,OAASD,KAAKE,iBAAiBb,EAAgBK,eAEhDP,EAAIgB,OAAQ,CACdH,KAAKI,SAAWJ,KAAKK,OAAOC,KAAKN,MACjC,cAAoBA,KAAKC,6BAAcM,iBAAiB,SAAUP,KAAKI,UACvEJ,KAAKQ,WAAWrB,EAAIgB,OAAOM,eAAeC,OAAQV,KAAKW,MAAML,KAAKN,OAClEA,KAAKY,OAAOzB,EAAIgB,OAAOM,eAAeI,UAEtCb,KAAKc,cAAczB,EAAgBM,UAAUoB,aAAa,WAAY,KAI1EC,EAAIb,sBACF,OAAOH,KAAKiB,SAGdD,EAAIb,oBAAQe,GACV,GAAIlB,KAAKiB,UAAYC,GAAU/B,EAAIgB,OACnC,OAAQe,GACN,KAAK/B,EAAIgB,OAAOgB,YAAYC,OAC5B,KAAKjC,EAAIgB,OAAOgB,YAAYE,MAC5B,KAAKlC,EAAIgB,OAAOgB,YAAYG,KAC1BtB,KAAKiB,QAAUC,EACf,cAAoBlB,KAAKC,uBAAQ,CAA5Bf,IAAMqC,OACTA,EAAMC,QAAUD,EAAML,QA
|