1 line
5.3 KiB
Text
1 line
5.3 KiB
Text
|
{"version":3,"file":"display.module.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":[],"mappings":";;AAAA,MAAM,MAAM,GAAG;AACf,EAAE,MAAM,EAAE,IAAI;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,YAAY,EAAE,SAAS;AACzB,EAAE,OAAO,EAAE,QAAQ;AACnB,CAAC;;ACJD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;ACC7B,MAAM,eAAe,GAAG;AAC/B,EAAE,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC/C,EAAE,aAAa,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;AACpE,EAAE,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;AACjD,CAAC;;ACHD,MAAM,OAAO,SAAS,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxC,EAAE,WAAW,iBAAiB,CAAC,GAAG;AAClC,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG;AACH;AACA,EAAE,IAAI,CAAC,GAAG;AACV,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AACvE;AACA,IAAI,IAAI,GAAG,CAAC,MAAM,EAAE;AACpB,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7C,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC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