1 line
No EOL
5.3 KiB
Text
1 line
No EOL
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,gBA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