@baloise/ds-core 16.0.3-nightly.20240417 → 16.1.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/all.d.ts +6 -2
- package/components/all.js +9 -3
- package/components/aria.js +3 -0
- package/components/bal-app.js +85 -1
- package/components/bal-checkbox-button.js +1 -1
- package/components/bal-checkbox2.js +3 -2
- package/components/bal-close2.js +1 -1
- package/components/bal-date-calendar2.js +1 -1
- package/components/bal-dropdown.d.ts +11 -0
- package/components/bal-dropdown.js +710 -0
- package/components/bal-field.js +12 -2
- package/components/bal-footer.js +1 -1
- package/components/bal-option-list.d.ts +11 -0
- package/components/bal-option-list.js +459 -0
- package/components/{bal-doc-app.d.ts → bal-option.d.ts} +4 -4
- package/components/bal-option.js +171 -0
- package/components/bal-popup.js +1 -1
- package/components/bal-radio2.js +1 -1
- package/components/bal-select2.js +3 -3
- package/components/bal-spinner2.js +54 -6
- package/components/bal-tag2.js +1 -1
- package/components/config.default.js +1 -0
- package/components/index.esm.js +1 -1
- package/components/index.js +290 -5
- package/components/option.js +46 -0
- 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-013b4c72.system.js +1 -0
- package/dist/baloise-design-system/p-0639833837.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-0cd70cd814.system.entry.js → p-06e9a468fc.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-0793c0159f.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-45de4b9eab.system.entry.js → p-0fed7a5f26.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f2de9458ad.entry.js → p-10b8686d91.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e113196061.system.entry.js → p-126c79c9e9.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-12bcc7da.js +1 -0
- package/dist/baloise-design-system/{p-3bd244cda7.entry.js → p-135c5759c5.entry.js} +1 -1
- package/dist/baloise-design-system/{p-88c086f8.system.js → p-14ae0709.system.js} +1 -1
- package/dist/baloise-design-system/{p-3bbf43bb.system.js → p-1509eaa7.system.js} +1 -1
- package/dist/baloise-design-system/{p-946e9e784d.system.entry.js → p-1659bb968c.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-187f98a1.system.js +1 -0
- package/dist/baloise-design-system/{p-a620678fd4.system.entry.js → p-18e2e391e0.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-1de6b20b1c.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-1c2dee82c4.system.entry.js → p-222bc9b30e.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0af6ae59f5.entry.js → p-22b041a511.entry.js} +1 -1
- package/dist/baloise-design-system/{p-45fe099fab.entry.js → p-25da216e4f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-3f8e5df9c5.system.entry.js → p-25e0d82e89.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-2d82b78410.entry.js +1 -0
- package/dist/baloise-design-system/{p-a0db085f89.entry.js → p-2d8bd11634.entry.js} +1 -1
- package/dist/baloise-design-system/p-2db9030ad9.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-7d6318e4f1.system.entry.js → p-3128128969.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9a5cb17cb9.entry.js → p-39bc49bc3d.entry.js} +1 -1
- package/dist/baloise-design-system/p-3bad0907.system.js +1 -0
- package/dist/baloise-design-system/{p-0545b101.js → p-3f1c49d0.js} +1 -1
- package/dist/baloise-design-system/{p-2e717f00bb.entry.js → p-4aba4c66ee.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9e4fcb76.js → p-54f81c32.js} +1 -1
- package/dist/baloise-design-system/{p-7c5868cc.system.js → p-55faac1d.system.js} +1 -1
- package/dist/baloise-design-system/{p-34ee3721dd.entry.js → p-5b571a9fb1.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a8f6447224.entry.js → p-60e94f8144.entry.js} +1 -1
- package/dist/baloise-design-system/{p-06e959a11a.entry.js → p-6164f99bb8.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6608061443.system.entry.js → p-62ab1f0ae2.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-053d572047.system.entry.js → p-62b792a34b.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-118e15f5f2.system.entry.js → p-74f4b9818b.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-439518e5ed.entry.js → p-77f5e777e6.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6ddfa58338.entry.js → p-7c42a363f3.entry.js} +1 -1
- package/dist/baloise-design-system/p-7cd815d3e8.entry.js +1 -0
- package/dist/baloise-design-system/p-80b45dd4d6.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-af5b58ab1c.system.entry.js → p-8870e1f3e0.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-3cb83cf9.system.js → p-8a87b9a8.system.js} +1 -1
- package/dist/baloise-design-system/{p-99e5872214.system.entry.js → p-8c209ac52b.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-8f77c423ad.entry.js +1 -0
- package/dist/baloise-design-system/{p-de726703ce.entry.js → p-8fe94b9e21.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1b76afbf.js → p-94efe2aa.js} +1 -1
- package/dist/baloise-design-system/{p-0ce86357bd.entry.js → p-9658f4a66f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4112f1cc6e.entry.js → p-9a0640d065.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c3bd665a8b.entry.js → p-9e167705ca.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e619be36b2.system.entry.js → p-9ecce014c2.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-a19d1e1d.js +1 -0
- package/dist/baloise-design-system/{p-115c7e47bd.entry.js → p-a8022ee701.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9038dd3550.entry.js → p-a97cbb7dda.entry.js} +1 -1
- package/dist/baloise-design-system/p-acb5cea0.system.js +1 -0
- package/dist/baloise-design-system/p-ae28b86fe5.entry.js +1 -0
- package/dist/baloise-design-system/p-b779742f50.entry.js +1 -0
- package/dist/baloise-design-system/{p-bda509c8.js → p-b8d99064.js} +1 -1
- package/dist/baloise-design-system/p-b8f085f7b5.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-7ca7b4dad9.system.entry.js → p-b97d9336a7.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2b27e981ed.entry.js → p-b9f197815f.entry.js} +1 -1
- package/dist/baloise-design-system/{p-afe91abbd5.system.entry.js → p-bb3914c87a.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-bb6304d0.system.js +1 -0
- package/dist/baloise-design-system/p-bcbb5b59f3.system.entry.js +1 -0
- package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -0
- package/dist/baloise-design-system/{p-b89bb101d7.entry.js → p-bcebf41b74.entry.js} +1 -1
- package/dist/baloise-design-system/p-bd5de78b2c.entry.js +1 -0
- package/dist/baloise-design-system/p-c304d5fa9c.entry.js +1 -0
- package/dist/baloise-design-system/{p-4e7e0fe4.system.js → p-cc61fac8.system.js} +1 -1
- package/dist/baloise-design-system/{p-f9c9ec626c.system.entry.js → p-cd8e72d87f.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e4f6e3047f.system.entry.js → p-d16557d133.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-d7a758b3.js +1 -0
- package/dist/baloise-design-system/{p-29f7274983.system.entry.js → p-d919753ed0.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-d9b38501.js +1 -0
- package/dist/baloise-design-system/p-d9d229a026.entry.js +1 -0
- package/dist/baloise-design-system/{p-13227d037a.system.entry.js → p-dbc2d22240.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-a9e5eba8c9.system.entry.js → p-dce3764ee5.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1eeee9a37e.entry.js → p-ddf9b2a289.entry.js} +1 -1
- package/dist/baloise-design-system/{p-03ec11adc1.system.entry.js → p-e4de708de1.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-e60c936359.system.entry.js +1 -0
- package/dist/baloise-design-system/p-e78a6409.js +1 -0
- package/dist/baloise-design-system/{p-f55c50abfa.system.entry.js → p-f076d1ed4f.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-283d037ce7.system.entry.js → p-f0b43f1452.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-d78eeb433a.entry.js → p-f12abda2db.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f3ea10dd64.system.entry.js → p-f1b95d78af.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-ef373ed3db.entry.js → p-f56fb1a197.entry.js} +1 -1
- package/dist/baloise-design-system/{p-b213175c21.entry.js → p-f8974d743d.entry.js} +1 -1
- package/dist/baloise-design-system/p-f8a98657a1.entry.js +1 -0
- package/dist/cjs/app-globals-ae3a8623.js +11 -0
- package/dist/cjs/aria-c8955a5c.js +5 -0
- package/dist/cjs/bal-carousel_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-checkbox-button.cjs.entry.js +1 -1
- package/dist/cjs/bal-checkbox_2.cjs.entry.js +3 -2
- package/dist/cjs/bal-close.cjs.entry.js +2 -2
- package/dist/cjs/bal-date-calendar_2.cjs.entry.js +2 -2
- package/dist/cjs/bal-date.cjs.entry.js +1 -1
- package/dist/cjs/bal-datepicker.cjs.entry.js +4 -4
- package/dist/cjs/bal-dropdown.cjs.entry.js +660 -0
- package/dist/cjs/bal-field_5.cjs.entry.js +12 -2
- package/dist/cjs/bal-footer.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_3.cjs.entry.js +3 -3
- package/dist/cjs/bal-icon.cjs.entry.js +1 -1
- package/dist/cjs/bal-input-stepper.cjs.entry.js +1 -1
- package/dist/cjs/bal-label.cjs.entry.js +1 -1
- package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-nav_8.cjs.entry.js +4 -4
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-number-input.cjs.entry.js +1 -1
- package/dist/cjs/bal-option_2.cjs.entry.js +541 -0
- package/dist/cjs/bal-pagination.cjs.entry.js +4 -4
- package/dist/cjs/bal-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-select_2.cjs.entry.js +2 -2
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-spinner.cjs.entry.js +49 -4
- package/dist/cjs/bal-steps.cjs.entry.js +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-tag_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
- package/dist/cjs/baloise-design-system.cjs.js +4 -5
- package/dist/cjs/{breakpoints.decorator-5a45d298.js → breakpoints.decorator-47fd6060.js} +1 -1
- package/dist/cjs/{breakpoints.subject-ee6b98cd.js → breakpoints.subject-66093c8f.js} +1 -1
- package/dist/cjs/{config.default-32725178.js → config.default-5bdd6e3d.js} +1 -0
- package/dist/cjs/index.cjs.js +6 -4
- package/dist/cjs/{initialize-e38e7028.js → initialize-2a19d091.js} +9 -2
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/option-c33cf2b8.js +49 -0
- package/dist/cjs/{tokens.esm-b37c935b.js → tokens.esm-bb0ef2db.js} +1 -1
- package/dist/collection/collection-manifest.json +15 -2
- package/dist/collection/components/bal-checkbox/bal-checkbox-button/bal-checkbox-button.css +1 -1
- package/dist/collection/components/bal-checkbox/bal-checkbox.js +2 -1
- package/dist/collection/components/bal-checkbox/radio-checkbox.css +1 -1
- package/dist/collection/components/bal-close/bal-close.js +1 -1
- package/dist/collection/components/bal-date/bal-date-calendar/components/bal-date-calendar__list.js +1 -1
- package/dist/collection/components/bal-dropdown/bal-dropdown.css +1 -0
- package/dist/collection/components/bal-dropdown/bal-dropdown.interfaces.js +4 -0
- package/dist/collection/components/bal-dropdown/bal-dropdown.js +882 -0
- package/dist/collection/components/bal-field/bal-field.js +12 -2
- package/dist/collection/components/bal-option/bal-option.css +1 -0
- package/dist/collection/components/bal-option/bal-option.interfaces.js +4 -0
- package/dist/collection/components/bal-option/bal-option.js +360 -0
- package/dist/collection/components/bal-option-list/bal-option-list.css +1 -0
- package/dist/collection/components/bal-option-list/bal-option-list.interfaces.js +4 -0
- package/dist/collection/components/bal-option-list/bal-option-list.js +939 -0
- package/dist/collection/components/bal-select/bal-select.js +3 -3
- package/dist/collection/components/bal-spinner/bal-spinner.css +1 -1
- package/dist/collection/components/bal-spinner/bal-spinner.interfaces.js +4 -0
- package/dist/collection/components/bal-spinner/bal-spinner.js +83 -4
- package/dist/collection/components/bal-tag/bal-tag.css +1 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/aria.js +1 -0
- package/dist/collection/utils/config/config.default.js +1 -0
- package/dist/collection/utils/config/config.js +7 -0
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/collection/utils/dropdown/auto-fill.js +38 -0
- package/dist/collection/utils/dropdown/component.js +1 -0
- package/dist/collection/utils/dropdown/dropdown.i18n.js +52 -0
- package/dist/collection/utils/dropdown/events.js +43 -0
- package/dist/collection/utils/dropdown/filters.js +10 -0
- package/dist/collection/utils/dropdown/focus.js +19 -0
- package/dist/collection/utils/dropdown/form-submit.js +35 -0
- package/dist/collection/utils/dropdown/icon.js +15 -0
- package/dist/collection/utils/dropdown/index.js +13 -0
- package/dist/collection/utils/dropdown/input.js +12 -0
- package/dist/collection/utils/dropdown/option-list.js +8 -0
- package/dist/collection/utils/dropdown/option.js +44 -0
- package/dist/collection/utils/dropdown/popup.js +45 -0
- package/dist/collection/utils/dropdown/value.js +103 -0
- package/dist/esm/app-globals-b0dd0fc4.js +9 -0
- package/dist/esm/aria-d5877698.js +3 -0
- package/dist/esm/bal-carousel_2.entry.js +4 -4
- package/dist/esm/bal-checkbox-button.entry.js +1 -1
- package/dist/esm/bal-checkbox_2.entry.js +4 -3
- package/dist/esm/bal-close.entry.js +2 -2
- package/dist/esm/bal-date-calendar_2.entry.js +4 -4
- package/dist/esm/bal-date.entry.js +3 -3
- package/dist/esm/bal-datepicker.entry.js +5 -5
- package/dist/esm/bal-dropdown.entry.js +656 -0
- package/dist/esm/bal-field_5.entry.js +12 -2
- package/dist/esm/bal-file-upload.entry.js +1 -1
- package/dist/esm/bal-footer.entry.js +2 -2
- package/dist/esm/bal-hint_3.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 +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +4 -4
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-number-input.entry.js +2 -2
- package/dist/esm/bal-option_2.entry.js +536 -0
- package/dist/esm/bal-pagination.entry.js +4 -4
- package/dist/esm/bal-popover_2.entry.js +3 -3
- package/dist/esm/bal-popup.entry.js +1 -1
- package/dist/esm/bal-progress-bar.entry.js +3 -3
- package/dist/esm/bal-radio_2.entry.js +2 -2
- package/dist/esm/bal-select_2.entry.js +3 -3
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-spinner.entry.js +50 -5
- package/dist/esm/bal-steps.entry.js +4 -4
- package/dist/esm/bal-tab-item_2.entry.js +4 -4
- package/dist/esm/bal-tag_2.entry.js +1 -1
- package/dist/esm/bal-time-input.entry.js +1 -1
- package/dist/esm/baloise-design-system.js +4 -5
- package/dist/esm/{breakpoints.decorator-1a7b0912.js → breakpoints.decorator-021fbaf0.js} +1 -1
- package/dist/esm/{breakpoints.subject-c5f9de1c.js → breakpoints.subject-ef464f89.js} +1 -1
- package/dist/esm/{config.default-79f94bf7.js → config.default-7efdc82d.js} +1 -0
- package/dist/esm/{date-f02fdb08.js → date-38a0b208.js} +1 -1
- package/dist/esm/{index.esm-ec4cba26.js → index.esm-83b1f9c4.js} +1 -1
- package/dist/esm/index.js +8 -7
- package/dist/esm/{initialize-66615dde.js → initialize-e216cfe4.js} +9 -2
- package/dist/esm/loader.js +4 -5
- package/dist/esm/option-37cb0282.js +46 -0
- package/dist/esm/{tokens.esm-99101350.js → tokens.esm-aab9bd61.js} +1 -1
- package/dist/esm-es5/app-globals-b0dd0fc4.js +1 -0
- package/dist/esm-es5/aria-d5877698.js +1 -0
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-checkbox-button.entry.js +1 -1
- package/dist/esm-es5/bal-checkbox_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-datepicker.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown.entry.js +1 -0
- package/dist/esm-es5/bal-field_5.entry.js +1 -1
- package/dist/esm-es5/bal-file-upload.entry.js +1 -1
- package/dist/esm-es5/bal-footer.entry.js +1 -1
- package/dist/esm-es5/bal-hint_3.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.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-option_2.entry.js +1 -0
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popover_2.entry.js +1 -1
- package/dist/esm-es5/bal-popup.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-radio_2.entry.js +1 -1
- package/dist/esm-es5/bal-select_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-tag_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-1a7b0912.js → breakpoints.decorator-021fbaf0.js} +1 -1
- package/dist/esm-es5/{breakpoints.subject-c5f9de1c.js → breakpoints.subject-ef464f89.js} +1 -1
- package/dist/esm-es5/{config.default-79f94bf7.js → config.default-7efdc82d.js} +1 -1
- package/dist/esm-es5/{date-f02fdb08.js → date-38a0b208.js} +1 -1
- package/dist/esm-es5/{index.esm-ec4cba26.js → index.esm-83b1f9c4.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{initialize-66615dde.js → initialize-e216cfe4.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/option-37cb0282.js +1 -0
- package/dist/html.html-data.json +357 -0
- package/dist/types/components/bal-dropdown/bal-dropdown.d.ts +187 -0
- package/dist/types/components/bal-dropdown/bal-dropdown.interfaces.d.ts +14 -0
- package/dist/types/components/bal-field/bal-field.d.ts +1 -0
- package/dist/types/components/bal-option/bal-option.d.ts +91 -0
- package/dist/types/components/bal-option/bal-option.interfaces.d.ts +19 -0
- package/dist/types/components/bal-option-list/bal-option-list.d.ts +168 -0
- package/dist/types/components/bal-option-list/bal-option-list.interfaces.d.ts +5 -0
- package/dist/types/components/bal-select/bal-select.d.ts +1 -1
- package/dist/types/components/bal-spinner/bal-spinner.d.ts +14 -2
- package/dist/types/components/bal-spinner/bal-spinner.interfaces.d.ts +6 -0
- package/dist/types/components.d.ts +443 -32
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces.d.ts +4 -0
- package/dist/types/utils/aria.d.ts +1 -0
- package/dist/types/utils/config/config.d.ts +2 -0
- package/dist/types/utils/config/config.types.d.ts +2 -0
- package/dist/types/utils/dropdown/auto-fill.d.ts +8 -0
- package/dist/types/utils/dropdown/component.d.ts +34 -0
- package/dist/types/utils/dropdown/dropdown.i18n.d.ts +8 -0
- package/dist/types/utils/dropdown/events.d.ts +13 -0
- package/dist/types/utils/dropdown/filters.d.ts +2 -0
- package/dist/types/utils/dropdown/focus.d.ts +13 -0
- package/dist/types/utils/dropdown/form-submit.d.ts +22 -0
- package/dist/types/utils/dropdown/icon.d.ts +13 -0
- package/dist/types/utils/dropdown/index.d.ts +13 -0
- package/dist/types/utils/dropdown/input.d.ts +27 -0
- package/dist/types/utils/dropdown/option-list.d.ts +17 -0
- package/dist/types/utils/dropdown/option.d.ts +25 -0
- package/dist/types/utils/dropdown/popup.d.ts +9 -0
- package/dist/types/utils/dropdown/value.d.ts +28 -0
- package/package.json +7 -7
- package/components/bal-app2.js +0 -87
- package/components/bal-doc-app.js +0 -260
- package/components/initialize.js +0 -281
- package/dist/baloise-design-system/p-1e0e5892a3.system.entry.js +0 -1
- package/dist/baloise-design-system/p-2ae9656e.system.js +0 -1
- package/dist/baloise-design-system/p-2dda46c5f8.entry.js +0 -1
- package/dist/baloise-design-system/p-320dd651.js +0 -1
- package/dist/baloise-design-system/p-4e218ac923.system.entry.js +0 -1
- package/dist/baloise-design-system/p-4f4df156.js +0 -1
- package/dist/baloise-design-system/p-87067c24.js +0 -1
- package/dist/baloise-design-system/p-8ea27b553e.system.entry.js +0 -1
- package/dist/baloise-design-system/p-96647117d9.entry.js +0 -1
- package/dist/baloise-design-system/p-9d114fae.js +0 -1
- package/dist/baloise-design-system/p-9ee6326d8f.entry.js +0 -1
- package/dist/baloise-design-system/p-a4d60ac8af.system.entry.js +0 -1
- package/dist/baloise-design-system/p-a8d19cb362.system.entry.js +0 -1
- package/dist/baloise-design-system/p-b0870e2498.system.entry.js +0 -1
- package/dist/baloise-design-system/p-b1c7ddc442.system.entry.js +0 -1
- package/dist/baloise-design-system/p-b1e3fc0bc8.entry.js +0 -1
- package/dist/baloise-design-system/p-c0a3d422.system.js +0 -1
- package/dist/baloise-design-system/p-c34504aa32.entry.js +0 -1
- package/dist/baloise-design-system/p-d6fc0dd434.entry.js +0 -1
- package/dist/baloise-design-system/p-db3e6b861f.entry.js +0 -1
- package/dist/baloise-design-system/p-e960037ef1.entry.js +0 -1
- package/dist/baloise-design-system/p-f15be367.system.js +0 -1
- package/dist/baloise-design-system/p-f8c2d916.system.js +0 -1
- package/dist/baloise-design-system/p-fa8f56c6.system.js +0 -1
- package/dist/cjs/app-globals-1a8f18e4.js +0 -7
- package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
- package/dist/cjs/global-6ea60588.js +0 -9
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
- package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -229
- package/dist/esm/app-globals-e3e23c19.js +0 -5
- package/dist/esm/bal-doc-app.entry.js +0 -227
- package/dist/esm/global-d54e7c09.js +0 -7
- package/dist/esm-es5/app-globals-e3e23c19.js +0 -1
- package/dist/esm-es5/bal-doc-app.entry.js +0 -1
- package/dist/esm-es5/global-d54e7c09.js +0 -1
- package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -81
- /package/dist/baloise-design-system/{p-8f430e01.system.js → p-03c136e2.system.js} +0 -0
- /package/dist/baloise-design-system/{p-2b04a8d8.js → p-7b9c33ba.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-99101350.js → tokens.esm-aab9bd61.js} +0 -0
package/components/bal-field.js
CHANGED
|
@@ -28,6 +28,7 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends HTMLElement {
|
|
|
28
28
|
'bal-input-stepper',
|
|
29
29
|
'bal-input-slider',
|
|
30
30
|
'bal-file-upload',
|
|
31
|
+
'bal-dropdown',
|
|
31
32
|
];
|
|
32
33
|
this.formElements = [...this.formControlElement, 'bal-field-label', 'bal-field-message'];
|
|
33
34
|
this.isDirectChild = (el) => {
|
|
@@ -46,18 +47,26 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends HTMLElement {
|
|
|
46
47
|
}
|
|
47
48
|
return this.isDirectChild(parent);
|
|
48
49
|
};
|
|
50
|
+
this.isVisible = (el) => {
|
|
51
|
+
if (!el) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return el.ariaHidden !== 'true';
|
|
55
|
+
};
|
|
49
56
|
this.findDirectChild = (selectors) => {
|
|
50
57
|
const element = this.el.querySelector(selectors);
|
|
51
58
|
const isDirectChild = this.isDirectChild(element);
|
|
52
59
|
if (isDirectChild) {
|
|
53
|
-
|
|
60
|
+
if (this.isVisible(element)) {
|
|
61
|
+
return element;
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
return undefined;
|
|
56
65
|
};
|
|
57
66
|
this.findDirectChildren = (selectors) => {
|
|
58
67
|
return selectors
|
|
59
68
|
.map(selector => {
|
|
60
|
-
return Array.from(this.el.querySelectorAll(selector)).filter(this.isDirectChild);
|
|
69
|
+
return Array.from(this.el.querySelectorAll(selector)).filter(this.isDirectChild).filter(this.isVisible);
|
|
61
70
|
})
|
|
62
71
|
.flat();
|
|
63
72
|
};
|
|
@@ -106,6 +115,7 @@ const Field = /*@__PURE__*/ proxyCustomElement(class Field extends HTMLElement {
|
|
|
106
115
|
'bal-field-control bal-input',
|
|
107
116
|
'bal-field-control bal-select',
|
|
108
117
|
'bal-field-control bal-input-date',
|
|
118
|
+
'bal-field-control bal-dropdown',
|
|
109
119
|
'bal-field-control bal-checkbox',
|
|
110
120
|
'bal-field-control bal-radio',
|
|
111
121
|
'bal-field-control bal-checkbox-group',
|
package/components/bal-footer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
3
|
-
import {
|
|
3
|
+
import { u as loadFooterLinks, v as loadSocialMediaLinks, L as Language } from './index.esm.js';
|
|
4
4
|
import { B as BEM } from './bem.js';
|
|
5
5
|
import { L as Logger } from './log.js';
|
|
6
6
|
import { k as rIC } from './helpers.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface BalOptionList extends Components.BalOptionList, HTMLElement {}
|
|
4
|
+
export const BalOptionList: {
|
|
5
|
+
prototype: BalOptionList;
|
|
6
|
+
new (): BalOptionList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
3
|
+
import { l as lodash_isnil } from './index2.js';
|
|
4
|
+
import { i as inheritAttributes } from './attributes.js';
|
|
5
|
+
import { B as BEM } from './bem.js';
|
|
6
|
+
import { b as waitAfterFramePaint, l as raf } from './helpers.js';
|
|
7
|
+
import { L as Logger } from './log.js';
|
|
8
|
+
import { s as startsWith, i as includes } from './utils.js';
|
|
9
|
+
import { d as defaultBalAriaForm } from './form.js';
|
|
10
|
+
|
|
11
|
+
const 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}";
|
|
12
|
+
const BalOptionListStyle0 = balOptionListCss;
|
|
13
|
+
|
|
14
|
+
const OptionList = /*@__PURE__*/ proxyCustomElement(class OptionList extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.__registerHost();
|
|
18
|
+
this.inputId = `bal-option-list-${balOptionListIds++}`;
|
|
19
|
+
this.inheritAttributes = {};
|
|
20
|
+
this.ariaForm = defaultBalAriaForm;
|
|
21
|
+
this.multiple = false;
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
this.required = false;
|
|
24
|
+
this.focusIndex = -1;
|
|
25
|
+
this.labelledby = undefined;
|
|
26
|
+
this.filter = 'includes';
|
|
27
|
+
this.contentHeight = 262;
|
|
28
|
+
}
|
|
29
|
+
createLogger(log) {
|
|
30
|
+
this.log = log;
|
|
31
|
+
}
|
|
32
|
+
contentHeightChanged(value) {
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
this.el.style.removeProperty('--bal-option-list-max-height');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.el.style.setProperty('--bal-option-list-max-height', `${value}px`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* LIFECYCLE
|
|
42
|
+
* ------------------------------------------------------
|
|
43
|
+
*/
|
|
44
|
+
componentDidLoad() {
|
|
45
|
+
this.contentHeightChanged(this.contentHeight);
|
|
46
|
+
}
|
|
47
|
+
componentWillRender() {
|
|
48
|
+
this.inheritAttributes = inheritAttributes(this.el, ['aria-multiselectable', 'aria-labelledby']);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* LISTENERS
|
|
52
|
+
* ------------------------------------------------------
|
|
53
|
+
*/
|
|
54
|
+
listenToMouseEnter(ev) {
|
|
55
|
+
const options = this.options;
|
|
56
|
+
const indexToFocus = this.getOptionIndex(options, ev.detail.value);
|
|
57
|
+
if (indexToFocus !== undefined) {
|
|
58
|
+
this.updateFocus(options, indexToFocus);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
listenToOptionChange({ detail }) {
|
|
62
|
+
if (!this.multiple) {
|
|
63
|
+
this.options.filter(option => option.value !== detail.value).forEach(option => (option.selected = false));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* PUBLIC METHODS
|
|
68
|
+
* ------------------------------------------------------
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Focus the first visible option in the list
|
|
72
|
+
* @returns focusIndex
|
|
73
|
+
*/
|
|
74
|
+
async focusFirst() {
|
|
75
|
+
const options = this.options;
|
|
76
|
+
const indexToFocus = this.getFirstOptionIndex(options);
|
|
77
|
+
this.updateFocus(options, indexToFocus);
|
|
78
|
+
const option = options[indexToFocus];
|
|
79
|
+
this.updateScrollTopPosition(option);
|
|
80
|
+
await waitAfterFramePaint();
|
|
81
|
+
return indexToFocus;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Focus the last visible option in the list
|
|
85
|
+
* @returns focusIndex
|
|
86
|
+
*/
|
|
87
|
+
async focusLast() {
|
|
88
|
+
const options = this.options;
|
|
89
|
+
const indexToFocus = this.getLastOptionIndex(options);
|
|
90
|
+
this.updateFocus(options, indexToFocus);
|
|
91
|
+
const option = options[indexToFocus];
|
|
92
|
+
this.updateScrollBottomPosition(option);
|
|
93
|
+
await waitAfterFramePaint();
|
|
94
|
+
return indexToFocus;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Focus the next visible option in the list
|
|
98
|
+
* @returns focusIndex
|
|
99
|
+
*/
|
|
100
|
+
async focusNext() {
|
|
101
|
+
const options = this.options;
|
|
102
|
+
const indexToFocus = this.getNextOptionIndex(options);
|
|
103
|
+
this.updateFocus(options, indexToFocus);
|
|
104
|
+
const option = options[indexToFocus];
|
|
105
|
+
this.updateScrollBottomPosition(option);
|
|
106
|
+
await waitAfterFramePaint();
|
|
107
|
+
return indexToFocus;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Focus the previous visible option in the list
|
|
111
|
+
* @returns focusIndex
|
|
112
|
+
*/
|
|
113
|
+
async focusPrevious() {
|
|
114
|
+
const options = this.options;
|
|
115
|
+
const indexToFocus = this.getPreviousOptionIndex(options);
|
|
116
|
+
this.updateFocus(options, indexToFocus);
|
|
117
|
+
const option = options[indexToFocus];
|
|
118
|
+
this.updateScrollTopPosition(option);
|
|
119
|
+
await waitAfterFramePaint();
|
|
120
|
+
return indexToFocus;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Focus the option with the label that starts with the search property
|
|
124
|
+
* @returns focusIndex
|
|
125
|
+
*/
|
|
126
|
+
async focusByLabel(search, config) {
|
|
127
|
+
const options = this.options;
|
|
128
|
+
const indexToFocus = this.getOptionIndexByLabel(options, search);
|
|
129
|
+
this.updateFocus(options, indexToFocus);
|
|
130
|
+
const option = options[indexToFocus];
|
|
131
|
+
this.updateScrollTopPosition(option);
|
|
132
|
+
await waitAfterFramePaint();
|
|
133
|
+
if (config.select) {
|
|
134
|
+
await option.select();
|
|
135
|
+
}
|
|
136
|
+
return indexToFocus;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Filter the options by the given filter property and hides options
|
|
140
|
+
* @returns focusIndex
|
|
141
|
+
*/
|
|
142
|
+
async filterByContent(search) {
|
|
143
|
+
const options = this.allOptions;
|
|
144
|
+
this.filterOptions(options, search);
|
|
145
|
+
await waitAfterFramePaint();
|
|
146
|
+
return this.focusFirst();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Shows or hides all options
|
|
150
|
+
*/
|
|
151
|
+
async resetHidden(hidden = false) {
|
|
152
|
+
this.options.forEach(option => (option.hidden = hidden));
|
|
153
|
+
await waitAfterFramePaint();
|
|
154
|
+
this.resetFocus();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Selects or deselects all options
|
|
158
|
+
*/
|
|
159
|
+
async resetSelected(selected = false) {
|
|
160
|
+
this.options.forEach(option => (option.selected = selected));
|
|
161
|
+
await waitAfterFramePaint();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Updates options
|
|
165
|
+
*/
|
|
166
|
+
async updateSelected(values) {
|
|
167
|
+
this.options.forEach(option => (option.selected = values.includes(option.value)));
|
|
168
|
+
await waitAfterFramePaint();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Resets the focus index to pristine and scrolls to the top of the list
|
|
172
|
+
*/
|
|
173
|
+
async resetFocus() {
|
|
174
|
+
const options = this.options;
|
|
175
|
+
const indexToFocus = -1;
|
|
176
|
+
this.updateFocus(options, indexToFocus);
|
|
177
|
+
this.scrollTo(0);
|
|
178
|
+
await waitAfterFramePaint();
|
|
179
|
+
return indexToFocus;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Returns a list of option values
|
|
183
|
+
*/
|
|
184
|
+
async getSelectedValues() {
|
|
185
|
+
const options = this.options;
|
|
186
|
+
return options.filter(option => option.selected).map(option => option.value);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Returns a list of option labels
|
|
190
|
+
*/
|
|
191
|
+
async getSelectedOptions(values) {
|
|
192
|
+
const options = this.options;
|
|
193
|
+
if (values && values.length > 0) {
|
|
194
|
+
return options.filter(option => values.includes(option.value)).map(option => option);
|
|
195
|
+
}
|
|
196
|
+
return options.filter(option => option.selected).map(option => option);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Returns a list of options
|
|
200
|
+
*/
|
|
201
|
+
async getValues() {
|
|
202
|
+
return this.options.map(option => option.value);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Returns a list of options
|
|
206
|
+
*/
|
|
207
|
+
async getLabels() {
|
|
208
|
+
return this.options.map(option => option.label);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Returns a list of accessible options
|
|
212
|
+
*/
|
|
213
|
+
async getOptions() {
|
|
214
|
+
return this.options.filter(o => !o.disabled || !o.hidden);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Selects the option with the current focus
|
|
218
|
+
*/
|
|
219
|
+
async selectByFocus() {
|
|
220
|
+
const options = this.options;
|
|
221
|
+
const option = options[this.focusIndex];
|
|
222
|
+
if (option) {
|
|
223
|
+
if (this.multiple) {
|
|
224
|
+
option.select(!option.selected);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
option.select(true);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @internal
|
|
233
|
+
*/
|
|
234
|
+
async setAriaForm(ariaForm) {
|
|
235
|
+
this.ariaForm = Object.assign({}, ariaForm);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* GETTERS
|
|
239
|
+
* ------------------------------------------------------
|
|
240
|
+
*/
|
|
241
|
+
get options() {
|
|
242
|
+
return Array.from(this.el.querySelectorAll('bal-option')).filter(o => !o.hidden);
|
|
243
|
+
}
|
|
244
|
+
get allOptions() {
|
|
245
|
+
return Array.from(this.el.querySelectorAll('bal-option'));
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* PRIVATE METHODS
|
|
249
|
+
* ------------------------------------------------------
|
|
250
|
+
*/
|
|
251
|
+
filterOptions(options, search) {
|
|
252
|
+
const filteredOptions = [];
|
|
253
|
+
const filter = this.filter === 'includes' ? includes : startsWith;
|
|
254
|
+
for (let index = 0; index < options.length; index++) {
|
|
255
|
+
const option = options[index];
|
|
256
|
+
const content = option.textContent || '';
|
|
257
|
+
if (filter(content, search)) {
|
|
258
|
+
filteredOptions.push(option);
|
|
259
|
+
option.hidden = false;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
option.hidden = true;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return filteredOptions;
|
|
266
|
+
}
|
|
267
|
+
isOptionVisible(option) {
|
|
268
|
+
const visibleHeight = this.el.clientHeight;
|
|
269
|
+
const topPosition = this.el.scrollTop;
|
|
270
|
+
const bottomPosition = topPosition + visibleHeight;
|
|
271
|
+
const isVisible = topPosition <= option.offsetTop && option.offsetTop + option.clientHeight <= bottomPosition;
|
|
272
|
+
return isVisible;
|
|
273
|
+
}
|
|
274
|
+
updateScrollTopPosition(option) {
|
|
275
|
+
if (option) {
|
|
276
|
+
const isVisible = this.isOptionVisible(option);
|
|
277
|
+
if (!isVisible) {
|
|
278
|
+
this.scrollTo(this.getScrollTopForTopPosition(option));
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
updateScrollBottomPosition(option) {
|
|
283
|
+
if (option) {
|
|
284
|
+
const isVisible = this.isOptionVisible(option);
|
|
285
|
+
if (!isVisible) {
|
|
286
|
+
this.scrollTo(this.getScrollTopForBottomPosition(option));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
getScrollTopForTopPosition(option) {
|
|
291
|
+
const topPosition = option.offsetTop;
|
|
292
|
+
const scrollTop = topPosition;
|
|
293
|
+
if (scrollTop < 0) {
|
|
294
|
+
return 0;
|
|
295
|
+
}
|
|
296
|
+
return scrollTop;
|
|
297
|
+
}
|
|
298
|
+
getScrollTopForBottomPosition(option) {
|
|
299
|
+
const visibleHeight = this.el.clientHeight;
|
|
300
|
+
const bottomPosition = option.offsetTop + option.clientHeight;
|
|
301
|
+
const scrollTop = bottomPosition - visibleHeight;
|
|
302
|
+
if (scrollTop < 0) {
|
|
303
|
+
return 0;
|
|
304
|
+
}
|
|
305
|
+
return scrollTop;
|
|
306
|
+
}
|
|
307
|
+
async scrollTo(scrollTop) {
|
|
308
|
+
if (scrollTop !== undefined && scrollTop !== null) {
|
|
309
|
+
if (this.focusRaf !== undefined) {
|
|
310
|
+
cancelAnimationFrame(this.focusRaf);
|
|
311
|
+
}
|
|
312
|
+
this.focusRaf = raf(async () => {
|
|
313
|
+
this.el.scrollTop = scrollTop;
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
updateFocus(options, indexToFocus) {
|
|
318
|
+
this.focusIndex = indexToFocus;
|
|
319
|
+
for (let index = 0; index < options.length; index++) {
|
|
320
|
+
const option = options[index];
|
|
321
|
+
option.focused = index === indexToFocus;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
getOptionIndex(options, value) {
|
|
325
|
+
for (let index = 0; index < options.length; index++) {
|
|
326
|
+
const option = options[index];
|
|
327
|
+
if (option.value === value) {
|
|
328
|
+
return index;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return undefined;
|
|
332
|
+
}
|
|
333
|
+
getFirstOptionIndex(options) {
|
|
334
|
+
for (let index = 0; index < options.length; index++) {
|
|
335
|
+
const option = options[index];
|
|
336
|
+
if (!option.disabled) {
|
|
337
|
+
return index;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return this.focusIndex;
|
|
341
|
+
}
|
|
342
|
+
getNextOptionIndex(options, index = this.focusIndex) {
|
|
343
|
+
if (index < 0) {
|
|
344
|
+
return this.getFirstOptionIndex(options);
|
|
345
|
+
}
|
|
346
|
+
const lastIndex = this.getLength(options);
|
|
347
|
+
let newIndex = index;
|
|
348
|
+
if (index < lastIndex) {
|
|
349
|
+
newIndex = index + 1;
|
|
350
|
+
if (options[newIndex].disabled) {
|
|
351
|
+
return this.getNextOptionIndex(options, newIndex);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return newIndex;
|
|
355
|
+
}
|
|
356
|
+
getPreviousOptionIndex(options, index = this.focusIndex) {
|
|
357
|
+
const firstIndex = this.getFirstOptionIndex(options);
|
|
358
|
+
if (index <= firstIndex) {
|
|
359
|
+
return firstIndex;
|
|
360
|
+
}
|
|
361
|
+
let newIndex = index;
|
|
362
|
+
newIndex = index - 1;
|
|
363
|
+
if (options[newIndex].disabled) {
|
|
364
|
+
return this.getPreviousOptionIndex(options, newIndex);
|
|
365
|
+
}
|
|
366
|
+
return newIndex;
|
|
367
|
+
}
|
|
368
|
+
getLastOptionIndex(options) {
|
|
369
|
+
for (let index = options.length - 1; index >= 0; index--) {
|
|
370
|
+
const option = options[index];
|
|
371
|
+
if (!option.disabled) {
|
|
372
|
+
return index;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return this.focusIndex;
|
|
376
|
+
}
|
|
377
|
+
getOptionIndexByLabel(options, label) {
|
|
378
|
+
if (label === undefined || label === '') {
|
|
379
|
+
return this.focusIndex;
|
|
380
|
+
}
|
|
381
|
+
const option = options.find(o => startsWith(o.label || '', label));
|
|
382
|
+
if (!lodash_isnil(option) && option.id) {
|
|
383
|
+
return options.indexOf(option);
|
|
384
|
+
}
|
|
385
|
+
return this.focusIndex;
|
|
386
|
+
}
|
|
387
|
+
getLength(options) {
|
|
388
|
+
const indexes = options.map((option, index) => (option.disabled ? 0 : index));
|
|
389
|
+
const length = Math.max(...indexes);
|
|
390
|
+
return length;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* RENDER
|
|
394
|
+
* ------------------------------------------------------
|
|
395
|
+
*/
|
|
396
|
+
render() {
|
|
397
|
+
const block = BEM.block('option-list');
|
|
398
|
+
const labelledby = this.labelledby || this.ariaForm.labelId;
|
|
399
|
+
return (h(Host, { class: Object.assign({}, block.class()), id: this.inputId, tabIndex: -1 }, h("div", Object.assign({ role: "listbox", "aria-labelledby": labelledby, "aria-disabled": this.disabled, class: Object.assign({}, block.element('container').class()) }, this.inheritAttributes), h("slot", null))));
|
|
400
|
+
}
|
|
401
|
+
get el() { return this; }
|
|
402
|
+
static get watchers() { return {
|
|
403
|
+
"contentHeight": ["contentHeightChanged"]
|
|
404
|
+
}; }
|
|
405
|
+
static get style() { return BalOptionListStyle0; }
|
|
406
|
+
}, [4, "bal-option-list", {
|
|
407
|
+
"multiple": [4],
|
|
408
|
+
"disabled": [4],
|
|
409
|
+
"required": [4],
|
|
410
|
+
"focusIndex": [1026, "focus-index"],
|
|
411
|
+
"labelledby": [1],
|
|
412
|
+
"filter": [1],
|
|
413
|
+
"contentHeight": [2, "content-height"],
|
|
414
|
+
"ariaForm": [32],
|
|
415
|
+
"focusFirst": [64],
|
|
416
|
+
"focusLast": [64],
|
|
417
|
+
"focusNext": [64],
|
|
418
|
+
"focusPrevious": [64],
|
|
419
|
+
"focusByLabel": [64],
|
|
420
|
+
"filterByContent": [64],
|
|
421
|
+
"resetHidden": [64],
|
|
422
|
+
"resetSelected": [64],
|
|
423
|
+
"updateSelected": [64],
|
|
424
|
+
"resetFocus": [64],
|
|
425
|
+
"getSelectedValues": [64],
|
|
426
|
+
"getSelectedOptions": [64],
|
|
427
|
+
"getValues": [64],
|
|
428
|
+
"getLabels": [64],
|
|
429
|
+
"getOptions": [64],
|
|
430
|
+
"selectByFocus": [64],
|
|
431
|
+
"setAriaForm": [64]
|
|
432
|
+
}, [[1, "balOptionFocus", "listenToMouseEnter"], [0, "balOptionChange", "listenToOptionChange"]], {
|
|
433
|
+
"contentHeight": ["contentHeightChanged"]
|
|
434
|
+
}]);
|
|
435
|
+
__decorate([
|
|
436
|
+
Logger('bal-option-list'),
|
|
437
|
+
__metadata("design:type", Function),
|
|
438
|
+
__metadata("design:paramtypes", [Function]),
|
|
439
|
+
__metadata("design:returntype", void 0)
|
|
440
|
+
], OptionList.prototype, "createLogger", null);
|
|
441
|
+
let balOptionListIds = 0;
|
|
442
|
+
function defineCustomElement$1() {
|
|
443
|
+
if (typeof customElements === "undefined") {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const components = ["bal-option-list"];
|
|
447
|
+
components.forEach(tagName => { switch (tagName) {
|
|
448
|
+
case "bal-option-list":
|
|
449
|
+
if (!customElements.get(tagName)) {
|
|
450
|
+
customElements.define(tagName, OptionList);
|
|
451
|
+
}
|
|
452
|
+
break;
|
|
453
|
+
} });
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const BalOptionList = OptionList;
|
|
457
|
+
const defineCustomElement = defineCustomElement$1;
|
|
458
|
+
|
|
459
|
+
export { BalOptionList, defineCustomElement };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../dist/types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface BalOption extends Components.BalOption, HTMLElement {}
|
|
4
|
+
export const BalOption: {
|
|
5
|
+
prototype: BalOption;
|
|
6
|
+
new (): BalOption;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|