TP_JO2024/home/dist/component/display/display.nomodule.min.js

4 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2024-03-27 17:19:37 +01:00
/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
!function(){"use strict";var e=window.dsfr,s={DISPLAY:e.internals.ns.selector("display"),RADIO_BUTTONS:'input[name="'+e.internals.ns("radios-theme")+'"]',FIELDSET:e.internals.ns.selector("fieldset")},t=function(t){function i(){t.apply(this,arguments)}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var n={scheme:{configurable:!0}},c={instanceClassName:{configurable:!0}};return c.instanceClassName.get=function(){return"Display"},i.prototype.init=function(){if(this.radios=this.querySelectorAll(s.RADIO_BUTTONS),e.scheme){this.changing=this.change.bind(this);for(var t=0,i=this.radios;t<i.length;t+=1){i[t].addEventListener("change",this.changing)}this.addDescent(e.scheme.SchemeEmission.SCHEME,this.apply.bind(this)),this.ascend(e.scheme.SchemeEmission.ASK)}else this.querySelector(s.FIELDSET).setAttribute("disabled","")},n.scheme.get=function(){return this._scheme},n.scheme.set=function(s){if(this._scheme!==s&&e.scheme)switch(s){case e.scheme.SchemeValue.SYSTEM:case e.scheme.SchemeValue.LIGHT:case e.scheme.SchemeValue.DARK:this._scheme=s;for(var t=0,i=this.radios;t<i.length;t+=1){var n=i[t];n.checked=n.value===s}this.ascend(e.scheme.SchemeEmission.SCHEME,s)}},i.prototype.change=function(){for(var e=0,s=this.radios;e<s.length;e+=1){var t=s[e];if(t.checked)return void(this.scheme=t.value)}},i.prototype.apply=function(e){this.scheme=e},i.prototype.dispose=function(){for(var e=0,s=this.radios;e<s.length;e+=1){s[e].removeEventListener("change",this.changing)}},Object.defineProperties(i.prototype,n),Object.defineProperties(i,c),i}(e.core.Instance);e.display={Display:t,DisplaySelector:s},e.internals.register(e.display.DisplaySelector.DISPLAY,e.display.Display)}();
//# sourceMappingURL=display.nomodule.min.js.map