@baloise/ds-core 19.8.4 → 19.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bal-logo.animation.js +77 -940
- package/components/bal-logo2.js +34 -19
- package/components/config.default.js +1 -0
- package/components/index.js +10 -1
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/{p-a53c24274c.entry.js → p-0077e5a12f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-26085b7dcc.system.entry.js → p-0556bebe3a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-255e5491e6.system.entry.js → p-14ae6214c4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-38fa211868.entry.js → p-1ee3f23f54.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b01f9c5651.entry.js → p-2333a469fa.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1074fb7fbc.entry.js → p-37641c340c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-dcebb4b8a2.system.entry.js → p-393a31ad6e.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f6cb5253aa.system.entry.js → p-3ed3bfc59a.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a32d50871a.system.entry.js → p-40f2569a17.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-70bdd60500.system.entry.js → p-41c63c9a82.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a2a1ed74fe.system.entry.js → p-44137a3d17.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c29bcf4e69.entry.js → p-493e239429.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1df2fb625c.entry.js → p-4b2eeb8c37.entry.js} +1 -1
- package/dist/baloise-design-system/{p-8cf1d029e7.entry.js → p-4be902176f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-31abb1f859.entry.js → p-54f5a92feb.entry.js} +1 -1
- package/dist/baloise-design-system/{p-41dcd76f1f.system.entry.js → p-5c3f48e883.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9da9d45bda.system.entry.js → p-6191805e40.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b38b2e9484.system.entry.js → p-772db94619.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f6238b798a.system.entry.js → p-79006350e3.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-26764b092e.entry.js → p-7b52e9987d.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f91be8b19a.entry.js → p-7f2e1e1be7.entry.js} +1 -1
- package/dist/baloise-design-system/{p-93dc4e9ec8.entry.js → p-8029d2f939.entry.js} +1 -1
- package/dist/baloise-design-system/{p-878f4e40a8.entry.js → p-862bf2c3e6.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d94f439c3b.system.entry.js → p-9191e04f14.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d4252ea848.system.entry.js → p-9417cf5581.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ac1cd5a1e1.system.entry.js → p-979dfed703.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-B3ZVog4n.system.js → p-BDYdAsv_.system.js} +1 -1
- package/dist/baloise-design-system/p-BFRjY4w3.js +1 -0
- package/dist/baloise-design-system/p-BIBFYhYa.system.js +1 -0
- package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -0
- package/dist/baloise-design-system/p-Bk7UdnZ5.system.js +1 -0
- package/dist/baloise-design-system/p-CBkFUwrD.js +1 -0
- package/dist/baloise-design-system/{p-DAsF8QfB.system.js → p-CE3V5D8z.system.js} +1 -1
- package/dist/baloise-design-system/p-CKN3W8qn.js +1 -0
- package/dist/baloise-design-system/p-CM3hCeNH.js +1 -0
- package/dist/baloise-design-system/p-CsPrCX4f.system.js +1 -0
- package/dist/baloise-design-system/p-CuyVPNj2.system.js +1 -0
- package/dist/baloise-design-system/{p-ReLIdwsB.js → p-DmVt6SeJ.js} +1 -1
- package/dist/baloise-design-system/{p-COIM5Kkz.js → p-Dn1vzM6-.js} +1 -1
- package/dist/baloise-design-system/p-Ere8qsaI.js +1 -0
- package/dist/baloise-design-system/p-Yg1qLcvR.js +1 -0
- package/dist/baloise-design-system/{p-3f596ba050.entry.js → p-a10bc9e5d8.entry.js} +1 -1
- package/dist/baloise-design-system/{p-cb3abec4bd.system.entry.js → p-a31aacd887.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4256f1331b.entry.js → p-a3c4c9d422.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6670584628.entry.js → p-a7503a0c9d.entry.js} +1 -1
- package/dist/baloise-design-system/{p-93311a064b.system.entry.js → p-aec5e73a82.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0b05d342f5.entry.js → p-b13d48cf28.entry.js} +1 -1
- package/dist/baloise-design-system/{p-81a7d8f03d.entry.js → p-b75b727fbc.entry.js} +1 -1
- package/dist/baloise-design-system/{p-cd6d0bfa91.system.entry.js → p-b9bbf796f3.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-BVitEMYC.system.js → p-bNRkwxp2.system.js} +1 -1
- package/dist/baloise-design-system/{p-0db571d8f2.system.entry.js → p-bb255885a4.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-99a9cc7202.entry.js → p-bd5655b6a8.entry.js} +1 -1
- package/dist/baloise-design-system/{p-042570e1b4.system.entry.js → p-c1f871bb5b.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-c23854bd63.entry.js +1 -0
- package/dist/baloise-design-system/{p-5a66d8f568.entry.js → p-c637edb9ea.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f682c289a1.system.entry.js → p-c8491fda99.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c291d986ba.entry.js → p-ce2de36f43.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4aeaa1a916.system.entry.js → p-d20d698c0b.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f55a98dc20.entry.js → p-dc45f7cf9c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-133b5a4986.entry.js → p-ea9aa92049.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f8b560b22f.system.entry.js → p-eb98a3713f.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e1b3b1f609.system.entry.js → p-ec911df779.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b4ff1b324f.system.entry.js → p-ee0b45ff30.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-06ae31c81e.entry.js → p-efd2551aca.entry.js} +1 -1
- package/dist/baloise-design-system/p-fb980109e2.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-e2e7e3c5c4.entry.js → p-fec5974e23.entry.js} +1 -1
- package/dist/baloise-design-system/p-giOY60zQ.system.js +1 -0
- package/dist/baloise-design-system/p-ncoiCFQ1.system.js +1 -0
- package/dist/cjs/{app-globals-C_KNnTwa.js → app-globals-D4xKyILL.js} +1 -1
- package/dist/cjs/bal-accordion_4.cjs.entry.js +1 -1
- package/dist/cjs/bal-carousel_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-close.cjs.entry.js +1 -1
- package/dist/cjs/bal-date-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-date.cjs.entry.js +1 -1
- package/dist/cjs/bal-dropdown_3.cjs.entry.js +1 -1
- package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-footer.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-icon.cjs.entry.js +1 -1
- package/dist/cjs/bal-input-stepper.cjs.entry.js +2 -2
- package/dist/cjs/bal-label.cjs.entry.js +1 -1
- package/dist/cjs/bal-list_8.cjs.entry.js +4 -4
- package/dist/cjs/{bal-logo.animation-q2TTdoP3.js → bal-logo.animation-B4LvXc5Q.js} +77 -940
- package/dist/cjs/bal-logo.cjs.entry.js +35 -22
- package/dist/cjs/bal-nav_8.cjs.entry.js +4 -4
- package/dist/cjs/bal-navbar_5.cjs.entry.js +4 -4
- package/dist/cjs/bal-number-input.cjs.entry.js +2 -2
- package/dist/cjs/bal-pagination.cjs.entry.js +4 -4
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-spinner.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
- package/dist/cjs/baloise-design-system.cjs.js +4 -4
- package/dist/cjs/{breakpoints.decorator-byAdfhn7.js → breakpoints.decorator-DhiWnqha.js} +1 -1
- package/dist/cjs/{breakpoints.subject-CarqIcOv.js → breakpoints.subject-DPTVZ3As.js} +1 -1
- package/dist/cjs/{config.default-Bkso4_bY.js → config.default-Cko-wpRU.js} +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{initialize-CWGvp-PN.js → initialize-BzrcZo6Y.js} +11 -2
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{number-COdZG-wK.js → number-Zs70JOU-.js} +1 -1
- package/dist/cjs/{tokens.esm-wN1fum6F.js → tokens.esm-DM_dMnsW.js} +1 -1
- package/dist/cjs/{window-resize.decorator-DMReD0Er.js → window-resize.decorator-oyMA7gDI.js} +1 -1
- package/dist/collection/components/bal-logo/bal-logo.css +1 -1
- package/dist/collection/components/bal-logo/bal-logo.data.js +77 -940
- package/dist/collection/components/bal-logo/bal-logo.js +57 -17
- package/dist/collection/utils/config/config.default.js +1 -0
- package/dist/collection/utils/config/config.js +9 -0
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/esm/{app-globals-BRqdW0lU.js → app-globals-Blx--ecs.js} +1 -1
- package/dist/esm/bal-accordion_4.entry.js +1 -1
- package/dist/esm/bal-carousel_2.entry.js +4 -4
- package/dist/esm/bal-close.entry.js +1 -1
- package/dist/esm/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm/bal-date.entry.js +1 -1
- package/dist/esm/bal-dropdown_3.entry.js +1 -1
- package/dist/esm/bal-field_5.entry.js +3 -3
- package/dist/esm/bal-footer.entry.js +1 -1
- package/dist/esm/bal-hint_5.entry.js +3 -3
- package/dist/esm/bal-icon.entry.js +1 -1
- package/dist/esm/bal-input-stepper.entry.js +2 -2
- package/dist/esm/bal-label.entry.js +1 -1
- package/dist/esm/bal-list_8.entry.js +4 -4
- package/dist/esm/{bal-logo.animation-Bm-_mal3.js → bal-logo.animation-DQd9HTdg.js} +77 -940
- package/dist/esm/bal-logo.entry.js +35 -22
- package/dist/esm/bal-nav_8.entry.js +4 -4
- package/dist/esm/bal-navbar_5.entry.js +4 -4
- package/dist/esm/bal-number-input.entry.js +2 -2
- package/dist/esm/bal-pagination.entry.js +4 -4
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-segment_2.entry.js +4 -4
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-spinner.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +3 -3
- package/dist/esm/bal-tab-item_2.entry.js +4 -4
- package/dist/esm/bal-time-input.entry.js +1 -1
- package/dist/esm/baloise-design-system.js +4 -4
- package/dist/esm/{breakpoints.decorator-t_yXJIZL.js → breakpoints.decorator-C-DmFJbn.js} +1 -1
- package/dist/esm/{breakpoints.subject-BnQp404Z.js → breakpoints.subject-Iyftu-nV.js} +1 -1
- package/dist/esm/{config.default-I6QXKbhg.js → config.default-RE8-gLMQ.js} +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/{initialize-pdWsVO-c.js → initialize-W3od-FM9.js} +11 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{number-Bwx2aNR0.js → number-DfnRcL0e.js} +1 -1
- package/dist/esm/{tokens.esm-Cf90NR4z.js → tokens.esm-C9EQ_6RZ.js} +1 -1
- package/dist/esm/{window-resize.decorator-DBJlK-45.js → window-resize.decorator-BU569j2_.js} +1 -1
- package/dist/esm-es5/app-globals-Blx--ecs.js +1 -0
- package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-close.entry.js +1 -1
- package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown_3.entry.js +1 -1
- package/dist/esm-es5/bal-field_5.entry.js +1 -1
- package/dist/esm-es5/bal-footer.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.entry.js +1 -1
- package/dist/esm-es5/bal-icon.entry.js +1 -1
- package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
- package/dist/esm-es5/bal-label.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.animation-DQd9HTdg.js +1 -0
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-number-input.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-segment_2.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-spinner.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/bal-time-input.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/{breakpoints.decorator-t_yXJIZL.js → breakpoints.decorator-C-DmFJbn.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-BnQp404Z.js → breakpoints.subject-Iyftu-nV.js} +1 -1
- package/dist/esm-es5/{config.default-I6QXKbhg.js → config.default-RE8-gLMQ.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-W3od-FM9.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{number-Bwx2aNR0.js → number-DfnRcL0e.js} +1 -1
- package/dist/esm-es5/{window-resize.decorator-DBJlK-45.js → window-resize.decorator-BU569j2_.js} +1 -1
- package/dist/html.html-data.json +12 -0
- package/dist/types/components/bal-logo/bal-logo.d.ts +6 -0
- package/dist/types/components/bal-logo/bal-logo.data.d.ts +81 -187
- package/dist/types/components/bal-logo/bal-logo.interfaces.d.ts +1 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/utils/config/config.d.ts +3 -1
- package/dist/types/utils/config/config.types.d.ts +3 -0
- package/package.json +6 -6
- package/dist/baloise-design-system/p-74047cc11f.entry.js +0 -1
- package/dist/baloise-design-system/p-B1a79Kak.system.js +0 -1
- package/dist/baloise-design-system/p-BC9JH89x.js +0 -1
- package/dist/baloise-design-system/p-BRJ7ljGZ.system.js +0 -1
- package/dist/baloise-design-system/p-BblIE2Vz.system.js +0 -1
- package/dist/baloise-design-system/p-BtgFoKGn.js +0 -1
- package/dist/baloise-design-system/p-CBUCh83e.js +0 -1
- package/dist/baloise-design-system/p-C_0MGoKB.js +0 -1
- package/dist/baloise-design-system/p-CgBveYeB.js +0 -1
- package/dist/baloise-design-system/p-CwWHLbPB.system.js +0 -1
- package/dist/baloise-design-system/p-DNy7adIE.system.js +0 -1
- package/dist/baloise-design-system/p-Dhp6-MTS.system.js +0 -1
- package/dist/baloise-design-system/p-DsxGYykr.js +0 -1
- package/dist/baloise-design-system/p-db2823d02b.system.entry.js +0 -1
- package/dist/baloise-design-system/p-wAfnccKA.system.js +0 -1
- package/dist/esm-es5/app-globals-BRqdW0lU.js +0 -1
- package/dist/esm-es5/bal-logo.animation-Bm-_mal3.js +0 -1
- package/dist/esm-es5/initialize-pdWsVO-c.js +0 -1
- /package/dist/baloise-design-system/{p-Cf90NR4z.js → p-C9EQ_6RZ.js} +0 -0
- /package/dist/baloise-design-system/{p-LFV9NiI-.system.js → p-dEE6wNs_.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-Cf90NR4z.js → tokens.esm-C9EQ_6RZ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-I6QXKbhg.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,a as waitAfterFramePaint,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback,m as raf}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{i as isNil}from"./index-zWZxKBfo.js";import{a as areArraysEqual}from"./array-CDfSqLEo.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{D as DropdownOptionUtil}from"./option-BLp4ll3i.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{d as defaultConfig}from"./config.default-I6QXKbhg.js";import{d as isArrowDownKey,b as isArrowUpKey,a as isEnterKey,j as isEscapeKey,i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{B as BalElementStateListener,L as ListenToElementStates}from"./element-states.decorator-B68ANq1p.js";import{i as includes,s as startsWith}from"./utils-C_qktPg7.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./listener-CClDIhvK.js";var DropdownAutoFillUtil=function(){function o(){var o=this;this.handleAutoFill=function(t){return __awaiter(o,void 0,void 0,(function(){var o,r;return __generator(this,(function(e){switch(e.label){case 0:stopEventBubbling(t);if(!this.isAutoFillAllowed())return[3,2];this.component.isAutoFilled=true;o=this.component.nativeEl.value;return[4,this.parseAutoFillValueWithOptions(o)];case 1:r=e.sent();if(r===undefined){this.component.isAutoFilled=false;return[2]}if(!areArraysEqual(r,this.component.rawValue)){this.component.valueUtil.updateRawValueBySelection(r,true)}e.label=2;case 2:return[2]}}))}))}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.isAutoFillAllowed=function(){return!this.component.multiple};o.prototype.parseAutoFillValueWithOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t,r,e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.component.listEl.getOptions()];case 1:t=i.sent();r=undefined;for(e=0;e<t.length;e++){n=t[e];if(n.value===o||n.label===o){return[2,[n.value]]}}return[2,r]}}))}))};return o}();var i18nBalDropdown={de:{clearable:"Löschen",open:"Öffnen",close:"Schließen"},en:{clearable:"clear",open:"Open",close:"Close"},fr:{clearable:"Effacer",open:"Ouvrir",close:"Fermer"},it:{clearable:"Cancellare",open:"Apri",close:"Chiudi"},nl:{clearable:"Wissen",open:"Open",close:"Sluiten"},es:{clearable:"Limpiar",open:"Abrir",close:"Cerrar"},pl:{clearable:"Wyczyść",open:"Otwórz",close:"Zamknij"},pt:{clearable:"Limpar",open:"Abrir",close:"Fechar"},sv:{clearable:"Rensa",open:"Öppna",close:"Stäng"},fi:{clearable:"Tyhjennä",open:"Avaa",close:"Sulje"}};var DropdownEventsUtil=function(){function o(){var o=this;this.handlePointerDown=function(){o.component.isKeyboardMode=false};this.handleKeydown=function(t){o.component.isKeyboardMode=FOCUS_KEYS.includes(t.key)}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.handleFocus=function(o){this.component.hasFocus=true;this.component.balFocus.emit(o)};o.prototype.handleBlur=function(o){var t=this;if(!this.component.isExpanded){this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}};o.prototype.handleClick=function(o){if(!this.component.valueUtil.isDisabled()){if(this.component.chips){var t=o.target;var r=t.closest("bal-close");if(r){return}}if(this.component.clearable){var t=o.target;var e=t.closest(".bal-dropdown__clear");if(e){this.component.valueUtil.updateRawValueBySelection([]);return}}this.component.popupUtil.toggleList()}};o.prototype.handleOutsideClick=function(o){var t=this;var r;if(this.component.isExpanded){if(!this.component.el.contains(o.target)){this.component.isExpanded=false;(r=this.component.listEl)===null||r===void 0?void 0:r.resetFocus();this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}}};return o}();var DropdownFocusUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.focusOptionByLabel=function(o,t){var r=this;if(t===void 0){t={}}this.component.labelToFocus=(this.component.labelToFocus+o).trim();if(this.component.labelToFocus.length>0){clearTimeout(this.keyHitTimeout);this.keyHitTimeout=setTimeout((function(){var o;(o=r.component.listEl)===null||o===void 0?void 0:o.focusByLabel(r.component.labelToFocus,t)}),100);clearTimeout(this.timeout);this.timeout=setTimeout((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(o){this.component.labelToFocus="";return[2]}))}))}),1e3)}};return o}();var DropdownFormSubmitUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o;this.component.initialValue=this.component.value};o.prototype.componentDidRender=function(){var o=this;if(this.component.selectEl){var t=this.component.selectEl.querySelectorAll("option");t.forEach((function(t){if(o.component.rawValue.includes(t.value)){t.selected=true}}))}};o.prototype.handle=function(o){var t=this;var r=o.target;if(r===null||r===void 0?void 0:r.contains(this.component.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){var o=t.component.valueUtil.parseValueString(t.component.initialValue);t.component.valueUtil.updateRawValueBySelection(o)}),0)}};return o}();var DropdownNativeSelect=function(o){var t=o.name,r=o.httpFormSubmit,e=o.multiple,n=o.required,i=o.disabled,a=o.rawValue,d=o.refSelectEl;var l=BEM.block("dropdown");return r?h("select",{class:Object.assign({},l.element("root").element("select").class()),"aria-hidden":"true",name:t,multiple:e,required:n,disabled:i,tabindex:-1,ref:d},a.map((function(o){return h("option",{key:o,value:o,selected:true},o)}))):""};var DropdownIcon=function(o){var t=o.size,r=o.theme,e=o.icon,n=o.language,i=o.loading,a=o.clearable,d=o.invalid,l=o.filled,s=o.expanded,c=o.disabled;var p=BEM.block("dropdown");if(i){return h("bal-spinner",{class:Object.assign({},p.element("rear").class()),small:true,variation:"circle",color:"white"})}else if(a&&l&&!c){return h("button",{title:i18nBalDropdown[n].clearable,type:"button",tabIndex:-1,class:Object.assign(Object.assign(Object.assign(Object.assign({},p.element("rear").class()),p.element("clear").class()),p.element("clear").modifier("invalid").class(d)),p.element("clear").modifier("theme-purple").class(r==="purple"))},h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:r==="purple"?"close":"close-circle",size:t,color:r==="purple"?"primary":"grey"}))}else{return h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:e,size:t,turn:s,color:c?"grey":d?"danger":"primary"})}};var DropdownInput=function(o){var t=o.inputId,r=o.httpFormSubmit,e=o.ariaForm,n=o.rawValue,i=o.autocomplete,a=o.required,d=o.disabled,l=o.readonly,s=o.placeholder,c=o.expanded,p=o.invalid,u=o.language,b=o.inputLabel,_=o.inheritedAttributes,f=o.refInputEl,v=o.onChange,w=o.onFocus,m=o.onBlur,g=o.onKeyDown;var x=BEM.block("dropdown");var y=function(){return h("input",Object.assign({id:e.controlId||"".concat(t,"-ctrl"),class:Object.assign({},x.element("root").element("input").class()),type:"text",size:1,inputmode:"none",tabindex:"0",autoComplete:i,value:n.join(","),required:a,disabled:d,readonly:l,placeholder:s,title:c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-label":c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-owns":"".concat(t,"-menu"),"aria-invalid":ariaBooleanToString(p),"aria-disabled":ariaBooleanToString(d||l),"aria-labelledby":e.labelId,"aria-describedby":e.messageId,"aria-haspopup":"listbox","data-native":true,"data-label":b,"data-value":n.join(","),ref:function(o){return f(o)},onChange:function(o){return v(o)},onFocus:function(o){return w(o)},onBlur:function(o){return m(o)},onKeyDown:function(o){return g(o)}},_))};if(r){return h(y,null)}return h("form",{novalidate:true},h(y,null))};var DropdownPopupUtil=function(){function o(){this.updatePanelPosition=function(o,t,r){return function(){o.computePosition(t,r,{placement:"bottom-start",middleware:[o.flip(),o.shift()]}).then((function(o){var t=o.x,e=o.y;Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(e,"px")})}))}}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.toggleList=function(){if(!this.component.valueUtil.isDisabled()){if(this.component.isExpanded){this.collapseList()}else{this.expandList()}}};o.prototype.expandList=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:if(!this.component.panelEl)return[3,2];return[4,balFloatingUi.load()];case 1:t=r.sent();this.component.panelCleanup=t.autoUpdate(this.component.el,this.component.panelEl,this.updatePanelPosition(t,this.component.el,this.component.panelEl));r.label=2;case 2:this.component.isExpanded=true;return[4,(o=this.component.listEl)===null||o===void 0?void 0:o.focusSelected()];case 3:r.sent();return[2]}}))}))};o.prototype.collapseList=function(){var o;this.component.isExpanded=false;(o=this.component.listEl)===null||o===void 0?void 0:o.resetFocus();if(this.component.panelCleanup){this.component.panelCleanup()}};return o}();var DropdownValueUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.componentDidLoad=function(){var o=this;setTimeout((function(){return o.valueChanged(o.component.value,undefined)}),0)};o.prototype.isDisabled=function(){return this.component.disabled||this.component.readonly};o.prototype.isFilled=function(){return this.component.rawValue&&this.component.rawValue.length>0};o.prototype.valueChanged=function(o,t){var r=typeof o;var e=typeof t;if(r!==e){this.updateRawValueByValueProp(o)}if(r==="string"&&o!==t){this.updateRawValueByValueProp(o)}if(Array.isArray(o)&&Array.isArray(t)&&!areArraysEqual(o,t)){this.updateRawValueByValueProp(o)}};o.prototype.updateRawValueBySelection=function(o,t){if(o===void 0){o=[]}if(t===void 0){t=false}this.component.isAutoFilled=t;this.updateRawValue(o);if(this.component.multiple){this.component.balChange.emit(this.component.rawValue)}else{this.component.balChange.emit(this.component.rawValue[0])}};o.prototype.parseValueString=function(o){if(o===void 0){o=[]}var t=[];if(!isNil(o)&&o!==""){if(Array.isArray(o)){t=__spreadArray([],o.filter((function(o){return!isNil(o)})),true)}else{if(o.split("").includes(",")){t=__spreadArray([],o.split(",").filter((function(o){return o})).map((function(o){return o.trim()})),true)}else{t=[o]}}}return t};o.prototype.updateRawValueByValueProp=function(o){if(o===void 0){o=[]}var t=this.parseValueString(o);this.updateRawValue(t)};o.prototype.updateRawValue=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=[]}return __generator(this,(function(t){switch(t.label){case 0:this.component.rawValue=o;if(!this.component.listEl)return[3,2];return[4,this.component.listEl.updateSelected(this.component.rawValue)];case 1:t.sent();t.label=2;case 2:return[4,this.updateInputContent()];case 3:t.sent();return[2]}}))}))};o.prototype.removeOption=function(o){var t=this.component.rawValue.filter((function(t){return t!==o.value}));this.updateRawValueBySelection(t)};o.prototype.updateInputContent=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:return[4,waitAfterFramePaint()];case 1:t.sent();if(!this.component.listEl)return[3,3];o=this.component;return[4,this.component.listEl.getSelectedOptions(this.component.rawValue)];case 2:o.choices=t.sent();this.component.inputLabel=this.component.choices.map((function(o){return o.label.trim()})).sort().join(",");t.label=3;case 3:return[2]}}))}))};return o}();var DropdownValue=function(o){var t=o.inlineLabel,r=o.filled,e=o.chips,n=o.placeholder,i=o.choices,a=o.renderChip;var d=BEM.block("dropdown");if(r){if(e){return h("div",{class:Object.assign({},d.element("root").element("content").element("chips").class())},i.map((function(o){return a(o)})))}else{return(t&&"".concat(t,": "))+i.map((function(o){return o.label})).join(", ")}}else{return n}};var balDropdownCss=':root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-3);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-3);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-weight:var(--bal-font-weight-regular);font-size:var(--bal-text-size-normal);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:1rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root:not(.bal-dropdown__root--disabled):not(.bal-dropdown__root--invalid):not(.bal-dropdown__root--theme-purple):not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-dropdown-control-background-hover)}}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:none;visibility:hidden;opacity:0;width:100vw;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}@media screen and (min-width: 769px),print{.bal-dropdown__list{max-width:100vw;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:100%}}.bal-dropdown__list--expanded{display:block;visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}.bal-dropdown__rear{z-index:1}.bal-dropdown__root--size-small{min-height:2rem}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content--placeholder{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-background-grey-light)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-1)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-purple-2)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled),.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active{border:none;background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--focused.bal-dropdown__root--theme-purple:before{content:"";border-width:var(--bal-border-width-normal);border-style:solid;border-color:var(--bal-focus-shadow-end-color);position:absolute;background:rgba(0,0,0,0);border-radius:var(--bal-radius-normal);top:-0.25rem;bottom:-0.25rem;left:-0.25rem;right:-0.25rem}.bal-dropdown__root__content--size-small{font-size:var(--bal-text-size-small);font-weight:var(--bal-font-weight-bold)}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}';var Dropdown=function(){function o(o){var t=this;registerInstance(this,o);this.balChange=createEvent(this,"balChange");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.inputId="bal-dropdown-".concat(balDropdownIds++);this.inheritedAttributes={};this.initialValue=[];this.nativeOptions=[];this.rawOptions=[];this.choices=[];this.rawValue=[];this.hasFocus=false;this.isExpanded=false;this.isAutoFilled=false;this.isKeyboardMode=false;this.inputLabel="";this.ariaForm=defaultBalAriaForm;this.language=defaultConfig.language;this.region=defaultConfig.region;this.httpFormSubmit=defaultConfig.httpFormSubmit;this.labelToFocus="";this.valueUtil=new DropdownValueUtil;this.eventsUtil=new DropdownEventsUtil;this.popupUtil=new DropdownPopupUtil;this.optionUtil=new DropdownOptionUtil;this.formSubmitUtil=new DropdownFormSubmitUtil;this.focusUtil=new DropdownFocusUtil;this.autoFillUtil=new DropdownAutoFillUtil;this.autocomplete="off";this.name=this.inputId;this.placeholder="";this.inlineLabel="";this.icon="caret-down";this.size="";this.theme="";this.disabled=false;this.readonly=false;this.multiple=false;this.chips=false;this.clearable=false;this.invalid=false;this.required=false;this.loading=false;this.filter="includes";this.contentHeight=262;this.inverted=false;this.options=[];this.value=[];this.hasConnected=false;this.listenToOptionChange=function(o){t.optionUtil.listenToOptionChange(o)};this.listenOnClickOutside=function(o){t.eventsUtil.handleOutsideClick(o)};this.resetHandler=function(o){t.formSubmitUtil.handle(o)};this.handleAutoFill=function(o){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.log("(handleAutoFill)",o,this.nativeEl.value);this.autoFillUtil.handleAutoFill(o);return[2]}))}))};this.handleKeyDown=function(o){var r,e,n,i,a;if(o&&o.key){if(t.isExpanded){if(isArrowDownKey(o)){stopEventBubbling(o);(r=t.listEl)===null||r===void 0?void 0:r.focusNext()}else if(isArrowUpKey(o)){stopEventBubbling(o);(e=t.listEl)===null||e===void 0?void 0:e.focusPrevious()}else if(o.key==="Home"||o.key==="PageUp"){stopEventBubbling(o);(n=t.listEl)===null||n===void 0?void 0:n.focusFirst()}else if(o.key==="End"||o.key==="PageDown"){stopEventBubbling(o);(i=t.listEl)===null||i===void 0?void 0:i.focusLast()}else if(isEnterKey(o)){stopEventBubbling(o);(a=t.listEl)===null||a===void 0?void 0:a.selectByFocus()}else if(o.key==="Tab"||isEscapeKey(o)){t.popupUtil.collapseList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key)}}else{if(isEnterKey(o)||isSpaceKey(o)){stopEventBubbling(o);t.popupUtil.expandList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key,{select:true})}}}else{if(t.isExpanded){t.popupUtil.collapseList()}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.optionChanged=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.optionUtil.optionChanged();return[2]}))}))};o.prototype.valueChanged=function(o,t){this.valueUtil.valueChanged(o,t)};o.prototype.connectedCallback=function(){if(!this.hasConnected){this.eventsUtil.connectedCallback(this);this.valueUtil.connectedCallback(this);this.popupUtil.connectedCallback(this);this.optionUtil.connectedCallback(this);this.formSubmitUtil.connectedCallback(this);this.focusUtil.connectedCallback(this);this.autoFillUtil.connectedCallback(this)}addEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){addEventListener(document,"keydown",this.eventsUtil.handleKeydown);addEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);addEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);addEventListener(document,"click",this.listenOnClickOutside);addEventListener(document,"reset",this.resetHandler,{capture:true})}this.hasConnected=true};o.prototype.disconnectedCallback=function(){removeEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.eventsUtil.handleKeydown);removeEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);removeEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);removeEventListener(document,"click",this.listenOnClickOutside);removeEventListener(document,"reset",this.resetHandler,{capture:true})}};o.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.inheritedAttributes=inheritAttributes(this.el,["tabindex","data-hj-allow"]);return[4,this.optionUtil.componentWillRender()];case 1:o.sent();return[2]}}))}))};o.prototype.componentDidRender=function(){this.formSubmitUtil.componentDidRender()};o.prototype.componentDidLoad=function(){this.valueUtil.componentDidLoad()};o.prototype.configChanged=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=o.language;this.region=o.region;this.httpFormSubmit=o.httpFormSubmit;return[2]}))}))};o.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(this.nativeEl&&!this.valueUtil.isDisabled()))return[3,2];return[4,waitAfterIdleCallback()];case 1:o.sent();this.nativeEl.focus();o.label=2;case 2:return[2]}}))}))};o.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.rawValue]}))}))};o.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.valueUtil.updateRawValueBySelection([]);return[2]}))}))};o.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.expandList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.collapseList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.select=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.valueUtil.parseValueString(o);this.valueUtil.updateRawValueBySelection(t);return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};o.prototype.render=function(){var o=this;var t=BEM.block("dropdown");var r=this.valueUtil.isFilled();var e=this.size!=="";var n="size-".concat(this.size);var i=this.theme!=="";var a="theme-".concat(this.theme);var d=this.theme==="purple"?this.hasFocus&&this.isKeyboardMode:this.hasFocus;return h(Host,{key:"3fe05ba6190dabe5fb8c297f4809659f7c24aa74",class:Object.assign({},t.class()),tabindex:"-1",id:"".concat(this.inputId)},h("div",{key:"e0b038aa5b7ead381d271c5b7b04fd5bbaa3ea3b",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").class()),t.element("root").modifier("focused").class(d)),t.element("root").modifier("invalid").class(this.invalid)),t.element("root").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").modifier("autofill").class(this.isAutoFilled)),t.element("root").modifier(n).class(e)),t.element("root").modifier(a).class(i)),t.element("root").modifier(a+"-filled").class(r&&i)),t.element("root").modifier(a+"-expanded").class(this.isExpanded&&i)),"data-testid":"bal-dropdown-trigger",onClick:function(t){return o.eventsUtil.handleClick(t)}},h("span",{key:"a3499a9e2abcaa3b363385c475c3dcd91ed1a371",class:Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").element("content").class()),t.element("root").element("content").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").element("content").modifier("placeholder").class(!this.valueUtil.isFilled())),t.element("root").element("content").modifier(n).class(e))},h(DropdownValue,{key:"8ffc980c91386038c4ee9b9e6673a25a3609d674",filled:this.valueUtil.isFilled(),inlineLabel:this.inlineLabel,chips:this.chips,placeholder:this.placeholder,choices:this.choices,renderChip:function(t){return h("bal-tag",{key:t.value,"data-testid":"bal-dropdown-chip",size:"small",invalid:o.invalid,disabled:o.disabled||o.readonly,closable:!(o.disabled||o.readonly),onBalCloseClick:function(){return o.valueUtil.removeOption(t)}},t.label)}})),h(DropdownInput,{key:"9a97fc39a821d5dcca32eba522ae29e4aa6eedc0",inputId:this.inputId,httpFormSubmit:this.httpFormSubmit,ariaForm:this.ariaForm,rawValue:this.rawValue,autocomplete:this.autocomplete,required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,expanded:this.isExpanded,invalid:this.invalid,language:this.language,inputLabel:this.inputLabel,inheritedAttributes:this.inheritedAttributes,refInputEl:function(t){return o.nativeEl=t},onChange:function(t){return o.handleAutoFill(t)},onFocus:function(t){return o.eventsUtil.handleFocus(t)},onBlur:function(t){return o.eventsUtil.handleBlur(t)},onKeyDown:function(t){return o.handleKeyDown(t)}}),h(DropdownNativeSelect,{key:"2a33a8ac7f336889197137fc741ed8a4a107fceb",name:this.name,httpFormSubmit:this.httpFormSubmit,multiple:this.multiple,required:this.required,disabled:this.valueUtil.isDisabled(),rawValue:this.rawValue,refSelectEl:function(t){return o.selectEl=t}}),h(DropdownIcon,{key:"d0f6958fb47ad7f6d73d4f98482cb2102c344f20",icon:this.icon,size:this.size,theme:this.theme,language:this.language,loading:this.loading,clearable:this.clearable,invalid:this.invalid,expanded:this.isExpanded,filled:r,disabled:this.valueUtil.isDisabled()})),h("div",{key:"29e98d1f54ffb6ee913bd682d6531d45997fc1d0",id:"".concat(this.inputId,"-menu"),class:Object.assign(Object.assign({},t.element("list").class()),t.element("list").modifier("expanded").class(this.isExpanded)),ref:function(t){return o.panelEl=t}},h("bal-option-list",{key:"4e6fa69f9d9859208f83dd7bc86c17fc75d5eb60",multiple:this.multiple,disabled:this.valueUtil.isDisabled(),filter:this.filter,required:this.required,contentHeight:this.contentHeight,ref:function(t){return o.listEl=t}},h("slot",{key:"1c169dc692632671f62410b2dadcbbc10b0fe36a"}),this.optionUtil.hasPropOptions()?this.rawOptions.map((function(o){return h("bal-option",{key:o.value,value:o.value,label:o.label,disabled:o.disabled,multiline:o.multiline,invalid:o.invalid,hidden:o.hidden,selected:o.selected,focused:o.focused},o.label)})):"")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{options:["optionChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-dropdown"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Dropdown.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Dropdown.prototype,"configChanged",null);var balDropdownIds=0;Dropdown.style=balDropdownCss;var balOptionCss=":root{--bal-option-padding-x:var(--bal-space-small);--bal-option-min-height:1.5rem;--bal-option-background:var(--bal-color-white);--bal-option-background-hovered:var(--bal-color-grey-3);--bal-option-background-selected:var(--bal-color-primary-1);--bal-option-background-selected-hovered:#dddfeb;--bal-option-background-invalid:var(--bal-color-danger-1);--bal-option-background-invalid-hovered:#fbe0de;--bal-option-border-width:var(--bal-border-width-normal);--bal-option-border-color:var(--bal-color-grey-2);--bal-option-font-family:var(--bal-font-family-text);--bal-option-font-weight:var(--bal-font-weight-regular);--bal-option-line-height:1.125rem;--bal-option-text-hovered:var(--bal-color-text-primary-hovered);--bal-option-text-pressed:var(--bal-color-text-primary-pressed);--bal-option-text-disabled:var(--bal-color-text-grey-light)}.bal-option{font-size:16px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:block;list-style:none;cursor:pointer;border-bottom-width:var(--bal-option-border-width);border-bottom-color:var(--bal-option-border-color);border-bottom-style:solid;background:var(--bal-option-background);padding-left:var(--bal-option-padding-x);padding-right:var(--bal-option-padding-x);min-height:var(--bal-option-min-height)}.bal-option>bal-stack{min-height:var(--bal-option-min-height)}.bal-option:last-child{border-bottom:none}.bal-option::-moz-focus-inner{border:none}.bal-option--hidden{display:none;visibility:hidden}.bal-option__inner{font-family:var(--bal-option-font-family);font-weight:var(--bal-option-font-weight);line-height:var(--bal-option-line-height);word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1;flex:1}.bal-option__inner--multiline{white-space:normal}.bal-option--focused{background:var(--bal-option-background-hovered)}@media (hover: hover)and (pointer: fine){.bal-option:hover{background:var(--bal-option-background-hovered);color:var(--bal-option-text-hovered)}}.bal-option:active{background:var(--bal-option-background-hovered);color:var(--bal-option-text-pressed)}.bal-option--selected{background:var(--bal-option-background-selected)}@media (hover: hover)and (pointer: fine){.bal-option--selected:hover{background:var(--bal-option-background-selected-hovered)}}.bal-option--selected:active{background:var(--bal-option-background-selected-hovered)}.bal-option--selected .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--selected.bal-option--focused{background:var(--bal-option-background-selected-hovered)}.bal-option--selected.bal-option--focused .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--invalid{background:var(--bal-option-background-invalid)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover{background:var(--bal-option-background-invalid-hovered)}}.bal-option--invalid:active{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid.bal-option--focused{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid .bal-option__inner{color:var(--bal-color-text-danger-hovered)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover .bal-option__inner{color:var(--bal-color-text-danger-hovered)}}.bal-option--invalid:active .bal-option__inner{color:var(--bal-color-text-danger-pressed)}.bal-option--disabled,.bal-option--disabled.bal-option--focused{background:var(--bal-option-background) !important;color:var(--bal-option-text-disabled) !important;cursor:default !important}.bal-option--disabled:hover,.bal-option--disabled.bal-option--focused:hover{background:var(--bal-option-background) !important}.bal-option{--bal-check-size:1.25rem}";var Option=function(){function o(o){var t=this;registerInstance(this,o);this.balOptionChange=createEvent(this,"balOptionChange");this.balOptionFocus=createEvent(this,"balOptionFocus");this.inputId="bal-option-".concat(balOptionIds++);this.checkbox=false;this.interactionState=BalElementStateListener.DefaultState;this.label="";this.value="";this.disabled=false;this.multiline=false;this.invalid=false;this.selected=false;this.focused=false;this.hidden=false;this.onClick=function(o){var r=t.el.closest("bal-option-list");if(t.disabled||r&&r.disabled){stopEventBubbling(o)}else{if(r&&r.required&&!r.multiple){if(!t.selected){t.select(true)}}else{t.select(!t.selected)}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.componentWillRender=function(){if(this.el){var o=this.el.closest("bal-option-list");if(o){this.checkbox=!!o.multiple}}};o.prototype.listenToMouseEnter=function(){var o=this,t=o.label,r=o.value,e=o.selected,n=o.disabled,i=o.hidden;if(!i&&!n){this.balOptionFocus.emit({label:t,value:r,selected:e})}};o.prototype.elementStateListener=function(o){this.interactionChildElements.forEach((function(t){t.hovered=o.hovered;t.pressed=o.pressed}))};o.prototype.select=function(){return __awaiter(this,arguments,void 0,(function(o){var t,r,e;if(o===void 0){o=true}return __generator(this,(function(n){this.selected=o;t=this,r=t.label,e=t.value;this.balOptionChange.emit({label:r,value:e,selected:o});return[2]}))}))};Object.defineProperty(o.prototype,"interactionChildElements",{get:function(){return Array.from(this.el.querySelectorAll("bal-check"))},enumerable:false,configurable:true});o.prototype.render=function(){var o=BEM.block("option");return h(Host,{key:"dca805aa021ad35c2ea4153008a8a5ba4f37931c",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o.class()),o.modifier("checkbox").class(this.checkbox)),o.modifier("focused").class(this.focused)),o.modifier("invalid").class(this.invalid)),o.modifier("selected").class(this.selected)),o.modifier("disabled").class(this.disabled)),o.modifier("hidden").class(this.hidden)),role:"option",id:this.inputId,"data-value":this.value,"data-label":this.label,"aria-label":this.label,"aria-hidden":ariaBooleanToString(this.hidden),"aria-selected":ariaBooleanToString(this.selected),"aria-checked":ariaBooleanToString(this.selected),"aria-disabled":ariaBooleanToString(this.disabled),"aria-invalid":ariaBooleanToString(this.invalid),tabIndex:-1,onClick:this.onClick},h("bal-stack",{key:"cfcf978a82159a6e7ad2dcddccdb40dd6b9f74a4",py:"small",space:"x-small"},this.checkbox?h("bal-check",{checked:this.selected,disabled:this.disabled,invalid:this.invalid,hovered:this.interactionState.hovered,pressed:this.interactionState.pressed,tabindex:-1}):"",h("div",{key:"e92a9c019432d29f6153371daca316c8136c75e9",class:Object.assign(Object.assign({},o.element("inner").class()),o.element("inner").modifier("multiline").class(this.multiline))},h("slot",{key:"639a99194ed6e86787e9eb2b3adc993161d58a07"})),this.selected&&!this.checkbox?h("bal-icon",{name:"check",size:"small",color:this.disabled?"grey":this.invalid?"danger":"primary"}):""))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Option.prototype,"createLogger",null);__decorate([ListenToElementStates(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Option.prototype,"elementStateListener",null);var balOptionIds=0;Option.style=balOptionCss;var balOptionListCss=".bal-option-list{display:block;position:relative;width:100%;list-style:none;margin:0;outline:0;max-height:var(--bal-option-list-max-height);border-radius:var(--bal-radius-normal);overflow:hidden auto}";var OptionList=function(){function o(o){registerInstance(this,o);this.inputId="bal-option-list-".concat(balOptionListIds++);this.inheritAttributes={};this.ariaForm=defaultBalAriaForm;this.multiple=false;this.disabled=false;this.required=false;this.focusIndex=-1;this.filter="includes";this.contentHeight=262}o.prototype.createLogger=function(o){this.log=o};o.prototype.contentHeightChanged=function(o){if(o===undefined){this.el.style.removeProperty("--bal-option-list-max-height")}else{this.el.style.setProperty("--bal-option-list-max-height","".concat(o,"px"))}};o.prototype.componentDidLoad=function(){this.contentHeightChanged(this.contentHeight)};o.prototype.componentWillRender=function(){this.inheritAttributes=inheritAttributes(this.el,["aria-multiselectable","aria-labelledby"])};o.prototype.listenToMouseEnter=function(o){var t=this.options;var r=this.getOptionIndex(t,o.detail.value);if(r!==undefined){this.updateFocus(t,r)}};o.prototype.listenToOptionChange=function(o){var t=o.detail;if(!this.multiple){this.options.filter((function(o){return o.value!==t.value})).forEach((function(o){return o.selected=false}))}};o.prototype.focusSelected=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=this.getSelectedOptionIndex(o);if(!(t>0))return[3,2];this.updateFocus(o,t);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t];case 2:return[4,this.focusFirst()];case 3:return[2,r.sent()]}}))}))};o.prototype.focusFirst=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getFirstOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusLast=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getLastOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusNext=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getNextOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusPrevious=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getPreviousOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusByLabel=function(o,t){return __awaiter(this,void 0,void 0,(function(){var r,e,n;return __generator(this,(function(i){switch(i.label){case 0:r=this.options;e=this.getOptionIndexByLabel(r,o);this.updateFocus(r,e);n=r[e];this.updateScrollTopPosition(n);return[4,waitAfterFramePaint()];case 1:i.sent();if(!t.select)return[3,3];return[4,n.select()];case 2:i.sent();i.label=3;case 3:return[2,e]}}))}))};o.prototype.filterByContent=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this.allOptions;this.filterOptions(t,o);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,this.focusFirst()]}}))}))};o.prototype.resetHidden=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.hidden=o}));return[4,waitAfterFramePaint()];case 1:t.sent();this.resetFocus();return[2]}}))}))};o.prototype.resetSelected=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.updateSelected=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o.includes(t.value)}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.resetFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=-1;this.updateFocus(o,t);this.scrollTo(0);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t]}}))}))};o.prototype.getSelectedValues=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=this.options;return[2,o.filter((function(o){return o.selected})).map((function(o){return o.value}))]}))}))};o.prototype.getSelectedOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.options;if(o&&o.length>0){return[2,t.filter((function(t){return o.includes(t.value)})).map((function(o){return o}))]}return[2,t.filter((function(o){return o.selected})).map((function(o){return o}))]}))}))};o.prototype.getValues=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.value}))]}))}))};o.prototype.getLabels=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.label}))]}))}))};o.prototype.getOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.filter((function(o){return!o.disabled||!o.hidden}))]}))}))};o.prototype.selectByFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){o=this.options;t=o[this.focusIndex];if(t){if(this.multiple){t.select(!t.selected)}else{t.select(true)}}return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};Object.defineProperty(o.prototype,"options",{get:function(){return Array.from(this.el.querySelectorAll("bal-option")).filter((function(o){return!o.hidden}))},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"allOptions",{get:function(){return Array.from(this.el.querySelectorAll("bal-option"))},enumerable:false,configurable:true});o.prototype.filterOptions=function(o,t){var r=[];var e=this.filter==="includes"?includes:startsWith;for(var n=0;n<o.length;n++){var i=o[n];var a=i.textContent||"";if(e(a,t)){r.push(i);i.hidden=false}else{i.hidden=true}}return r};o.prototype.isOptionVisible=function(o){var t=this.el.clientHeight;var r=this.el.scrollTop;var e=r+t;var n=r<=o.offsetTop&&o.offsetTop+o.clientHeight<=e;return n};o.prototype.updateScrollTopPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForTopPosition(o))}}};o.prototype.updateScrollBottomPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForBottomPosition(o))}}};o.prototype.getScrollTopForTopPosition=function(o){var t=o.offsetTop;var r=t;if(r<0){return 0}return r};o.prototype.getScrollTopForBottomPosition=function(o){var t=this.el.clientHeight;var r=o.offsetTop+o.clientHeight;var e=r-t;if(e<0){return 0}return e};o.prototype.scrollTo=function(o){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){if(o!==undefined&&o!==null){if(this.focusRaf!==undefined){cancelAnimationFrame(this.focusRaf)}this.focusRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.el.scrollTop=o;return[2]}))}))}))}return[2]}))}))};o.prototype.updateFocus=function(o,t){this.focusIndex=t;for(var r=0;r<o.length;r++){var e=o[r];e.focused=r===t}};o.prototype.getOptionIndex=function(o,t){for(var r=0;r<o.length;r++){var e=o[r];if(e.value===t){return r}}return undefined};o.prototype.getSelectedOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(r.selected&&!r.hidden){return t}}return this.focusIndex};o.prototype.getFirstOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(!r.disabled&&!r.hidden){return t}}return this.focusIndex};o.prototype.getNextOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}if(t<0){return this.getFirstOptionIndex(o)}var r=this.getLength(o);var e=t;if(t<r){e=t+1;if(o[e].disabled){return this.getNextOptionIndex(o,e)}}return e};o.prototype.getPreviousOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}var r=this.getFirstOptionIndex(o);if(t<=r){return r}var e=t;e=t-1;if(o[e].disabled){return this.getPreviousOptionIndex(o,e)}return e};o.prototype.getLastOptionIndex=function(o){for(var t=o.length-1;t>=0;t--){var r=o[t];if(!r.disabled){return t}}return this.focusIndex};o.prototype.getOptionIndexByLabel=function(o,t){if(t===undefined||t===""){return this.focusIndex}var r=o.find((function(o){return startsWith(o.label||"",t)}));if(!isNil(r)&&r.id){return o.indexOf(r)}return this.focusIndex};o.prototype.getLength=function(o){var t=o.map((function(o,t){return o.disabled?0:t}));var r=Math.max.apply(Math,t);return r};o.prototype.render=function(){var o=BEM.block("option-list");var t=this.labelledby||this.ariaForm.labelId;return h(Host,{key:"bcb9ee55aefe68beac309225d1127524f327f9da",class:Object.assign({},o.class()),id:this.inputId},h("div",Object.assign({key:"ac14c8a5615c6497569ca0aa8436dda3924babf6",role:"listbox","aria-labelledby":t,"aria-disabled":ariaBooleanToString(this.disabled),class:Object.assign({},o.element("container").class())},this.inheritAttributes),h("slot",{key:"869656387e53fd832b45141cb3b5b89684e61727"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{contentHeight:["contentHeightChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option-list"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],OptionList.prototype,"createLogger",null);var balOptionListIds=0;OptionList.style=balOptionListCss;export{Dropdown as bal_dropdown,Option as bal_option,OptionList as bal_option_list};
|
|
1
|
+
import{__awaiter,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,a as waitAfterFramePaint,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback,m as raf}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{i as isNil}from"./index-zWZxKBfo.js";import{a as areArraysEqual}from"./array-CDfSqLEo.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{D as DropdownOptionUtil}from"./option-BLp4ll3i.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{d as isArrowDownKey,b as isArrowUpKey,a as isEnterKey,j as isEscapeKey,i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{B as BalElementStateListener,L as ListenToElementStates}from"./element-states.decorator-B68ANq1p.js";import{i as includes,s as startsWith}from"./utils-C_qktPg7.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./listener-CClDIhvK.js";var DropdownAutoFillUtil=function(){function o(){var o=this;this.handleAutoFill=function(t){return __awaiter(o,void 0,void 0,(function(){var o,r;return __generator(this,(function(e){switch(e.label){case 0:stopEventBubbling(t);if(!this.isAutoFillAllowed())return[3,2];this.component.isAutoFilled=true;o=this.component.nativeEl.value;return[4,this.parseAutoFillValueWithOptions(o)];case 1:r=e.sent();if(r===undefined){this.component.isAutoFilled=false;return[2]}if(!areArraysEqual(r,this.component.rawValue)){this.component.valueUtil.updateRawValueBySelection(r,true)}e.label=2;case 2:return[2]}}))}))}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.isAutoFillAllowed=function(){return!this.component.multiple};o.prototype.parseAutoFillValueWithOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t,r,e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.component.listEl.getOptions()];case 1:t=i.sent();r=undefined;for(e=0;e<t.length;e++){n=t[e];if(n.value===o||n.label===o){return[2,[n.value]]}}return[2,r]}}))}))};return o}();var i18nBalDropdown={de:{clearable:"Löschen",open:"Öffnen",close:"Schließen"},en:{clearable:"clear",open:"Open",close:"Close"},fr:{clearable:"Effacer",open:"Ouvrir",close:"Fermer"},it:{clearable:"Cancellare",open:"Apri",close:"Chiudi"},nl:{clearable:"Wissen",open:"Open",close:"Sluiten"},es:{clearable:"Limpiar",open:"Abrir",close:"Cerrar"},pl:{clearable:"Wyczyść",open:"Otwórz",close:"Zamknij"},pt:{clearable:"Limpar",open:"Abrir",close:"Fechar"},sv:{clearable:"Rensa",open:"Öppna",close:"Stäng"},fi:{clearable:"Tyhjennä",open:"Avaa",close:"Sulje"}};var DropdownEventsUtil=function(){function o(){var o=this;this.handlePointerDown=function(){o.component.isKeyboardMode=false};this.handleKeydown=function(t){o.component.isKeyboardMode=FOCUS_KEYS.includes(t.key)}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.handleFocus=function(o){this.component.hasFocus=true;this.component.balFocus.emit(o)};o.prototype.handleBlur=function(o){var t=this;if(!this.component.isExpanded){this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}};o.prototype.handleClick=function(o){if(!this.component.valueUtil.isDisabled()){if(this.component.chips){var t=o.target;var r=t.closest("bal-close");if(r){return}}if(this.component.clearable){var t=o.target;var e=t.closest(".bal-dropdown__clear");if(e){this.component.valueUtil.updateRawValueBySelection([]);return}}this.component.popupUtil.toggleList()}};o.prototype.handleOutsideClick=function(o){var t=this;var r;if(this.component.isExpanded){if(!this.component.el.contains(o.target)){this.component.isExpanded=false;(r=this.component.listEl)===null||r===void 0?void 0:r.resetFocus();this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}}};return o}();var DropdownFocusUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.focusOptionByLabel=function(o,t){var r=this;if(t===void 0){t={}}this.component.labelToFocus=(this.component.labelToFocus+o).trim();if(this.component.labelToFocus.length>0){clearTimeout(this.keyHitTimeout);this.keyHitTimeout=setTimeout((function(){var o;(o=r.component.listEl)===null||o===void 0?void 0:o.focusByLabel(r.component.labelToFocus,t)}),100);clearTimeout(this.timeout);this.timeout=setTimeout((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(o){this.component.labelToFocus="";return[2]}))}))}),1e3)}};return o}();var DropdownFormSubmitUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o;this.component.initialValue=this.component.value};o.prototype.componentDidRender=function(){var o=this;if(this.component.selectEl){var t=this.component.selectEl.querySelectorAll("option");t.forEach((function(t){if(o.component.rawValue.includes(t.value)){t.selected=true}}))}};o.prototype.handle=function(o){var t=this;var r=o.target;if(r===null||r===void 0?void 0:r.contains(this.component.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){var o=t.component.valueUtil.parseValueString(t.component.initialValue);t.component.valueUtil.updateRawValueBySelection(o)}),0)}};return o}();var DropdownNativeSelect=function(o){var t=o.name,r=o.httpFormSubmit,e=o.multiple,n=o.required,i=o.disabled,a=o.rawValue,d=o.refSelectEl;var l=BEM.block("dropdown");return r?h("select",{class:Object.assign({},l.element("root").element("select").class()),"aria-hidden":"true",name:t,multiple:e,required:n,disabled:i,tabindex:-1,ref:d},a.map((function(o){return h("option",{key:o,value:o,selected:true},o)}))):""};var DropdownIcon=function(o){var t=o.size,r=o.theme,e=o.icon,n=o.language,i=o.loading,a=o.clearable,d=o.invalid,l=o.filled,s=o.expanded,c=o.disabled;var p=BEM.block("dropdown");if(i){return h("bal-spinner",{class:Object.assign({},p.element("rear").class()),small:true,variation:"circle",color:"white"})}else if(a&&l&&!c){return h("button",{title:i18nBalDropdown[n].clearable,type:"button",tabIndex:-1,class:Object.assign(Object.assign(Object.assign(Object.assign({},p.element("rear").class()),p.element("clear").class()),p.element("clear").modifier("invalid").class(d)),p.element("clear").modifier("theme-purple").class(r==="purple"))},h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:r==="purple"?"close":"close-circle",size:t,color:r==="purple"?"primary":"grey"}))}else{return h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:e,size:t,turn:s,color:c?"grey":d?"danger":"primary"})}};var DropdownInput=function(o){var t=o.inputId,r=o.httpFormSubmit,e=o.ariaForm,n=o.rawValue,i=o.autocomplete,a=o.required,d=o.disabled,l=o.readonly,s=o.placeholder,c=o.expanded,p=o.invalid,u=o.language,b=o.inputLabel,_=o.inheritedAttributes,f=o.refInputEl,v=o.onChange,w=o.onFocus,m=o.onBlur,g=o.onKeyDown;var x=BEM.block("dropdown");var y=function(){return h("input",Object.assign({id:e.controlId||"".concat(t,"-ctrl"),class:Object.assign({},x.element("root").element("input").class()),type:"text",size:1,inputmode:"none",tabindex:"0",autoComplete:i,value:n.join(","),required:a,disabled:d,readonly:l,placeholder:s,title:c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-label":c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-owns":"".concat(t,"-menu"),"aria-invalid":ariaBooleanToString(p),"aria-disabled":ariaBooleanToString(d||l),"aria-labelledby":e.labelId,"aria-describedby":e.messageId,"aria-haspopup":"listbox","data-native":true,"data-label":b,"data-value":n.join(","),ref:function(o){return f(o)},onChange:function(o){return v(o)},onFocus:function(o){return w(o)},onBlur:function(o){return m(o)},onKeyDown:function(o){return g(o)}},_))};if(r){return h(y,null)}return h("form",{novalidate:true},h(y,null))};var DropdownPopupUtil=function(){function o(){this.updatePanelPosition=function(o,t,r){return function(){o.computePosition(t,r,{placement:"bottom-start",middleware:[o.flip(),o.shift()]}).then((function(o){var t=o.x,e=o.y;Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(e,"px")})}))}}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.toggleList=function(){if(!this.component.valueUtil.isDisabled()){if(this.component.isExpanded){this.collapseList()}else{this.expandList()}}};o.prototype.expandList=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:if(!this.component.panelEl)return[3,2];return[4,balFloatingUi.load()];case 1:t=r.sent();this.component.panelCleanup=t.autoUpdate(this.component.el,this.component.panelEl,this.updatePanelPosition(t,this.component.el,this.component.panelEl));r.label=2;case 2:this.component.isExpanded=true;return[4,(o=this.component.listEl)===null||o===void 0?void 0:o.focusSelected()];case 3:r.sent();return[2]}}))}))};o.prototype.collapseList=function(){var o;this.component.isExpanded=false;(o=this.component.listEl)===null||o===void 0?void 0:o.resetFocus();if(this.component.panelCleanup){this.component.panelCleanup()}};return o}();var DropdownValueUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.componentDidLoad=function(){var o=this;setTimeout((function(){return o.valueChanged(o.component.value,undefined)}),0)};o.prototype.isDisabled=function(){return this.component.disabled||this.component.readonly};o.prototype.isFilled=function(){return this.component.rawValue&&this.component.rawValue.length>0};o.prototype.valueChanged=function(o,t){var r=typeof o;var e=typeof t;if(r!==e){this.updateRawValueByValueProp(o)}if(r==="string"&&o!==t){this.updateRawValueByValueProp(o)}if(Array.isArray(o)&&Array.isArray(t)&&!areArraysEqual(o,t)){this.updateRawValueByValueProp(o)}};o.prototype.updateRawValueBySelection=function(o,t){if(o===void 0){o=[]}if(t===void 0){t=false}this.component.isAutoFilled=t;this.updateRawValue(o);if(this.component.multiple){this.component.balChange.emit(this.component.rawValue)}else{this.component.balChange.emit(this.component.rawValue[0])}};o.prototype.parseValueString=function(o){if(o===void 0){o=[]}var t=[];if(!isNil(o)&&o!==""){if(Array.isArray(o)){t=__spreadArray([],o.filter((function(o){return!isNil(o)})),true)}else{if(o.split("").includes(",")){t=__spreadArray([],o.split(",").filter((function(o){return o})).map((function(o){return o.trim()})),true)}else{t=[o]}}}return t};o.prototype.updateRawValueByValueProp=function(o){if(o===void 0){o=[]}var t=this.parseValueString(o);this.updateRawValue(t)};o.prototype.updateRawValue=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=[]}return __generator(this,(function(t){switch(t.label){case 0:this.component.rawValue=o;if(!this.component.listEl)return[3,2];return[4,this.component.listEl.updateSelected(this.component.rawValue)];case 1:t.sent();t.label=2;case 2:return[4,this.updateInputContent()];case 3:t.sent();return[2]}}))}))};o.prototype.removeOption=function(o){var t=this.component.rawValue.filter((function(t){return t!==o.value}));this.updateRawValueBySelection(t)};o.prototype.updateInputContent=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:return[4,waitAfterFramePaint()];case 1:t.sent();if(!this.component.listEl)return[3,3];o=this.component;return[4,this.component.listEl.getSelectedOptions(this.component.rawValue)];case 2:o.choices=t.sent();this.component.inputLabel=this.component.choices.map((function(o){return o.label.trim()})).sort().join(",");t.label=3;case 3:return[2]}}))}))};return o}();var DropdownValue=function(o){var t=o.inlineLabel,r=o.filled,e=o.chips,n=o.placeholder,i=o.choices,a=o.renderChip;var d=BEM.block("dropdown");if(r){if(e){return h("div",{class:Object.assign({},d.element("root").element("content").element("chips").class())},i.map((function(o){return a(o)})))}else{return(t&&"".concat(t,": "))+i.map((function(o){return o.label})).join(", ")}}else{return n}};var balDropdownCss=':root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-3);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-3);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-weight:var(--bal-font-weight-regular);font-size:var(--bal-text-size-normal);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:1rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root:not(.bal-dropdown__root--disabled):not(.bal-dropdown__root--invalid):not(.bal-dropdown__root--theme-purple):not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-dropdown-control-background-hover)}}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:none;visibility:hidden;opacity:0;width:100vw;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}@media screen and (min-width: 769px),print{.bal-dropdown__list{max-width:100vw;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:100%}}.bal-dropdown__list--expanded{display:block;visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}.bal-dropdown__rear{z-index:1}.bal-dropdown__root--size-small{min-height:2rem}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content--placeholder{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-background-grey-light)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-1)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-purple-2)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled),.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active{border:none;background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--focused.bal-dropdown__root--theme-purple:before{content:"";border-width:var(--bal-border-width-normal);border-style:solid;border-color:var(--bal-focus-shadow-end-color);position:absolute;background:rgba(0,0,0,0);border-radius:var(--bal-radius-normal);top:-0.25rem;bottom:-0.25rem;left:-0.25rem;right:-0.25rem}.bal-dropdown__root__content--size-small{font-size:var(--bal-text-size-small);font-weight:var(--bal-font-weight-bold)}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}';var Dropdown=function(){function o(o){var t=this;registerInstance(this,o);this.balChange=createEvent(this,"balChange");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.inputId="bal-dropdown-".concat(balDropdownIds++);this.inheritedAttributes={};this.initialValue=[];this.nativeOptions=[];this.rawOptions=[];this.choices=[];this.rawValue=[];this.hasFocus=false;this.isExpanded=false;this.isAutoFilled=false;this.isKeyboardMode=false;this.inputLabel="";this.ariaForm=defaultBalAriaForm;this.language=defaultConfig.language;this.region=defaultConfig.region;this.httpFormSubmit=defaultConfig.httpFormSubmit;this.labelToFocus="";this.valueUtil=new DropdownValueUtil;this.eventsUtil=new DropdownEventsUtil;this.popupUtil=new DropdownPopupUtil;this.optionUtil=new DropdownOptionUtil;this.formSubmitUtil=new DropdownFormSubmitUtil;this.focusUtil=new DropdownFocusUtil;this.autoFillUtil=new DropdownAutoFillUtil;this.autocomplete="off";this.name=this.inputId;this.placeholder="";this.inlineLabel="";this.icon="caret-down";this.size="";this.theme="";this.disabled=false;this.readonly=false;this.multiple=false;this.chips=false;this.clearable=false;this.invalid=false;this.required=false;this.loading=false;this.filter="includes";this.contentHeight=262;this.inverted=false;this.options=[];this.value=[];this.hasConnected=false;this.listenToOptionChange=function(o){t.optionUtil.listenToOptionChange(o)};this.listenOnClickOutside=function(o){t.eventsUtil.handleOutsideClick(o)};this.resetHandler=function(o){t.formSubmitUtil.handle(o)};this.handleAutoFill=function(o){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.log("(handleAutoFill)",o,this.nativeEl.value);this.autoFillUtil.handleAutoFill(o);return[2]}))}))};this.handleKeyDown=function(o){var r,e,n,i,a;if(o&&o.key){if(t.isExpanded){if(isArrowDownKey(o)){stopEventBubbling(o);(r=t.listEl)===null||r===void 0?void 0:r.focusNext()}else if(isArrowUpKey(o)){stopEventBubbling(o);(e=t.listEl)===null||e===void 0?void 0:e.focusPrevious()}else if(o.key==="Home"||o.key==="PageUp"){stopEventBubbling(o);(n=t.listEl)===null||n===void 0?void 0:n.focusFirst()}else if(o.key==="End"||o.key==="PageDown"){stopEventBubbling(o);(i=t.listEl)===null||i===void 0?void 0:i.focusLast()}else if(isEnterKey(o)){stopEventBubbling(o);(a=t.listEl)===null||a===void 0?void 0:a.selectByFocus()}else if(o.key==="Tab"||isEscapeKey(o)){t.popupUtil.collapseList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key)}}else{if(isEnterKey(o)||isSpaceKey(o)){stopEventBubbling(o);t.popupUtil.expandList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key,{select:true})}}}else{if(t.isExpanded){t.popupUtil.collapseList()}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.optionChanged=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.optionUtil.optionChanged();return[2]}))}))};o.prototype.valueChanged=function(o,t){this.valueUtil.valueChanged(o,t)};o.prototype.connectedCallback=function(){if(!this.hasConnected){this.eventsUtil.connectedCallback(this);this.valueUtil.connectedCallback(this);this.popupUtil.connectedCallback(this);this.optionUtil.connectedCallback(this);this.formSubmitUtil.connectedCallback(this);this.focusUtil.connectedCallback(this);this.autoFillUtil.connectedCallback(this)}addEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){addEventListener(document,"keydown",this.eventsUtil.handleKeydown);addEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);addEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);addEventListener(document,"click",this.listenOnClickOutside);addEventListener(document,"reset",this.resetHandler,{capture:true})}this.hasConnected=true};o.prototype.disconnectedCallback=function(){removeEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.eventsUtil.handleKeydown);removeEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);removeEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);removeEventListener(document,"click",this.listenOnClickOutside);removeEventListener(document,"reset",this.resetHandler,{capture:true})}};o.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.inheritedAttributes=inheritAttributes(this.el,["tabindex","data-hj-allow"]);return[4,this.optionUtil.componentWillRender()];case 1:o.sent();return[2]}}))}))};o.prototype.componentDidRender=function(){this.formSubmitUtil.componentDidRender()};o.prototype.componentDidLoad=function(){this.valueUtil.componentDidLoad()};o.prototype.configChanged=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=o.language;this.region=o.region;this.httpFormSubmit=o.httpFormSubmit;return[2]}))}))};o.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(this.nativeEl&&!this.valueUtil.isDisabled()))return[3,2];return[4,waitAfterIdleCallback()];case 1:o.sent();this.nativeEl.focus();o.label=2;case 2:return[2]}}))}))};o.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.rawValue]}))}))};o.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.valueUtil.updateRawValueBySelection([]);return[2]}))}))};o.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.expandList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.collapseList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.select=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.valueUtil.parseValueString(o);this.valueUtil.updateRawValueBySelection(t);return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};o.prototype.render=function(){var o=this;var t=BEM.block("dropdown");var r=this.valueUtil.isFilled();var e=this.size!=="";var n="size-".concat(this.size);var i=this.theme!=="";var a="theme-".concat(this.theme);var d=this.theme==="purple"?this.hasFocus&&this.isKeyboardMode:this.hasFocus;return h(Host,{key:"3fe05ba6190dabe5fb8c297f4809659f7c24aa74",class:Object.assign({},t.class()),tabindex:"-1",id:"".concat(this.inputId)},h("div",{key:"e0b038aa5b7ead381d271c5b7b04fd5bbaa3ea3b",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").class()),t.element("root").modifier("focused").class(d)),t.element("root").modifier("invalid").class(this.invalid)),t.element("root").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").modifier("autofill").class(this.isAutoFilled)),t.element("root").modifier(n).class(e)),t.element("root").modifier(a).class(i)),t.element("root").modifier(a+"-filled").class(r&&i)),t.element("root").modifier(a+"-expanded").class(this.isExpanded&&i)),"data-testid":"bal-dropdown-trigger",onClick:function(t){return o.eventsUtil.handleClick(t)}},h("span",{key:"a3499a9e2abcaa3b363385c475c3dcd91ed1a371",class:Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").element("content").class()),t.element("root").element("content").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").element("content").modifier("placeholder").class(!this.valueUtil.isFilled())),t.element("root").element("content").modifier(n).class(e))},h(DropdownValue,{key:"8ffc980c91386038c4ee9b9e6673a25a3609d674",filled:this.valueUtil.isFilled(),inlineLabel:this.inlineLabel,chips:this.chips,placeholder:this.placeholder,choices:this.choices,renderChip:function(t){return h("bal-tag",{key:t.value,"data-testid":"bal-dropdown-chip",size:"small",invalid:o.invalid,disabled:o.disabled||o.readonly,closable:!(o.disabled||o.readonly),onBalCloseClick:function(){return o.valueUtil.removeOption(t)}},t.label)}})),h(DropdownInput,{key:"9a97fc39a821d5dcca32eba522ae29e4aa6eedc0",inputId:this.inputId,httpFormSubmit:this.httpFormSubmit,ariaForm:this.ariaForm,rawValue:this.rawValue,autocomplete:this.autocomplete,required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,expanded:this.isExpanded,invalid:this.invalid,language:this.language,inputLabel:this.inputLabel,inheritedAttributes:this.inheritedAttributes,refInputEl:function(t){return o.nativeEl=t},onChange:function(t){return o.handleAutoFill(t)},onFocus:function(t){return o.eventsUtil.handleFocus(t)},onBlur:function(t){return o.eventsUtil.handleBlur(t)},onKeyDown:function(t){return o.handleKeyDown(t)}}),h(DropdownNativeSelect,{key:"2a33a8ac7f336889197137fc741ed8a4a107fceb",name:this.name,httpFormSubmit:this.httpFormSubmit,multiple:this.multiple,required:this.required,disabled:this.valueUtil.isDisabled(),rawValue:this.rawValue,refSelectEl:function(t){return o.selectEl=t}}),h(DropdownIcon,{key:"d0f6958fb47ad7f6d73d4f98482cb2102c344f20",icon:this.icon,size:this.size,theme:this.theme,language:this.language,loading:this.loading,clearable:this.clearable,invalid:this.invalid,expanded:this.isExpanded,filled:r,disabled:this.valueUtil.isDisabled()})),h("div",{key:"29e98d1f54ffb6ee913bd682d6531d45997fc1d0",id:"".concat(this.inputId,"-menu"),class:Object.assign(Object.assign({},t.element("list").class()),t.element("list").modifier("expanded").class(this.isExpanded)),ref:function(t){return o.panelEl=t}},h("bal-option-list",{key:"4e6fa69f9d9859208f83dd7bc86c17fc75d5eb60",multiple:this.multiple,disabled:this.valueUtil.isDisabled(),filter:this.filter,required:this.required,contentHeight:this.contentHeight,ref:function(t){return o.listEl=t}},h("slot",{key:"1c169dc692632671f62410b2dadcbbc10b0fe36a"}),this.optionUtil.hasPropOptions()?this.rawOptions.map((function(o){return h("bal-option",{key:o.value,value:o.value,label:o.label,disabled:o.disabled,multiline:o.multiline,invalid:o.invalid,hidden:o.hidden,selected:o.selected,focused:o.focused},o.label)})):"")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{options:["optionChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-dropdown"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Dropdown.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Dropdown.prototype,"configChanged",null);var balDropdownIds=0;Dropdown.style=balDropdownCss;var balOptionCss=":root{--bal-option-padding-x:var(--bal-space-small);--bal-option-min-height:1.5rem;--bal-option-background:var(--bal-color-white);--bal-option-background-hovered:var(--bal-color-grey-3);--bal-option-background-selected:var(--bal-color-primary-1);--bal-option-background-selected-hovered:#dddfeb;--bal-option-background-invalid:var(--bal-color-danger-1);--bal-option-background-invalid-hovered:#fbe0de;--bal-option-border-width:var(--bal-border-width-normal);--bal-option-border-color:var(--bal-color-grey-2);--bal-option-font-family:var(--bal-font-family-text);--bal-option-font-weight:var(--bal-font-weight-regular);--bal-option-line-height:1.125rem;--bal-option-text-hovered:var(--bal-color-text-primary-hovered);--bal-option-text-pressed:var(--bal-color-text-primary-pressed);--bal-option-text-disabled:var(--bal-color-text-grey-light)}.bal-option{font-size:16px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:block;list-style:none;cursor:pointer;border-bottom-width:var(--bal-option-border-width);border-bottom-color:var(--bal-option-border-color);border-bottom-style:solid;background:var(--bal-option-background);padding-left:var(--bal-option-padding-x);padding-right:var(--bal-option-padding-x);min-height:var(--bal-option-min-height)}.bal-option>bal-stack{min-height:var(--bal-option-min-height)}.bal-option:last-child{border-bottom:none}.bal-option::-moz-focus-inner{border:none}.bal-option--hidden{display:none;visibility:hidden}.bal-option__inner{font-family:var(--bal-option-font-family);font-weight:var(--bal-option-font-weight);line-height:var(--bal-option-line-height);word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1;flex:1}.bal-option__inner--multiline{white-space:normal}.bal-option--focused{background:var(--bal-option-background-hovered)}@media (hover: hover)and (pointer: fine){.bal-option:hover{background:var(--bal-option-background-hovered);color:var(--bal-option-text-hovered)}}.bal-option:active{background:var(--bal-option-background-hovered);color:var(--bal-option-text-pressed)}.bal-option--selected{background:var(--bal-option-background-selected)}@media (hover: hover)and (pointer: fine){.bal-option--selected:hover{background:var(--bal-option-background-selected-hovered)}}.bal-option--selected:active{background:var(--bal-option-background-selected-hovered)}.bal-option--selected .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--selected.bal-option--focused{background:var(--bal-option-background-selected-hovered)}.bal-option--selected.bal-option--focused .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--invalid{background:var(--bal-option-background-invalid)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover{background:var(--bal-option-background-invalid-hovered)}}.bal-option--invalid:active{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid.bal-option--focused{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid .bal-option__inner{color:var(--bal-color-text-danger-hovered)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover .bal-option__inner{color:var(--bal-color-text-danger-hovered)}}.bal-option--invalid:active .bal-option__inner{color:var(--bal-color-text-danger-pressed)}.bal-option--disabled,.bal-option--disabled.bal-option--focused{background:var(--bal-option-background) !important;color:var(--bal-option-text-disabled) !important;cursor:default !important}.bal-option--disabled:hover,.bal-option--disabled.bal-option--focused:hover{background:var(--bal-option-background) !important}.bal-option{--bal-check-size:1.25rem}";var Option=function(){function o(o){var t=this;registerInstance(this,o);this.balOptionChange=createEvent(this,"balOptionChange");this.balOptionFocus=createEvent(this,"balOptionFocus");this.inputId="bal-option-".concat(balOptionIds++);this.checkbox=false;this.interactionState=BalElementStateListener.DefaultState;this.label="";this.value="";this.disabled=false;this.multiline=false;this.invalid=false;this.selected=false;this.focused=false;this.hidden=false;this.onClick=function(o){var r=t.el.closest("bal-option-list");if(t.disabled||r&&r.disabled){stopEventBubbling(o)}else{if(r&&r.required&&!r.multiple){if(!t.selected){t.select(true)}}else{t.select(!t.selected)}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.componentWillRender=function(){if(this.el){var o=this.el.closest("bal-option-list");if(o){this.checkbox=!!o.multiple}}};o.prototype.listenToMouseEnter=function(){var o=this,t=o.label,r=o.value,e=o.selected,n=o.disabled,i=o.hidden;if(!i&&!n){this.balOptionFocus.emit({label:t,value:r,selected:e})}};o.prototype.elementStateListener=function(o){this.interactionChildElements.forEach((function(t){t.hovered=o.hovered;t.pressed=o.pressed}))};o.prototype.select=function(){return __awaiter(this,arguments,void 0,(function(o){var t,r,e;if(o===void 0){o=true}return __generator(this,(function(n){this.selected=o;t=this,r=t.label,e=t.value;this.balOptionChange.emit({label:r,value:e,selected:o});return[2]}))}))};Object.defineProperty(o.prototype,"interactionChildElements",{get:function(){return Array.from(this.el.querySelectorAll("bal-check"))},enumerable:false,configurable:true});o.prototype.render=function(){var o=BEM.block("option");return h(Host,{key:"dca805aa021ad35c2ea4153008a8a5ba4f37931c",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o.class()),o.modifier("checkbox").class(this.checkbox)),o.modifier("focused").class(this.focused)),o.modifier("invalid").class(this.invalid)),o.modifier("selected").class(this.selected)),o.modifier("disabled").class(this.disabled)),o.modifier("hidden").class(this.hidden)),role:"option",id:this.inputId,"data-value":this.value,"data-label":this.label,"aria-label":this.label,"aria-hidden":ariaBooleanToString(this.hidden),"aria-selected":ariaBooleanToString(this.selected),"aria-checked":ariaBooleanToString(this.selected),"aria-disabled":ariaBooleanToString(this.disabled),"aria-invalid":ariaBooleanToString(this.invalid),tabIndex:-1,onClick:this.onClick},h("bal-stack",{key:"cfcf978a82159a6e7ad2dcddccdb40dd6b9f74a4",py:"small",space:"x-small"},this.checkbox?h("bal-check",{checked:this.selected,disabled:this.disabled,invalid:this.invalid,hovered:this.interactionState.hovered,pressed:this.interactionState.pressed,tabindex:-1}):"",h("div",{key:"e92a9c019432d29f6153371daca316c8136c75e9",class:Object.assign(Object.assign({},o.element("inner").class()),o.element("inner").modifier("multiline").class(this.multiline))},h("slot",{key:"639a99194ed6e86787e9eb2b3adc993161d58a07"})),this.selected&&!this.checkbox?h("bal-icon",{name:"check",size:"small",color:this.disabled?"grey":this.invalid?"danger":"primary"}):""))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Option.prototype,"createLogger",null);__decorate([ListenToElementStates(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Option.prototype,"elementStateListener",null);var balOptionIds=0;Option.style=balOptionCss;var balOptionListCss=".bal-option-list{display:block;position:relative;width:100%;list-style:none;margin:0;outline:0;max-height:var(--bal-option-list-max-height);border-radius:var(--bal-radius-normal);overflow:hidden auto}";var OptionList=function(){function o(o){registerInstance(this,o);this.inputId="bal-option-list-".concat(balOptionListIds++);this.inheritAttributes={};this.ariaForm=defaultBalAriaForm;this.multiple=false;this.disabled=false;this.required=false;this.focusIndex=-1;this.filter="includes";this.contentHeight=262}o.prototype.createLogger=function(o){this.log=o};o.prototype.contentHeightChanged=function(o){if(o===undefined){this.el.style.removeProperty("--bal-option-list-max-height")}else{this.el.style.setProperty("--bal-option-list-max-height","".concat(o,"px"))}};o.prototype.componentDidLoad=function(){this.contentHeightChanged(this.contentHeight)};o.prototype.componentWillRender=function(){this.inheritAttributes=inheritAttributes(this.el,["aria-multiselectable","aria-labelledby"])};o.prototype.listenToMouseEnter=function(o){var t=this.options;var r=this.getOptionIndex(t,o.detail.value);if(r!==undefined){this.updateFocus(t,r)}};o.prototype.listenToOptionChange=function(o){var t=o.detail;if(!this.multiple){this.options.filter((function(o){return o.value!==t.value})).forEach((function(o){return o.selected=false}))}};o.prototype.focusSelected=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=this.getSelectedOptionIndex(o);if(!(t>0))return[3,2];this.updateFocus(o,t);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t];case 2:return[4,this.focusFirst()];case 3:return[2,r.sent()]}}))}))};o.prototype.focusFirst=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getFirstOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusLast=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getLastOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusNext=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getNextOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusPrevious=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getPreviousOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusByLabel=function(o,t){return __awaiter(this,void 0,void 0,(function(){var r,e,n;return __generator(this,(function(i){switch(i.label){case 0:r=this.options;e=this.getOptionIndexByLabel(r,o);this.updateFocus(r,e);n=r[e];this.updateScrollTopPosition(n);return[4,waitAfterFramePaint()];case 1:i.sent();if(!t.select)return[3,3];return[4,n.select()];case 2:i.sent();i.label=3;case 3:return[2,e]}}))}))};o.prototype.filterByContent=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this.allOptions;this.filterOptions(t,o);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,this.focusFirst()]}}))}))};o.prototype.resetHidden=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.hidden=o}));return[4,waitAfterFramePaint()];case 1:t.sent();this.resetFocus();return[2]}}))}))};o.prototype.resetSelected=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.updateSelected=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o.includes(t.value)}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.resetFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=-1;this.updateFocus(o,t);this.scrollTo(0);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t]}}))}))};o.prototype.getSelectedValues=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=this.options;return[2,o.filter((function(o){return o.selected})).map((function(o){return o.value}))]}))}))};o.prototype.getSelectedOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.options;if(o&&o.length>0){return[2,t.filter((function(t){return o.includes(t.value)})).map((function(o){return o}))]}return[2,t.filter((function(o){return o.selected})).map((function(o){return o}))]}))}))};o.prototype.getValues=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.value}))]}))}))};o.prototype.getLabels=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.label}))]}))}))};o.prototype.getOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.filter((function(o){return!o.disabled||!o.hidden}))]}))}))};o.prototype.selectByFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){o=this.options;t=o[this.focusIndex];if(t){if(this.multiple){t.select(!t.selected)}else{t.select(true)}}return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};Object.defineProperty(o.prototype,"options",{get:function(){return Array.from(this.el.querySelectorAll("bal-option")).filter((function(o){return!o.hidden}))},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"allOptions",{get:function(){return Array.from(this.el.querySelectorAll("bal-option"))},enumerable:false,configurable:true});o.prototype.filterOptions=function(o,t){var r=[];var e=this.filter==="includes"?includes:startsWith;for(var n=0;n<o.length;n++){var i=o[n];var a=i.textContent||"";if(e(a,t)){r.push(i);i.hidden=false}else{i.hidden=true}}return r};o.prototype.isOptionVisible=function(o){var t=this.el.clientHeight;var r=this.el.scrollTop;var e=r+t;var n=r<=o.offsetTop&&o.offsetTop+o.clientHeight<=e;return n};o.prototype.updateScrollTopPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForTopPosition(o))}}};o.prototype.updateScrollBottomPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForBottomPosition(o))}}};o.prototype.getScrollTopForTopPosition=function(o){var t=o.offsetTop;var r=t;if(r<0){return 0}return r};o.prototype.getScrollTopForBottomPosition=function(o){var t=this.el.clientHeight;var r=o.offsetTop+o.clientHeight;var e=r-t;if(e<0){return 0}return e};o.prototype.scrollTo=function(o){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){if(o!==undefined&&o!==null){if(this.focusRaf!==undefined){cancelAnimationFrame(this.focusRaf)}this.focusRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.el.scrollTop=o;return[2]}))}))}))}return[2]}))}))};o.prototype.updateFocus=function(o,t){this.focusIndex=t;for(var r=0;r<o.length;r++){var e=o[r];e.focused=r===t}};o.prototype.getOptionIndex=function(o,t){for(var r=0;r<o.length;r++){var e=o[r];if(e.value===t){return r}}return undefined};o.prototype.getSelectedOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(r.selected&&!r.hidden){return t}}return this.focusIndex};o.prototype.getFirstOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(!r.disabled&&!r.hidden){return t}}return this.focusIndex};o.prototype.getNextOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}if(t<0){return this.getFirstOptionIndex(o)}var r=this.getLength(o);var e=t;if(t<r){e=t+1;if(o[e].disabled){return this.getNextOptionIndex(o,e)}}return e};o.prototype.getPreviousOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}var r=this.getFirstOptionIndex(o);if(t<=r){return r}var e=t;e=t-1;if(o[e].disabled){return this.getPreviousOptionIndex(o,e)}return e};o.prototype.getLastOptionIndex=function(o){for(var t=o.length-1;t>=0;t--){var r=o[t];if(!r.disabled){return t}}return this.focusIndex};o.prototype.getOptionIndexByLabel=function(o,t){if(t===undefined||t===""){return this.focusIndex}var r=o.find((function(o){return startsWith(o.label||"",t)}));if(!isNil(r)&&r.id){return o.indexOf(r)}return this.focusIndex};o.prototype.getLength=function(o){var t=o.map((function(o,t){return o.disabled?0:t}));var r=Math.max.apply(Math,t);return r};o.prototype.render=function(){var o=BEM.block("option-list");var t=this.labelledby||this.ariaForm.labelId;return h(Host,{key:"bcb9ee55aefe68beac309225d1127524f327f9da",class:Object.assign({},o.class()),id:this.inputId},h("div",Object.assign({key:"ac14c8a5615c6497569ca0aa8436dda3924babf6",role:"listbox","aria-labelledby":t,"aria-disabled":ariaBooleanToString(this.disabled),class:Object.assign({},o.element("container").class())},this.inheritAttributes),h("slot",{key:"869656387e53fd832b45141cb3b5b89684e61727"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{contentHeight:["contentHeightChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option-list"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],OptionList.prototype,"createLogger",null);var balOptionListIds=0;OptionList.style=balOptionListCss;export{Dropdown as bal_dropdown,Option as bal_option,OptionList as bal_option_list};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{d as deepReady,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBreakpoints}from"./breakpoints.subject-BnQp404Z.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-t_yXJIZL.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./listener-CClDIhvK.js";import"./device-TtMibDFL.js";import"./tokens.esm-Cf90NR4z.js";var balFieldCss=":root{--bal-field-label-horizontal-width:33.3333%;--bal-field-label-column-gap:.5rem}.bal-field,.bal-field-label,.bal-field-control,.bal-field-message,.bal-field-hint{display:block;position:relative;font-family:var(--bal-font-family-text)}.bal-field-label{display:inline}.bal-field-label~.bal-field-control{margin-top:.25rem}.bal-field-hint{display:inline-block;margin-left:.25rem;height:1rem;width:1rem}.bal-field-hint__hint{position:absolute;top:2px;left:0}.bal-field-message{line-height:var(--bal-line-height-normal)}.bal-field-hidden{display:none !important;visibility:hidden !important}.bal-field-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;gap:.5rem}.bal-field-control .bal-input{-ms-flex:1;flex:1}@media screen and (max-width: 768px){.bal-field-control--expanded-on-mobile{-ms-flex-direction:column;flex-direction:column}.bal-field-control--expanded-on-mobile .bal-button,.bal-field-control--expanded-on-mobile .bal-button .button{width:100%}}.bal-field-message{margin-top:0 !important}.bal-field-control+.bal-field-message{min-height:1.375rem;line-height:1.375rem}.bal-field-control:not(:has(+.bal-field-message)){padding-bottom:1.375rem}.bal-field--horizontal{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:var(--bal-field-label-column-gap);-moz-column-gap:var(--bal-field-label-column-gap);column-gap:var(--bal-field-label-column-gap);-ms-flex-align:center;align-items:center}.bal-field--horizontal .bal-field-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-width:var(--bal-field-label-horizontal-width);max-width:var(--bal-field-label-horizontal-width);-ms-flex-pack:end;justify-content:flex-end;text-align:right;margin-bottom:0}.bal-field--horizontal .bal-field-control{-ms-flex:1;flex:1;padding-bottom:0;-ms-flex-item-align:end;align-self:flex-end}.bal-field--horizontal .bal-field-message{-ms-flex-preferred-size:100%;flex-basis:100%;margin-top:0 !important;margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap))}.bal-field--horizontal .bal-field-hint{margin-left:0}.bal-field--horizontal .bal-field-hint .bal-hint{top:0}.bal-field--horizontal .bal-field-hint~.bal-field-message{margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap)*2 + 1.125rem)}.bal-field--horizontal .bal-field-label~.bal-field-control{margin-top:0}";var Field=function(){function e(e){var i=this;registerInstance(this,e);this.balFormControlDidLoad=createEvent(this,"balFormControlDidLoad");this.fieldId="bal-field-".concat(FieldIds++);this.formControlElement=["bal-field-control"];this.inputElements=["bal-input","bal-number-input","bal-textarea","bal-select","bal-checkbox","bal-radio","bal-input-group","bal-date","bal-input-date","bal-input-stepper","bal-input-slider","bal-file-upload","bal-dropdown","bal-segment"];this.formElements=__spreadArray(__spreadArray([],this.formControlElement,true),["bal-field-label","bal-field-message"],false);this.required=undefined;this.horizontal=false;this.invalid=undefined;this.valid=false;this.disabled=undefined;this.readonly=undefined;this.loading=undefined;this.isDirectChild=function(e){if(!e){return false}var t=e.parentElement;if(!t){return false}if(t.nodeName.toLowerCase()==="bal-field"&&t!==i.el){return false}if(t===i.el){return true}return i.isDirectChild(t)};this.isVisible=function(e){if(!e){return false}return e.ariaHidden!=="true"};this.findDirectChild=function(e){var t=i.el.querySelector(e);var l=i.isDirectChild(t);if(l){if(i.isVisible(t)){return t}}return undefined};this.findDirectChildren=function(e){return e.map((function(e){return Array.from(i.el.querySelectorAll(e)).filter(i.isDirectChild).filter(i.isVisible)})).flat()};this.mutationObserverActive=true}e.prototype.requiredHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),["bal-field-label"],false),"required")};e.prototype.invalidHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"invalid")};e.prototype.validHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"valid")};e.prototype.disabledHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"disabled")};e.prototype.readonlyHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"readonly")};e.prototype.loadingHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formControlElement,true),"loading")};e.prototype.connectedCallback=function(){this.triggerAllHandlers()};e.prototype.componentWillLoad=function(){this.triggerAllHandlers()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.syncAriaAttributes()];case 1:e.sent();return[2]}}))}))};e.prototype.syncAriaAttributes=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,l,a,n;return __generator(this,(function(r){switch(r.label){case 0:return[4,deepReady(this.el)];case 1:r.sent();return[4,waitAfterFramePaint()];case 2:r.sent();e=this.findDirectChild("bal-field-label bal-label");i=this.findDirectChild("bal-field-message");t=this.findDirectChildren(["bal-field-control bal-input","bal-field-control bal-select","bal-field-control bal-input-date","bal-field-control bal-dropdown","bal-field-control bal-checkbox","bal-field-control bal-radio","bal-field-control bal-segment","bal-field-control bal-segment-item","bal-field-control bal-checkbox-group","bal-field-control bal-radio-group","bal-field-control bal-number-input","bal-field-control bal-time-input","bal-field-control bal-input-slider","bal-field-control bal-input-stepper","bal-field-control bal-textarea","bal-field-control bal-file-upload"]);l=Object.assign({},defaultBalAriaForm);if(e){l.labelId="".concat(this.fieldId,"-lbl")}if(i){l.messageId="".concat(this.fieldId,"-msg")}a=0;r.label=3;case 3:if(!(a<t.length))return[3,10];n=t[a];if(!(a===0))return[3,7];l.controlId="".concat(this.fieldId,"-ctrl");return[4,e===null||e===void 0?void 0:e.setAriaForm(l)];case 4:r.sent();return[4,i===null||i===void 0?void 0:i.setAriaForm(l)];case 5:r.sent();return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 6:r.sent();return[3,9];case 7:l.controlId="".concat(this.fieldId,"-ctrl-").concat(a);return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 8:r.sent();r.label=9;case 9:a++;return[3,3];case 10:return[2]}}))}))};e.prototype.mutationListener=function(){this.triggerAllHandlers();this.syncAriaAttributes()};e.prototype.triggerAllHandlers=function(){this.requiredHandler();this.invalidHandler();this.validHandler();this.readonlyHandler();this.disabledHandler();this.loadingHandler()};e.prototype.updateProps=function(e,i){var t=this[i];if(t!==undefined){this.notifyComponents(e,(function(e){return e[i]=t}))}};e.prototype.notifyComponents=function(e,i){var t=this.el.querySelectorAll(e.join(", "));t.forEach((function(e){return i(e)}))};e.prototype.render=function(){return h(Host,{key:"ef05b294a516d40c5089d051feeb46715f581bc1",id:this.fieldId,class:{"bal-field":true,field:true,"bal-field--invalid":this.invalid===true,"bal-field--horizontal":this.horizontal===true}},h("slot",{key:"5710d7fd141b21d699004d7982d5d5bb7238cd94"}),h("span",{key:"e1b36343cdcb60960bcdac4d938c946f40041334",class:"bal-field-hidden"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{required:["requiredHandler"],invalid:["invalidHandler"],valid:["validHandler"],disabled:["disabledHandler"],readonly:["readonlyHandler"],loading:["loadingHandler"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({subtree:false,waitAfterFramePrint:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Field.prototype,"mutationListener",null);var FieldIds=0;Field.style=balFieldCss;var FieldControl=function(){function e(e){registerInstance(this,e);this.iconRight="";this.iconLeft="";this.expandedOnMobile=undefined;this.loading=false}Object.defineProperty(e.prototype,"buildIconLeftTemplate",{get:function(){if(this.iconLeft){return h("bal-icon",{name:this.iconLeft,color:"info",class:"is-left",size:"small"})}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"buildIconRightTemplate",{get:function(){if(this.iconRight){return h("bal-icon",{name:this.iconRight,color:"info",class:"is-right",size:"small"})}return""},enumerable:false,configurable:true});e.prototype.render=function(){return h(Host,{key:"f2dbde868506b54d5b5e2fc14b5c29c417d42891",class:{"bal-field-control":true,control:true,"has-icons-left":!!this.iconLeft,"has-icons-right":!!this.iconRight,"is-loading":this.loading,"bal-field-control--expanded-on-mobile":!!this.expandedOnMobile}},h("slot",{key:"274cd16bccefc825d85e4b1222da7c523a1aa937"}),this.buildIconLeftTemplate,this.buildIconRightTemplate)};return e}();var FieldHint=function(){function e(e){registerInstance(this,e);this.hideTitleOnDesktop=false;this.subject="";this.closeLabel="Close";this.small=false;this.isDesktop=balBreakpoints.isDesktop}e.prototype.breakpointListener=function(e){this.isDesktop=e.desktop};e.prototype.render=function(){var e=BEM.block("field-hint");return h(Host,{key:"90dbf0da0a0c7ec498538721135e2fdefc4ac238",class:Object.assign({},e.class())},h("bal-hint",{key:"1976d07de449aa8b2897a375f61953f0c705e4ae",class:Object.assign({},e.element("hint").class()),"data-testid":"bal-field-hint",closeLabel:this.closeLabel,small:this.small},this.subject&&!(this.hideTitleOnDesktop&&this.isDesktop)?h("bal-hint-title",null,this.subject):"",h("bal-hint-text",{key:"ae2b48186e4f4c1adbfe7b3ed57a798a55a4cad0"},h("slot",{key:"e4a33e9e14ab86a15e78321fbd9f7325e0420ec5"}))))};return e}();__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],FieldHint.prototype,"breakpointListener",null);var FieldLabel=function(){function e(e){registerInstance(this,e);this.htmlFor=undefined;this.required=true;this.valid=undefined;this.invalid=undefined;this.disabled=undefined;this.readonly=undefined;this.size="small";this.weight="bold"}e.prototype.componentDidLoad=function(){if(this.element){this.parentBalFieldElement=this.element.closest("bal-field");if(this.parentBalFieldElement){this.parentBalFieldElement.classList.add("has-label")}}};e.prototype.disconnectedCallback=function(){if(this.parentBalFieldElement){this.parentBalFieldElement.classList.remove("has-label")}};e.prototype.render=function(){return h(Host,{key:"6685a5711aba2152b975fe49fe114a9edb400679",class:"bal-field-label"},h("bal-label",{key:"f677ab02ba144832c6304dc99c3e2900079e38b7",multiline:true,size:this.size,htmlFor:this.htmlFor,required:this.required,valid:this.valid,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,weight:this.weight},h("slot",{key:"687bfc73cab2cf7bef4e3e15b6a9090d5ba29d38"})))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var FieldMessage=function(){function e(e){registerInstance(this,e);this.ariaForm=defaultBalAriaForm;this.color="";this.invalid=false;this.valid=false;this.disabled=false;this.readonly=false;this.noReservedSpace=false}e.prototype.setAriaForm=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.ariaForm=Object.assign({},e);return[2]}))}))};e.prototype.render=function(){var e;return h(Host,{key:"24a1ad8e6d848841fd1e83428aa14430ed6fe5fc",id:this.ariaForm.messageId,class:(e={"bal-field-message":true,help:true,"is-danger":this.invalid,"is-success":this.valid,"is-disabled":this.disabled||this.readonly},e["is-".concat(this.color)]=!!this.color,e),style:{minHeight:this.noReservedSpace?"0":undefined}},h("slot",{key:"2cb9fb2480527f5b4ae63611f3a424fcc202bc36"}))};return e}();export{Field as bal_field,FieldControl as bal_field_control,FieldHint as bal_field_hint,FieldLabel as bal_field_label,FieldMessage as bal_field_message};
|
|
1
|
+
import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{d as deepReady,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBreakpoints}from"./breakpoints.subject-Iyftu-nV.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-C-DmFJbn.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./listener-CClDIhvK.js";import"./device-TtMibDFL.js";import"./tokens.esm-C9EQ_6RZ.js";var balFieldCss=":root{--bal-field-label-horizontal-width:33.3333%;--bal-field-label-column-gap:.5rem}.bal-field,.bal-field-label,.bal-field-control,.bal-field-message,.bal-field-hint{display:block;position:relative;font-family:var(--bal-font-family-text)}.bal-field-label{display:inline}.bal-field-label~.bal-field-control{margin-top:.25rem}.bal-field-hint{display:inline-block;margin-left:.25rem;height:1rem;width:1rem}.bal-field-hint__hint{position:absolute;top:2px;left:0}.bal-field-message{line-height:var(--bal-line-height-normal)}.bal-field-hidden{display:none !important;visibility:hidden !important}.bal-field-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;gap:.5rem}.bal-field-control .bal-input{-ms-flex:1;flex:1}@media screen and (max-width: 768px){.bal-field-control--expanded-on-mobile{-ms-flex-direction:column;flex-direction:column}.bal-field-control--expanded-on-mobile .bal-button,.bal-field-control--expanded-on-mobile .bal-button .button{width:100%}}.bal-field-message{margin-top:0 !important}.bal-field-control+.bal-field-message{min-height:1.375rem;line-height:1.375rem}.bal-field-control:not(:has(+.bal-field-message)){padding-bottom:1.375rem}.bal-field--horizontal{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:var(--bal-field-label-column-gap);-moz-column-gap:var(--bal-field-label-column-gap);column-gap:var(--bal-field-label-column-gap);-ms-flex-align:center;align-items:center}.bal-field--horizontal .bal-field-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-width:var(--bal-field-label-horizontal-width);max-width:var(--bal-field-label-horizontal-width);-ms-flex-pack:end;justify-content:flex-end;text-align:right;margin-bottom:0}.bal-field--horizontal .bal-field-control{-ms-flex:1;flex:1;padding-bottom:0;-ms-flex-item-align:end;align-self:flex-end}.bal-field--horizontal .bal-field-message{-ms-flex-preferred-size:100%;flex-basis:100%;margin-top:0 !important;margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap))}.bal-field--horizontal .bal-field-hint{margin-left:0}.bal-field--horizontal .bal-field-hint .bal-hint{top:0}.bal-field--horizontal .bal-field-hint~.bal-field-message{margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap)*2 + 1.125rem)}.bal-field--horizontal .bal-field-label~.bal-field-control{margin-top:0}";var Field=function(){function e(e){var i=this;registerInstance(this,e);this.balFormControlDidLoad=createEvent(this,"balFormControlDidLoad");this.fieldId="bal-field-".concat(FieldIds++);this.formControlElement=["bal-field-control"];this.inputElements=["bal-input","bal-number-input","bal-textarea","bal-select","bal-checkbox","bal-radio","bal-input-group","bal-date","bal-input-date","bal-input-stepper","bal-input-slider","bal-file-upload","bal-dropdown","bal-segment"];this.formElements=__spreadArray(__spreadArray([],this.formControlElement,true),["bal-field-label","bal-field-message"],false);this.required=undefined;this.horizontal=false;this.invalid=undefined;this.valid=false;this.disabled=undefined;this.readonly=undefined;this.loading=undefined;this.isDirectChild=function(e){if(!e){return false}var t=e.parentElement;if(!t){return false}if(t.nodeName.toLowerCase()==="bal-field"&&t!==i.el){return false}if(t===i.el){return true}return i.isDirectChild(t)};this.isVisible=function(e){if(!e){return false}return e.ariaHidden!=="true"};this.findDirectChild=function(e){var t=i.el.querySelector(e);var l=i.isDirectChild(t);if(l){if(i.isVisible(t)){return t}}return undefined};this.findDirectChildren=function(e){return e.map((function(e){return Array.from(i.el.querySelectorAll(e)).filter(i.isDirectChild).filter(i.isVisible)})).flat()};this.mutationObserverActive=true}e.prototype.requiredHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),["bal-field-label"],false),"required")};e.prototype.invalidHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"invalid")};e.prototype.validHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"valid")};e.prototype.disabledHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"disabled")};e.prototype.readonlyHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"readonly")};e.prototype.loadingHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formControlElement,true),"loading")};e.prototype.connectedCallback=function(){this.triggerAllHandlers()};e.prototype.componentWillLoad=function(){this.triggerAllHandlers()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.syncAriaAttributes()];case 1:e.sent();return[2]}}))}))};e.prototype.syncAriaAttributes=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,l,a,n;return __generator(this,(function(r){switch(r.label){case 0:return[4,deepReady(this.el)];case 1:r.sent();return[4,waitAfterFramePaint()];case 2:r.sent();e=this.findDirectChild("bal-field-label bal-label");i=this.findDirectChild("bal-field-message");t=this.findDirectChildren(["bal-field-control bal-input","bal-field-control bal-select","bal-field-control bal-input-date","bal-field-control bal-dropdown","bal-field-control bal-checkbox","bal-field-control bal-radio","bal-field-control bal-segment","bal-field-control bal-segment-item","bal-field-control bal-checkbox-group","bal-field-control bal-radio-group","bal-field-control bal-number-input","bal-field-control bal-time-input","bal-field-control bal-input-slider","bal-field-control bal-input-stepper","bal-field-control bal-textarea","bal-field-control bal-file-upload"]);l=Object.assign({},defaultBalAriaForm);if(e){l.labelId="".concat(this.fieldId,"-lbl")}if(i){l.messageId="".concat(this.fieldId,"-msg")}a=0;r.label=3;case 3:if(!(a<t.length))return[3,10];n=t[a];if(!(a===0))return[3,7];l.controlId="".concat(this.fieldId,"-ctrl");return[4,e===null||e===void 0?void 0:e.setAriaForm(l)];case 4:r.sent();return[4,i===null||i===void 0?void 0:i.setAriaForm(l)];case 5:r.sent();return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 6:r.sent();return[3,9];case 7:l.controlId="".concat(this.fieldId,"-ctrl-").concat(a);return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 8:r.sent();r.label=9;case 9:a++;return[3,3];case 10:return[2]}}))}))};e.prototype.mutationListener=function(){this.triggerAllHandlers();this.syncAriaAttributes()};e.prototype.triggerAllHandlers=function(){this.requiredHandler();this.invalidHandler();this.validHandler();this.readonlyHandler();this.disabledHandler();this.loadingHandler()};e.prototype.updateProps=function(e,i){var t=this[i];if(t!==undefined){this.notifyComponents(e,(function(e){return e[i]=t}))}};e.prototype.notifyComponents=function(e,i){var t=this.el.querySelectorAll(e.join(", "));t.forEach((function(e){return i(e)}))};e.prototype.render=function(){return h(Host,{key:"ef05b294a516d40c5089d051feeb46715f581bc1",id:this.fieldId,class:{"bal-field":true,field:true,"bal-field--invalid":this.invalid===true,"bal-field--horizontal":this.horizontal===true}},h("slot",{key:"5710d7fd141b21d699004d7982d5d5bb7238cd94"}),h("span",{key:"e1b36343cdcb60960bcdac4d938c946f40041334",class:"bal-field-hidden"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{required:["requiredHandler"],invalid:["invalidHandler"],valid:["validHandler"],disabled:["disabledHandler"],readonly:["readonlyHandler"],loading:["loadingHandler"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({subtree:false,waitAfterFramePrint:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Field.prototype,"mutationListener",null);var FieldIds=0;Field.style=balFieldCss;var FieldControl=function(){function e(e){registerInstance(this,e);this.iconRight="";this.iconLeft="";this.expandedOnMobile=undefined;this.loading=false}Object.defineProperty(e.prototype,"buildIconLeftTemplate",{get:function(){if(this.iconLeft){return h("bal-icon",{name:this.iconLeft,color:"info",class:"is-left",size:"small"})}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"buildIconRightTemplate",{get:function(){if(this.iconRight){return h("bal-icon",{name:this.iconRight,color:"info",class:"is-right",size:"small"})}return""},enumerable:false,configurable:true});e.prototype.render=function(){return h(Host,{key:"f2dbde868506b54d5b5e2fc14b5c29c417d42891",class:{"bal-field-control":true,control:true,"has-icons-left":!!this.iconLeft,"has-icons-right":!!this.iconRight,"is-loading":this.loading,"bal-field-control--expanded-on-mobile":!!this.expandedOnMobile}},h("slot",{key:"274cd16bccefc825d85e4b1222da7c523a1aa937"}),this.buildIconLeftTemplate,this.buildIconRightTemplate)};return e}();var FieldHint=function(){function e(e){registerInstance(this,e);this.hideTitleOnDesktop=false;this.subject="";this.closeLabel="Close";this.small=false;this.isDesktop=balBreakpoints.isDesktop}e.prototype.breakpointListener=function(e){this.isDesktop=e.desktop};e.prototype.render=function(){var e=BEM.block("field-hint");return h(Host,{key:"90dbf0da0a0c7ec498538721135e2fdefc4ac238",class:Object.assign({},e.class())},h("bal-hint",{key:"1976d07de449aa8b2897a375f61953f0c705e4ae",class:Object.assign({},e.element("hint").class()),"data-testid":"bal-field-hint",closeLabel:this.closeLabel,small:this.small},this.subject&&!(this.hideTitleOnDesktop&&this.isDesktop)?h("bal-hint-title",null,this.subject):"",h("bal-hint-text",{key:"ae2b48186e4f4c1adbfe7b3ed57a798a55a4cad0"},h("slot",{key:"e4a33e9e14ab86a15e78321fbd9f7325e0420ec5"}))))};return e}();__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],FieldHint.prototype,"breakpointListener",null);var FieldLabel=function(){function e(e){registerInstance(this,e);this.htmlFor=undefined;this.required=true;this.valid=undefined;this.invalid=undefined;this.disabled=undefined;this.readonly=undefined;this.size="small";this.weight="bold"}e.prototype.componentDidLoad=function(){if(this.element){this.parentBalFieldElement=this.element.closest("bal-field");if(this.parentBalFieldElement){this.parentBalFieldElement.classList.add("has-label")}}};e.prototype.disconnectedCallback=function(){if(this.parentBalFieldElement){this.parentBalFieldElement.classList.remove("has-label")}};e.prototype.render=function(){return h(Host,{key:"6685a5711aba2152b975fe49fe114a9edb400679",class:"bal-field-label"},h("bal-label",{key:"f677ab02ba144832c6304dc99c3e2900079e38b7",multiline:true,size:this.size,htmlFor:this.htmlFor,required:this.required,valid:this.valid,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,weight:this.weight},h("slot",{key:"687bfc73cab2cf7bef4e3e15b6a9090d5ba29d38"})))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var FieldMessage=function(){function e(e){registerInstance(this,e);this.ariaForm=defaultBalAriaForm;this.color="";this.invalid=false;this.valid=false;this.disabled=false;this.readonly=false;this.noReservedSpace=false}e.prototype.setAriaForm=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.ariaForm=Object.assign({},e);return[2]}))}))};e.prototype.render=function(){var e;return h(Host,{key:"24a1ad8e6d848841fd1e83428aa14430ed6fe5fc",id:this.ariaForm.messageId,class:(e={"bal-field-message":true,help:true,"is-danger":this.invalid,"is-success":this.valid,"is-disabled":this.disabled||this.readonly},e["is-".concat(this.color)]=!!this.color,e),style:{minHeight:this.noReservedSpace?"0":undefined}},h("slot",{key:"2cb9fb2480527f5b4ae63611f3a424fcc202bc36"}))};return e}();export{Field as bal_field,FieldControl as bal_field_control,FieldHint as bal_field_hint,FieldLabel as bal_field_label,FieldMessage as bal_field_message};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{l as loadFooterLinks,a as loadSocialMediaLinks,L as Language}from"./index.esm-Btc0yydR.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{r as rIC}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{s as sanitizeSvg}from"./svg-DUNB4kTY.js";import{e as updateBalLanguage}from"./config.utils-B7jugjyM.js";import{d as defaultConfig}from"./config.default-I6QXKbhg.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./browser-B1u-Mq75.js";var i18nBalFooter={en:{name:"English"},fr:{name:"Français"},it:{name:"Italiano"},nl:{name:"Nederlands"},es:{name:"Español"},pt:{name:"Português"},sv:{name:"Svenska"},fi:{name:"Suomi"},de:{name:"Deutsch"},pl:{name:"Polski"}};var balFooterCss=":root{--bal-footer-font-family:var(--bal-font-family-text);--bal-footer-background:var(--bal-color-primary);--bal-footer-color:var(--bal-color-text-white);--bal-footer-language-color:var(--bal-color-text-white);--bal-footer-language-color-hover:var(--bal-color-light-blue-2);--bal-footer-language-color-active:var(--bal-color-light-blue-3);--bal-footer-language-background:var(--bal-color-text-white);--bal-footer-language-background-hover:var(--bal-color-light-blue-2);--bal-footer-language-background-active:var(--bal-color-light-blue-3);--bal-footer-logo-image-max-height:64px}.bal-footer{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;position:static;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.bal-footer__slot{color:var(--bal-footer-color)}.bal-footer__inner{position:relative;font-family:var(--bal-footer-font-family);background-color:var(--bal-footer-background);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-large)}@media screen and (min-width: 769px),print{.bal-footer__inner{padding-top:var(--bal-space-large);padding-bottom:var(--bal-space-large)}}@media screen and (min-width: 1024px){.bal-footer__inner{padding-top:var(--bal-space-large);padding-bottom:var(--bal-space-large)}}.bal-footer__inner__wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--bal-space-large)}@media screen and (min-width: 769px)and (max-width: 1023px){.bal-footer__inner__wrapper{gap:var(--bal-space-medium-tablet)}}@media screen and (max-width: 768px){.bal-footer__inner__wrapper{gap:var(--bal-space-medium-tablet)}}.bal-footer__inner__wrapper__header-container{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}.bal-footer__inner__wrapper__header-container__language{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:center;align-items:center}.bal-footer__inner__wrapper__header-container__language__wrapper{display:-ms-flexbox;display:flex;gap:1rem;cursor:pointer}.bal-footer__inner__wrapper__header-container__language__wrapper svg,.bal-footer__inner__wrapper__header-container__language__wrapper g,.bal-footer__inner__wrapper__header-container__language__wrapper path,.bal-footer__inner__wrapper__header-container__language__wrapper circle{fill:var(--bal-footer-language-background) !important}.bal-footer__inner__wrapper__header-container__language__wrapper select{padding-left:2px;padding-right:2px;background:rgba(0,0,0,0);-webkit-appearance:none;border:none;color:var(--bal-footer-language-color);font-weight:var(--bal-font-weight-bold);font-family:var(--bal-font-family-title);cursor:pointer}.bal-footer__inner__wrapper__header-container__language__wrapper select option{background:var(--bal-color-white) !important;color:var(--bal-color-primary) !important;font-weight:var(--bal-font-weight-bold) !important;font-family:var(--bal-font-family-text) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:hover svg,.bal-footer__inner__wrapper__header-container__language__wrapper:hover g,.bal-footer__inner__wrapper__header-container__language__wrapper:hover path,.bal-footer__inner__wrapper__header-container__language__wrapper:hover circle{fill:var(--bal-footer-language-background-hover) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:hover select{color:var(--bal-footer-language-color-hover)}.bal-footer__inner__wrapper__header-container__language__wrapper:active svg,.bal-footer__inner__wrapper__header-container__language__wrapper:active g,.bal-footer__inner__wrapper__header-container__language__wrapper:active path,.bal-footer__inner__wrapper__header-container__language__wrapper:active circle{fill:var(--bal-footer-language-background-active) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:active select{color:var(--bal-footer-language-color-active)}.bal-footer__inner__wrapper__header-container__logo{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.bal-footer__inner__wrapper__header-container__logo img{max-height:var(--bal-footer-logo-image-max-height)}.bal-footer__inner__wrapper__header-container__logo div{height:var(--bal-footer-logo-image-max-height);min-width:var(--bal-footer-logo-image-max-height)}.bal-footer__inner__wrapper__links-container{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (min-width: 769px),print{.bal-footer__inner__wrapper__links-container{-ms-flex-direction:column;flex-direction:column}}@media screen and (min-width: 1024px){.bal-footer__inner__wrapper__links-container{-ms-flex-direction:row;flex-direction:row}}.bal-footer__inner__wrapper__links-container__legal-links{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;gap:var(--bal-space-large-desktop)}.bal-footer__inner__wrapper__links-container__legal-links a{font-size:var(--bal-text-size-small) !important}@media screen and (max-width: 768px){.bal-footer__inner__wrapper__links-container__legal-links{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%;gap:var(--bal-space-normal)}}.bal-footer__inner__wrapper__links-container__social-media-links{-ms-flex-align:center;align-items:center;gap:var(--bal-space-large-desktop);padding:var(--bal-space-normal) var(--bal-space-normal) var(--bal-space-normal) 0}@media screen and (min-width: 769px)and (max-width: 1023px){.bal-footer__inner__wrapper__links-container__social-media-links{padding-bottom:var(--bal-space-large)}}@media screen and (max-width: 768px){.bal-footer__inner__wrapper__links-container__social-media-links{padding-bottom:var(--bal-space-large);-ms-flex-pack:center;justify-content:center;width:100%;padding:var(--bal-space-normal) 0 var(--bal-space-normal) 0}}";var Footer=function(){function e(e){registerInstance(this,e);this.logoSvgContent="";this.links=[];this.socialMediaLinks=[];this.language=defaultConfig.language;this.region=defaultConfig.region;this.allowedLanguages=defaultConfig.allowedLanguages;this.logoHref="";this.logoSvg="";this.hideLinks=false;this.overrideLinks=undefined;this.showSocialMedia=false;this.hideLanguageSelection=false}e.prototype.createLogger=function(e){this.log=e};e.prototype.logoSvgChanged=function(){this.logoSvgContent=sanitizeSvg(this.logoSvg)};e.prototype.connectedCallback=function(){this.updateFooterLinks();this.updateSocialMediaLinks();this.logoSvgChanged()};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(a){if(this.language!==e.language||this.region!==e.region){this.language=e.language;this.region=e.region;this.allowedLanguages=e.allowedLanguages;this.updateFooterLinks();this.updateSocialMediaLinks()}return[2]}))}))};e.prototype.changeLanguage=function(e){updateBalLanguage(e)};e.prototype.updateFooterLinks=function(){var e=this;if(this.overrideLinks){this.links=this.overrideLinks}else if(!this.hideLinks&&(this.region==="CH"||this.region==="DE")){var a=this.region;rIC((function(){loadFooterLinks(new Language(e.language),a).then((function(a){return e.links=a}))}))}};e.prototype.updateSocialMediaLinks=function(){var e=this;if(this.showSocialMedia&&(this.region==="CH"||this.region==="DE")){var a=this.region;rIC((function(){loadSocialMediaLinks(new Language(e.language),a).then((function(a){return e.socialMediaLinks=a}))}))}};e.prototype.render=function(){var e=this;var a=BEM.block("footer");var r=a.element("slot");var t=a.element("inner");var o=t.element("wrapper");var n=o.element("container");var i=o.element("links-container");var l=o.element("header-container");var _=l.element("logo");var s=l.element("language");var c=s.element("wrapper");var p=i.element("legal-links");var f=i.element("social-media-links");return h(Host,{key:"ca5dacc6c906754b6bb466c448be4f6bb5b38dff",class:Object.assign({},a.class())},h("footer",{key:"8d42cfff788350c5e5ae26f86b613fcd5144085d",class:Object.assign({},t.class())},h("div",{key:"a60281af0dcf73da3901cb605b49d35b3bb3e6ed",class:Object.assign({},o.class())},h("div",{key:"857d35746558b5b0a5ec79562b3f2c0e30037141",class:Object.assign(Object.assign({container:true},n.class()),l.class())},h("div",{key:"c1e5bae12ba5449888156244789fd79dbdc3a388",class:Object.assign({},_.class())},this.logoHref?h("img",{src:this.logoHref,alt:"Logo"}):this.logoSvgContent?h("div",{innerHTML:this.logoSvgContent}):h("bal-logo",{color:"white"})),h("div",{key:"de3b93d01ad75facf4219df8954016095aa143ab",class:Object.assign({},s.class()),style:{display:this.hideLanguageSelection||this.allowedLanguages.length<=1?"none":"flex"}},h("div",{key:"7be8f0588d5da5e436b72214c67542316d325481",class:Object.assign({},c.class())},h("bal-icon",{key:"935dfaa39b97f40cd946ce8c8a0a0f421b3876b6",class:Object.assign({},c.element("icon").class()),name:"web",color:"white"}),h("select",{key:"d8408623006a257fa422b0789bc1e021461f1b1e",class:Object.assign({},c.element("select").class()),onChange:function(a){return e.changeLanguage(a.target.value)},"data-testid":"bal-footer-language"},this.allowedLanguages.map((function(a){return h("option",{key:a,value:a,selected:a===e.language},a.toLocaleUpperCase()+" - "+i18nBalFooter[a].name)})))))),h("div",{key:"422e8cae4fd1cd625afb3cc81bc7c0cfac99fe65",class:Object.assign({},r.class())},h("slot",{key:"b7c73e907ffbe0b64eb4608143774bcf7c56ff30"})),h("div",{key:"7bc64923fe79674a26e96f263785abf96dba1af6",class:Object.assign(Object.assign({container:true},n.class()),i.class())},h("div",{key:"5e5c86e58b3df89978657217ba145555786becfb",class:Object.assign({},f.class()),style:{display:!this.showSocialMedia?"none":"flex"}},this.socialMediaLinks.map((function(e){return h("a",{key:e.link,href:e.link,target:"_blank",class:{link:true,"is-inverted":true}},h("bal-icon",{name:e.label.toLowerCase()}))}))),h("div",{key:"610e34f952fd08cba92099a213371e45c5f7ebc6",class:Object.assign({},p.class()),style:{display:this.hideLinks?"none":"flex"}},this.links&&this.links.map((function(e){return h("a",{key:e.link,href:e.link,target:"_blank",class:{link:true,"is-light":true}},e.label)})))))))};Object.defineProperty(e,"watchers",{get:function(){return{logoSvg:["logoSvgChanged"]}},enumerable:false,configurable:true});return e}();__decorate([Logger("bal-footer"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Footer.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Footer.prototype,"configChanged",null);Footer.style=balFooterCss;export{Footer as bal_footer};
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{l as loadFooterLinks,a as loadSocialMediaLinks,L as Language}from"./index.esm-Btc0yydR.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{r as rIC}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{s as sanitizeSvg}from"./svg-DUNB4kTY.js";import{e as updateBalLanguage}from"./config.utils-B7jugjyM.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./browser-B1u-Mq75.js";var i18nBalFooter={en:{name:"English"},fr:{name:"Français"},it:{name:"Italiano"},nl:{name:"Nederlands"},es:{name:"Español"},pt:{name:"Português"},sv:{name:"Svenska"},fi:{name:"Suomi"},de:{name:"Deutsch"},pl:{name:"Polski"}};var balFooterCss=":root{--bal-footer-font-family:var(--bal-font-family-text);--bal-footer-background:var(--bal-color-primary);--bal-footer-color:var(--bal-color-text-white);--bal-footer-language-color:var(--bal-color-text-white);--bal-footer-language-color-hover:var(--bal-color-light-blue-2);--bal-footer-language-color-active:var(--bal-color-light-blue-3);--bal-footer-language-background:var(--bal-color-text-white);--bal-footer-language-background-hover:var(--bal-color-light-blue-2);--bal-footer-language-background-active:var(--bal-color-light-blue-3);--bal-footer-logo-image-max-height:64px}.bal-footer{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;position:static;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.bal-footer__slot{color:var(--bal-footer-color)}.bal-footer__inner{position:relative;font-family:var(--bal-footer-font-family);background-color:var(--bal-footer-background);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-large)}@media screen and (min-width: 769px),print{.bal-footer__inner{padding-top:var(--bal-space-large);padding-bottom:var(--bal-space-large)}}@media screen and (min-width: 1024px){.bal-footer__inner{padding-top:var(--bal-space-large);padding-bottom:var(--bal-space-large)}}.bal-footer__inner__wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--bal-space-large)}@media screen and (min-width: 769px)and (max-width: 1023px){.bal-footer__inner__wrapper{gap:var(--bal-space-medium-tablet)}}@media screen and (max-width: 768px){.bal-footer__inner__wrapper{gap:var(--bal-space-medium-tablet)}}.bal-footer__inner__wrapper__header-container{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}.bal-footer__inner__wrapper__header-container__language{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:center;align-items:center}.bal-footer__inner__wrapper__header-container__language__wrapper{display:-ms-flexbox;display:flex;gap:1rem;cursor:pointer}.bal-footer__inner__wrapper__header-container__language__wrapper svg,.bal-footer__inner__wrapper__header-container__language__wrapper g,.bal-footer__inner__wrapper__header-container__language__wrapper path,.bal-footer__inner__wrapper__header-container__language__wrapper circle{fill:var(--bal-footer-language-background) !important}.bal-footer__inner__wrapper__header-container__language__wrapper select{padding-left:2px;padding-right:2px;background:rgba(0,0,0,0);-webkit-appearance:none;border:none;color:var(--bal-footer-language-color);font-weight:var(--bal-font-weight-bold);font-family:var(--bal-font-family-title);cursor:pointer}.bal-footer__inner__wrapper__header-container__language__wrapper select option{background:var(--bal-color-white) !important;color:var(--bal-color-primary) !important;font-weight:var(--bal-font-weight-bold) !important;font-family:var(--bal-font-family-text) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:hover svg,.bal-footer__inner__wrapper__header-container__language__wrapper:hover g,.bal-footer__inner__wrapper__header-container__language__wrapper:hover path,.bal-footer__inner__wrapper__header-container__language__wrapper:hover circle{fill:var(--bal-footer-language-background-hover) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:hover select{color:var(--bal-footer-language-color-hover)}.bal-footer__inner__wrapper__header-container__language__wrapper:active svg,.bal-footer__inner__wrapper__header-container__language__wrapper:active g,.bal-footer__inner__wrapper__header-container__language__wrapper:active path,.bal-footer__inner__wrapper__header-container__language__wrapper:active circle{fill:var(--bal-footer-language-background-active) !important}.bal-footer__inner__wrapper__header-container__language__wrapper:active select{color:var(--bal-footer-language-color-active)}.bal-footer__inner__wrapper__header-container__logo{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.bal-footer__inner__wrapper__header-container__logo img{max-height:var(--bal-footer-logo-image-max-height)}.bal-footer__inner__wrapper__header-container__logo div{height:var(--bal-footer-logo-image-max-height);min-width:var(--bal-footer-logo-image-max-height)}.bal-footer__inner__wrapper__links-container{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (min-width: 769px),print{.bal-footer__inner__wrapper__links-container{-ms-flex-direction:column;flex-direction:column}}@media screen and (min-width: 1024px){.bal-footer__inner__wrapper__links-container{-ms-flex-direction:row;flex-direction:row}}.bal-footer__inner__wrapper__links-container__legal-links{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;gap:var(--bal-space-large-desktop)}.bal-footer__inner__wrapper__links-container__legal-links a{font-size:var(--bal-text-size-small) !important}@media screen and (max-width: 768px){.bal-footer__inner__wrapper__links-container__legal-links{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%;gap:var(--bal-space-normal)}}.bal-footer__inner__wrapper__links-container__social-media-links{-ms-flex-align:center;align-items:center;gap:var(--bal-space-large-desktop);padding:var(--bal-space-normal) var(--bal-space-normal) var(--bal-space-normal) 0}@media screen and (min-width: 769px)and (max-width: 1023px){.bal-footer__inner__wrapper__links-container__social-media-links{padding-bottom:var(--bal-space-large)}}@media screen and (max-width: 768px){.bal-footer__inner__wrapper__links-container__social-media-links{padding-bottom:var(--bal-space-large);-ms-flex-pack:center;justify-content:center;width:100%;padding:var(--bal-space-normal) 0 var(--bal-space-normal) 0}}";var Footer=function(){function e(e){registerInstance(this,e);this.logoSvgContent="";this.links=[];this.socialMediaLinks=[];this.language=defaultConfig.language;this.region=defaultConfig.region;this.allowedLanguages=defaultConfig.allowedLanguages;this.logoHref="";this.logoSvg="";this.hideLinks=false;this.overrideLinks=undefined;this.showSocialMedia=false;this.hideLanguageSelection=false}e.prototype.createLogger=function(e){this.log=e};e.prototype.logoSvgChanged=function(){this.logoSvgContent=sanitizeSvg(this.logoSvg)};e.prototype.connectedCallback=function(){this.updateFooterLinks();this.updateSocialMediaLinks();this.logoSvgChanged()};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(a){if(this.language!==e.language||this.region!==e.region){this.language=e.language;this.region=e.region;this.allowedLanguages=e.allowedLanguages;this.updateFooterLinks();this.updateSocialMediaLinks()}return[2]}))}))};e.prototype.changeLanguage=function(e){updateBalLanguage(e)};e.prototype.updateFooterLinks=function(){var e=this;if(this.overrideLinks){this.links=this.overrideLinks}else if(!this.hideLinks&&(this.region==="CH"||this.region==="DE")){var a=this.region;rIC((function(){loadFooterLinks(new Language(e.language),a).then((function(a){return e.links=a}))}))}};e.prototype.updateSocialMediaLinks=function(){var e=this;if(this.showSocialMedia&&(this.region==="CH"||this.region==="DE")){var a=this.region;rIC((function(){loadSocialMediaLinks(new Language(e.language),a).then((function(a){return e.socialMediaLinks=a}))}))}};e.prototype.render=function(){var e=this;var a=BEM.block("footer");var r=a.element("slot");var t=a.element("inner");var o=t.element("wrapper");var n=o.element("container");var i=o.element("links-container");var l=o.element("header-container");var _=l.element("logo");var s=l.element("language");var c=s.element("wrapper");var p=i.element("legal-links");var f=i.element("social-media-links");return h(Host,{key:"ca5dacc6c906754b6bb466c448be4f6bb5b38dff",class:Object.assign({},a.class())},h("footer",{key:"8d42cfff788350c5e5ae26f86b613fcd5144085d",class:Object.assign({},t.class())},h("div",{key:"a60281af0dcf73da3901cb605b49d35b3bb3e6ed",class:Object.assign({},o.class())},h("div",{key:"857d35746558b5b0a5ec79562b3f2c0e30037141",class:Object.assign(Object.assign({container:true},n.class()),l.class())},h("div",{key:"c1e5bae12ba5449888156244789fd79dbdc3a388",class:Object.assign({},_.class())},this.logoHref?h("img",{src:this.logoHref,alt:"Logo"}):this.logoSvgContent?h("div",{innerHTML:this.logoSvgContent}):h("bal-logo",{color:"white"})),h("div",{key:"de3b93d01ad75facf4219df8954016095aa143ab",class:Object.assign({},s.class()),style:{display:this.hideLanguageSelection||this.allowedLanguages.length<=1?"none":"flex"}},h("div",{key:"7be8f0588d5da5e436b72214c67542316d325481",class:Object.assign({},c.class())},h("bal-icon",{key:"935dfaa39b97f40cd946ce8c8a0a0f421b3876b6",class:Object.assign({},c.element("icon").class()),name:"web",color:"white"}),h("select",{key:"d8408623006a257fa422b0789bc1e021461f1b1e",class:Object.assign({},c.element("select").class()),onChange:function(a){return e.changeLanguage(a.target.value)},"data-testid":"bal-footer-language"},this.allowedLanguages.map((function(a){return h("option",{key:a,value:a,selected:a===e.language},a.toLocaleUpperCase()+" - "+i18nBalFooter[a].name)})))))),h("div",{key:"422e8cae4fd1cd625afb3cc81bc7c0cfac99fe65",class:Object.assign({},r.class())},h("slot",{key:"b7c73e907ffbe0b64eb4608143774bcf7c56ff30"})),h("div",{key:"7bc64923fe79674a26e96f263785abf96dba1af6",class:Object.assign(Object.assign({container:true},n.class()),i.class())},h("div",{key:"5e5c86e58b3df89978657217ba145555786becfb",class:Object.assign({},f.class()),style:{display:!this.showSocialMedia?"none":"flex"}},this.socialMediaLinks.map((function(e){return h("a",{key:e.link,href:e.link,target:"_blank",class:{link:true,"is-inverted":true}},h("bal-icon",{name:e.label.toLowerCase()}))}))),h("div",{key:"610e34f952fd08cba92099a213371e45c5f7ebc6",class:Object.assign({},p.class()),style:{display:this.hideLinks?"none":"flex"}},this.links&&this.links.map((function(e){return h("a",{key:e.link,href:e.link,target:"_blank",class:{link:true,"is-light":true}},e.label)})))))))};Object.defineProperty(e,"watchers",{get:function(){return{logoSvg:["logoSvgChanged"]}},enumerable:false,configurable:true});return e}();__decorate([Logger("bal-footer"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Footer.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Footer.prototype,"configChanged",null);Footer.style=balFooterCss;export{Footer as bal_footer};
|