@baloise/ds-core 20.0.0-next.4 → 20.0.0-next.6
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/LICENSE +9 -0
- package/components/all.d.ts +56 -0
- package/components/all.js +84 -0
- package/components/ds-accordion.js +1 -1
- package/components/ds-alert-container.js +1 -1
- package/components/ds-app.js +1 -1
- package/components/ds-badge.js +1 -1
- package/components/ds-button-group.js +1 -1
- package/components/ds-button.js +1 -1
- package/components/ds-card-actions.js +1 -1
- package/components/ds-card-content.js +1 -1
- package/components/ds-card-header.js +1 -1
- package/components/ds-card-subtitle.js +1 -1
- package/components/ds-card-title.js +1 -1
- package/components/ds-card.js +1 -1
- package/components/ds-carousel-item.d.ts +11 -0
- package/components/ds-carousel-item.js +4 -0
- package/components/ds-carousel.d.ts +11 -0
- package/components/ds-carousel.js +4 -0
- package/components/ds-checkbox-group.js +1 -1
- package/components/ds-checkbox.js +1 -1
- package/components/ds-close.js +1 -1
- package/components/ds-content.js +1 -1
- package/components/ds-data-item.d.ts +11 -0
- package/components/ds-data-item.js +4 -0
- package/components/ds-data-label.d.ts +11 -0
- package/components/ds-data-label.js +4 -0
- package/components/ds-data-value.d.ts +11 -0
- package/components/ds-data-value.js +4 -0
- package/components/ds-data.d.ts +11 -0
- package/components/ds-data.js +4 -0
- package/components/ds-date.d.ts +11 -0
- package/components/ds-date.js +4 -0
- package/components/ds-divider.js +1 -1
- package/components/ds-drawer.d.ts +11 -0
- package/components/ds-drawer.js +4 -0
- package/components/ds-file-upload.d.ts +11 -0
- package/components/ds-file-upload.js +4 -0
- package/components/ds-footer.d.ts +11 -0
- package/components/ds-footer.js +4 -0
- package/components/ds-heading.js +1 -1
- package/components/ds-hint-text.d.ts +11 -0
- package/components/ds-hint-text.js +4 -0
- package/components/ds-hint-title.d.ts +11 -0
- package/components/ds-hint-title.js +4 -0
- package/components/ds-hint.d.ts +11 -0
- package/components/ds-hint.js +4 -0
- package/components/ds-icon.js +1 -1
- package/components/ds-input.js +1 -1
- package/components/ds-item.js +1 -1
- package/components/ds-label.js +1 -1
- package/components/ds-list.js +1 -1
- package/components/ds-logo.js +1 -1
- package/components/ds-modal-body.d.ts +11 -0
- package/components/ds-modal-body.js +4 -0
- package/components/ds-modal-header.d.ts +11 -0
- package/components/ds-modal-header.js +4 -0
- package/components/ds-modal.d.ts +11 -0
- package/components/ds-modal.js +4 -0
- package/components/ds-navbar.d.ts +11 -0
- package/components/ds-navbar.js +4 -0
- package/components/ds-notification.js +1 -1
- package/components/ds-number-input.js +1 -1
- package/components/ds-pagination.js +1 -1
- package/components/ds-popup.d.ts +11 -0
- package/components/ds-popup.js +4 -0
- package/components/ds-progress-bar.js +1 -1
- package/components/ds-radio-group.js +1 -1
- package/components/ds-radio.js +1 -1
- package/components/ds-segment-item.js +1 -1
- package/components/ds-segment.js +1 -1
- package/components/ds-select-optgroup.d.ts +11 -0
- package/components/ds-select-optgroup.js +4 -0
- package/components/ds-select-option.d.ts +11 -0
- package/components/ds-select-option.js +4 -0
- package/components/ds-select.d.ts +11 -0
- package/components/ds-select.js +4 -0
- package/components/ds-shape.js +1 -1
- package/components/ds-snackbar.js +1 -1
- package/components/ds-spinner.js +1 -1
- package/components/ds-stack.js +1 -1
- package/components/ds-step-panel.d.ts +11 -0
- package/components/ds-step-panel.js +4 -0
- package/components/ds-step.d.ts +11 -0
- package/components/ds-step.js +4 -0
- package/components/ds-steps.d.ts +11 -0
- package/components/ds-steps.js +4 -0
- package/components/ds-tab-panel.d.ts +11 -0
- package/components/ds-tab-panel.js +4 -0
- package/components/ds-tab.d.ts +11 -0
- package/components/ds-tab.js +4 -0
- package/components/ds-tabs.d.ts +11 -0
- package/components/ds-tabs.js +4 -0
- package/components/ds-tag-group.js +1 -1
- package/components/ds-tag.js +1 -1
- package/components/ds-text.js +1 -1
- package/components/ds-textarea.js +1 -1
- package/components/ds-toast.js +1 -1
- package/components/ds-toggle.js +1 -1
- package/components/ds-tooltip.d.ts +11 -0
- package/components/ds-tooltip.js +4 -0
- package/components/index.js +1 -1
- package/components/p-3Mi9vpmB.js +4 -0
- package/components/p-B-en4B17.js +4 -0
- package/components/p-B1gnrQ9b.js +4 -0
- package/components/p-BU0dY8pq.js +4 -0
- package/components/p-BfXZJ1Fe.js +4 -0
- package/components/p-BgzU1loG.js +4 -0
- package/components/p-BhbWmCTu.js +4 -0
- package/components/p-BqY0KzJC.js +4 -0
- package/components/p-BrIcCcce.js +4 -0
- package/components/p-BrJFPhMA.js +4 -0
- package/components/p-Btdh3fq7.js +4 -0
- package/components/{p-Urcs7-vS.js → p-BwfAXfmz.js} +1 -1
- package/components/p-ByX1_7SF.js +4 -0
- package/components/p-C1jqbZdf.js +4 -0
- package/{dist/design-system/p-15bc012833.entry.js → components/p-CA7G72wZ.js} +1 -1
- package/components/p-CQHwI4iD.js +4 -0
- package/components/p-CYWn3X22.js +4 -0
- package/components/p-CjIxf5zy.js +4 -0
- package/components/p-Ctnm_MBD.js +4 -0
- package/components/p-CvaNxQtw.js +4 -0
- package/components/p-D9ILiUgm.js +4 -0
- package/components/{p-BATOumsf.js → p-D9YYP2SG.js} +1 -1
- package/components/p-DAYd9ty0.js +4 -0
- package/components/p-DIK6Zkg6.js +4 -0
- package/{dist/design-system/p-BkESlUMc.js → components/p-DQBzmbR6.js} +1 -1
- package/components/{p-z1jJgtep.js → p-DU7t9H9h.js} +1 -1
- package/components/p-DYTOWDAA.js +4 -0
- package/components/p-DYlqkAWn.js +4 -0
- package/components/p-DbM7ALm9.js +14 -0
- package/{dist/design-system/p-D2tr7015.js → components/p-DbY6Pfeh.js} +1 -1
- package/components/{p-DZqqelPH.js → p-DcSNuA8W.js} +1 -1
- package/components/p-DenZRIeA.js +4 -0
- package/components/p-DokkRjWC.js +4 -0
- package/{dist/design-system/p-BwrOVItb.js → components/p-Dr4MUfss.js} +1 -1
- package/components/p-DsvYY32v.js +4 -0
- package/components/p-Du7QOHtz.js +5 -0
- package/components/{p-E8U6M5ii.js → p-FBQaJyH0.js} +1 -1
- package/components/{p-Dr4dquer.js → p-J0mxIuTt.js} +1 -1
- package/{dist/design-system/p-DJxr2Dcd.js → components/p-UCeQ1JCs.js} +1 -1
- package/components/p-Uy_dVz21.js +4 -0
- package/components/p-WO0X5Vmy.js +4 -0
- package/components/p-bGV2P6rT.js +4 -0
- package/components/{p-Bt20CEww.js → p-n3_2KEz0.js} +1 -1
- package/dist/cjs/array-CioNm_V1.js +1985 -0
- package/dist/cjs/{breakpoints.decorator-qaoHOU6Q.js → breakpoints.decorator-C-Qm21UK.js} +1 -1
- package/dist/cjs/{breakpoints.subject-DhAN_ZAn.js → breakpoints.subject-XNcGwhzh.js} +3 -3
- package/dist/cjs/{button.interfaces-BueDWsuH.js → button.interfaces-CqlUGR-N.js} +1 -1
- package/dist/cjs/carousel.interfaces-BFQpUNrw.js +12 -0
- package/dist/cjs/{config.decorator-Qmrq4ZYj.js → config.decorator-ThGLtT-3.js} +1 -1
- package/dist/cjs/{config.utils-Cv4cx_Xa.js → config.utils-MhZvq4Qm.js} +1 -1
- package/dist/cjs/create-validator-decorator-BIgFqrMJ.js +212 -0
- package/dist/cjs/design-system.cjs.js +3 -3
- package/dist/cjs/{device-CptgCtVc.js → device-BnjBOLnP.js} +1 -1
- package/dist/cjs/ds-accordion.cjs.entry.js +30 -34
- package/dist/cjs/ds-alert-container.cjs.entry.js +12 -15
- package/dist/cjs/ds-app.cjs.entry.js +16 -6
- package/dist/cjs/ds-badge.cjs.entry.js +32 -25
- package/dist/cjs/ds-button-group.cjs.entry.js +14 -17
- package/dist/cjs/ds-button_2.cjs.entry.js +58 -73
- package/dist/cjs/ds-card-actions.cjs.entry.js +6 -8
- package/dist/cjs/ds-card-content.cjs.entry.js +2 -2
- package/dist/cjs/ds-card-header.cjs.entry.js +8 -5
- package/dist/cjs/ds-card-subtitle.cjs.entry.js +13 -13
- package/dist/cjs/ds-card-title.cjs.entry.js +11 -7
- package/dist/cjs/ds-card.cjs.entry.js +30 -42
- package/dist/cjs/ds-carousel-item.cjs.entry.js +128 -0
- package/dist/cjs/ds-carousel.cjs.entry.js +473 -0
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +41 -2012
- package/dist/cjs/ds-checkbox.cjs.entry.js +23 -19
- package/dist/cjs/ds-content_2.cjs.entry.js +330 -0
- package/dist/cjs/ds-data-item.cjs.entry.js +146 -0
- package/dist/cjs/ds-data-label.cjs.entry.js +41 -0
- package/dist/cjs/ds-data-value.cjs.entry.js +31 -0
- package/dist/cjs/ds-data.cjs.entry.js +43 -0
- package/dist/cjs/ds-date.cjs.entry.js +5334 -0
- package/dist/cjs/{ds-logo.cjs.entry.js → ds-divider_2.cjs.entry.js} +130 -25
- package/dist/cjs/ds-drawer_2.cjs.entry.js +602 -0
- package/dist/cjs/ds-file-upload.cjs.entry.js +515 -0
- package/dist/cjs/ds-footer.cjs.entry.js +159 -0
- package/dist/cjs/ds-heading.cjs.entry.js +21 -19
- package/dist/cjs/ds-hint-text.cjs.entry.js +28 -0
- package/dist/cjs/ds-hint-title.cjs.entry.js +31 -0
- package/dist/cjs/ds-hint.cjs.entry.js +243 -0
- package/dist/cjs/ds-icon_2.cjs.entry.js +78 -70
- package/dist/cjs/ds-input.cjs.entry.js +45 -43
- package/dist/cjs/ds-item.cjs.entry.js +29 -34
- package/dist/cjs/ds-label.cjs.entry.js +22 -30
- package/dist/cjs/ds-list.cjs.entry.js +6 -12
- package/dist/cjs/ds-modal-body.cjs.entry.js +34 -0
- package/dist/cjs/ds-modal-header.cjs.entry.js +31 -0
- package/dist/cjs/ds-modal.cjs.entry.js +201 -0
- package/dist/cjs/ds-navbar.cjs.entry.js +359 -0
- package/dist/cjs/ds-notification.cjs.entry.js +19 -27
- package/dist/cjs/ds-number-input.cjs.entry.js +128 -45
- package/dist/cjs/ds-pagination.cjs.entry.js +41 -37
- package/dist/cjs/ds-progress-bar.cjs.entry.js +25 -29
- package/dist/cjs/ds-radio-group.cjs.entry.js +30 -29
- package/dist/cjs/ds-radio.cjs.entry.js +26 -33
- package/dist/cjs/ds-segment-item.cjs.entry.js +9 -9
- package/dist/cjs/ds-segment.cjs.entry.js +29 -117
- package/dist/cjs/ds-select-optgroup.cjs.entry.js +49 -0
- package/dist/cjs/ds-select-option.cjs.entry.js +57 -0
- package/dist/cjs/ds-select.cjs.entry.js +2772 -0
- package/dist/cjs/ds-shape.cjs.entry.js +10 -16
- package/dist/cjs/ds-snackbar.cjs.entry.js +40 -57
- package/dist/cjs/ds-step-panel.cjs.entry.js +55 -0
- package/dist/cjs/ds-step.cjs.entry.js +170 -0
- package/dist/cjs/ds-steps.cjs.entry.js +227 -0
- package/dist/cjs/ds-tab-panel.cjs.entry.js +55 -0
- package/dist/cjs/ds-tab.cjs.entry.js +120 -0
- package/dist/cjs/ds-tabs.cjs.entry.js +364 -0
- package/dist/cjs/ds-tag-group.cjs.entry.js +3 -3
- package/dist/cjs/ds-tag.cjs.entry.js +19 -26
- package/dist/cjs/ds-text.cjs.entry.js +28 -32
- package/dist/cjs/ds-textarea.cjs.entry.js +32 -31
- package/dist/cjs/ds-toast.cjs.entry.js +40 -54
- package/dist/cjs/ds-toggle.cjs.entry.js +22 -21
- package/dist/cjs/ds-tooltip.cjs.entry.js +182 -0
- package/dist/cjs/{field.util-RjuvTLNZ.js → field.util-L-DkeMVk.js} +1 -1
- package/dist/cjs/floating-ui.dom-Cu3dZdFD.js +1628 -0
- package/dist/cjs/focus-D3VVgpM7.js +1958 -0
- package/dist/cjs/footer.i18n-CpGxizgm.js +162 -0
- package/dist/cjs/{form-control-Bno2tBGf.js → form-control-CtMcJUuC.js} +2 -2
- package/dist/cjs/has-value-DK0oRqXI.js +12 -0
- package/dist/cjs/{index-CdD-TT_n.js → index-sC3JnTlJ.js} +497 -175
- package/dist/cjs/index.cjs.js +26 -8283
- package/dist/cjs/keyboard-C7y0jXYb.js +23 -0
- package/dist/cjs/{listener-DgVWqfa1.js → listener-BwB_xent.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/luxon-q23LOWrr.js +8137 -0
- package/dist/cjs/one-of-BZGRIMtQ.js +30 -0
- package/dist/cjs/popup.interfaces-B-mwd9rh.js +23 -0
- package/dist/cjs/required-COz3Unzu.js +38 -0
- package/dist/cjs/resize.decorator-DWM_fQgv.js +98 -0
- package/dist/cjs/scroll-CUuEh4xd.js +89 -0
- package/dist/cjs/svg-D9RbiR8R.js +2443 -0
- package/dist/cjs/{tslib.es6-BTi-SLnA.js → tslib.es6-CxyosZMg.js} +1 -1
- package/dist/cjs/type-hmc4CJcO.js +33 -0
- package/dist/collection/collection-manifest.json +30 -2
- package/dist/collection/components/accordion/accordion.host.css +1 -1
- package/dist/collection/components/accordion/accordion.js +22 -29
- package/dist/collection/components/alert/alert-container.js +8 -14
- package/dist/collection/components/alert/alert.controller.js +1 -1
- package/dist/collection/components/alert/snackbar/snackbar.js +30 -53
- package/dist/collection/components/alert/toast/toast.js +32 -53
- package/dist/collection/components/app/app.js +11 -3
- package/dist/collection/components/badge/badge.interfaces.js +1 -1
- package/dist/collection/components/badge/badge.js +28 -25
- package/dist/collection/components/button/button-group/button-group.js +8 -14
- package/dist/collection/components/button/button.host.css +1 -1
- package/dist/collection/components/button/button.interfaces.js +1 -1
- package/dist/collection/components/button/button.js +44 -54
- package/dist/collection/components/card/card-actions/card-actions.js +3 -6
- package/dist/collection/components/card/card-header/card-header.js +4 -3
- package/dist/collection/components/card/card-subtitle/card-subtitle.js +8 -11
- package/dist/collection/components/card/card-title/card-title.js +6 -5
- package/dist/collection/components/card/card.host.css +1 -1
- package/dist/collection/components/card/card.js +25 -38
- package/dist/collection/components/carousel/carousel/carousel.host.css +1 -0
- package/dist/collection/components/carousel/carousel/carousel.i18n.js +65 -0
- package/dist/collection/components/carousel/carousel/carousel.js +631 -0
- package/dist/collection/components/carousel/carousel-item/carousel-item.host.css +1 -0
- package/dist/collection/components/carousel/carousel-item/carousel-item.js +313 -0
- package/dist/collection/components/carousel/carousel.interfaces.js +6 -0
- package/dist/collection/components/carousel/test/carousel.a11y.play.js +34 -0
- package/dist/collection/components/carousel/test/carousel.component.play.js +57 -0
- package/dist/collection/components/carousel/test/carousel.visual.play.js +24 -0
- package/dist/collection/components/checkbox/checkbox-group/checkbox-group.host.css +1 -1
- package/dist/collection/components/checkbox/checkbox-group/checkbox-group.js +25 -26
- package/dist/collection/components/checkbox/checkbox.js +18 -18
- package/dist/collection/components/close/close.js +10 -21
- package/dist/collection/components/content/content.js +38 -52
- package/dist/collection/components/data/data-item.host.css +1 -0
- package/dist/collection/components/data/data-item.i18n.js +35 -0
- package/dist/collection/components/data/data-item.js +244 -0
- package/dist/collection/components/data/data-label.host.css +1 -0
- package/dist/collection/components/data/data-label.js +72 -0
- package/dist/collection/components/data/data-value.host.css +1 -0
- package/dist/collection/components/data/data-value.js +38 -0
- package/dist/collection/components/data/data.host.css +1 -0
- package/dist/collection/components/data/data.js +75 -0
- package/dist/collection/components/data/test/data.a11y.play.js +31 -0
- package/dist/collection/components/data/test/data.component.play.js +104 -0
- package/dist/collection/components/data/test/data.visual.play.js +25 -0
- package/dist/collection/components/date/date.host.css +1 -0
- package/dist/collection/components/date/date.i18n.js +105 -0
- package/dist/collection/components/date/date.interfaces.js +4 -0
- package/dist/collection/components/date/date.js +1241 -0
- package/dist/collection/components/date/date.mask.js +189 -0
- package/dist/collection/components/date/date.picker.js +536 -0
- package/dist/collection/components/date/test/date.a11y.play.js +27 -0
- package/dist/collection/components/date/test/date.component.play.js +69 -0
- package/dist/collection/components/date/test/date.visual.play.js +43 -0
- package/dist/collection/components/divider/divider.host.css +1 -1
- package/dist/collection/components/divider/divider.js +11 -24
- package/dist/collection/components/drawer/drawer.host.css +1 -0
- package/dist/collection/{utils/property-checkers/constants.js → components/drawer/drawer.interfaces.js} +1 -1
- package/dist/collection/components/drawer/drawer.js +492 -0
- package/dist/collection/components/drawer/test/drawer.a11y.play.js +39 -0
- package/dist/collection/components/drawer/test/drawer.component.play.js +131 -0
- package/dist/collection/components/drawer/test/drawer.visual.play.js +31 -0
- package/dist/collection/components/file-upload/file-upload.host.css +1 -0
- package/dist/collection/components/file-upload/file-upload.i18n.js +55 -0
- package/dist/collection/components/file-upload/file-upload.interfaces.js +10 -0
- package/dist/collection/components/file-upload/file-upload.js +1030 -0
- package/dist/collection/components/file-upload/test/file-upload.a11y.play.js +52 -0
- package/dist/collection/components/file-upload/test/file-upload.component.play.js +124 -0
- package/dist/collection/components/file-upload/test/file-upload.visual.play.js +18 -0
- package/dist/collection/components/file-upload/utils/file-list.util.js +13 -0
- package/dist/collection/components/file-upload/utils/file-size.util.js +10 -0
- package/dist/collection/components/file-upload/utils/file-validation.util.js +48 -0
- package/dist/collection/components/footer/footer.host.css +1 -0
- package/dist/collection/components/footer/footer.i18n.js +155 -0
- package/dist/collection/components/footer/footer.interfaces.js +4 -0
- package/dist/collection/components/footer/footer.js +350 -0
- package/dist/collection/components/footer/test/footer.a11y.play.js +17 -0
- package/dist/collection/components/footer/test/footer.component.play.js +74 -0
- package/dist/collection/components/footer/test/footer.visual.play.js +16 -0
- package/dist/collection/components/form/test/form.visual.play.js +13 -1
- package/dist/collection/components/heading/heading.js +16 -17
- package/dist/collection/components/hint/hint-text/hint-text.js +28 -0
- package/dist/collection/components/hint/hint-title/hint-title.js +31 -0
- package/dist/collection/components/hint/hint.host.css +1 -0
- package/dist/collection/components/hint/hint.i18n.js +35 -0
- package/dist/collection/components/hint/hint.interfaces.js +1 -0
- package/dist/collection/components/hint/hint.js +410 -0
- package/dist/collection/components/hint/test/hint.a11y.play.js +41 -0
- package/dist/collection/components/hint/test/hint.component.play.js +110 -0
- package/dist/collection/components/hint/test/hint.visual.play.js +39 -0
- package/dist/collection/components/icon/icon.host.css +1 -1
- package/dist/collection/components/icon/icon.interfaces.js +1 -0
- package/dist/collection/components/icon/icon.js +73 -42
- package/dist/collection/components/icon/test/icon.component.play.js +23 -1
- package/dist/collection/components/input/clear-button.i18n.js +35 -0
- package/dist/collection/components/input/clear-button.util.js +11 -0
- package/dist/collection/components/input/input.host.css +1 -1
- package/dist/collection/components/input/input.js +36 -37
- package/dist/collection/components/input/test/input.component.play.js +1 -1
- package/dist/collection/components/input/trigger-button.i18n.js +45 -0
- package/dist/collection/components/label/label.js +16 -28
- package/dist/collection/components/list/item/item.host.css +1 -1
- package/dist/collection/components/list/item/item.interfaces.js +1 -1
- package/dist/collection/components/list/item/item.js +27 -34
- package/dist/collection/components/list/list.js +3 -10
- package/dist/collection/components/list/test/list.visual.play.js +30 -0
- package/dist/collection/components/logo/logo.js +11 -18
- package/dist/collection/components/modal/modal-body/modal-body.host.css +1 -0
- package/dist/collection/components/modal/modal-body/modal-body.js +41 -0
- package/dist/collection/components/modal/modal-header/modal-header.js +32 -0
- package/dist/collection/components/modal/modal.controller.js +31 -0
- package/dist/collection/components/modal/modal.host.css +1 -0
- package/dist/collection/components/modal/modal.interfaces.js +1 -0
- package/dist/collection/components/modal/modal.js +461 -0
- package/dist/collection/components/modal/test/modal.a11y.play.js +59 -0
- package/dist/collection/components/modal/test/modal.component.play.js +196 -0
- package/dist/collection/components/modal/test/modal.visual.play.js +36 -0
- package/dist/collection/components/navbar/navbar.host.css +1 -0
- package/dist/collection/components/navbar/navbar.i18n.js +65 -0
- package/dist/collection/components/navbar/navbar.interfaces.js +6 -0
- package/dist/collection/components/navbar/navbar.js +544 -0
- package/dist/collection/components/navbar/test/navbar.a11y.play.js +26 -0
- package/dist/collection/components/navbar/test/navbar.component.play.js +76 -0
- package/dist/collection/components/navbar/test/navbar.visual.play.js +14 -0
- package/dist/collection/components/notification/notification.js +14 -26
- package/dist/collection/components/number-input/number-input.host.css +1 -1
- package/dist/collection/components/number-input/number-input.js +23 -24
- package/dist/collection/components/pagination/pagination.host.css +1 -1
- package/dist/collection/components/pagination/pagination.js +29 -28
- package/dist/collection/components/popup/popup.host.css +1 -0
- package/dist/collection/components/popup/popup.interfaces.js +18 -0
- package/dist/collection/components/popup/popup.js +869 -0
- package/dist/collection/components/popup/test/popup.a11y.play.js +50 -0
- package/dist/collection/components/popup/test/popup.component.play.js +168 -0
- package/dist/collection/components/popup/test/popup.visual.play.js +33 -0
- package/dist/collection/components/progress-bar/progress-bar.host.css +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +13 -20
- package/dist/collection/components/radio/radio-group/radio-group.host.css +1 -1
- package/dist/collection/components/radio/radio-group/radio-group.js +22 -23
- package/dist/collection/components/radio/radio.js +19 -20
- package/dist/collection/components/segment/segment/segment.host.css +1 -1
- package/dist/collection/components/segment/segment/segment.js +19 -20
- package/dist/collection/components/segment/segment-item.js +6 -7
- package/dist/collection/components/select/select-optgroup.host.css +1 -0
- package/dist/collection/components/select/select-optgroup.js +82 -0
- package/dist/collection/components/select/select-option.host.css +1 -0
- package/dist/collection/components/select/select-option.js +112 -0
- package/dist/collection/components/select/select.host.css +1 -0
- package/dist/collection/components/select/select.i18n.js +45 -0
- package/dist/collection/components/select/select.interfaces.js +4 -0
- package/dist/collection/components/select/select.js +1024 -0
- package/dist/collection/components/select/select.picker.js +276 -0
- package/dist/collection/components/select/test/select.a11y.play.js +81 -0
- package/dist/collection/components/select/test/select.component.play.js +184 -0
- package/dist/collection/components/select/test/select.visual.play.js +70 -0
- package/dist/collection/components/shape/shape.js +7 -14
- package/dist/collection/components/spinner/spinner.js +18 -26
- package/dist/collection/components/stack/stack.host.css +1 -1
- package/dist/collection/components/stack/stack.js +41 -153
- package/dist/collection/components/steps/step/step.host.css +1 -0
- package/dist/collection/components/steps/step/step.js +431 -0
- package/dist/collection/components/steps/step-panel/step-panel.host.css +1 -0
- package/dist/collection/components/steps/step-panel/step-panel.js +104 -0
- package/dist/collection/components/steps/steps/steps.host.css +1 -0
- package/dist/collection/components/steps/steps/steps.js +356 -0
- package/dist/collection/components/steps/steps.interfaces.js +4 -0
- package/dist/collection/components/steps/test/steps.a11y.play.js +73 -0
- package/dist/collection/components/steps/test/steps.component.play.js +182 -0
- package/dist/collection/components/steps/test/steps.visual.play.js +18 -0
- package/dist/collection/components/tabs/tab/tab.host.css +1 -0
- package/dist/collection/components/tabs/tab/tab.js +278 -0
- package/dist/collection/components/tabs/tab-panel/tab-panel.host.css +1 -0
- package/dist/collection/components/tabs/tab-panel/tab-panel.js +104 -0
- package/dist/collection/components/tabs/tabs/tabs.host.css +1 -0
- package/dist/collection/components/tabs/tabs/tabs.i18n.js +45 -0
- package/dist/collection/components/tabs/tabs/tabs.js +552 -0
- package/dist/collection/components/tabs/tabs.interfaces.js +12 -0
- package/dist/collection/components/tabs/test/tabs.a11y.play.js +60 -0
- package/dist/collection/components/tabs/test/tabs.component.play.js +129 -0
- package/dist/collection/components/tabs/test/tabs.visual.play.js +31 -0
- package/dist/collection/components/tag/tag-group/tag-group.js +1 -1
- package/dist/collection/components/tag/tag.js +15 -26
- package/dist/collection/components/text/text.js +23 -30
- package/dist/collection/components/textarea/textarea.host.css +1 -1
- package/dist/collection/components/textarea/textarea.js +24 -25
- package/dist/collection/components/time-input/test/time-input.visual.play.js +18 -0
- package/dist/collection/components/toggle/toggle.js +19 -20
- package/dist/collection/components/tooltip/test/tooltip.a11y.play.js +32 -0
- package/dist/collection/components/tooltip/test/tooltip.component.play.js +51 -0
- package/dist/collection/components/tooltip/test/tooltip.visual.play.js +16 -0
- package/dist/collection/components/tooltip/tooltip.host.css +1 -0
- package/dist/collection/components/tooltip/tooltip.interfaces.js +4 -0
- package/dist/collection/components/tooltip/tooltip.js +407 -0
- package/dist/collection/foundation/colors.visual.play.js +18 -0
- package/dist/collection/global/config/config.const.js +11 -0
- package/dist/collection/global/config/config.default.js +92 -42
- package/dist/collection/global/config/config.js +1 -1
- package/dist/collection/global/config/config.meta.js +27 -0
- package/dist/collection/global/config/index.js +1 -0
- package/dist/collection/global/config/initialize.js +2 -1
- package/dist/collection/global/constants/tags.constant.js +29 -1
- package/dist/collection/global/constants/version.constant.js +1 -1
- package/dist/collection/global/index.js +0 -1
- package/dist/collection/global/initialize.js +2 -0
- package/dist/collection/index.js +5 -20
- package/dist/collection/utils/attributes.js +0 -15
- package/dist/collection/utils/focus.js +72 -0
- package/dist/collection/utils/form-control.js +1 -1
- package/dist/collection/utils/has-value.js +7 -0
- package/dist/collection/utils/helpers.js +14 -74
- package/dist/collection/utils/index.js +7 -5
- package/dist/collection/utils/{property-checkers/is-value-empty.js → is-value-empty.js} +1 -1
- package/dist/collection/utils/number.js +6 -25
- package/dist/collection/utils/property-decorators/array-of.js +25 -0
- package/dist/collection/utils/property-decorators/bound.js +79 -0
- package/dist/collection/utils/property-decorators/create-validator-decorator.js +212 -0
- package/dist/collection/utils/property-decorators/date.js +24 -0
- package/dist/collection/utils/property-decorators/index.js +12 -0
- package/dist/collection/utils/property-decorators/iso-date.js +24 -0
- package/dist/collection/utils/property-decorators/one-of.js +25 -0
- package/dist/collection/utils/property-decorators/pattern.js +25 -0
- package/dist/collection/utils/property-decorators/required.js +44 -0
- package/dist/collection/utils/property-decorators/type.js +28 -0
- package/dist/collection/utils/property-decorators/url.js +32 -0
- package/dist/collection/utils/property-types.js +1 -0
- package/dist/collection/utils/svg.js +19 -0
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-01430d5c28.entry.js +4 -0
- package/dist/design-system/p-014d464627.entry.js +4 -0
- package/dist/design-system/p-0663d7c0f1.entry.js +4 -0
- package/dist/design-system/p-0bd2ce2da3.entry.js +4 -0
- package/dist/design-system/p-0ff0be5b83.entry.js +4 -0
- package/dist/design-system/p-10c136d00d.entry.js +4 -0
- package/dist/design-system/p-11f34d0c7d.entry.js +4 -0
- package/dist/design-system/p-13d1ce3158.entry.js +4 -0
- package/dist/design-system/p-163d606781.entry.js +4 -0
- package/dist/design-system/p-1VXOIrN2.js +4 -0
- package/dist/design-system/p-202ecb8f01.entry.js +4 -0
- package/dist/design-system/p-27d181c5ac.entry.js +4 -0
- package/dist/design-system/p-2a35e0b9b0.entry.js +4 -0
- package/dist/design-system/p-2f51e1d39b.entry.js +4 -0
- package/dist/design-system/p-3134821ac6.entry.js +4 -0
- package/dist/design-system/p-3292ae6a05.entry.js +4 -0
- package/dist/design-system/p-372bf379f9.entry.js +4 -0
- package/dist/design-system/p-3895178b39.entry.js +4 -0
- package/dist/design-system/p-3c6b7a2967.entry.js +4 -0
- package/dist/design-system/p-3ef4bd1c59.entry.js +4 -0
- package/dist/design-system/p-493b18cc46.entry.js +4 -0
- package/dist/design-system/p-4a99464dae.entry.js +4 -0
- package/dist/design-system/p-4e6638d14e.entry.js +4 -0
- package/dist/design-system/p-53dda5d400.entry.js +4 -0
- package/dist/design-system/p-5d17209d91.entry.js +4 -0
- package/dist/design-system/p-5e51fa8df4.entry.js +4 -0
- package/dist/design-system/p-60d29d8b8e.entry.js +4 -0
- package/dist/design-system/p-62cb503015.entry.js +4 -0
- package/dist/design-system/p-650289138a.entry.js +4 -0
- package/dist/design-system/p-65c221261c.entry.js +4 -0
- package/dist/design-system/p-68c9f4f630.entry.js +4 -0
- package/dist/design-system/p-68ebed7eee.entry.js +4 -0
- package/dist/design-system/p-6b6531379b.entry.js +4 -0
- package/dist/design-system/p-6d168ba9ad.entry.js +4 -0
- package/dist/design-system/p-6ef31a3c07.entry.js +4 -0
- package/dist/design-system/p-774b89ed0b.entry.js +4 -0
- package/dist/design-system/p-787bd92bcc.entry.js +4 -0
- package/{components/p-E1SnOz0L.js → dist/design-system/p-78NZc8PM.js} +1 -1
- package/dist/design-system/p-7c353652a9.entry.js +4 -0
- package/dist/design-system/p-7c8bf0f33e.entry.js +4 -0
- package/dist/design-system/p-7e702193fc.entry.js +4 -0
- package/dist/design-system/p-8353961d39.entry.js +4 -0
- package/dist/design-system/{p-1d312498a6.entry.js → p-8406f6faf1.entry.js} +1 -1
- package/dist/design-system/p-9f2dd0b55b.entry.js +4 -0
- package/dist/design-system/p-B-en4B17.js +4 -0
- package/dist/design-system/p-B1e0kNRJ.js +14 -0
- package/dist/design-system/p-B8KVoKrH.js +5 -0
- package/dist/design-system/p-BAY6Z8bT.js +4 -0
- package/dist/design-system/p-BLGVE-7Z.js +4 -0
- package/dist/design-system/{p-C7EnKCpl.js → p-BMM6Nxeh.js} +1 -1
- package/{components/p-Diz11uvt.js → dist/design-system/p-BPGfTrrM.js} +1 -1
- package/dist/design-system/p-BhdSNuGP.js +4 -0
- package/dist/design-system/p-BkTv_bQR.js +4 -0
- package/dist/design-system/p-BqY0KzJC.js +4 -0
- package/dist/design-system/p-BrJFPhMA.js +4 -0
- package/dist/design-system/p-BvEM6oCl.js +4 -0
- package/dist/design-system/p-C1jqbZdf.js +4 -0
- package/dist/design-system/p-C6MVahkC.js +5 -0
- package/dist/design-system/{p-DCf2fJmI.js → p-C7i6xLTJ.js} +1 -1
- package/dist/design-system/p-CvTcEsXg.js +4 -0
- package/dist/design-system/p-CwCAiaMq.js +4 -0
- package/{components/p-5Sp1eJOt.js → dist/design-system/p-DTxLRTYr.js} +1 -1
- package/dist/design-system/{p-Dnjznncd.js → p-DgVaaZT_.js} +1 -1
- package/dist/design-system/{p-CAcwu8uP.js → p-Dm2lqE3-.js} +1 -1
- package/dist/design-system/p-HwbqEzpk.js +4 -0
- package/dist/design-system/p-LCY5n5tq.js +4 -0
- package/dist/design-system/p-Uy_dVz21.js +4 -0
- package/dist/design-system/p-a465c1acce.entry.js +4 -0
- package/dist/design-system/p-a62b7985a0.entry.js +4 -0
- package/dist/design-system/p-a8de98dd7b.entry.js +4 -0
- package/dist/design-system/p-ad2b17b0a0.entry.js +4 -0
- package/dist/design-system/p-afd8bbe699.entry.js +4 -0
- package/dist/design-system/{p-7e6ed497e7.entry.js → p-b68bc14064.entry.js} +1 -1
- package/dist/design-system/p-b955a93959.entry.js +4 -0
- package/dist/design-system/p-c37f266740.entry.js +4 -0
- package/dist/design-system/p-caad93b943.entry.js +4 -0
- package/dist/design-system/p-cca79bfeb1.entry.js +4 -0
- package/dist/design-system/p-d5f8d8f5e1.entry.js +4 -0
- package/dist/design-system/p-dcb749efc7.entry.js +4 -0
- package/dist/design-system/p-dd38f8f206.entry.js +4 -0
- package/dist/design-system/p-ddf2a7dfee.entry.js +4 -0
- package/dist/design-system/p-df5899b930.entry.js +4 -0
- package/dist/design-system/p-e7472337ed.entry.js +4 -0
- package/dist/design-system/p-e85c92ca1a.entry.js +4 -0
- package/dist/design-system/p-f0119fe693.entry.js +4 -0
- package/dist/design-system/p-f4958b9e97.entry.js +4 -0
- package/dist/design-system/p-f62643c33d.entry.js +4 -0
- package/dist/design-system/p-fa9568abce.entry.js +4 -0
- package/dist/design-system/p-fcd98f22b7.entry.js +4 -0
- package/dist/design-system/p-feeef4a8cb.entry.js +4 -0
- package/dist/design-system/{p-BLPSziW-.js → p-hLAmwHiq.js} +1 -1
- package/dist/design-system/p-ij4OEkzJ.js +4 -0
- package/dist/design-system/p-tl_BegdE.js +4 -0
- package/dist/esm/array-dJH4dfMr.js +1983 -0
- package/dist/esm/{breakpoints.decorator-L2xeP46f.js → breakpoints.decorator-DZ0xN4Np.js} +1 -1
- package/dist/esm/{breakpoints.subject-BhbzG-rl.js → breakpoints.subject-BNnXcKMw.js} +3 -3
- package/dist/esm/{button.interfaces-BkESlUMc.js → button.interfaces-BPGfTrrM.js} +1 -1
- package/dist/esm/carousel.interfaces-B-en4B17.js +8 -0
- package/dist/esm/{config.decorator-BQNIja4k.js → config.decorator-ZQ0_Zx5y.js} +1 -1
- package/dist/esm/{config.utils-COlKFRlV.js → config.utils-D9o7rffC.js} +1 -1
- package/dist/esm/create-validator-decorator-DovxquEu.js +208 -0
- package/dist/esm/design-system.js +4 -4
- package/dist/esm/{device-Dhwt3m7W.js → device-CRuIJzXR.js} +1 -1
- package/dist/esm/ds-accordion.entry.js +30 -34
- package/dist/esm/ds-alert-container.entry.js +12 -15
- package/dist/esm/ds-app.entry.js +16 -6
- package/dist/esm/ds-badge.entry.js +32 -25
- package/dist/esm/ds-button-group.entry.js +14 -17
- package/dist/esm/ds-button_2.entry.js +58 -73
- package/dist/esm/ds-card-actions.entry.js +6 -8
- package/dist/esm/ds-card-content.entry.js +2 -2
- package/dist/esm/ds-card-header.entry.js +8 -5
- package/dist/esm/ds-card-subtitle.entry.js +13 -13
- package/dist/esm/ds-card-title.entry.js +11 -7
- package/dist/esm/ds-card.entry.js +30 -42
- package/dist/esm/ds-carousel-item.entry.js +126 -0
- package/dist/esm/ds-carousel.entry.js +471 -0
- package/dist/esm/ds-checkbox-group.entry.js +40 -2011
- package/dist/esm/ds-checkbox.entry.js +23 -19
- package/dist/esm/ds-content_2.entry.js +327 -0
- package/dist/esm/ds-data-item.entry.js +144 -0
- package/dist/esm/ds-data-label.entry.js +39 -0
- package/dist/esm/ds-data-value.entry.js +29 -0
- package/dist/esm/ds-data.entry.js +41 -0
- package/dist/esm/ds-date.entry.js +5332 -0
- package/dist/esm/{ds-logo.entry.js → ds-divider_2.entry.js} +130 -26
- package/dist/esm/ds-drawer_2.entry.js +599 -0
- package/dist/esm/ds-file-upload.entry.js +513 -0
- package/dist/esm/ds-footer.entry.js +157 -0
- package/dist/esm/ds-heading.entry.js +21 -19
- package/dist/esm/ds-hint-text.entry.js +26 -0
- package/dist/esm/ds-hint-title.entry.js +29 -0
- package/dist/esm/ds-hint.entry.js +241 -0
- package/dist/esm/ds-icon_2.entry.js +78 -70
- package/dist/esm/ds-input.entry.js +46 -44
- package/dist/esm/ds-item.entry.js +29 -34
- package/dist/esm/ds-label.entry.js +22 -30
- package/dist/esm/ds-list.entry.js +6 -12
- package/dist/esm/ds-modal-body.entry.js +32 -0
- package/dist/esm/ds-modal-header.entry.js +29 -0
- package/dist/esm/ds-modal.entry.js +199 -0
- package/dist/esm/ds-navbar.entry.js +357 -0
- package/dist/esm/ds-notification.entry.js +19 -27
- package/dist/esm/ds-number-input.entry.js +129 -46
- package/dist/esm/ds-pagination.entry.js +41 -37
- package/dist/esm/ds-progress-bar.entry.js +25 -29
- package/dist/esm/ds-radio-group.entry.js +31 -30
- package/dist/esm/ds-radio.entry.js +25 -32
- package/dist/esm/ds-segment-item.entry.js +9 -9
- package/dist/esm/ds-segment.entry.js +28 -116
- package/dist/esm/ds-select-optgroup.entry.js +47 -0
- package/dist/esm/ds-select-option.entry.js +55 -0
- package/dist/esm/ds-select.entry.js +2770 -0
- package/dist/esm/ds-shape.entry.js +10 -16
- package/dist/esm/ds-snackbar.entry.js +40 -57
- package/dist/esm/ds-step-panel.entry.js +53 -0
- package/dist/esm/ds-step.entry.js +168 -0
- package/dist/esm/ds-steps.entry.js +225 -0
- package/dist/esm/ds-tab-panel.entry.js +53 -0
- package/dist/esm/ds-tab.entry.js +118 -0
- package/dist/esm/ds-tabs.entry.js +362 -0
- package/dist/esm/ds-tag-group.entry.js +3 -3
- package/dist/esm/ds-tag.entry.js +19 -26
- package/dist/esm/ds-text.entry.js +28 -32
- package/dist/esm/ds-textarea.entry.js +33 -32
- package/dist/esm/ds-toast.entry.js +40 -54
- package/dist/esm/ds-toggle.entry.js +22 -21
- package/dist/esm/ds-tooltip.entry.js +180 -0
- package/dist/esm/{field.util-BXxRO7CD.js → field.util-BjZzAi09.js} +1 -1
- package/dist/esm/floating-ui.dom-BqY0KzJC.js +1621 -0
- package/dist/esm/focus-ZxHImoOj.js +1956 -0
- package/dist/esm/footer.i18n-BrJFPhMA.js +159 -0
- package/dist/esm/{form-control-D2O-sb65.js → form-control-DvJo0GKN.js} +2 -2
- package/dist/esm/has-value-DU9L2JaI.js +10 -0
- package/dist/esm/{index-CuwLeg-T.js → index-C6MVahkC.js} +496 -175
- package/dist/esm/index.js +13 -8273
- package/dist/esm/{input.interfaces-C7EnKCpl.js → input.interfaces-BMM6Nxeh.js} +1 -1
- package/dist/esm/keyboard-Uy_dVz21.js +20 -0
- package/dist/esm/{listener-C_kjUVTE.js → listener-DHP2OPMZ.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/luxon-C1jqbZdf.js +8133 -0
- package/dist/esm/one-of-CKPv0Nqm.js +28 -0
- package/dist/esm/popup.interfaces-BAY6Z8bT.js +20 -0
- package/dist/esm/required-Dqsbx5fH.js +36 -0
- package/dist/esm/resize.decorator-B8h8D676.js +96 -0
- package/dist/esm/scroll-CsH7NHo5.js +87 -0
- package/dist/esm/svg-B8KVoKrH.js +2440 -0
- package/dist/esm/{tslib.es6-tdchDLyb.js → tslib.es6-C9GKXw-5.js} +1 -1
- package/dist/esm/type-DzkhLOG_.js +31 -0
- package/dist/types/components/accordion/accordion.d.ts +0 -5
- package/dist/types/components/alert/alert-container.d.ts +0 -5
- package/dist/types/components/alert/snackbar/snackbar.d.ts +0 -5
- package/dist/types/components/alert/toast/toast.d.ts +0 -5
- package/dist/types/components/badge/badge.d.ts +1 -3
- package/dist/types/components/badge/badge.interfaces.d.ts +1 -1
- package/dist/types/components/button/button-group/button-group.d.ts +0 -5
- package/dist/types/components/button/button.d.ts +1 -3
- package/dist/types/components/button/button.interfaces.d.ts +1 -1
- package/dist/types/components/card/card-actions/card-actions.d.ts +0 -1
- package/dist/types/components/card/card-subtitle/card-subtitle.d.ts +0 -1
- package/dist/types/components/card/card.d.ts +1 -3
- package/dist/types/components/carousel/carousel/carousel.d.ts +114 -0
- package/dist/types/components/carousel/carousel/carousel.i18n.d.ts +9 -0
- package/dist/types/components/carousel/carousel-item/carousel-item.d.ts +70 -0
- package/dist/types/components/carousel/carousel.interfaces.d.ts +14 -0
- package/dist/types/components/carousel/test/carousel.a11y.play.d.ts +1 -0
- package/dist/types/components/carousel/test/carousel.component.play.d.ts +1 -0
- package/dist/types/components/carousel/test/carousel.visual.play.d.ts +1 -0
- package/dist/types/components/close/close.d.ts +1 -3
- package/dist/types/components/content/content.d.ts +2 -5
- package/dist/types/components/data/data-item.d.ts +43 -0
- package/dist/types/components/data/data-item.i18n.d.ts +6 -0
- package/dist/types/components/data/data-item.interfaces.d.ts +4 -0
- package/dist/types/components/data/data-label.d.ts +19 -0
- package/dist/types/components/data/data-label.interfaces.d.ts +3 -0
- package/dist/types/components/data/data-value.d.ts +15 -0
- package/dist/types/components/data/data-value.interfaces.d.ts +5 -0
- package/dist/types/components/data/data.d.ts +19 -0
- package/dist/types/components/data/data.interfaces.d.ts +4 -0
- package/dist/types/components/data/test/data.a11y.play.d.ts +1 -0
- package/dist/types/components/data/test/data.component.play.d.ts +1 -0
- package/dist/types/components/data/test/data.visual.play.d.ts +1 -0
- package/dist/types/components/date/date.d.ts +214 -0
- package/dist/types/components/date/date.i18n.d.ts +13 -0
- package/dist/types/components/date/date.interfaces.d.ts +18 -0
- package/dist/types/components/date/date.mask.d.ts +29 -0
- package/dist/types/components/date/date.picker.d.ts +67 -0
- package/dist/types/components/date/test/date.a11y.play.d.ts +1 -0
- package/dist/types/components/date/test/date.component.play.d.ts +1 -0
- package/dist/types/components/date/test/date.visual.play.d.ts +1 -0
- package/dist/types/components/divider/divider.d.ts +1 -3
- package/dist/types/components/drawer/drawer.d.ts +102 -0
- package/dist/types/components/drawer/drawer.interfaces.d.ts +8 -0
- package/dist/types/components/drawer/test/drawer.a11y.play.d.ts +1 -0
- package/dist/types/components/drawer/test/drawer.component.play.d.ts +1 -0
- package/dist/types/components/drawer/test/drawer.visual.play.d.ts +1 -0
- package/dist/types/components/file-upload/file-upload.d.ts +192 -0
- package/dist/types/components/file-upload/file-upload.i18n.d.ts +8 -0
- package/dist/types/components/file-upload/file-upload.interfaces.d.ts +24 -0
- package/dist/types/components/file-upload/test/file-upload.a11y.play.d.ts +1 -0
- package/dist/types/components/file-upload/test/file-upload.component.play.d.ts +1 -0
- package/dist/types/components/file-upload/test/file-upload.visual.play.d.ts +1 -0
- package/dist/types/components/file-upload/utils/file-list.util.d.ts +2 -0
- package/dist/types/components/file-upload/utils/file-size.util.d.ts +1 -0
- package/dist/types/components/file-upload/utils/file-validation.util.d.ts +13 -0
- package/dist/types/components/footer/footer.d.ts +68 -0
- package/dist/types/components/footer/footer.i18n.d.ts +7 -0
- package/dist/types/components/footer/footer.interfaces.d.ts +19 -0
- package/dist/types/components/footer/test/footer.a11y.play.d.ts +1 -0
- package/dist/types/components/footer/test/footer.component.play.d.ts +1 -0
- package/dist/types/components/footer/test/footer.visual.play.d.ts +1 -0
- package/dist/types/components/hint/hint-text/hint-text.d.ts +15 -0
- package/dist/types/components/hint/hint-title/hint-title.d.ts +16 -0
- package/dist/types/components/hint/hint.d.ts +87 -0
- package/dist/types/components/hint/hint.i18n.d.ts +6 -0
- package/dist/types/components/hint/hint.interfaces.d.ts +4 -0
- package/dist/types/components/hint/test/hint.a11y.play.d.ts +1 -0
- package/dist/types/components/hint/test/hint.component.play.d.ts +1 -0
- package/dist/types/components/hint/test/hint.visual.play.d.ts +1 -0
- package/dist/types/components/icon/icon.d.ts +7 -3
- package/dist/types/components/icon/icon.interfaces.d.ts +1 -1
- package/dist/types/components/input/clear-button.i18n.d.ts +6 -0
- package/dist/types/components/input/clear-button.util.d.ts +10 -0
- package/dist/types/components/input/trigger-button.i18n.d.ts +7 -0
- package/dist/types/components/label/label.d.ts +3 -5
- package/dist/types/components/list/item/item.d.ts +0 -5
- package/dist/types/components/list/item/item.interfaces.d.ts +1 -1
- package/dist/types/components/list/list.d.ts +0 -5
- package/dist/types/components/list/test/list.visual.play.d.ts +1 -0
- package/dist/types/components/logo/logo.d.ts +1 -2
- package/dist/types/components/modal/modal-body/modal-body.d.ts +15 -0
- package/dist/types/components/modal/modal-header/modal-header.d.ts +17 -0
- package/dist/types/components/modal/modal.controller.d.ts +3 -0
- package/dist/types/components/modal/modal.d.ts +97 -0
- package/dist/types/components/modal/modal.interfaces.d.ts +15 -0
- package/dist/types/components/modal/test/modal.a11y.play.d.ts +1 -0
- package/dist/types/components/modal/test/modal.component.play.d.ts +1 -0
- package/dist/types/components/modal/test/modal.visual.play.d.ts +1 -0
- package/dist/types/components/navbar/navbar.d.ts +128 -0
- package/dist/types/components/navbar/navbar.i18n.d.ts +9 -0
- package/dist/types/components/navbar/navbar.interfaces.d.ts +10 -0
- package/dist/types/components/navbar/test/navbar.a11y.play.d.ts +1 -0
- package/dist/types/components/navbar/test/navbar.component.play.d.ts +1 -0
- package/dist/types/components/navbar/test/navbar.visual.play.d.ts +1 -0
- package/dist/types/components/notification/notification.d.ts +1 -3
- package/dist/types/components/pagination/pagination.d.ts +0 -5
- package/dist/types/components/popup/popup.d.ts +152 -0
- package/dist/types/components/popup/popup.interfaces.d.ts +14 -0
- package/dist/types/components/popup/test/popup.a11y.play.d.ts +1 -0
- package/dist/types/components/popup/test/popup.component.play.d.ts +1 -0
- package/dist/types/components/popup/test/popup.visual.play.d.ts +1 -0
- package/dist/types/components/progress-bar/progress-bar.d.ts +0 -5
- package/dist/types/components/select/select-optgroup.d.ts +28 -0
- package/dist/types/components/select/select-option.d.ts +34 -0
- package/dist/types/components/select/select.d.ts +193 -0
- package/dist/types/components/select/select.i18n.d.ts +7 -0
- package/dist/types/components/select/select.interfaces.d.ts +16 -0
- package/dist/types/components/select/select.picker.d.ts +57 -0
- package/dist/types/components/select/test/select.a11y.play.d.ts +1 -0
- package/dist/types/components/select/test/select.component.play.d.ts +1 -0
- package/dist/types/components/select/test/select.visual.play.d.ts +1 -0
- package/dist/types/components/shape/shape.d.ts +2 -7
- package/dist/types/components/spinner/spinner.d.ts +0 -2
- package/dist/types/components/stack/stack.d.ts +7 -19
- package/dist/types/components/steps/step/step.d.ts +89 -0
- package/dist/types/components/steps/step-panel/step-panel.d.ts +34 -0
- package/dist/types/components/steps/steps/steps.d.ts +77 -0
- package/dist/types/components/steps/steps.interfaces.d.ts +10 -0
- package/dist/types/components/steps/test/steps.a11y.play.d.ts +1 -0
- package/dist/types/components/steps/test/steps.component.play.d.ts +1 -0
- package/dist/types/components/steps/test/steps.visual.play.d.ts +1 -0
- package/dist/types/components/tabs/tab/tab.d.ts +67 -0
- package/dist/types/components/tabs/tab-panel/tab-panel.d.ts +34 -0
- package/dist/types/components/tabs/tabs/tabs.d.ts +97 -0
- package/dist/types/components/tabs/tabs/tabs.i18n.d.ts +7 -0
- package/dist/types/components/tabs/tabs.interfaces.d.ts +12 -0
- package/dist/types/components/tabs/test/tabs.a11y.play.d.ts +1 -0
- package/dist/types/components/tabs/test/tabs.component.play.d.ts +1 -0
- package/dist/types/components/tabs/test/tabs.visual.play.d.ts +1 -0
- package/dist/types/components/tag/tag.d.ts +1 -3
- package/dist/types/components/text/text.d.ts +2 -7
- package/dist/types/components/time-input/test/time-input.visual.play.d.ts +1 -0
- package/dist/types/components/tooltip/test/tooltip.a11y.play.d.ts +1 -0
- package/dist/types/components/tooltip/test/tooltip.component.play.d.ts +1 -0
- package/dist/types/components/tooltip/test/tooltip.visual.play.d.ts +1 -0
- package/dist/types/components/tooltip/tooltip.d.ts +85 -0
- package/dist/types/components/tooltip/tooltip.interfaces.d.ts +10 -0
- package/dist/types/components.d.ts +4913 -1926
- package/dist/types/foundation/colors.visual.play.d.ts +1 -0
- package/dist/types/global/config/config.const.d.ts +3 -0
- package/dist/types/global/config/config.default.d.ts +0 -40
- package/dist/types/global/config/config.meta.d.ts +2 -0
- package/dist/types/global/config/config.types.d.ts +27 -0
- package/dist/types/global/config/index.d.ts +1 -0
- package/dist/types/global/index.d.ts +0 -1
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/carousel.po.d.ts +12 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/data-item.po.d.ts +16 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/data.po.d.ts +12 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/date.po.d.ts +15 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/drawer.po.d.ts +11 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/file-upload.po.d.ts +16 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/footer.po.d.ts +16 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/hint.po.d.ts +10 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/index.d.ts +15 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/modal.po.d.ts +15 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/navbar.po.d.ts +13 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/popup.po.d.ts +11 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/select.po.d.ts +24 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/steps.po.d.ts +13 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/tabs.po.d.ts +13 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/tooltip.po.d.ts +6 -0
- package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/page/utils/goto.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/attributes.d.ts +0 -8
- package/dist/types/utils/focus.d.ts +18 -0
- package/dist/types/utils/form-control.d.ts +2 -2
- package/dist/types/utils/has-value.d.ts +1 -0
- package/dist/types/utils/index.d.ts +7 -5
- package/dist/types/utils/number.d.ts +0 -3
- package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
- package/dist/types/utils/property-decorators/bound.d.ts +36 -0
- package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +48 -0
- package/dist/types/utils/property-decorators/date.d.ts +6 -0
- package/dist/types/utils/property-decorators/index.d.ts +9 -0
- package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
- package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
- package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
- package/dist/types/utils/property-decorators/required.d.ts +17 -0
- package/dist/types/utils/property-decorators/type.d.ts +9 -0
- package/dist/types/utils/property-decorators/url.d.ts +6 -0
- package/dist/types/utils/svg.d.ts +2 -0
- package/docs/cem.json +17659 -0
- package/docs/components.json +38767 -17409
- package/docs/html.html-data.json +1529 -147
- package/docs/tags.json +29 -1
- package/package.json +45 -38
- package/sbom.cdx.json +54391 -0
- package/README.md +0 -33
- package/components/p-82RSSk25.js +0 -4
- package/components/p-BEngECpF.js +0 -4
- package/components/p-BMBthpLd.js +0 -4
- package/components/p-BNY3JzuV.js +0 -4
- package/components/p-BOTkpyFe.js +0 -5
- package/components/p-BOgMmRCt.js +0 -4
- package/components/p-CDYlUuhB.js +0 -4
- package/components/p-Cb75Rr6o.js +0 -4
- package/components/p-CojUmpFm.js +0 -4
- package/components/p-DHeVI6dR.js +0 -4
- package/components/p-DTPbL3uY.js +0 -4
- package/components/p-DnnGnukM.js +0 -4
- package/components/p-DtuTnY5l.js +0 -4
- package/components/p-JZ1uDtZv.js +0 -4
- package/components/p-cSbDziZm.js +0 -4
- package/components/p-gA-94RPS.js +0 -4
- package/components/p-xDEngwqW.js +0 -4
- package/dist/cjs/contact-SPfz2A_q.js +0 -1647
- package/dist/cjs/ds-content.cjs.entry.js +0 -154
- package/dist/cjs/ds-divider.cjs.entry.js +0 -131
- package/dist/cjs/ds-stack.cjs.entry.js +0 -224
- package/dist/cjs/isEmpty-BmKp4bH4.js +0 -99
- package/dist/cjs/stack.interfaces-6vlKvBmb.js +0 -68
- package/dist/cjs/svg-D7Mwbcvp.js +0 -1482
- package/dist/cjs/validate.decorator-C9-9HA0Y.js +0 -115
- package/dist/collection/global/constants/icons.constant.js +0 -42
- package/dist/collection/utils/element-states/element-states.decorator.js +0 -23
- package/dist/collection/utils/element-states/element-states.listener.js +0 -55
- package/dist/collection/utils/element-states/element-states.subject.js +0 -24
- package/dist/collection/utils/element-states/index.js +0 -5
- package/dist/collection/utils/keyboard/index.js +0 -6
- package/dist/collection/utils/keyboard/keyboard.decorator.js +0 -23
- package/dist/collection/utils/keyboard/keyboard.listener.js +0 -34
- package/dist/collection/utils/keyboard/keyboard.subject.js +0 -24
- package/dist/collection/utils/property-checkers/check-array-of.js +0 -13
- package/dist/collection/utils/property-checkers/check-date.js +0 -18
- package/dist/collection/utils/property-checkers/check-iso-date.js +0 -14
- package/dist/collection/utils/property-checkers/check-one-of.js +0 -13
- package/dist/collection/utils/property-checkers/check-pattern.js +0 -13
- package/dist/collection/utils/property-checkers/check-type.js +0 -20
- package/dist/collection/utils/property-checkers/check-url.js +0 -20
- package/dist/collection/utils/property-checkers/empty-or.js +0 -15
- package/dist/collection/utils/property-checkers/index.js +0 -57
- package/dist/collection/utils/property-checkers/required-and.js +0 -20
- package/dist/collection/utils/swipe/index.js +0 -6
- package/dist/collection/utils/swipe/swipe.decorator.js +0 -23
- package/dist/collection/utils/swipe/swipe.listener.js +0 -33
- package/dist/collection/utils/swipe/swipe.subject.js +0 -28
- package/dist/collection/utils/validate.decorator.js +0 -203
- package/dist/design-system/p-03bbcdf9de.entry.js +0 -4
- package/dist/design-system/p-1154323457.entry.js +0 -4
- package/dist/design-system/p-1f0601a4f4.entry.js +0 -4
- package/dist/design-system/p-21b080a49a.entry.js +0 -4
- package/dist/design-system/p-27c34c4e5f.entry.js +0 -4
- package/dist/design-system/p-2b91de302f.entry.js +0 -4
- package/dist/design-system/p-31c1235ac5.entry.js +0 -4
- package/dist/design-system/p-3259acaa64.entry.js +0 -4
- package/dist/design-system/p-339d85cca0.entry.js +0 -4
- package/dist/design-system/p-35e63b52e7.entry.js +0 -4
- package/dist/design-system/p-363f3a7ab4.entry.js +0 -4
- package/dist/design-system/p-3d901720f7.entry.js +0 -4
- package/dist/design-system/p-40ba8b9812.entry.js +0 -4
- package/dist/design-system/p-432430e14f.entry.js +0 -4
- package/dist/design-system/p-487807f228.entry.js +0 -4
- package/dist/design-system/p-4a049d1b7f.entry.js +0 -4
- package/dist/design-system/p-4f4cce8ce4.entry.js +0 -4
- package/dist/design-system/p-5a901a9b8e.entry.js +0 -4
- package/dist/design-system/p-5d3330bf93.entry.js +0 -4
- package/dist/design-system/p-640223834c.entry.js +0 -4
- package/dist/design-system/p-6b9aab417f.entry.js +0 -4
- package/dist/design-system/p-799705af3a.entry.js +0 -4
- package/dist/design-system/p-82RSSk25.js +0 -4
- package/dist/design-system/p-8e0872fef0.entry.js +0 -4
- package/dist/design-system/p-9617d56181.entry.js +0 -4
- package/dist/design-system/p-BaIoYrFa.js +0 -5
- package/dist/design-system/p-Cb75Rr6o.js +0 -4
- package/dist/design-system/p-CqZ6YSy9.js +0 -4
- package/dist/design-system/p-CqzM3doy.js +0 -4
- package/dist/design-system/p-CuwLeg-T.js +0 -5
- package/dist/design-system/p-DTPbL3uY.js +0 -4
- package/dist/design-system/p-aff68865ee.entry.js +0 -4
- package/dist/design-system/p-b3c6327744.entry.js +0 -4
- package/dist/design-system/p-be9023a38b.entry.js +0 -4
- package/dist/design-system/p-c031d1dce5.entry.js +0 -4
- package/dist/design-system/p-c3ae96e220.entry.js +0 -4
- package/dist/design-system/p-d430812a57.entry.js +0 -4
- package/dist/design-system/p-de1354f022.entry.js +0 -4
- package/dist/design-system/p-e3d0c82e2a.entry.js +0 -4
- package/dist/design-system/p-ea1a5e1f75.entry.js +0 -4
- package/dist/design-system/p-ea7169501c.entry.js +0 -4
- package/dist/design-system/p-eab397e041.entry.js +0 -4
- package/dist/design-system/p-ecba4deb9a.entry.js +0 -4
- package/dist/design-system/p-fe0dbd4b03.entry.js +0 -4
- package/dist/design-system/p-ng5ZzTOj.js +0 -4
- package/dist/esm/contact-Cb75Rr6o.js +0 -1636
- package/dist/esm/ds-content.entry.js +0 -152
- package/dist/esm/ds-divider.entry.js +0 -129
- package/dist/esm/ds-stack.entry.js +0 -222
- package/dist/esm/isEmpty-DmZYZqE9.js +0 -97
- package/dist/esm/stack.interfaces-ng5ZzTOj.js +0 -62
- package/dist/esm/svg-BaIoYrFa.js +0 -1480
- package/dist/esm/validate.decorator-82RSSk25.js +0 -110
- package/dist/types/global/constants/icons.constant.d.ts +0 -38
- package/dist/types/utils/element-states/element-states.decorator.d.ts +0 -3
- package/dist/types/utils/element-states/element-states.interfaces.d.ts +0 -10
- package/dist/types/utils/element-states/element-states.listener.d.ts +0 -15
- package/dist/types/utils/element-states/element-states.subject.d.ts +0 -8
- package/dist/types/utils/element-states/index.d.ts +0 -2
- package/dist/types/utils/keyboard/index.d.ts +0 -3
- package/dist/types/utils/keyboard/keyboard.decorator.d.ts +0 -3
- package/dist/types/utils/keyboard/keyboard.interfaces.d.ts +0 -8
- package/dist/types/utils/keyboard/keyboard.listener.d.ts +0 -9
- package/dist/types/utils/keyboard/keyboard.subject.d.ts +0 -8
- package/dist/types/utils/property-checkers/check-array-of.d.ts +0 -2
- package/dist/types/utils/property-checkers/check-date.d.ts +0 -1
- package/dist/types/utils/property-checkers/check-iso-date.d.ts +0 -1
- package/dist/types/utils/property-checkers/check-one-of.d.ts +0 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +0 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +0 -2
- package/dist/types/utils/property-checkers/check-url.d.ts +0 -1
- package/dist/types/utils/property-checkers/constants.d.ts +0 -1
- package/dist/types/utils/property-checkers/empty-or.d.ts +0 -1
- package/dist/types/utils/property-checkers/index.d.ts +0 -19
- package/dist/types/utils/property-checkers/required-and.d.ts +0 -1
- package/dist/types/utils/swipe/index.d.ts +0 -3
- package/dist/types/utils/swipe/swipe.decorator.d.ts +0 -5
- package/dist/types/utils/swipe/swipe.interfaces.d.ts +0 -10
- package/dist/types/utils/swipe/swipe.listener.d.ts +0 -10
- package/dist/types/utils/swipe/swipe.subject.d.ts +0 -11
- package/dist/types/utils/validate.decorator.d.ts +0 -114
- /package/dist/collection/{utils/element-states/element-states.interfaces.js → components/data/data-item.interfaces.js} +0 -0
- /package/dist/collection/{utils/keyboard/keyboard.interfaces.js → components/data/data-label.interfaces.js} +0 -0
- /package/dist/collection/{utils/property-checkers/property-types.js → components/data/data-value.interfaces.js} +0 -0
- /package/dist/collection/{utils/swipe/swipe.interfaces.js → components/data/data.interfaces.js} +0 -0
- /package/dist/collection/utils/{property-checkers/is-iso-date.js → is-iso-date.js} +0 -0
- /package/dist/collection/utils/{keyboard/keyboard.helpers.js → keyboard.js} +0 -0
- /package/dist/types/utils/{property-checkers/is-iso-date.d.ts → is-iso-date.d.ts} +0 -0
- /package/dist/types/utils/{property-checkers/is-value-empty.d.ts → is-value-empty.d.ts} +0 -0
- /package/dist/types/utils/{keyboard/keyboard.helpers.d.ts → keyboard.d.ts} +0 -0
- /package/dist/types/utils/{property-checkers/property-types.d.ts → property-types.d.ts} +0 -0
|
@@ -0,0 +1,2772 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Helvetia Design System https://design.baloise.dev/ - Apache License 2.0
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
var index = require('./index-sC3JnTlJ.js');
|
|
7
|
+
var tslib_es6 = require('./tslib.es6-CxyosZMg.js');
|
|
8
|
+
var attributes = require('./attributes-D57TMQsY.js');
|
|
9
|
+
var formControl = require('./form-control-CtMcJUuC.js');
|
|
10
|
+
var field_util = require('./field.util-L-DkeMVk.js');
|
|
11
|
+
var input_interfaces = require('./input.interfaces-YapUUaRx.js');
|
|
12
|
+
var type = require('./type-hmc4CJcO.js');
|
|
13
|
+
var oneOf = require('./one-of-BZGRIMtQ.js');
|
|
14
|
+
var config_decorator = require('./config.decorator-ThGLtT-3.js');
|
|
15
|
+
require('./aria-C3Tx6AHY.js');
|
|
16
|
+
require('./label.i18n-C00ZY0P9.js');
|
|
17
|
+
require('./create-validator-decorator-BIgFqrMJ.js');
|
|
18
|
+
require('./config.utils-MhZvq4Qm.js');
|
|
19
|
+
|
|
20
|
+
//#region src/slim-select/classes.ts
|
|
21
|
+
var e = class {
|
|
22
|
+
main;
|
|
23
|
+
placeholder;
|
|
24
|
+
values;
|
|
25
|
+
single;
|
|
26
|
+
multiString;
|
|
27
|
+
max;
|
|
28
|
+
value;
|
|
29
|
+
valueText;
|
|
30
|
+
valueDelete;
|
|
31
|
+
valueOut;
|
|
32
|
+
deselect;
|
|
33
|
+
deselectPath;
|
|
34
|
+
arrow;
|
|
35
|
+
arrowClose;
|
|
36
|
+
arrowOpen;
|
|
37
|
+
content;
|
|
38
|
+
contentOpen;
|
|
39
|
+
dirAbove;
|
|
40
|
+
dirBelow;
|
|
41
|
+
search;
|
|
42
|
+
searchHighlighter;
|
|
43
|
+
searching;
|
|
44
|
+
status;
|
|
45
|
+
addable;
|
|
46
|
+
addablePath;
|
|
47
|
+
list;
|
|
48
|
+
optgroup;
|
|
49
|
+
optgroupLabel;
|
|
50
|
+
optgroupLabelText;
|
|
51
|
+
optgroupActions;
|
|
52
|
+
optgroupSelectAll;
|
|
53
|
+
optgroupSelectAllBox;
|
|
54
|
+
optgroupSelectAllCheck;
|
|
55
|
+
optgroupClosable;
|
|
56
|
+
option;
|
|
57
|
+
optionDelete;
|
|
58
|
+
highlighted;
|
|
59
|
+
modalOverlay;
|
|
60
|
+
modalDialog;
|
|
61
|
+
modalTitle;
|
|
62
|
+
modalClose;
|
|
63
|
+
modalContent;
|
|
64
|
+
mainOpen;
|
|
65
|
+
close;
|
|
66
|
+
selected;
|
|
67
|
+
error;
|
|
68
|
+
disabled;
|
|
69
|
+
hide;
|
|
70
|
+
constructor(e) {
|
|
71
|
+
e ||= {};
|
|
72
|
+
let t = (e = "", t = "") => `${e} ${t}`.trim();
|
|
73
|
+
this.main = t("ss-main", e.main), this.placeholder = t("ss-placeholder", e.placeholder), this.values = t("ss-values", e.values), this.single = t("ss-single", e.single), this.multiString = t("ss-multi-string", e.multiString), this.max = t("ss-max", e.max), this.value = t("ss-value", e.value), this.valueText = t("ss-value-text", e.valueText), this.valueDelete = t("ss-value-delete", e.valueDelete), this.valueOut = t("ss-value-out", e.valueOut), this.deselect = t("ss-deselect", e.deselect), this.deselectPath = e.deselectPath || "M10,10 L90,90 M10,90 L90,10", this.arrow = t("ss-arrow", e.arrow), this.arrowClose = e.arrowClose || "M10,30 L50,70 L90,30", this.arrowOpen = e.arrowOpen || "M10,70 L50,30 L90,70", this.content = t("ss-content", e.content), this.contentOpen = t("ss-open", e.contentOpen), this.dirAbove = t("ss-dir-above", e.dirAbove), this.dirBelow = t("ss-dir-below", e.dirBelow), this.search = t("ss-search", e.search), this.searchHighlighter = t("ss-search-highlight", e.searchHighlighter), this.searching = t("ss-searching", e.searching), this.status = t("ss-status", e.status), this.addable = t("ss-addable", e.addable), this.addablePath = e.addablePath || "M50,10 L50,90 M10,50 L90,50", this.list = t("ss-list", e.list), this.optgroup = t("ss-optgroup", e.optgroup), this.optgroupLabel = t("ss-optgroup-label", e.optgroupLabel), this.optgroupLabelText = t("ss-optgroup-label-text", e.optgroupLabelText), this.optgroupActions = t("ss-optgroup-actions", e.optgroupActions), this.optgroupSelectAll = t("ss-selectall", e.optgroupSelectAll), this.optgroupSelectAllBox = e.optgroupSelectAllBox || "M60,10 L10,10 L10,90 L90,90 L90,50", this.optgroupSelectAllCheck = e.optgroupSelectAllCheck || "M30,45 L50,70 L90,10", this.optgroupClosable = t("ss-closable", e.optgroupClosable), this.option = t("ss-option", e.option), this.optionDelete = e.optionDelete || "M10,10 L90,90 M10,90 L90,10", this.highlighted = t("ss-highlighted", e.highlighted), this.modalOverlay = t("ss-modal-overlay", e.modalOverlay), this.modalDialog = t("ss-modal-dialog", e.modalDialog), this.modalTitle = t("ss-modal-title", e.modalTitle), this.modalClose = t("ss-modal-close", e.modalClose), this.modalContent = t("ss-modal-content", e.modalContent), this.mainOpen = t("ss-open", e.mainOpen), this.close = t("ss-close", e.close), this.selected = t("ss-selected", e.selected), this.error = t("ss-error", e.error), this.disabled = t("ss-disabled", e.disabled), this.hide = t("ss-hide", e.hide);
|
|
74
|
+
}
|
|
75
|
+
getFirst(e) {
|
|
76
|
+
return this[e].split(" ")[0];
|
|
77
|
+
}
|
|
78
|
+
}, t = 200, n = ["transform", "opacity"];
|
|
79
|
+
function r(e, n = t) {
|
|
80
|
+
let r = e.trim();
|
|
81
|
+
if (!r) return n;
|
|
82
|
+
if (r.endsWith("ms")) {
|
|
83
|
+
let e = parseFloat(r);
|
|
84
|
+
return Number.isNaN(e) ? n : e;
|
|
85
|
+
}
|
|
86
|
+
if (r.endsWith("s")) {
|
|
87
|
+
let e = parseFloat(r);
|
|
88
|
+
return Number.isNaN(e) ? n : e * 1e3;
|
|
89
|
+
}
|
|
90
|
+
let i = parseFloat(r);
|
|
91
|
+
return Number.isNaN(i) ? n : i;
|
|
92
|
+
}
|
|
93
|
+
function i(e, n = t) {
|
|
94
|
+
return r(getComputedStyle(e).getPropertyValue("--ss-animation-timing").trim(), n);
|
|
95
|
+
}
|
|
96
|
+
function a(e, n, r = t) {
|
|
97
|
+
let a = i(e, r) + 50;
|
|
98
|
+
return n === void 0 ? a : Math.max(a, n);
|
|
99
|
+
}
|
|
100
|
+
function o() {
|
|
101
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? false : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
102
|
+
}
|
|
103
|
+
function s(e) {
|
|
104
|
+
return e === void 0 ? null : new Set(Array.isArray(e) ? e : [e]);
|
|
105
|
+
}
|
|
106
|
+
function c(e, n, r = t, i) {
|
|
107
|
+
if (o() || i?.aborted) return Promise.resolve();
|
|
108
|
+
let a = s(n);
|
|
109
|
+
return new Promise((t) => {
|
|
110
|
+
let n = null, o = false, s = () => {
|
|
111
|
+
o || (o = true, e.removeEventListener("transitionend", l), i?.removeEventListener("abort", c), n && clearTimeout(n), t());
|
|
112
|
+
}, c = () => s(), l = (t) => {
|
|
113
|
+
t.target === e && (a && (!a.has(t.propertyName) || (a.delete(t.propertyName), a.size > 0)) || s());
|
|
114
|
+
};
|
|
115
|
+
i?.addEventListener("abort", c, { once: true }), e.addEventListener("transitionend", l), n = setTimeout(s, r);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function l(e, n, r = t, i) {
|
|
119
|
+
return o() || i?.aborted ? Promise.resolve() : new Promise((t) => {
|
|
120
|
+
let a = null, o = false, s = () => {
|
|
121
|
+
o || (o = true, e.removeEventListener("animationend", l), a && clearTimeout(a), t());
|
|
122
|
+
}, l = (t) => {
|
|
123
|
+
t.target === e && (t.animationName !== n || s());
|
|
124
|
+
};
|
|
125
|
+
e.addEventListener("animationend", l), a = setTimeout(s, r);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/slim-select/settings.ts
|
|
130
|
+
var d = class {
|
|
131
|
+
id = "";
|
|
132
|
+
style = "";
|
|
133
|
+
class = [];
|
|
134
|
+
isMultiple = false;
|
|
135
|
+
isOpen = false;
|
|
136
|
+
isFullOpen = false;
|
|
137
|
+
disabled;
|
|
138
|
+
alwaysOpen;
|
|
139
|
+
showSearch;
|
|
140
|
+
focusSearch;
|
|
141
|
+
keepSearch;
|
|
142
|
+
ariaLabel;
|
|
143
|
+
searchPlaceholder;
|
|
144
|
+
searchText;
|
|
145
|
+
searchingText;
|
|
146
|
+
resultsText;
|
|
147
|
+
deselectText;
|
|
148
|
+
removeText;
|
|
149
|
+
searchHighlight;
|
|
150
|
+
closeOnSelect;
|
|
151
|
+
contentLocation;
|
|
152
|
+
contentPosition;
|
|
153
|
+
contentWidth;
|
|
154
|
+
openPosition;
|
|
155
|
+
placeholderText;
|
|
156
|
+
allowDeselect;
|
|
157
|
+
hideSelected;
|
|
158
|
+
multiString;
|
|
159
|
+
keepOrder;
|
|
160
|
+
showOptionTooltips;
|
|
161
|
+
minSelected;
|
|
162
|
+
maxSelected;
|
|
163
|
+
timeoutDelay;
|
|
164
|
+
maxValuesShown;
|
|
165
|
+
maxValuesMessage;
|
|
166
|
+
addableText;
|
|
167
|
+
modal;
|
|
168
|
+
modalTitle;
|
|
169
|
+
constructor(e) {
|
|
170
|
+
e ||= {}, this.id = "ss-" + h(), this.style = e.style || "", this.class = e.class || [], this.disabled = e.disabled !== void 0 && e.disabled, this.alwaysOpen = e.alwaysOpen !== void 0 && e.alwaysOpen, this.showSearch = e.showSearch === void 0 || e.showSearch, this.focusSearch = e.focusSearch === void 0 || e.focusSearch, this.keepSearch = e.keepSearch !== void 0 && e.keepSearch, this.ariaLabel = e.ariaLabel || "Combobox", this.searchPlaceholder = e.searchPlaceholder || "Search...", this.searchText = e.searchText || "No Results", this.searchingText = e.searchingText || "Searching...", this.resultsText = e.resultsText || "{count} results available", this.deselectText = e.deselectText || "Clear", this.removeText = e.removeText || "Remove", this.searchHighlight = e.searchHighlight !== void 0 && e.searchHighlight, this.closeOnSelect = e.closeOnSelect === void 0 || e.closeOnSelect, this.contentLocation = e.contentLocation || document.body, this.contentPosition = e.contentPosition || "absolute", this.contentWidth = e.contentWidth || "", this.openPosition = e.openPosition || "auto", this.placeholderText = e.placeholderText === void 0 ? "Select Value" : e.placeholderText, this.allowDeselect = e.allowDeselect !== void 0 && e.allowDeselect, this.hideSelected = e.hideSelected !== void 0 && e.hideSelected, this.multiString = e.multiString !== void 0 && e.multiString, this.keepOrder = e.keepOrder !== void 0 && e.keepOrder, this.showOptionTooltips = e.showOptionTooltips !== void 0 && e.showOptionTooltips, this.minSelected = e.minSelected || 0, this.maxSelected = e.maxSelected || 1e3, this.timeoutDelay = e.timeoutDelay || 200, this.maxValuesShown = e.maxValuesShown || 20, this.maxValuesMessage = e.maxValuesMessage || "{number} selected", this.addableText = e.addableText || "Press \"Enter\" to add {value}", this.modal = e.modal || "mobile", this.modalTitle = e.modalTitle || "";
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/slim-select/helpers.ts
|
|
175
|
+
function f(e) {
|
|
176
|
+
if (!e) return {};
|
|
177
|
+
let t = {};
|
|
178
|
+
for (let n of Object.keys(e)) {
|
|
179
|
+
let r = e[n];
|
|
180
|
+
r !== void 0 && (t[n] = r);
|
|
181
|
+
}
|
|
182
|
+
return t;
|
|
183
|
+
}
|
|
184
|
+
function p(e) {
|
|
185
|
+
let t = e.cloneNode(true);
|
|
186
|
+
return t.querySelectorAll("select, option, optgroup, textarea, input, button").forEach((e) => e.remove()), t.textContent?.replace(/\s+/g, " ").trim() || "";
|
|
187
|
+
}
|
|
188
|
+
function m(e) {
|
|
189
|
+
if (e.labels && e.labels.length > 0) {
|
|
190
|
+
let t = Array.from(e.labels).map(p).filter(Boolean);
|
|
191
|
+
if (t.length > 0) return [...new Set(t)].join(" ");
|
|
192
|
+
}
|
|
193
|
+
return e.getAttribute("aria-label")?.trim() || "";
|
|
194
|
+
}
|
|
195
|
+
function h() {
|
|
196
|
+
return Math.random().toString(36).substring(2, 10);
|
|
197
|
+
}
|
|
198
|
+
function g(e, t) {
|
|
199
|
+
function n(e, n) {
|
|
200
|
+
return n && e && e.classList && e.classList.contains(n) || n && e && e.dataset && e.dataset.id && e.dataset.id === t ? e : null;
|
|
201
|
+
}
|
|
202
|
+
function r(e, t) {
|
|
203
|
+
return !e || e === document ? null : n(e, t) ? e : r(e.parentNode, t);
|
|
204
|
+
}
|
|
205
|
+
return n(e, t) || r(e, t);
|
|
206
|
+
}
|
|
207
|
+
function _(e, t = 50, n = false) {
|
|
208
|
+
let r;
|
|
209
|
+
return function(...i) {
|
|
210
|
+
let a = self, o = () => {
|
|
211
|
+
r = null, n || e.apply(a, i);
|
|
212
|
+
}, s = n && !r;
|
|
213
|
+
clearTimeout(r), r = setTimeout(o, t), s && e.apply(a, i);
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function v(e, t) {
|
|
217
|
+
if (e.length !== t.length) return false;
|
|
218
|
+
let n = [...e].sort(), r = [...t].sort();
|
|
219
|
+
return n.every((e, t) => e === r[t]);
|
|
220
|
+
}
|
|
221
|
+
var y = [
|
|
222
|
+
"id",
|
|
223
|
+
"value",
|
|
224
|
+
"text",
|
|
225
|
+
"html",
|
|
226
|
+
"defaultSelected",
|
|
227
|
+
"selected",
|
|
228
|
+
"display",
|
|
229
|
+
"disabled",
|
|
230
|
+
"placeholder",
|
|
231
|
+
"class",
|
|
232
|
+
"style",
|
|
233
|
+
"mandatory"
|
|
234
|
+
];
|
|
235
|
+
function b(e, t) {
|
|
236
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
237
|
+
if (n.length !== r.length) return false;
|
|
238
|
+
for (let r of n) if (e[r] !== t[r]) return false;
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
function x(e, t) {
|
|
242
|
+
switch (t) {
|
|
243
|
+
case "id": return e.id || "";
|
|
244
|
+
case "value": return e.value === void 0 ? e.text || "" : e.value || "";
|
|
245
|
+
case "text": return e.text || "";
|
|
246
|
+
case "html": return e.html || "";
|
|
247
|
+
case "defaultSelected": return e.defaultSelected ?? false;
|
|
248
|
+
case "selected": return e.selected ?? false;
|
|
249
|
+
case "display": return e.display ?? true;
|
|
250
|
+
case "disabled": return e.disabled ?? false;
|
|
251
|
+
case "placeholder": return e.placeholder ?? false;
|
|
252
|
+
case "class": return e.class || "";
|
|
253
|
+
case "style": return e.style || "";
|
|
254
|
+
case "mandatory": return e.mandatory ?? false;
|
|
255
|
+
default: return e.data || {};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function S(e) {
|
|
259
|
+
return !!e && typeof e == "object" && "label" in e && "options" in e;
|
|
260
|
+
}
|
|
261
|
+
function C(e, t) {
|
|
262
|
+
for (let n of y) if (x(e, n) !== x(t, n)) return false;
|
|
263
|
+
return b(e.data || {}, t.data || {});
|
|
264
|
+
}
|
|
265
|
+
function w(e, t) {
|
|
266
|
+
let n = (e) => ({
|
|
267
|
+
id: e.id || "",
|
|
268
|
+
label: e.label || "",
|
|
269
|
+
selectAll: e.selectAll ?? false,
|
|
270
|
+
closable: e.closable || "off"
|
|
271
|
+
}), r = n(e), i = n(t);
|
|
272
|
+
if (r.id !== i.id || r.label !== i.label || r.selectAll !== i.selectAll || r.closable !== i.closable) return false;
|
|
273
|
+
let a = e.options || [], o = t.options || [];
|
|
274
|
+
if (a.length !== o.length) return false;
|
|
275
|
+
for (let e = 0; e < a.length; e++) if (!C(a[e], o[e])) return false;
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
function T(e, t) {
|
|
279
|
+
if (e === t) return true;
|
|
280
|
+
if (e.length !== t.length) return false;
|
|
281
|
+
for (let n = 0; n < e.length; n++) {
|
|
282
|
+
let r = e[n], i = t[n], a = S(r);
|
|
283
|
+
if (a !== S(i)) return false;
|
|
284
|
+
if (a) {
|
|
285
|
+
if (!w(r, i)) return false;
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (!C(r, i)) return false;
|
|
289
|
+
}
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
function E(e) {
|
|
293
|
+
let t = e.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (e) => "-" + e.toLowerCase());
|
|
294
|
+
return e[0] === e[0].toUpperCase() ? t.substring(1) : t;
|
|
295
|
+
}
|
|
296
|
+
function D(e, t = typeof window < "u" ? window.innerWidth : 768) {
|
|
297
|
+
return e === "on" || e === "mobile" && t < 768;
|
|
298
|
+
}
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/slim-select/events.ts
|
|
301
|
+
var O = class {
|
|
302
|
+
handlers;
|
|
303
|
+
attached = false;
|
|
304
|
+
constructor(e) {
|
|
305
|
+
this.handlers = e;
|
|
306
|
+
}
|
|
307
|
+
attach(e) {
|
|
308
|
+
this.attached || (this.attached = true, window.addEventListener("resize", this.resizeHandler, false), e.listenScroll && window.addEventListener("scroll", this.scrollHandler, false), document.addEventListener("visibilitychange", this.visibilityHandler));
|
|
309
|
+
}
|
|
310
|
+
attachDocumentClick() {
|
|
311
|
+
document.addEventListener("click", this.handlers.onDocumentClick);
|
|
312
|
+
}
|
|
313
|
+
detachDocumentClick() {
|
|
314
|
+
document.removeEventListener("click", this.handlers.onDocumentClick);
|
|
315
|
+
}
|
|
316
|
+
detach(e) {
|
|
317
|
+
this.attached && (this.attached = false, this.detachDocumentClick(), window.removeEventListener("resize", this.resizeHandler, false), e.listenScroll && window.removeEventListener("scroll", this.scrollHandler, false), document.removeEventListener("visibilitychange", this.visibilityHandler));
|
|
318
|
+
}
|
|
319
|
+
resizeHandler = _(() => {
|
|
320
|
+
this.handlers.onWindowResize();
|
|
321
|
+
});
|
|
322
|
+
scrollHandler = _(() => {
|
|
323
|
+
this.handlers.onWindowScroll();
|
|
324
|
+
});
|
|
325
|
+
visibilityHandler = () => {
|
|
326
|
+
this.handlers.onVisibilityChange();
|
|
327
|
+
};
|
|
328
|
+
}, k = class {
|
|
329
|
+
handlers;
|
|
330
|
+
options;
|
|
331
|
+
state = "closed";
|
|
332
|
+
pendingTimer = null;
|
|
333
|
+
waitResolvers = [];
|
|
334
|
+
generation = 0;
|
|
335
|
+
animationAbort = null;
|
|
336
|
+
constructor(e, t) {
|
|
337
|
+
this.handlers = e, this.options = t;
|
|
338
|
+
}
|
|
339
|
+
get isOpen() {
|
|
340
|
+
return this.state === "opening" || this.state === "open";
|
|
341
|
+
}
|
|
342
|
+
get isFullOpen() {
|
|
343
|
+
return this.state === "open";
|
|
344
|
+
}
|
|
345
|
+
async requestOpen() {
|
|
346
|
+
if (this.state === "opening" || this.state === "open") return;
|
|
347
|
+
this.cancelPending();
|
|
348
|
+
let e = ++this.generation;
|
|
349
|
+
if (this.handlers.beforeOpen && this.handlers.beforeOpen(), this.state = "opening", await this.waitForPhase("open", e), e !== this.generation) {
|
|
350
|
+
this.state === "opening" && (this.state = "closed");
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.state = "open", this.handlers.afterOpen && this.handlers.afterOpen(), this.handlers.onOpenReady && this.handlers.onOpenReady();
|
|
354
|
+
}
|
|
355
|
+
async requestClose(e = {
|
|
356
|
+
source: "api",
|
|
357
|
+
selectionChanged: false
|
|
358
|
+
}) {
|
|
359
|
+
if (this.state === "closed" || this.state === "closing" || this.handlers.beforeClose && this.handlers.beforeClose(e) === false) return false;
|
|
360
|
+
this.cancelPending();
|
|
361
|
+
let t = ++this.generation;
|
|
362
|
+
return this.handlers.onClose && this.handlers.onClose(e), this.state = "closing", await this.waitForPhase("close", t), t === this.generation ? (this.state = "closed", this.handlers.afterClose && this.handlers.afterClose(), this.handlers.onCloseReady && this.handlers.onCloseReady(), true) : false;
|
|
363
|
+
}
|
|
364
|
+
cancelPending() {
|
|
365
|
+
this.generation++, this.animationAbort?.abort(), this.animationAbort = null, this.pendingTimer &&= (clearTimeout(this.pendingTimer), null);
|
|
366
|
+
let e = this.waitResolvers.splice(0);
|
|
367
|
+
for (let t of e) t();
|
|
368
|
+
}
|
|
369
|
+
destroy() {
|
|
370
|
+
this.cancelPending(), this.state = "closed";
|
|
371
|
+
}
|
|
372
|
+
waitForPhase(e, t) {
|
|
373
|
+
return new Promise((t) => {
|
|
374
|
+
let n = false, r = () => {
|
|
375
|
+
if (n) return;
|
|
376
|
+
n = true;
|
|
377
|
+
let e = this.waitResolvers.indexOf(r);
|
|
378
|
+
e !== -1 && this.waitResolvers.splice(e, 1), t();
|
|
379
|
+
};
|
|
380
|
+
if (this.waitResolvers.push(r), this.options.waitForAnimation) {
|
|
381
|
+
let t = new AbortController();
|
|
382
|
+
this.animationAbort = t, this.options.waitForAnimation(e, t.signal).catch(() => void 0).finally(() => {
|
|
383
|
+
this.animationAbort === t && (this.animationAbort = null), r();
|
|
384
|
+
});
|
|
385
|
+
} else this.pendingTimer = setTimeout(() => {
|
|
386
|
+
this.pendingTimer = null, r();
|
|
387
|
+
}, this.options.timeoutDelay);
|
|
388
|
+
}).then(() => {
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}, A = class {
|
|
392
|
+
id;
|
|
393
|
+
value;
|
|
394
|
+
text;
|
|
395
|
+
html;
|
|
396
|
+
defaultSelected;
|
|
397
|
+
selected;
|
|
398
|
+
display;
|
|
399
|
+
disabled;
|
|
400
|
+
placeholder;
|
|
401
|
+
class;
|
|
402
|
+
style;
|
|
403
|
+
data;
|
|
404
|
+
mandatory;
|
|
405
|
+
constructor(e) {
|
|
406
|
+
this.id = !e.id || e.id === "" ? h() : e.id, this.value = e.value === void 0 ? e.text || "" : e.value || "", this.text = e.text || "", this.html = e.html || "", this.defaultSelected = e.defaultSelected !== void 0 && e.defaultSelected, this.selected = e.selected !== void 0 && e.selected, this.display = e.display === void 0 || e.display, this.disabled = e.disabled !== void 0 && e.disabled, this.mandatory = e.mandatory !== void 0 && e.mandatory, this.placeholder = e.placeholder !== void 0 && e.placeholder, this.class = e.class || "", this.style = e.style || "", this.data = f(e.data);
|
|
407
|
+
}
|
|
408
|
+
}, j = class {
|
|
409
|
+
id;
|
|
410
|
+
label;
|
|
411
|
+
selectAll;
|
|
412
|
+
closable;
|
|
413
|
+
options;
|
|
414
|
+
constructor(e) {
|
|
415
|
+
if (this.id = !e.id || e.id === "" ? h() : e.id, this.label = e.label || "", this.selectAll = e.selectAll !== void 0 && e.selectAll, this.closable = e.closable || "off", this.options = [], e.options) for (let t of e.options) this.options.push(new A(t));
|
|
416
|
+
}
|
|
417
|
+
}, M = class {
|
|
418
|
+
selectType = "single";
|
|
419
|
+
data = [];
|
|
420
|
+
selectedOrder = [];
|
|
421
|
+
catalog = null;
|
|
422
|
+
constructor(e, t) {
|
|
423
|
+
this.selectType = e, this.setData(t), this.snapshotCatalog();
|
|
424
|
+
}
|
|
425
|
+
validateDataArray(e) {
|
|
426
|
+
if (!Array.isArray(e)) return /* @__PURE__ */ Error("Data must be an array");
|
|
427
|
+
for (let t of e) if (t) if (t instanceof j || "label" in t) {
|
|
428
|
+
if (!("label" in t)) return /* @__PURE__ */ Error("Optgroup must have a label");
|
|
429
|
+
if ("options" in t && t.options) for (let e of t.options) {
|
|
430
|
+
let t = this.validateOption(e);
|
|
431
|
+
if (t) return t;
|
|
432
|
+
}
|
|
433
|
+
} else if (t instanceof A || "text" in t) {
|
|
434
|
+
let e = this.validateOption(t);
|
|
435
|
+
if (e) return e;
|
|
436
|
+
} else return /* @__PURE__ */ Error("Data object must be a valid optgroup or option");
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
validateOption(e) {
|
|
440
|
+
return "text" in e ? null : /* @__PURE__ */ Error("Option must have a text");
|
|
441
|
+
}
|
|
442
|
+
partialToFullData(e) {
|
|
443
|
+
let t = [];
|
|
444
|
+
return e.forEach((e) => {
|
|
445
|
+
if (e) {
|
|
446
|
+
if (e instanceof j || "label" in e) {
|
|
447
|
+
let n = [];
|
|
448
|
+
"options" in e && e.options && e.options.forEach((e) => {
|
|
449
|
+
n.push(new A(e));
|
|
450
|
+
}), n.length > 0 && t.push(new j(e));
|
|
451
|
+
}
|
|
452
|
+
(e instanceof A || "text" in e) && t.push(new A(e));
|
|
453
|
+
}
|
|
454
|
+
}), t;
|
|
455
|
+
}
|
|
456
|
+
snapshotCatalog() {
|
|
457
|
+
this.catalog = this.cloneData(this.data);
|
|
458
|
+
}
|
|
459
|
+
getCatalogData() {
|
|
460
|
+
return this.cloneData(this.catalog ?? this.data);
|
|
461
|
+
}
|
|
462
|
+
cloneData(e) {
|
|
463
|
+
return e.map((e) => e instanceof j ? new j({
|
|
464
|
+
id: e.id,
|
|
465
|
+
label: e.label,
|
|
466
|
+
selectAll: e.selectAll,
|
|
467
|
+
closable: e.closable,
|
|
468
|
+
options: e.options.map((e) => new A(e instanceof A ? { ...e } : e))
|
|
469
|
+
}) : new A({ ...e }));
|
|
470
|
+
}
|
|
471
|
+
optionMatchesSelected(e, t) {
|
|
472
|
+
return e.id === t.id || t.value !== "" && e.value !== "" && e.value === t.value;
|
|
473
|
+
}
|
|
474
|
+
findOptionInData(e, t) {
|
|
475
|
+
for (let n of e) {
|
|
476
|
+
if (n instanceof A) {
|
|
477
|
+
if (this.optionMatchesSelected(n, t)) return n;
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
for (let e of n.options) if (this.optionMatchesSelected(e, t)) return e;
|
|
481
|
+
}
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
setData(e, t = false) {
|
|
485
|
+
let n = this.partialToFullData(e), r = [];
|
|
486
|
+
if (t) {
|
|
487
|
+
r = this.getSelectedOptions();
|
|
488
|
+
let e = [];
|
|
489
|
+
r.forEach((t) => {
|
|
490
|
+
this.findOptionInData(n, t) || e.push(t);
|
|
491
|
+
}), this.data = [...e, ...n];
|
|
492
|
+
let t = this.selectType === "single" && r.length === 0, i = r.map((e) => {
|
|
493
|
+
let t = this.findOptionInData(this.data, e);
|
|
494
|
+
return t ? t.id : e.id;
|
|
495
|
+
});
|
|
496
|
+
this.setSelectedBy("id", i, t);
|
|
497
|
+
} else this.data = n;
|
|
498
|
+
!t && this.selectType === "single" && this.setSelectedBy("id", this.getSelected(), false);
|
|
499
|
+
}
|
|
500
|
+
getData(e = true) {
|
|
501
|
+
return this.filter(null, true, e);
|
|
502
|
+
}
|
|
503
|
+
getDataOptions(e = true) {
|
|
504
|
+
return this.filter(null, false, e);
|
|
505
|
+
}
|
|
506
|
+
addOption(e, t = false) {
|
|
507
|
+
if (t) {
|
|
508
|
+
let t = [new A(e)];
|
|
509
|
+
this.setData(t.concat(this.getData()));
|
|
510
|
+
} else this.setData(this.getData().concat(new A(e)));
|
|
511
|
+
}
|
|
512
|
+
setSelectedBy(e, t, n = false) {
|
|
513
|
+
let r = null, i = false, a = [];
|
|
514
|
+
for (let n of this.data) {
|
|
515
|
+
if (n instanceof j) for (let o of n.options) {
|
|
516
|
+
r ||= o;
|
|
517
|
+
let n = o[e] || "";
|
|
518
|
+
o.selected = !i && t.includes(n), o.selected && (a.push(o), this.selectType === "single" && (i = true));
|
|
519
|
+
}
|
|
520
|
+
n instanceof A && (r ||= n, n.selected = !i && t.includes(n[e]), n.selected && (a.push(n), this.selectType === "single" && (i = true)));
|
|
521
|
+
}
|
|
522
|
+
this.selectType === "single" && r && !i && !n && (r.selected = true, a.push(r));
|
|
523
|
+
let o = t.map((t) => a.find((n) => n[e] === t)?.id || "");
|
|
524
|
+
this.selectedOrder = o;
|
|
525
|
+
}
|
|
526
|
+
getSelected() {
|
|
527
|
+
return this.getSelectedOptions().map((e) => e.id);
|
|
528
|
+
}
|
|
529
|
+
getSelectedValues() {
|
|
530
|
+
return this.getSelectedOptions().map((e) => e.value);
|
|
531
|
+
}
|
|
532
|
+
getSelectedOptions() {
|
|
533
|
+
let e = [];
|
|
534
|
+
for (let t of this.data) if (t instanceof j) for (let n of t.options) n.selected && e.push(n);
|
|
535
|
+
else t.selected && e.push(t);
|
|
536
|
+
return e;
|
|
537
|
+
}
|
|
538
|
+
getOptgroupByID(e) {
|
|
539
|
+
for (let t of this.data) if (t instanceof j && t.id === e) return t;
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
getOptionByID(e) {
|
|
543
|
+
for (let t of this.data) if (t instanceof j) {
|
|
544
|
+
for (let n of t.options) if (n.id === e) return n;
|
|
545
|
+
} else if (t.id === e) return t;
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
getSelectType() {
|
|
549
|
+
return this.selectType;
|
|
550
|
+
}
|
|
551
|
+
getFirstOption() {
|
|
552
|
+
let e = null;
|
|
553
|
+
for (let t of this.data) if (t instanceof j ? e = t.options[0] : t instanceof A && (e = t), e) break;
|
|
554
|
+
return e;
|
|
555
|
+
}
|
|
556
|
+
search(e, t) {
|
|
557
|
+
return e = e.trim(), e === "" ? this.getData(false) : this.filter((n) => t(n, e), true, false);
|
|
558
|
+
}
|
|
559
|
+
createOptgroupView(e, t) {
|
|
560
|
+
let n = new j({
|
|
561
|
+
id: e.id,
|
|
562
|
+
label: e.label,
|
|
563
|
+
selectAll: e.selectAll,
|
|
564
|
+
closable: e.closable,
|
|
565
|
+
options: []
|
|
566
|
+
});
|
|
567
|
+
return n.options = t, n;
|
|
568
|
+
}
|
|
569
|
+
filter(e, t, n = true) {
|
|
570
|
+
let r = [];
|
|
571
|
+
return this.data.forEach((i) => {
|
|
572
|
+
if (i instanceof j) {
|
|
573
|
+
let a = [];
|
|
574
|
+
if (i.options.forEach((i) => {
|
|
575
|
+
(!e || e(i)) && (t ? a.push(n ? new A(i) : i) : r.push(n ? new A(i) : i));
|
|
576
|
+
}), a.length > 0) if (n) {
|
|
577
|
+
let e = new j(i);
|
|
578
|
+
e.options = a, r.push(e);
|
|
579
|
+
} else r.push(this.createOptgroupView(i, a));
|
|
580
|
+
}
|
|
581
|
+
i instanceof A && (!e || e(i)) && r.push(n ? new A(i) : i);
|
|
582
|
+
}), r;
|
|
583
|
+
}
|
|
584
|
+
selectedOrderOptions(e) {
|
|
585
|
+
let t = [];
|
|
586
|
+
return this.selectedOrder.forEach((n) => {
|
|
587
|
+
let r = e.find((e) => e.id === n);
|
|
588
|
+
r && t.push(r);
|
|
589
|
+
}), e.forEach((e) => {
|
|
590
|
+
let n = false;
|
|
591
|
+
t.forEach((t) => {
|
|
592
|
+
if (e.id === t.id) {
|
|
593
|
+
n = true;
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
}), n || t.push(e);
|
|
597
|
+
}), t;
|
|
598
|
+
}
|
|
599
|
+
}, N = class {
|
|
600
|
+
settings;
|
|
601
|
+
store;
|
|
602
|
+
callbacks;
|
|
603
|
+
lastSelectedOption;
|
|
604
|
+
lastRenderedOptions;
|
|
605
|
+
optionsListIsFullData = false;
|
|
606
|
+
lastSearchFilterTerm = "";
|
|
607
|
+
main;
|
|
608
|
+
content;
|
|
609
|
+
classes;
|
|
610
|
+
positionObserver = null;
|
|
611
|
+
positionObserverRaf = 0;
|
|
612
|
+
overflowShiftRaf = 0;
|
|
613
|
+
modalElements = null;
|
|
614
|
+
modalSessionActive = null;
|
|
615
|
+
bodyScrollLocked = false;
|
|
616
|
+
savedBodyOverflow = "";
|
|
617
|
+
constructor(e, t, n, r) {
|
|
618
|
+
this.store = n, this.settings = e, this.classes = t, this.callbacks = r, this.lastSelectedOption = null, this.lastRenderedOptions = [], this.main = this.mainDiv(), this.content = this.contentDiv(), this.updateClassStyles(), this.updateAriaAttributes(), this.settings.contentPosition !== "relative" && (this.content.main.style.top = "-9999px", this.content.main.style.left = "-9999px", this.content.main.style.margin = "0", this.content.main.style.width = "auto"), this.settings.contentLocation && this.settings.contentLocation.appendChild(this.content.main), this.settings.modal !== "off" && !this.settings.alwaysOpen && (this.modalElements = this.createModalElements(), document.body.appendChild(this.modalElements.overlay));
|
|
619
|
+
}
|
|
620
|
+
requestClose(e, t) {
|
|
621
|
+
this.callbacks.close({
|
|
622
|
+
source: e,
|
|
623
|
+
option: t?.option,
|
|
624
|
+
selectionChanged: t?.selectionChanged ?? false
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
selectionChanged(e, t) {
|
|
628
|
+
if (e.length !== t.length) return true;
|
|
629
|
+
let n = e.map((e) => e.id).sort(), r = t.map((e) => e.id).sort();
|
|
630
|
+
return n.some((e, t) => e !== r[t]);
|
|
631
|
+
}
|
|
632
|
+
closeOnSingleSelectReclick(e) {
|
|
633
|
+
this.settings.closeOnSelect && this.requestClose("select", {
|
|
634
|
+
option: e,
|
|
635
|
+
selectionChanged: false
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
addClasses(e, t) {
|
|
639
|
+
if (!t || t.trim() === "") return;
|
|
640
|
+
let n = t.split(" ").filter((e) => e.trim() !== "");
|
|
641
|
+
for (let t of n) e.classList.add(t.trim());
|
|
642
|
+
}
|
|
643
|
+
removeClasses(e, t) {
|
|
644
|
+
if (!t || t.trim() === "") return;
|
|
645
|
+
let n = t.split(" ").filter((e) => e.trim() !== "");
|
|
646
|
+
for (let t of n) e.classList.remove(t.trim());
|
|
647
|
+
}
|
|
648
|
+
enable() {
|
|
649
|
+
this.removeClasses(this.main.main, this.classes.disabled), this.main.main.setAttribute("aria-disabled", "false"), this.content.search.input.disabled = false;
|
|
650
|
+
}
|
|
651
|
+
disable() {
|
|
652
|
+
this.addClasses(this.main.main, this.classes.disabled), this.main.main.setAttribute("aria-disabled", "true"), this.content.search.input.disabled = true;
|
|
653
|
+
}
|
|
654
|
+
open() {
|
|
655
|
+
this.main.arrow.path.setAttribute("d", this.classes.arrowOpen), this.main.main.setAttribute("aria-expanded", "true");
|
|
656
|
+
let e = this.resolveModalView();
|
|
657
|
+
if (!e) {
|
|
658
|
+
let e = this.settings.openPosition === "up" ? this.classes.dirAbove : this.classes.dirBelow;
|
|
659
|
+
this.addClasses(this.main.main, e), this.addClasses(this.content.main, e);
|
|
660
|
+
}
|
|
661
|
+
this.addClasses(this.content.main, this.classes.contentOpen), this.content.search.input.removeAttribute("aria-hidden"), e ? this.showModal() : this.moveContent();
|
|
662
|
+
let t = this.store.getSelectedOptions();
|
|
663
|
+
if (t.length) {
|
|
664
|
+
let e = t[t.length - 1].id, n = this.content.list.querySelector("[data-id=\"" + e + "\"]");
|
|
665
|
+
n && this.ensureElementInView(this.content.list, n);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
isModalViewActive() {
|
|
669
|
+
return this.modalSessionActive === true;
|
|
670
|
+
}
|
|
671
|
+
resolveModalView() {
|
|
672
|
+
return this.settings.alwaysOpen || this.settings.modal === "off" || !this.modalElements ? false : (this.modalSessionActive === null && (this.modalSessionActive = D(this.settings.modal)), this.modalSessionActive);
|
|
673
|
+
}
|
|
674
|
+
createModalElements() {
|
|
675
|
+
let e = document.createElement("div");
|
|
676
|
+
this.addClasses(e, this.classes.modalOverlay), this.addClasses(e, this.classes.hide), e.dataset.id = this.settings.id;
|
|
677
|
+
let t = document.createElement("div");
|
|
678
|
+
this.addClasses(t, this.classes.modalDialog), t.setAttribute("role", "dialog"), t.setAttribute("aria-modal", "true");
|
|
679
|
+
let n = null;
|
|
680
|
+
this.settings.modalTitle ? (n = document.createElement("div"), this.addClasses(n, this.classes.modalTitle), n.id = `${this.settings.id}-modal-title`, n.textContent = this.settings.modalTitle, t.setAttribute("aria-labelledby", n.id)) : t.setAttribute("aria-label", this.settings.ariaLabel);
|
|
681
|
+
let r = document.createElement("button");
|
|
682
|
+
r.type = "button", this.addClasses(r, this.classes.modalClose), r.setAttribute("aria-label", "Close"), r.onclick = (e) => {
|
|
683
|
+
e.stopPropagation(), this.requestClose("modal");
|
|
684
|
+
};
|
|
685
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
686
|
+
i.setAttribute("viewBox", "0 0 100 100");
|
|
687
|
+
let a = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
688
|
+
return a.setAttribute("d", this.classes.deselectPath), i.appendChild(a), r.appendChild(i), e.onclick = (t) => {
|
|
689
|
+
t.target === e && this.requestClose("modal");
|
|
690
|
+
}, n && t.appendChild(n), e.appendChild(t), {
|
|
691
|
+
overlay: e,
|
|
692
|
+
dialog: t,
|
|
693
|
+
closeButton: r,
|
|
694
|
+
title: n
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
showModal() {
|
|
698
|
+
this.modalElements && (this.modalElements.dialog.appendChild(this.content.main), this.addClasses(this.content.main, this.classes.modalContent), this.content.main.appendChild(this.modalElements.closeButton), this.content.main.style.top = "", this.content.main.style.left = "", this.content.main.style.margin = "", this.content.main.style.width = "", this.removeClasses(this.modalElements.overlay, this.classes.hide), requestAnimationFrame(() => {
|
|
699
|
+
this.modalElements && this.addClasses(this.modalElements.overlay, this.classes.contentOpen);
|
|
700
|
+
}), this.lockBodyScroll());
|
|
701
|
+
}
|
|
702
|
+
lockBodyScroll() {
|
|
703
|
+
this.bodyScrollLocked ||= (this.savedBodyOverflow = document.body.style.overflow, document.body.style.overflow = "hidden", true);
|
|
704
|
+
}
|
|
705
|
+
unlockBodyScroll() {
|
|
706
|
+
this.bodyScrollLocked && (document.body.style.overflow = this.savedBodyOverflow, this.bodyScrollLocked = false, this.savedBodyOverflow = "");
|
|
707
|
+
}
|
|
708
|
+
restoreContentOffscreen() {
|
|
709
|
+
this.settings.contentLocation && this.settings.contentLocation.appendChild(this.content.main), this.settings.contentPosition !== "relative" && (this.content.main.style.top = "-9999px", this.content.main.style.left = "-9999px", this.content.main.style.margin = "0", this.content.main.style.width = "auto");
|
|
710
|
+
}
|
|
711
|
+
finalizeModalClose() {
|
|
712
|
+
this.modalElements && this.content.main.parentElement === this.modalElements.dialog && (this.addClasses(this.modalElements.overlay, this.classes.hide), this.removeClasses(this.modalElements.overlay, this.classes.contentOpen), this.removeClasses(this.content.main, this.classes.modalContent), this.modalElements.closeButton.remove(), this.restoreContentOffscreen(), this.unlockBodyScroll());
|
|
713
|
+
}
|
|
714
|
+
waitForAnimation(e, t) {
|
|
715
|
+
let r = a(this.content.main, this.settings.timeoutDelay);
|
|
716
|
+
return c(this.content.main, n, r, t);
|
|
717
|
+
}
|
|
718
|
+
close() {
|
|
719
|
+
this.main.main.setAttribute("aria-expanded", "false"), this.main.arrow.path.setAttribute("d", this.classes.arrowClose);
|
|
720
|
+
let e = this.modalSessionActive === true;
|
|
721
|
+
this.removeClasses(this.content.main, this.classes.contentOpen), e || (this.removeClasses(this.main.main, this.classes.dirAbove), this.removeClasses(this.main.main, this.classes.dirBelow)), e && this.modalElements && this.removeClasses(this.modalElements.overlay, this.classes.contentOpen), this.modalSessionActive = null, this.content.search.input.setAttribute("aria-hidden", "true"), this.main.main.removeAttribute("aria-activedescendant");
|
|
722
|
+
}
|
|
723
|
+
clearDirectionClasses() {
|
|
724
|
+
this.removeClasses(this.main.main, this.classes.dirAbove), this.removeClasses(this.main.main, this.classes.dirBelow), this.removeClasses(this.content.main, this.classes.dirAbove), this.removeClasses(this.content.main, this.classes.dirBelow);
|
|
725
|
+
}
|
|
726
|
+
updateClassStyles() {
|
|
727
|
+
if (this.main.main.className = "", this.main.main.removeAttribute("style"), this.content.main.className = "", this.content.main.removeAttribute("style"), this.addClasses(this.main.main, this.classes.main), this.addClasses(this.content.main, this.classes.content), this.settings.style !== "" && (this.main.main.style.cssText = this.settings.style, this.content.main.style.cssText = this.settings.style), this.settings.class.length) for (let e of this.settings.class) e.trim() !== "" && (this.main.main.classList.add(e.trim()), this.content.main.classList.add(e.trim()));
|
|
728
|
+
(this.settings.contentPosition === "relative" || this.settings.contentPosition === "fixed") && this.content.main.classList.add("ss-" + this.settings.contentPosition);
|
|
729
|
+
}
|
|
730
|
+
updateAriaAttributes() {
|
|
731
|
+
let e = this.content.list.id;
|
|
732
|
+
this.main.main.role = "combobox", this.main.main.setAttribute("aria-haspopup", "listbox"), this.main.main.setAttribute("aria-controls", e), this.main.main.setAttribute("aria-expanded", "false"), this.content.list.setAttribute("role", "listbox"), this.content.list.setAttribute("aria-label", this.settings.ariaLabel + " listbox"), this.settings.isMultiple && this.content.list.setAttribute("aria-multiselectable", "true"), this.content.search.input.setAttribute("aria-controls", e);
|
|
733
|
+
}
|
|
734
|
+
mainDiv() {
|
|
735
|
+
let e = document.createElement("div");
|
|
736
|
+
e.dataset.id = this.settings.id, e.setAttribute("aria-label", this.settings.ariaLabel), e.tabIndex = 0, e.onkeydown = (e) => {
|
|
737
|
+
switch (e.key) {
|
|
738
|
+
case "ArrowUp":
|
|
739
|
+
case "ArrowDown": return this.callbacks.open(), e.key === "ArrowDown" ? this.highlight("down") : this.highlight("up"), false;
|
|
740
|
+
case "Tab": return this.requestClose("tab"), true;
|
|
741
|
+
case "Enter":
|
|
742
|
+
case " ":
|
|
743
|
+
this.callbacks.open();
|
|
744
|
+
let t = this.content.list.querySelector("." + this.classes.getFirst("highlighted"));
|
|
745
|
+
return t && t.click(), false;
|
|
746
|
+
case "Escape": return this.requestClose("escape"), false;
|
|
747
|
+
}
|
|
748
|
+
return e.key.length === 1 && this.callbacks.open(), true;
|
|
749
|
+
}, e.onclick = (e) => {
|
|
750
|
+
this.settings.disabled || (this.settings.isOpen ? this.requestClose("toggle") : this.callbacks.open());
|
|
751
|
+
};
|
|
752
|
+
let t = document.createElement("div");
|
|
753
|
+
this.addClasses(t, this.classes.values), e.appendChild(t);
|
|
754
|
+
let n = document.createElement("div");
|
|
755
|
+
this.addClasses(n, this.classes.deselect), n.setAttribute("role", "button"), n.setAttribute("aria-label", this.settings.deselectText), n.setAttribute("tabindex", "0");
|
|
756
|
+
let r = this.store?.getSelectedOptions();
|
|
757
|
+
!this.settings.allowDeselect || this.settings.isMultiple && r && r.length <= 0 || this.isAtMinSelected() ? this.addClasses(n, this.classes.hide) : this.removeClasses(n, this.classes.hide), n.onclick = (e) => {
|
|
758
|
+
if (e.stopPropagation(), this.settings.disabled || this.settings.isMultiple && this.isAtMinSelected()) return;
|
|
759
|
+
let t = true, n = this.store.getSelectedOptions(), r = [], i = "";
|
|
760
|
+
if (this.settings.isMultiple) {
|
|
761
|
+
let e = this.settings.minSelected, t = this.store.getSelected();
|
|
762
|
+
if (e > 0 && t.length > e) i = this.getMinimumSelectionIds(), r = n.filter((e) => i.includes(e.id));
|
|
763
|
+
else if (e <= 0) i = [];
|
|
764
|
+
else return;
|
|
765
|
+
}
|
|
766
|
+
if (this.callbacks.beforeChange && (t = this.callbacks.beforeChange(r, n) === true), t) {
|
|
767
|
+
if (this.settings.isMultiple) this.callbacks.setSelected(i, false), this.updateDeselectAll();
|
|
768
|
+
else {
|
|
769
|
+
let e = this.store.getFirstOption(), t = e ? e.id : "";
|
|
770
|
+
this.callbacks.setSelected(t, false);
|
|
771
|
+
}
|
|
772
|
+
this.settings.closeOnSelect && this.requestClose("deselect", { selectionChanged: true }), this.callbacks.afterChange && this.callbacks.afterChange(this.store.getSelectedOptions());
|
|
773
|
+
}
|
|
774
|
+
}, n.onkeydown = (e) => {
|
|
775
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), n.click());
|
|
776
|
+
};
|
|
777
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
778
|
+
i.setAttribute("viewBox", "0 0 100 100");
|
|
779
|
+
let a = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
780
|
+
a.setAttribute("d", this.classes.deselectPath), i.appendChild(a), n.appendChild(i), e.appendChild(n);
|
|
781
|
+
let o = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
782
|
+
this.addClasses(o, this.classes.arrow), o.setAttribute("viewBox", "0 0 100 100");
|
|
783
|
+
let s = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
784
|
+
return s.setAttribute("d", this.classes.arrowClose), this.settings.alwaysOpen && this.addClasses(o, this.classes.hide), o.appendChild(s), e.appendChild(o), {
|
|
785
|
+
main: e,
|
|
786
|
+
values: t,
|
|
787
|
+
deselect: {
|
|
788
|
+
main: n,
|
|
789
|
+
svg: i,
|
|
790
|
+
path: a
|
|
791
|
+
},
|
|
792
|
+
arrow: {
|
|
793
|
+
main: o,
|
|
794
|
+
path: s
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
mainFocus(e) {
|
|
799
|
+
e !== "click" && this.main.main.focus({ preventScroll: true });
|
|
800
|
+
}
|
|
801
|
+
placeholder() {
|
|
802
|
+
let e = this.store.filter((e) => e.placeholder, false, false), t = this.settings.placeholderText;
|
|
803
|
+
e.length && (e[0].html === "" ? e[0].text !== "" && (t = e[0].text) : t = e[0].html);
|
|
804
|
+
let n = document.createElement("div");
|
|
805
|
+
return this.addClasses(n, this.classes.placeholder), n.innerHTML = t, n;
|
|
806
|
+
}
|
|
807
|
+
renderValues() {
|
|
808
|
+
if (!this.settings.isMultiple) {
|
|
809
|
+
this.renderSingleValue();
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
this.renderMultipleValues(), this.updateDeselectAll();
|
|
813
|
+
}
|
|
814
|
+
renderSingleValue() {
|
|
815
|
+
let e = this.store.filter((e) => e.selected && !e.placeholder, false, false), t = e.length > 0 ? e[0] : null;
|
|
816
|
+
if (!t) this.main.values.innerHTML = this.placeholder().outerHTML;
|
|
817
|
+
else {
|
|
818
|
+
let e = document.createElement("div");
|
|
819
|
+
this.addClasses(e, this.classes.single), t.html ? e.innerHTML = t.html : e.innerText = t.text, this.main.values.innerHTML = e.outerHTML;
|
|
820
|
+
}
|
|
821
|
+
!this.settings.allowDeselect || !e.length ? this.addClasses(this.main.deselect.main, this.classes.hide) : this.removeClasses(this.main.deselect.main, this.classes.hide);
|
|
822
|
+
}
|
|
823
|
+
renderMultipleValues() {
|
|
824
|
+
let e = this.main.values.childNodes, t = this.store.filter((e) => e.selected && e.display, false, false);
|
|
825
|
+
if (t.length === 0) {
|
|
826
|
+
this.main.values.innerHTML = this.placeholder().outerHTML;
|
|
827
|
+
return;
|
|
828
|
+
} else {
|
|
829
|
+
let e = this.main.values.querySelector("." + this.classes.getFirst("placeholder"));
|
|
830
|
+
e && e.remove();
|
|
831
|
+
}
|
|
832
|
+
if (this.settings.multiString) {
|
|
833
|
+
let e = t;
|
|
834
|
+
this.settings.keepOrder && (e = this.store.selectedOrderOptions(e));
|
|
835
|
+
let n = document.createElement("div");
|
|
836
|
+
this.addClasses(n, this.classes.multiString), n.textContent = e.map((e) => e.text).join(", "), this.settings.showOptionTooltips && n.setAttribute("title", n.textContent), this.main.values.innerHTML = n.outerHTML;
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
if (t.length > this.settings.maxValuesShown) {
|
|
840
|
+
let e = document.createElement("div");
|
|
841
|
+
this.addClasses(e, this.classes.max), e.textContent = this.settings.maxValuesMessage.replace("{number}", t.length.toString()), this.main.values.innerHTML = e.outerHTML;
|
|
842
|
+
return;
|
|
843
|
+
} else {
|
|
844
|
+
let e = this.main.values.querySelector("." + this.classes.getFirst("max"));
|
|
845
|
+
e && e.remove();
|
|
846
|
+
}
|
|
847
|
+
this.settings.keepOrder && (t = this.store.selectedOrderOptions(t));
|
|
848
|
+
let n = [];
|
|
849
|
+
for (let r = 0; r < e.length; r++) {
|
|
850
|
+
let i = e[r], a = i.getAttribute("data-id");
|
|
851
|
+
a && (t.filter((e) => e.id === a, false).length || n.push(i));
|
|
852
|
+
}
|
|
853
|
+
let r = a(this.content.main, this.settings.timeoutDelay);
|
|
854
|
+
for (let e of n) this.addClasses(e, this.classes.valueOut), l(e, "ss-valueOut", r).then(() => {
|
|
855
|
+
this.main.values.hasChildNodes() && this.main.values.contains(e) && this.main.values.removeChild(e);
|
|
856
|
+
});
|
|
857
|
+
e = this.main.values.childNodes;
|
|
858
|
+
for (let n = 0; n < t.length; n++) {
|
|
859
|
+
let r = true;
|
|
860
|
+
for (let i = 0; i < e.length; i++) t[n].id === String(e[i].dataset.id) && (r = false);
|
|
861
|
+
r && (this.settings.keepOrder || e.length === 0 ? this.main.values.appendChild(this.multipleValue(t[n])) : n === 0 ? this.main.values.insertBefore(this.multipleValue(t[n]), e[n]) : e[n - 1].insertAdjacentElement("afterend", this.multipleValue(t[n])));
|
|
862
|
+
}
|
|
863
|
+
this.updateMultipleValueDeleteVisibility();
|
|
864
|
+
}
|
|
865
|
+
isAtMinSelected() {
|
|
866
|
+
return this.settings.isMultiple && this.settings.minSelected > 0 && this.store.getSelectedOptions().length <= this.settings.minSelected;
|
|
867
|
+
}
|
|
868
|
+
getMinimumSelectionIds() {
|
|
869
|
+
let e = this.store.getSelectedOptions();
|
|
870
|
+
return this.settings.keepOrder && (e = this.store.selectedOrderOptions(e)), e.slice(0, this.settings.minSelected).map((e) => e.id);
|
|
871
|
+
}
|
|
872
|
+
updateMultipleValueDeleteVisibility() {
|
|
873
|
+
if (!this.settings.isMultiple || this.settings.multiString) return;
|
|
874
|
+
let e = !this.isAtMinSelected(), t = this.main.values.querySelectorAll("." + this.classes.getFirst("valueDelete"));
|
|
875
|
+
for (let n of t) e ? this.removeClasses(n, this.classes.hide) : this.addClasses(n, this.classes.hide);
|
|
876
|
+
}
|
|
877
|
+
multipleValue(e) {
|
|
878
|
+
let t = document.createElement("div");
|
|
879
|
+
this.addClasses(t, this.classes.value), t.dataset.id = e.id;
|
|
880
|
+
let n = document.createElement("div");
|
|
881
|
+
if (this.addClasses(n, this.classes.valueText), n.textContent = e.text, t.appendChild(n), !e.mandatory) {
|
|
882
|
+
let n = document.createElement("div");
|
|
883
|
+
this.addClasses(n, this.classes.valueDelete), n.setAttribute("tabindex", "0"), n.setAttribute("role", "button"), n.setAttribute("aria-label", `${this.settings.removeText} ${e.text}`), this.isAtMinSelected() && this.addClasses(n, this.classes.hide), n.onclick = (t) => {
|
|
884
|
+
if (t.preventDefault(), t.stopPropagation(), this.settings.disabled) return;
|
|
885
|
+
let n = true, r = this.store.getSelectedOptions(), i = r.filter((t) => t.selected && t.id !== e.id, true);
|
|
886
|
+
if (!(this.settings.minSelected && i.length < this.settings.minSelected) && (this.callbacks.beforeChange && (n = this.callbacks.beforeChange(i, r) === true), n)) {
|
|
887
|
+
let e = [];
|
|
888
|
+
for (let t of i) {
|
|
889
|
+
if (t instanceof j) for (let n of t.options) n.id && e.push(n.id);
|
|
890
|
+
t instanceof A && e.push(t.id);
|
|
891
|
+
}
|
|
892
|
+
this.callbacks.setSelected(e, false), this.settings.closeOnSelect && this.requestClose("deselect", { selectionChanged: true }), this.callbacks.afterChange && this.callbacks.afterChange(i), this.updateDeselectAll(), this.updateMultipleValueDeleteVisibility();
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
let r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
896
|
+
r.setAttribute("viewBox", "0 0 100 100");
|
|
897
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
898
|
+
i.setAttribute("d", this.classes.optionDelete), r.appendChild(i), n.appendChild(r), t.appendChild(n), n.onkeydown = (e) => {
|
|
899
|
+
e.key === "Enter" && n.click();
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
return t;
|
|
903
|
+
}
|
|
904
|
+
contentDiv() {
|
|
905
|
+
let e = document.createElement("div");
|
|
906
|
+
e.dataset.id = this.settings.id;
|
|
907
|
+
let t = this.searchDiv();
|
|
908
|
+
e.appendChild(t.main);
|
|
909
|
+
let n = document.createElement("div");
|
|
910
|
+
this.addClasses(n, this.classes.status), n.setAttribute("aria-live", "polite"), n.setAttribute("aria-atomic", "true"), n.setAttribute("role", "status"), e.appendChild(n);
|
|
911
|
+
let r = this.listDiv();
|
|
912
|
+
return e.appendChild(r), {
|
|
913
|
+
main: e,
|
|
914
|
+
search: t,
|
|
915
|
+
status: n,
|
|
916
|
+
list: r
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
announce(e) {
|
|
920
|
+
this.settings.showSearch && (this.content.status.textContent = e);
|
|
921
|
+
}
|
|
922
|
+
moveContent() {
|
|
923
|
+
if (!this.isModalViewActive()) {
|
|
924
|
+
if (this.settings.contentPosition === "relative") {
|
|
925
|
+
this.moveContentBelow();
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (this.settings.openPosition === "down") {
|
|
929
|
+
this.moveContentBelow();
|
|
930
|
+
return;
|
|
931
|
+
} else if (this.settings.openPosition === "up") {
|
|
932
|
+
this.moveContentAbove();
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
this.putContent() === "up" ? this.moveContentAbove() : this.moveContentBelow();
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
startPositionTracking() {
|
|
939
|
+
this.settings.contentPosition !== "absolute" || this.isModalViewActive() || (this.stopPositionTracking(), !(typeof ResizeObserver > "u") && (this.positionObserver = new ResizeObserver(() => {
|
|
940
|
+
this.settings.isOpen && (cancelAnimationFrame(this.positionObserverRaf), this.positionObserverRaf = requestAnimationFrame(() => {
|
|
941
|
+
this.moveContent();
|
|
942
|
+
}));
|
|
943
|
+
}), this.observePositionTargets()));
|
|
944
|
+
}
|
|
945
|
+
stopPositionTracking() {
|
|
946
|
+
cancelAnimationFrame(this.positionObserverRaf), this.positionObserver?.disconnect(), this.positionObserver = null, this.cancelOverflowShift();
|
|
947
|
+
}
|
|
948
|
+
observePositionTargets() {
|
|
949
|
+
if (!this.positionObserver) return;
|
|
950
|
+
let e = /* @__PURE__ */ new Set(), t = (t) => {
|
|
951
|
+
!t || e.has(t) || (e.add(t), this.positionObserver.observe(t));
|
|
952
|
+
};
|
|
953
|
+
t(this.main.main);
|
|
954
|
+
let n = this.main.main.parentElement, r = this.settings.contentLocation;
|
|
955
|
+
for (let e = 0; n && e < 8 && (t(n), n !== r); e++) n = n.parentElement;
|
|
956
|
+
}
|
|
957
|
+
searchDiv() {
|
|
958
|
+
let e = document.createElement("div"), t = document.createElement("input"), n = document.createElement("div");
|
|
959
|
+
this.addClasses(e, this.classes.search);
|
|
960
|
+
let r = {
|
|
961
|
+
main: e,
|
|
962
|
+
input: t
|
|
963
|
+
};
|
|
964
|
+
if (this.settings.showSearch || (this.addClasses(e, this.classes.hide), t.readOnly = true), t.type = "search", t.placeholder = this.settings.searchPlaceholder, t.tabIndex = -1, t.setAttribute("aria-label", this.settings.searchPlaceholder), t.setAttribute("aria-autocomplete", "list"), t.setAttribute("autocapitalize", "off"), t.setAttribute("autocomplete", "off"), t.setAttribute("autocorrect", "off"), t.setAttribute("aria-hidden", "true"), t.oninput = _((e) => {
|
|
965
|
+
this.callbacks.search(e.target.value);
|
|
966
|
+
}, 100), t.onkeydown = (e) => {
|
|
967
|
+
switch (e.key) {
|
|
968
|
+
case "ArrowUp":
|
|
969
|
+
case "ArrowDown": return e.key === "ArrowDown" ? this.highlight("down") : this.highlight("up"), false;
|
|
970
|
+
case "Tab": return this.requestClose("tab"), true;
|
|
971
|
+
case "Escape": return this.requestClose("escape"), false;
|
|
972
|
+
case "Enter":
|
|
973
|
+
let t = this.content.list.querySelector("." + this.classes.getFirst("highlighted"));
|
|
974
|
+
return t ? (t.click(), false) : this.callbacks.addable ? (n.click(), false) : true;
|
|
975
|
+
}
|
|
976
|
+
return true;
|
|
977
|
+
}, e.appendChild(t), this.callbacks.addable) {
|
|
978
|
+
this.addClasses(n, this.classes.addable);
|
|
979
|
+
let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
980
|
+
t.setAttribute("viewBox", "0 0 100 100");
|
|
981
|
+
let a = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
982
|
+
a.setAttribute("d", this.classes.addablePath), t.appendChild(a), n.appendChild(t), n.onclick = (e) => {
|
|
983
|
+
if (e.preventDefault(), e.stopPropagation(), !this.callbacks.addable) return;
|
|
984
|
+
let t = this.content.search.input.value.trim();
|
|
985
|
+
if (t === "") {
|
|
986
|
+
this.content.search.input.focus();
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
let n = (e) => {
|
|
990
|
+
let t = new A(e);
|
|
991
|
+
if (this.callbacks.addOption(t), this.settings.isMultiple) {
|
|
992
|
+
let e = this.store.getSelected();
|
|
993
|
+
e.push(t.id), this.callbacks.setSelected(e, true);
|
|
994
|
+
} else this.callbacks.setSelected([t.id], true);
|
|
995
|
+
if (this.callbacks.search(""), this.settings.closeOnSelect) {
|
|
996
|
+
let e = i(this.content.main);
|
|
997
|
+
setTimeout(() => {
|
|
998
|
+
this.requestClose("select", { selectionChanged: true });
|
|
999
|
+
}, e);
|
|
1000
|
+
}
|
|
1001
|
+
}, r = this.callbacks.addable(t);
|
|
1002
|
+
r === false || r == null || (r instanceof Promise ? r.then((e) => {
|
|
1003
|
+
typeof e == "string" ? n({
|
|
1004
|
+
text: e,
|
|
1005
|
+
value: e
|
|
1006
|
+
}) : r instanceof Error ? this.renderError(r.message) : n(e);
|
|
1007
|
+
}) : typeof r == "string" ? n({
|
|
1008
|
+
text: r,
|
|
1009
|
+
value: r
|
|
1010
|
+
}) : r instanceof Error ? this.renderError(r.message) : n(r));
|
|
1011
|
+
}, e.appendChild(n), r.addable = {
|
|
1012
|
+
main: n,
|
|
1013
|
+
svg: t,
|
|
1014
|
+
path: a
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
return r;
|
|
1018
|
+
}
|
|
1019
|
+
searchFocus() {
|
|
1020
|
+
this.content.search.input.focus({ preventScroll: true });
|
|
1021
|
+
}
|
|
1022
|
+
getOptions(e = false, t = false, n = false) {
|
|
1023
|
+
let r = "." + this.classes.getFirst("option");
|
|
1024
|
+
return e && (r += ":not(." + this.classes.getFirst("placeholder") + ")"), t && (r += ":not(." + this.classes.getFirst("disabled") + ")"), n && (r += ":not(." + this.classes.getFirst("hide") + ")"), Array.from(this.content.list.querySelectorAll(r));
|
|
1025
|
+
}
|
|
1026
|
+
highlight(e) {
|
|
1027
|
+
let t = this.getOptions(true, true, true);
|
|
1028
|
+
if (t.length === 0) return;
|
|
1029
|
+
if (t.length === 1 && !t[0].classList.contains(this.classes.getFirst("highlighted"))) {
|
|
1030
|
+
this.addClasses(t[0], this.classes.highlighted);
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
let n = false;
|
|
1034
|
+
for (let e of t) e.classList.contains(this.classes.getFirst("highlighted")) && (n = true);
|
|
1035
|
+
if (!n) {
|
|
1036
|
+
for (let e of t) if (e.classList.contains(this.classes.getFirst("selected"))) {
|
|
1037
|
+
this.addClasses(e, this.classes.highlighted);
|
|
1038
|
+
break;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
for (let n = 0; n < t.length; n++) if (t[n].classList.contains(this.classes.getFirst("highlighted"))) {
|
|
1042
|
+
let r = t[n];
|
|
1043
|
+
this.removeClasses(r, this.classes.highlighted);
|
|
1044
|
+
let i = r.parentElement;
|
|
1045
|
+
if (i && i.classList.contains(this.classes.getFirst("mainOpen"))) {
|
|
1046
|
+
let e = i.querySelector("." + this.classes.getFirst("optgroupLabel"));
|
|
1047
|
+
e && e.click();
|
|
1048
|
+
}
|
|
1049
|
+
let a = t[e === "down" ? n + 1 < t.length ? n + 1 : 0 : n - 1 >= 0 ? n - 1 : t.length - 1];
|
|
1050
|
+
this.addClasses(a, this.classes.highlighted), this.ensureElementInView(this.content.list, a), a.id && this.main.main.setAttribute("aria-activedescendant", a.id);
|
|
1051
|
+
let o = a.parentElement;
|
|
1052
|
+
if (o && o.classList.contains(this.classes.getFirst("close"))) {
|
|
1053
|
+
let e = o.querySelector("." + this.classes.getFirst("optgroupLabel"));
|
|
1054
|
+
e && e.click();
|
|
1055
|
+
}
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
let r = t[e === "down" ? 0 : t.length - 1];
|
|
1059
|
+
this.addClasses(r, this.classes.highlighted), r.id && this.main.main.setAttribute("aria-activedescendant", r.id), this.ensureElementInView(this.content.list, r);
|
|
1060
|
+
}
|
|
1061
|
+
listDiv() {
|
|
1062
|
+
let e = document.createElement("div");
|
|
1063
|
+
this.addClasses(e, this.classes.list);
|
|
1064
|
+
let t = this.settings.id + "-list";
|
|
1065
|
+
return e.id = t, e.dataset.id = t, e;
|
|
1066
|
+
}
|
|
1067
|
+
renderError(e) {
|
|
1068
|
+
this.optionsListIsFullData = false, this.content.list.innerHTML = "";
|
|
1069
|
+
let t = document.createElement("div");
|
|
1070
|
+
this.addClasses(t, this.classes.error), t.textContent = e, this.content.list.appendChild(t);
|
|
1071
|
+
}
|
|
1072
|
+
renderSearching() {
|
|
1073
|
+
this.optionsListIsFullData = false, this.content.list.innerHTML = "";
|
|
1074
|
+
let e = document.createElement("div");
|
|
1075
|
+
this.addClasses(e, this.classes.searching), e.textContent = this.settings.searchingText, this.content.list.appendChild(e), this.announce(this.settings.searchingText);
|
|
1076
|
+
}
|
|
1077
|
+
renderOptions(e) {
|
|
1078
|
+
if (this.lastSearchFilterTerm = "", this.lastRenderedOptions = e.map((e) => e instanceof A ? [e] : e.options.map((e) => new A(e))).flat(), this.content.list.innerHTML = "", e.length === 0) {
|
|
1079
|
+
this.optionsListIsFullData = false;
|
|
1080
|
+
let e = document.createElement("div");
|
|
1081
|
+
if (this.addClasses(e, this.classes.search), this.callbacks.addable) {
|
|
1082
|
+
let t = this.settings.addableText.replace("{value}", this.content.search.input.value);
|
|
1083
|
+
e.innerHTML = t, this.announce(t);
|
|
1084
|
+
} else e.innerHTML = this.settings.searchText, this.announce(this.settings.searchText);
|
|
1085
|
+
this.content.list.appendChild(e);
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
this.settings.allowDeselect && !this.settings.isMultiple && (this.store.filter((e) => e.placeholder, false, false).length || this.store.addOption(new A({
|
|
1089
|
+
text: "",
|
|
1090
|
+
value: "",
|
|
1091
|
+
selected: false,
|
|
1092
|
+
placeholder: true
|
|
1093
|
+
}), true));
|
|
1094
|
+
let t = document.createDocumentFragment();
|
|
1095
|
+
for (let n of e) {
|
|
1096
|
+
if (n instanceof j) {
|
|
1097
|
+
let e = document.createElement("div");
|
|
1098
|
+
this.addClasses(e, this.classes.optgroup);
|
|
1099
|
+
let r = document.createElement("div");
|
|
1100
|
+
this.addClasses(r, this.classes.optgroupLabel), e.appendChild(r);
|
|
1101
|
+
let i = document.createElement("div");
|
|
1102
|
+
this.addClasses(i, this.classes.optgroupLabelText), i.textContent = n.label, r.appendChild(i);
|
|
1103
|
+
let a = document.createElement("div");
|
|
1104
|
+
if (this.addClasses(a, this.classes.optgroupActions), r.appendChild(a), this.settings.isMultiple && n.selectAll) {
|
|
1105
|
+
let e = document.createElement("div");
|
|
1106
|
+
this.addClasses(e, this.classes.optgroupSelectAll);
|
|
1107
|
+
let t = this.isOptgroupAllSelected(n.options);
|
|
1108
|
+
t && this.addClasses(e, this.classes.selected);
|
|
1109
|
+
let r = document.createElement("span");
|
|
1110
|
+
r.textContent = this.optgroupSelectAllLabel(t), e.appendChild(r);
|
|
1111
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1112
|
+
i.setAttribute("viewBox", "0 0 100 100"), e.appendChild(i);
|
|
1113
|
+
let o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1114
|
+
o.setAttribute("d", this.classes.optgroupSelectAllBox), i.appendChild(o);
|
|
1115
|
+
let s = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1116
|
+
s.setAttribute("d", this.classes.optgroupSelectAllCheck), i.appendChild(s), e.addEventListener("click", (e) => {
|
|
1117
|
+
e.preventDefault(), e.stopPropagation();
|
|
1118
|
+
let t = this.store.getSelected();
|
|
1119
|
+
if (this.isOptgroupAllSelected(n.options, new Set(t))) {
|
|
1120
|
+
let e = t.filter((e) => {
|
|
1121
|
+
for (let t of n.options) if (e === t.id) return false;
|
|
1122
|
+
return true;
|
|
1123
|
+
});
|
|
1124
|
+
this.callbacks.setSelected(e, true);
|
|
1125
|
+
return;
|
|
1126
|
+
} else {
|
|
1127
|
+
let e = n.options.map((e) => e.id).filter((e) => e !== void 0), r = t.concat(e);
|
|
1128
|
+
for (let e of n.options) e.id && !this.store.getOptionByID(e.id) && this.callbacks.addOption(new A(e));
|
|
1129
|
+
this.callbacks.setSelected(r, true);
|
|
1130
|
+
return;
|
|
1131
|
+
}
|
|
1132
|
+
}), a.appendChild(e);
|
|
1133
|
+
}
|
|
1134
|
+
if (n.closable !== "off") {
|
|
1135
|
+
let t = document.createElement("div");
|
|
1136
|
+
this.addClasses(t, this.classes.optgroupClosable);
|
|
1137
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1138
|
+
i.setAttribute("viewBox", "0 0 100 100"), this.addClasses(i, this.classes.arrow), t.appendChild(i);
|
|
1139
|
+
let o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1140
|
+
i.appendChild(o), n.options.some((e) => e.selected) || this.content.search.input.value.trim() !== "" ? (this.addClasses(t, this.classes.mainOpen), o.setAttribute("d", this.classes.arrowOpen)) : n.closable === "open" ? (this.addClasses(e, this.classes.mainOpen), o.setAttribute("d", this.classes.arrowOpen)) : n.closable === "close" && (this.addClasses(e, this.classes.close), o.setAttribute("d", this.classes.arrowClose)), r.addEventListener("click", (n) => {
|
|
1141
|
+
n.preventDefault(), n.stopPropagation(), this.isClosableOptgroupOpen(e, t) ? (this.removeClasses(e, this.classes.mainOpen), this.removeClasses(t, this.classes.mainOpen), this.addClasses(e, this.classes.close), o.setAttribute("d", this.classes.arrowClose)) : (this.closeOtherClosableOptgroups(e), this.removeClasses(e, this.classes.close), this.removeClasses(t, this.classes.mainOpen), this.addClasses(e, this.classes.mainOpen), o.setAttribute("d", this.classes.arrowOpen));
|
|
1142
|
+
}), a.appendChild(t);
|
|
1143
|
+
}
|
|
1144
|
+
e.appendChild(r);
|
|
1145
|
+
for (let r of n.options) e.appendChild(this.option(new A(r))), t.appendChild(e);
|
|
1146
|
+
}
|
|
1147
|
+
n instanceof A && t.appendChild(this.option(n));
|
|
1148
|
+
}
|
|
1149
|
+
this.content.list.appendChild(t), this.setOptionsListFullData(e), this.announce(this.settings.resultsText.replace("{count}", String(this.lastRenderedOptions.length)));
|
|
1150
|
+
}
|
|
1151
|
+
canFilterOptionsInPlace() {
|
|
1152
|
+
return this.optionsListIsFullData ? this.content.list.querySelector("." + this.classes.getFirst("option")) !== null : false;
|
|
1153
|
+
}
|
|
1154
|
+
resetSearchFilterState() {
|
|
1155
|
+
this.lastSearchFilterTerm = "";
|
|
1156
|
+
}
|
|
1157
|
+
filterOptionsInPlace(e, t) {
|
|
1158
|
+
let n = e.trim();
|
|
1159
|
+
if (n === this.lastSearchFilterTerm) return;
|
|
1160
|
+
this.lastSearchFilterTerm = n;
|
|
1161
|
+
let r = [], i = this.content.list.querySelectorAll("." + this.classes.getFirst("option"));
|
|
1162
|
+
for (let e of i) {
|
|
1163
|
+
let i = e.dataset.id;
|
|
1164
|
+
if (!i) continue;
|
|
1165
|
+
let a = this.store.getOptionByID(i);
|
|
1166
|
+
if (!a) continue;
|
|
1167
|
+
let o = a.placeholder || !a.display || a.selected && this.settings.hideSelected, s = t(a, n);
|
|
1168
|
+
o || !s ? (this.addClasses(e, this.classes.hide), this.removeClasses(e, this.classes.highlighted)) : (this.removeClasses(e, this.classes.hide), this.setOptionElementContent(e, a, n), r.push(a)), a.selected ? (this.addClasses(e, this.classes.selected), e.setAttribute("aria-selected", "true")) : (this.removeClasses(e, this.classes.selected), e.setAttribute("aria-selected", "false"));
|
|
1169
|
+
}
|
|
1170
|
+
this.lastRenderedOptions = r, this.updateOptgroupVisibilityAfterSearch(n), r.length === 0 ? this.updateSearchResultsMessage(0, n) : (this.removeListSearchMessage(), this.announce(this.settings.resultsText.replace("{count}", String(r.length)))), this.updateOptgroupSelectAllStates();
|
|
1171
|
+
}
|
|
1172
|
+
setOptionsListFullData(e) {
|
|
1173
|
+
let t = this.store.getDataOptions(false), n = e.map((e) => e instanceof A ? [e] : e.options.map((e) => new A(e))).flat();
|
|
1174
|
+
if (n.length !== t.length) {
|
|
1175
|
+
this.optionsListIsFullData = false;
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
let r = new Set(t.map((e) => e.id));
|
|
1179
|
+
this.optionsListIsFullData = n.every((e) => r.has(e.id));
|
|
1180
|
+
}
|
|
1181
|
+
isClosableOptgroupOpen(e, t) {
|
|
1182
|
+
return e.classList.contains(this.classes.getFirst("close")) ? false : e.classList.contains(this.classes.getFirst("mainOpen")) || t.classList.contains(this.classes.getFirst("mainOpen"));
|
|
1183
|
+
}
|
|
1184
|
+
closeClosableOptgroup(e) {
|
|
1185
|
+
let t = e.querySelector("." + this.classes.getFirst("optgroupClosable"));
|
|
1186
|
+
if (!t || e.classList.contains(this.classes.getFirst("close"))) return;
|
|
1187
|
+
this.removeClasses(e, this.classes.mainOpen), this.removeClasses(t, this.classes.mainOpen), this.addClasses(e, this.classes.close);
|
|
1188
|
+
let n = t.querySelector("path");
|
|
1189
|
+
n && n.setAttribute("d", this.classes.arrowClose);
|
|
1190
|
+
}
|
|
1191
|
+
closeOtherClosableOptgroups(e) {
|
|
1192
|
+
let t = this.content.list.querySelectorAll("." + this.classes.getFirst("optgroup"));
|
|
1193
|
+
for (let n of t) n !== e && this.closeClosableOptgroup(n);
|
|
1194
|
+
}
|
|
1195
|
+
updateOptgroupVisibilityAfterSearch(e) {
|
|
1196
|
+
let t = this.content.list.querySelectorAll("." + this.classes.getFirst("optgroup"));
|
|
1197
|
+
for (let n of t) {
|
|
1198
|
+
let t = n.querySelectorAll("." + this.classes.getFirst("option")), r = false;
|
|
1199
|
+
for (let e of t) if (!e.classList.contains(this.classes.getFirst("hide"))) {
|
|
1200
|
+
r = true;
|
|
1201
|
+
break;
|
|
1202
|
+
}
|
|
1203
|
+
if (!r) {
|
|
1204
|
+
this.addClasses(n, this.classes.hide);
|
|
1205
|
+
continue;
|
|
1206
|
+
}
|
|
1207
|
+
this.removeClasses(n, this.classes.hide), e !== "" && (this.removeClasses(n, this.classes.close), this.addClasses(n, this.classes.mainOpen));
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
updateSearchResultsMessage(e, t) {
|
|
1211
|
+
if (this.removeListSearchMessage(), e > 0) return;
|
|
1212
|
+
let n = document.createElement("div");
|
|
1213
|
+
if (this.addClasses(n, this.classes.search), this.callbacks.addable) {
|
|
1214
|
+
let e = this.settings.addableText.replace("{value}", t);
|
|
1215
|
+
n.innerHTML = e, this.announce(e);
|
|
1216
|
+
} else n.innerHTML = this.settings.searchText, this.announce(this.settings.searchText);
|
|
1217
|
+
this.content.list.appendChild(n);
|
|
1218
|
+
}
|
|
1219
|
+
removeListSearchMessage() {
|
|
1220
|
+
this.content.list.querySelectorAll("." + this.classes.getFirst("search")).forEach((e) => e.remove());
|
|
1221
|
+
}
|
|
1222
|
+
setOptionElementContent(e, t, n) {
|
|
1223
|
+
let r = n.trim();
|
|
1224
|
+
this.settings.searchHighlight && r !== "" ? e.innerHTML = this.highlightText(t.html === "" ? t.text : t.html, r, this.classes.searchHighlighter) : t.html === "" ? e.textContent = t.text : e.innerHTML = t.html, this.settings.showOptionTooltips && e.textContent ? e.setAttribute("title", e.textContent) : e.removeAttribute("title");
|
|
1225
|
+
}
|
|
1226
|
+
hasRenderedOptions() {
|
|
1227
|
+
return this.content.list.querySelector("." + this.classes.getFirst("option")) !== null;
|
|
1228
|
+
}
|
|
1229
|
+
canUpdateOptionSelectionInPlace() {
|
|
1230
|
+
return this.content.search.input.value.trim() === "" && this.hasRenderedOptions();
|
|
1231
|
+
}
|
|
1232
|
+
updateOptionSelection() {
|
|
1233
|
+
let e = new Set(this.store.getSelected()), t = this.content.list.querySelectorAll("." + this.classes.getFirst("option")), n = null;
|
|
1234
|
+
for (let r of t) {
|
|
1235
|
+
let t = r.dataset.id;
|
|
1236
|
+
if (!t) continue;
|
|
1237
|
+
let i = this.store.getOptionByID(t);
|
|
1238
|
+
if (!i) continue;
|
|
1239
|
+
let a = e.has(t);
|
|
1240
|
+
a ? (this.addClasses(r, this.classes.selected), r.setAttribute("aria-selected", "true"), n = r) : (this.removeClasses(r, this.classes.selected), r.setAttribute("aria-selected", "false")), this.settings.hideSelected && (a ? this.addClasses(r, this.classes.hide) : (this.removeClasses(r, this.classes.hide), i.display || this.addClasses(r, this.classes.hide)));
|
|
1241
|
+
}
|
|
1242
|
+
!this.settings.isMultiple && n ? this.main.main.setAttribute("aria-activedescendant", n.id) : !this.settings.isMultiple && e.size === 0 && this.main.main.removeAttribute("aria-activedescendant"), this.updateOptgroupSelectAllStates();
|
|
1243
|
+
}
|
|
1244
|
+
updateOptgroupSelectAllStates() {
|
|
1245
|
+
if (!this.settings.isMultiple) return;
|
|
1246
|
+
let e = new Set(this.store.getSelected()), t = this.content.list.querySelectorAll("." + this.classes.getFirst("optgroup"));
|
|
1247
|
+
for (let n of t) {
|
|
1248
|
+
let t = n.querySelector("." + this.classes.getFirst("optgroupSelectAll"));
|
|
1249
|
+
if (!t) continue;
|
|
1250
|
+
let r = n.querySelectorAll("." + this.classes.getFirst("option")), i = r.length > 0;
|
|
1251
|
+
for (let t of r) {
|
|
1252
|
+
let n = t.dataset.id;
|
|
1253
|
+
if (!n || !e.has(n)) {
|
|
1254
|
+
i = false;
|
|
1255
|
+
break;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
i ? this.addClasses(t, this.classes.selected) : this.removeClasses(t, this.classes.selected);
|
|
1259
|
+
let a = t.querySelector("span");
|
|
1260
|
+
a && (a.textContent = this.optgroupSelectAllLabel(i));
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
optgroupSelectAllLabel(e) {
|
|
1264
|
+
return e ? "Unselect All" : "Select All";
|
|
1265
|
+
}
|
|
1266
|
+
isOptgroupAllSelected(e, t) {
|
|
1267
|
+
if (e.length === 0) return false;
|
|
1268
|
+
for (let n of e) if (!(t ? n.id && t.has(n.id) : n.selected)) return false;
|
|
1269
|
+
return true;
|
|
1270
|
+
}
|
|
1271
|
+
option(e) {
|
|
1272
|
+
if (e.placeholder) {
|
|
1273
|
+
let e = document.createElement("div");
|
|
1274
|
+
return this.addClasses(e, this.classes.option), this.addClasses(e, this.classes.hide), e;
|
|
1275
|
+
}
|
|
1276
|
+
let t = document.createElement("div");
|
|
1277
|
+
return t.dataset.id = e.id, t.id = this.settings.id + "-" + e.id, this.addClasses(t, this.classes.option), t.setAttribute("role", "option"), e.class && e.class.split(" ").forEach((e) => {
|
|
1278
|
+
t.classList.add(e);
|
|
1279
|
+
}), e.style && (t.style.cssText = e.style), this.setOptionElementContent(t, e, this.content.search.input.value), e.display || this.addClasses(t, this.classes.hide), e.disabled && this.addClasses(t, this.classes.disabled), e.selected && this.settings.hideSelected && this.addClasses(t, this.classes.hide), e.selected ? (this.addClasses(t, this.classes.selected), t.setAttribute("aria-selected", "true"), this.main.main.setAttribute("aria-activedescendant", t.id)) : (this.removeClasses(t, this.classes.selected), t.setAttribute("aria-selected", "false")), t.addEventListener("click", (t) => {
|
|
1280
|
+
t.preventDefault(), t.stopPropagation();
|
|
1281
|
+
let n = this.store.getSelected(), r = t.currentTarget, i = String(r.dataset.id), a = this.store.getOptionByID(i) ?? e, o = n.includes(i), s = t.ctrlKey || t.metaKey;
|
|
1282
|
+
if (e.disabled) return;
|
|
1283
|
+
if (!this.settings.isMultiple && o && !this.settings.allowDeselect) {
|
|
1284
|
+
this.closeOnSingleSelectReclick(a);
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
if (o && a.mandatory) {
|
|
1288
|
+
this.closeOnSingleSelectReclick(a);
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
if (this.settings.isMultiple && this.settings.maxSelected <= n.length && !o || this.settings.isMultiple && this.settings.minSelected >= n.length && o && !s) return;
|
|
1292
|
+
let c = false, l = this.store.getSelectedOptions(), u = [];
|
|
1293
|
+
if (this.settings.isMultiple) {
|
|
1294
|
+
let n = l.some((e) => e.id === i);
|
|
1295
|
+
if (t.shiftKey && this.lastSelectedOption) {
|
|
1296
|
+
let t = this.lastRenderedOptions, n = t.findIndex((e) => e.id === this.lastSelectedOption.id), r = t.findIndex((t) => t.id === e.id);
|
|
1297
|
+
if (n >= 0 && r >= 0) {
|
|
1298
|
+
let e = Math.min(n, r), i = Math.max(n, r), a = t.slice(e, i + 1).filter((e) => !l.find((t) => t.id === e.id));
|
|
1299
|
+
u = l.length + a.length <= this.settings.maxSelected ? l.concat(a) : l;
|
|
1300
|
+
} else u = l;
|
|
1301
|
+
} else u = n ? l.filter((e) => e.id !== i) : l.concat(a), this.lastSelectedOption = a;
|
|
1302
|
+
}
|
|
1303
|
+
if (this.settings.isMultiple || (u = o ? [] : [a]), this.callbacks.beforeChange || (c = true), this.callbacks.beforeChange && (c = this.callbacks.beforeChange(u, l) !== false), c) {
|
|
1304
|
+
this.store.getOptionByID(i) || this.callbacks.addOption(e), this.callbacks.setSelected(u.map((e) => e.id), false);
|
|
1305
|
+
let n = t.ctrlKey || t.metaKey || t.shiftKey;
|
|
1306
|
+
this.settings.closeOnSelect && !(this.settings.isMultiple && n) && this.requestClose("select", {
|
|
1307
|
+
option: a,
|
|
1308
|
+
selectionChanged: this.selectionChanged(l, u)
|
|
1309
|
+
}), this.callbacks.afterChange && this.callbacks.afterChange(u);
|
|
1310
|
+
}
|
|
1311
|
+
}), t;
|
|
1312
|
+
}
|
|
1313
|
+
destroy() {
|
|
1314
|
+
this.stopPositionTracking(), this.modalElements ? (this.unlockBodyScroll(), this.content.main.parentElement === this.modalElements.dialog && this.restoreContentOffscreen(), this.modalElements.overlay.remove(), this.modalElements = null) : this.bodyScrollLocked && this.unlockBodyScroll(), this.main.main.remove(), this.content.main.remove(), this.removeDetachedInstanceDom();
|
|
1315
|
+
}
|
|
1316
|
+
removeDetachedInstanceDom() {
|
|
1317
|
+
let e = this.settings.id, t = this.classes.getFirst("main"), n = this.classes.getFirst("content"), r = this.classes.getFirst("modalOverlay");
|
|
1318
|
+
document.querySelectorAll(`[data-id="${e}"]`).forEach((e) => {
|
|
1319
|
+
(e.classList.contains(t) || e.classList.contains(n) || e.classList.contains(r)) && e.remove();
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
highlightText(e, t, n) {
|
|
1323
|
+
let r = t.trim();
|
|
1324
|
+
if (r === "") return e;
|
|
1325
|
+
let i = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = document.createElement("div");
|
|
1326
|
+
a.innerHTML = e;
|
|
1327
|
+
let o = (e) => {
|
|
1328
|
+
if (e.nodeType === Node.TEXT_NODE) {
|
|
1329
|
+
let t = e.textContent || "", r = RegExp("(" + i + ")", "i");
|
|
1330
|
+
if (r.test(t)) {
|
|
1331
|
+
let i = document.createElement("span");
|
|
1332
|
+
t.split(r).forEach((e, t) => {
|
|
1333
|
+
if (e && r.test(e)) {
|
|
1334
|
+
let t = document.createElement("mark");
|
|
1335
|
+
t.className = n, t.textContent = e, i.appendChild(t);
|
|
1336
|
+
} else e && i.appendChild(document.createTextNode(e));
|
|
1337
|
+
}), e.parentNode?.replaceChild(i, e);
|
|
1338
|
+
}
|
|
1339
|
+
} else e.nodeType === Node.ELEMENT_NODE && Array.from(e.childNodes).forEach((e) => o(e));
|
|
1340
|
+
};
|
|
1341
|
+
return Array.from(a.childNodes).forEach((e) => o(e)), a.innerHTML;
|
|
1342
|
+
}
|
|
1343
|
+
setContentDirection(e) {
|
|
1344
|
+
let t = e === "above", n = t ? this.classes.dirAbove : this.classes.dirBelow, r = t ? this.classes.dirBelow : this.classes.dirAbove;
|
|
1345
|
+
if (this.removeClasses(this.main.main, r), this.addClasses(this.main.main, n), this.removeClasses(this.content.main, r), this.addClasses(this.content.main, n), t) {
|
|
1346
|
+
let e = this.main.main.offsetHeight, t = this.content.main.offsetHeight;
|
|
1347
|
+
this.content.main.style.margin = "-" + (e + t - 1) + "px 0px 0px 0px";
|
|
1348
|
+
} else this.content.main.style.margin = "-1px 0px 0px 0px";
|
|
1349
|
+
}
|
|
1350
|
+
setContentPosition() {
|
|
1351
|
+
let e = this.main.main.getBoundingClientRect();
|
|
1352
|
+
if (this.settings.contentPosition === "relative") {
|
|
1353
|
+
this.applyContentWidth(e);
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
this.cancelOverflowShift();
|
|
1357
|
+
let t, n;
|
|
1358
|
+
this.settings.contentPosition === "fixed" ? (t = e.top + e.height, n = e.left) : (t = e.top + window.scrollY + e.height, n = e.left + window.scrollX), this.content.main.style.top = t + "px", this.content.main.style.left = n + "px", this.applyContentWidth(e);
|
|
1359
|
+
let r = this.getKnownContentWidth(e);
|
|
1360
|
+
if (r !== null) {
|
|
1361
|
+
this.content.main.style.left = this.adjustLeftForOverflow(n, e.left, r) + "px";
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
this.overflowShiftRaf = requestAnimationFrame(() => {
|
|
1365
|
+
this.overflowShiftRaf = 0, this.applyOverflowShiftFromMeasure();
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
applyContentWidth(e) {
|
|
1369
|
+
let t = this.settings.contentWidth;
|
|
1370
|
+
if (this.content.main.style.width = "", this.content.main.style.minWidth = "", this.content.main.style.maxWidth = "", !t) {
|
|
1371
|
+
this.settings.contentPosition !== "relative" && (this.content.main.style.width = e.width + "px");
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
t.startsWith(">") ? this.content.main.style.minWidth = t.slice(1) : t.startsWith("<") ? this.content.main.style.maxWidth = t.slice(1) : this.content.main.style.width = t;
|
|
1375
|
+
}
|
|
1376
|
+
cancelOverflowShift() {
|
|
1377
|
+
this.overflowShiftRaf &&= (cancelAnimationFrame(this.overflowShiftRaf), 0);
|
|
1378
|
+
}
|
|
1379
|
+
getKnownContentWidth(e) {
|
|
1380
|
+
let t = this.settings.contentWidth;
|
|
1381
|
+
if (!t) return e.width;
|
|
1382
|
+
if (t.startsWith(">") || t.startsWith("<") || t.includes("%")) return null;
|
|
1383
|
+
let n = parseFloat(t);
|
|
1384
|
+
return Number.isNaN(n) ? null : n;
|
|
1385
|
+
}
|
|
1386
|
+
adjustLeftForOverflow(e, t, n) {
|
|
1387
|
+
let r = t + n;
|
|
1388
|
+
if (r <= window.innerWidth) return e;
|
|
1389
|
+
let i = e - (r - (window.innerWidth - 20));
|
|
1390
|
+
return this.settings.contentPosition === "fixed" ? Math.max(0, i) : Math.max(window.scrollX, i);
|
|
1391
|
+
}
|
|
1392
|
+
applyOverflowShiftFromMeasure() {
|
|
1393
|
+
let e = this.content.main.getBoundingClientRect().right;
|
|
1394
|
+
if (e <= window.innerWidth) return;
|
|
1395
|
+
let t = e - (window.innerWidth - 20), n = (parseFloat(this.content.main.style.left) || 0) - t;
|
|
1396
|
+
this.settings.contentPosition === "fixed" ? this.content.main.style.left = Math.max(0, n) + "px" : this.content.main.style.left = Math.max(window.scrollX, n) + "px";
|
|
1397
|
+
}
|
|
1398
|
+
moveContentAbove() {
|
|
1399
|
+
this.setContentDirection("above"), this.setContentPosition();
|
|
1400
|
+
}
|
|
1401
|
+
moveContentBelow() {
|
|
1402
|
+
this.setContentDirection("below"), this.setContentPosition();
|
|
1403
|
+
}
|
|
1404
|
+
ensureElementInView(e, t) {
|
|
1405
|
+
let n = e.scrollTop + e.offsetTop, r = n + e.clientHeight, i = t.offsetTop, a = i + t.clientHeight;
|
|
1406
|
+
i < n ? e.scrollTop -= n - i : a > r && (e.scrollTop += a - r);
|
|
1407
|
+
}
|
|
1408
|
+
putContent() {
|
|
1409
|
+
let e = this.main.main.offsetHeight, t = this.main.main.getBoundingClientRect(), n = this.content.main.offsetHeight;
|
|
1410
|
+
return window.innerHeight - (t.top + e) <= n && t.top > n ? "up" : "down";
|
|
1411
|
+
}
|
|
1412
|
+
updateDeselectAll() {
|
|
1413
|
+
if (!this.store || !this.settings) return;
|
|
1414
|
+
let e = this.store.getSelectedOptions(), t = e && e.length > 0, n = this.settings.isMultiple, r = this.settings.allowDeselect, i = this.isAtMinSelected(), a = this.main.deselect.main, o = this.classes.hide;
|
|
1415
|
+
r && !(n && !t) && !i ? this.removeClasses(a, o) : this.addClasses(a, o);
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
//#endregion
|
|
1419
|
+
//#region src/slim-select/mutations.ts
|
|
1420
|
+
function P(e, t) {
|
|
1421
|
+
let n = {
|
|
1422
|
+
classChanged: false,
|
|
1423
|
+
disabledChanged: false,
|
|
1424
|
+
optgroupOptionChanged: false,
|
|
1425
|
+
selectionChanged: false
|
|
1426
|
+
};
|
|
1427
|
+
for (let r of e) {
|
|
1428
|
+
if (r.target === t && (r.attributeName === "disabled" && (n.disabledChanged = true), r.attributeName === "class" && (n.classChanged = true), r.type === "childList")) {
|
|
1429
|
+
for (let e of Array.from(r.addedNodes)) if (e.nodeName === "OPTION" && e.value === t.value) {
|
|
1430
|
+
n.selectionChanged = true;
|
|
1431
|
+
break;
|
|
1432
|
+
}
|
|
1433
|
+
n.optgroupOptionChanged = true;
|
|
1434
|
+
}
|
|
1435
|
+
(r.target.nodeName === "OPTGROUP" || r.target.nodeName === "OPTION") && (n.optgroupOptionChanged = true);
|
|
1436
|
+
}
|
|
1437
|
+
return n;
|
|
1438
|
+
}
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region src/slim-select/select.ts
|
|
1441
|
+
var F = class {
|
|
1442
|
+
select;
|
|
1443
|
+
onValueChange;
|
|
1444
|
+
onClassChange;
|
|
1445
|
+
onDisabledChange;
|
|
1446
|
+
onOptionsChange;
|
|
1447
|
+
onLabelClick;
|
|
1448
|
+
listen = false;
|
|
1449
|
+
observer = null;
|
|
1450
|
+
isUpdating = false;
|
|
1451
|
+
pendingOptionsChange = null;
|
|
1452
|
+
preventNativeSelect = null;
|
|
1453
|
+
preventNativeSelectMousedown = null;
|
|
1454
|
+
preventNativeSelectFocus = null;
|
|
1455
|
+
restoreAriaHiddenOnBlur = null;
|
|
1456
|
+
constructor(e) {
|
|
1457
|
+
this.select = e, this.valueChange = this.valueChange.bind(this), this.select.addEventListener("change", this.valueChange, { passive: true }), this.observer = new MutationObserver(this.observeCall.bind(this)), this.changeListen(true);
|
|
1458
|
+
}
|
|
1459
|
+
enable() {
|
|
1460
|
+
this.select.disabled = false;
|
|
1461
|
+
}
|
|
1462
|
+
disable() {
|
|
1463
|
+
this.select.disabled = true;
|
|
1464
|
+
}
|
|
1465
|
+
hideUI() {
|
|
1466
|
+
this.select.tabIndex = -1, this.select.style.position = "absolute", this.select.style.width = "1px", this.select.style.height = "1px", this.select.style.opacity = "0", this.select.style.overflow = "hidden", this.select.style.pointerEvents = "none", this.select.style.margin = "0", this.select.style.padding = "0", this.select.style.borderWidth = "0", this.select.style.clipPath = "inset(50%)", document.activeElement !== this.select && this.select.setAttribute("aria-hidden", "true"), this.preventNativeSelect || (this.preventNativeSelect = (e) => {
|
|
1467
|
+
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
1468
|
+
}, this.preventNativeSelectMousedown = (e) => {
|
|
1469
|
+
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
1470
|
+
}, this.preventNativeSelectFocus = (e) => {
|
|
1471
|
+
this.select.removeAttribute("aria-hidden"), e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
1472
|
+
}, this.restoreAriaHiddenOnBlur = () => {
|
|
1473
|
+
this.select.setAttribute("aria-hidden", "true");
|
|
1474
|
+
}, this.select.addEventListener("click", this.preventNativeSelect, {
|
|
1475
|
+
capture: true,
|
|
1476
|
+
passive: false
|
|
1477
|
+
}), this.select.addEventListener("mousedown", this.preventNativeSelectMousedown, {
|
|
1478
|
+
capture: true,
|
|
1479
|
+
passive: false
|
|
1480
|
+
}), this.select.addEventListener("focus", this.preventNativeSelectFocus, {
|
|
1481
|
+
capture: true,
|
|
1482
|
+
passive: false
|
|
1483
|
+
}), this.select.addEventListener("blur", this.restoreAriaHiddenOnBlur, {
|
|
1484
|
+
capture: true,
|
|
1485
|
+
passive: true
|
|
1486
|
+
}));
|
|
1487
|
+
}
|
|
1488
|
+
showUI() {
|
|
1489
|
+
this.select.removeAttribute("tabindex"), this.select.style.position = "", this.select.style.width = "", this.select.style.height = "", this.select.style.opacity = "", this.select.style.overflow = "", this.select.style.pointerEvents = "", this.select.style.margin = "", this.select.style.padding = "", this.select.style.borderWidth = "", this.select.style.clipPath = "", this.select.removeAttribute("aria-hidden"), this.preventNativeSelect &&= (this.select.removeEventListener("click", this.preventNativeSelect, { capture: true }), null), this.preventNativeSelectMousedown &&= (this.select.removeEventListener("mousedown", this.preventNativeSelectMousedown, { capture: true }), null), this.preventNativeSelectFocus &&= (this.select.removeEventListener("focus", this.preventNativeSelectFocus, { capture: true }), null), this.restoreAriaHiddenOnBlur &&= (this.select.removeEventListener("blur", this.restoreAriaHiddenOnBlur, { capture: true }), null);
|
|
1490
|
+
}
|
|
1491
|
+
changeListen(e) {
|
|
1492
|
+
this.listen = e, e && this.observer && this.observer.observe(this.select, {
|
|
1493
|
+
subtree: true,
|
|
1494
|
+
childList: true,
|
|
1495
|
+
attributes: true
|
|
1496
|
+
}), e || this.observer && this.observer.disconnect();
|
|
1497
|
+
}
|
|
1498
|
+
valueChange(e) {
|
|
1499
|
+
return this.listen && this.onValueChange && this.onValueChange(this.getSelectedOptions()), true;
|
|
1500
|
+
}
|
|
1501
|
+
observeCall(e) {
|
|
1502
|
+
if (!this.listen) return;
|
|
1503
|
+
let { classChanged: t, disabledChanged: n, optgroupOptionChanged: r, selectionChanged: i } = P(e, this.select), a = i;
|
|
1504
|
+
if (t && this.onClassChange && this.onClassChange(this.select.className.split(" ")), n && this.onDisabledChange && (this.changeListen(false), this.onDisabledChange(this.select.disabled), this.changeListen(true)), r && this.onOptionsChange) {
|
|
1505
|
+
if (this.isUpdating) {
|
|
1506
|
+
if (this.select.options.length > 0) {
|
|
1507
|
+
let e = this.getData();
|
|
1508
|
+
e.length > 0 && (this.pendingOptionsChange = e);
|
|
1509
|
+
}
|
|
1510
|
+
a && this.select.dispatchEvent(new Event("change"));
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
this.changeListen(false), this.onOptionsChange(this.getData()), this.changeListen(true), a = false;
|
|
1514
|
+
}
|
|
1515
|
+
a && this.select.dispatchEvent(new Event("change"));
|
|
1516
|
+
}
|
|
1517
|
+
getData() {
|
|
1518
|
+
let e = [], t = this.select.childNodes;
|
|
1519
|
+
for (let n of t) n.nodeName === "OPTGROUP" && e.push(this.getDataFromOptgroup(n)), n.nodeName === "OPTION" && e.push(this.getDataFromOption(n));
|
|
1520
|
+
return e;
|
|
1521
|
+
}
|
|
1522
|
+
getDataFromOptgroup(e) {
|
|
1523
|
+
let t = {
|
|
1524
|
+
id: e.id,
|
|
1525
|
+
label: e.label,
|
|
1526
|
+
selectAll: e.dataset ? e.dataset.selectall === "true" : false,
|
|
1527
|
+
closable: e.dataset ? e.dataset.closable : "off",
|
|
1528
|
+
options: []
|
|
1529
|
+
}, n = e.childNodes;
|
|
1530
|
+
for (let e of n) e.nodeName === "OPTION" && t.options.push(this.getDataFromOption(e));
|
|
1531
|
+
return t;
|
|
1532
|
+
}
|
|
1533
|
+
getDataFromOption(e) {
|
|
1534
|
+
return {
|
|
1535
|
+
id: e.id,
|
|
1536
|
+
value: e.value,
|
|
1537
|
+
text: e.text,
|
|
1538
|
+
html: e.dataset && e.dataset.html ? e.dataset.html : "",
|
|
1539
|
+
defaultSelected: e.defaultSelected,
|
|
1540
|
+
selected: e.selected,
|
|
1541
|
+
display: e.style.display !== "none",
|
|
1542
|
+
disabled: e.disabled,
|
|
1543
|
+
mandatory: e.dataset ? e.dataset.mandatory === "true" : false,
|
|
1544
|
+
placeholder: e.dataset.placeholder === "true",
|
|
1545
|
+
class: e.className,
|
|
1546
|
+
style: e.style.cssText,
|
|
1547
|
+
data: f(e.dataset)
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1550
|
+
getSelectedOptions() {
|
|
1551
|
+
let e = [], t = this.select.childNodes;
|
|
1552
|
+
for (let n of t) {
|
|
1553
|
+
if (n.nodeName === "OPTGROUP") {
|
|
1554
|
+
let t = n.childNodes;
|
|
1555
|
+
for (let n of t) if (n.nodeName === "OPTION") {
|
|
1556
|
+
let t = n;
|
|
1557
|
+
t.selected && e.push(this.getDataFromOption(t));
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (n.nodeName === "OPTION") {
|
|
1561
|
+
let t = n;
|
|
1562
|
+
t.selected && e.push(this.getDataFromOption(t));
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
return e;
|
|
1566
|
+
}
|
|
1567
|
+
getSelectedValues() {
|
|
1568
|
+
return this.getSelectedOptions().map((e) => e.value);
|
|
1569
|
+
}
|
|
1570
|
+
setSelected(e) {
|
|
1571
|
+
this.changeListen(false);
|
|
1572
|
+
let t = this.select.childNodes;
|
|
1573
|
+
for (let n of t) {
|
|
1574
|
+
if (n.nodeName === "OPTGROUP") {
|
|
1575
|
+
let t = n.childNodes;
|
|
1576
|
+
for (let n of t) if (n.nodeName === "OPTION") {
|
|
1577
|
+
let t = n;
|
|
1578
|
+
t.selected = e.includes(t.id);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
if (n.nodeName === "OPTION") {
|
|
1582
|
+
let t = n;
|
|
1583
|
+
t.selected = e.includes(t.id);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
let n = this.getSelectedOptions();
|
|
1587
|
+
this.select.multiple || (this.select.value = n.length === 1 ? n[0].value : ""), this.select.dispatchEvent(new Event("change", { bubbles: true })), this.changeListen(true);
|
|
1588
|
+
}
|
|
1589
|
+
setSelectedByValue(e) {
|
|
1590
|
+
this.changeListen(false);
|
|
1591
|
+
let t = this.select.childNodes;
|
|
1592
|
+
for (let n of t) {
|
|
1593
|
+
if (n.nodeName === "OPTGROUP") {
|
|
1594
|
+
let t = n.childNodes;
|
|
1595
|
+
for (let n of t) if (n.nodeName === "OPTION") {
|
|
1596
|
+
let t = n;
|
|
1597
|
+
t.selected = e.includes(t.value);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
if (n.nodeName === "OPTION") {
|
|
1601
|
+
let t = n;
|
|
1602
|
+
t.selected = e.includes(t.value);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
let n = this.getSelectedOptions();
|
|
1606
|
+
this.select.multiple || (this.select.value = n.length === 1 ? n[0].value : ""), this.select.dispatchEvent(new Event("change", { bubbles: true })), this.changeListen(true);
|
|
1607
|
+
}
|
|
1608
|
+
updateSelect(e, t, n) {
|
|
1609
|
+
this.changeListen(false), e && (this.select.dataset.id = e), t && (this.select.style.cssText = t), n && (this.select.className = "", n.forEach((e) => {
|
|
1610
|
+
e.trim() !== "" && this.select.classList.add(e.trim());
|
|
1611
|
+
})), this.changeListen(true);
|
|
1612
|
+
}
|
|
1613
|
+
updateOptions(e) {
|
|
1614
|
+
if (!(!e || e.length === 0)) {
|
|
1615
|
+
this.isUpdating = true, this.pendingOptionsChange = null, this.changeListen(false), this.select.innerHTML = "";
|
|
1616
|
+
for (let t of e) t instanceof j && this.select.appendChild(this.createOptgroup(t)), t instanceof A && this.select.appendChild(this.createOption(t));
|
|
1617
|
+
if (this.select.dispatchEvent(new Event("change", { bubbles: true })), this.changeListen(true), this.isUpdating = false, this.pendingOptionsChange !== null) {
|
|
1618
|
+
let e = this.pendingOptionsChange;
|
|
1619
|
+
e.length > 0 && this.onOptionsChange ? (this.pendingOptionsChange = null, this.changeListen(false), this.onOptionsChange(e), this.changeListen(true)) : this.pendingOptionsChange = null;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
createOptgroup(e) {
|
|
1624
|
+
let t = document.createElement("optgroup");
|
|
1625
|
+
if (t.id = e.id, t.label = e.label, e.selectAll && (t.dataset.selectAll = "true"), e.closable !== "off" && (t.dataset.closable = e.closable), e.options) for (let n of e.options) t.appendChild(this.createOption(n));
|
|
1626
|
+
return t;
|
|
1627
|
+
}
|
|
1628
|
+
createOption(e) {
|
|
1629
|
+
let t = document.createElement("option");
|
|
1630
|
+
return t.id = e.id, t.value = e.value, t.textContent = e.text, e.html !== "" && t.setAttribute("data-html", e.html), t.defaultSelected = e.defaultSelected, t.selected = e.selected, e.disabled && (t.disabled = true), e.display || (t.style.display = "none"), e.placeholder && t.setAttribute("data-placeholder", "true"), e.mandatory && t.setAttribute("data-mandatory", "true"), e.class && e.class.split(" ").forEach((e) => {
|
|
1631
|
+
t.classList.add(e);
|
|
1632
|
+
}), e.data && typeof e.data == "object" && Object.keys(e.data).forEach((n) => {
|
|
1633
|
+
t.setAttribute("data-" + E(n), e.data[n]);
|
|
1634
|
+
}), t;
|
|
1635
|
+
}
|
|
1636
|
+
setupLabelHandlers() {
|
|
1637
|
+
let e = [], t = this.select.id;
|
|
1638
|
+
t && document.querySelectorAll(`label[for="${t}"]`).forEach((t) => e.push(t));
|
|
1639
|
+
let n = this.select.parentElement;
|
|
1640
|
+
for (; n && n !== document.body;) {
|
|
1641
|
+
if (n.tagName === "LABEL") {
|
|
1642
|
+
e.push(n);
|
|
1643
|
+
break;
|
|
1644
|
+
}
|
|
1645
|
+
n = n.parentElement;
|
|
1646
|
+
}
|
|
1647
|
+
Array.from(new Set(e)).forEach((e) => {
|
|
1648
|
+
if (e.__slimSelectLabelHandler) return;
|
|
1649
|
+
let t = (e) => {
|
|
1650
|
+
let t = e.target, n = g(t, this.select.dataset.id);
|
|
1651
|
+
e.preventDefault(), !n && this.onLabelClick && this.onLabelClick();
|
|
1652
|
+
};
|
|
1653
|
+
e.__slimSelectLabelHandler = t, e.addEventListener("click", t, {
|
|
1654
|
+
capture: true,
|
|
1655
|
+
passive: false
|
|
1656
|
+
});
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
removeLabelHandlers() {
|
|
1660
|
+
let e = [], t = this.select.id;
|
|
1661
|
+
t && document.querySelectorAll(`label[for="${t}"]`).forEach((t) => e.push(t));
|
|
1662
|
+
let n = this.select.parentElement;
|
|
1663
|
+
for (; n && n !== document.body;) {
|
|
1664
|
+
if (n.tagName === "LABEL") {
|
|
1665
|
+
e.push(n);
|
|
1666
|
+
break;
|
|
1667
|
+
}
|
|
1668
|
+
n = n.parentElement;
|
|
1669
|
+
}
|
|
1670
|
+
Array.from(new Set(e)).forEach((e) => {
|
|
1671
|
+
let t = e.__slimSelectLabelHandler;
|
|
1672
|
+
t && (e.removeEventListener("click", t, { capture: true }), delete e.__slimSelectLabelHandler);
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
destroy() {
|
|
1676
|
+
this.changeListen(false), this.select.removeEventListener("change", this.valueChange), this.preventNativeSelect &&= (this.select.removeEventListener("click", this.preventNativeSelect, { capture: true }), null), this.preventNativeSelectMousedown &&= (this.select.removeEventListener("mousedown", this.preventNativeSelectMousedown, { capture: true }), null), this.preventNativeSelectFocus &&= (this.select.removeEventListener("focus", this.preventNativeSelectFocus, { capture: true }), null), this.restoreAriaHiddenOnBlur &&= (this.select.removeEventListener("blur", this.restoreAriaHiddenOnBlur, { capture: true }), null), this.observer &&= (this.observer.disconnect(), null), this.removeLabelHandlers(), delete this.select.dataset.id, this.showUI();
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
//#endregion
|
|
1680
|
+
//#region src/slim-select/sync.ts
|
|
1681
|
+
function I(e, t) {
|
|
1682
|
+
return T(e.getData(false), t);
|
|
1683
|
+
}
|
|
1684
|
+
function L(e, t) {
|
|
1685
|
+
let n = Array.isArray(t) ? t : [t], r = e.getDataOptions(false), i = [];
|
|
1686
|
+
for (let e of n) {
|
|
1687
|
+
if (r.find((t) => t.id == e)) {
|
|
1688
|
+
i.push(e);
|
|
1689
|
+
continue;
|
|
1690
|
+
}
|
|
1691
|
+
for (let t of r.filter((t) => t.value == e)) i.push(t.id);
|
|
1692
|
+
}
|
|
1693
|
+
return i;
|
|
1694
|
+
}
|
|
1695
|
+
var R = class {
|
|
1696
|
+
deps;
|
|
1697
|
+
queue = [];
|
|
1698
|
+
flushScheduled = false;
|
|
1699
|
+
isSyncing = false;
|
|
1700
|
+
constructor(e) {
|
|
1701
|
+
this.deps = e;
|
|
1702
|
+
}
|
|
1703
|
+
enqueue(e) {
|
|
1704
|
+
if (this.queue.push(e), e.source === "native") {
|
|
1705
|
+
this.flushScheduled || (this.flushScheduled = true, queueMicrotask(() => this.flush()));
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
this.isSyncing || this.flush();
|
|
1709
|
+
}
|
|
1710
|
+
flush() {
|
|
1711
|
+
if (this.flushScheduled = false, this.queue.length === 0) return;
|
|
1712
|
+
let e = this.coalesceBatch(this.queue);
|
|
1713
|
+
this.queue = [], this.isSyncing = true;
|
|
1714
|
+
try {
|
|
1715
|
+
for (let t of e) this.applyChange(t);
|
|
1716
|
+
} finally {
|
|
1717
|
+
this.isSyncing = false, this.queue.length > 0 && this.flush();
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
coalesceBatch(e) {
|
|
1721
|
+
let t = e.some((e) => e.type === "structure"), n = e.some((e) => e.type === "addOption");
|
|
1722
|
+
if (t || n) {
|
|
1723
|
+
let t = e.filter((e) => e.type === "structure" || e.type === "addOption"), n = t[t.length - 1];
|
|
1724
|
+
return n?.type === "structure" ? [n] : t;
|
|
1725
|
+
}
|
|
1726
|
+
let r = e.filter((e) => e.type === "selection");
|
|
1727
|
+
return r.length > 0 ? [r[r.length - 1]] : e;
|
|
1728
|
+
}
|
|
1729
|
+
applyChange(e) {
|
|
1730
|
+
switch (e.type) {
|
|
1731
|
+
case "structure":
|
|
1732
|
+
this.applyStructure(e.data, e.source, e.preserveSelection, e.isSearchResult);
|
|
1733
|
+
break;
|
|
1734
|
+
case "selection":
|
|
1735
|
+
this.applySelection(e.values, e.source, e.runAfterChange !== false);
|
|
1736
|
+
break;
|
|
1737
|
+
case "addOption":
|
|
1738
|
+
this.applyAddOption(e.option);
|
|
1739
|
+
break;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
applyStructure(e, t, n = false, r = false) {
|
|
1743
|
+
let { store: i, select: a, render: o, events: s } = this.deps;
|
|
1744
|
+
if (!r && I(i, e)) return;
|
|
1745
|
+
let c = i.getSelected(), l = i.validateDataArray(e);
|
|
1746
|
+
if (l) {
|
|
1747
|
+
s.error ? s.error(l) : this.deps.onError && this.deps.onError(l);
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
i.setData(e, n);
|
|
1751
|
+
let u = i.getData(false);
|
|
1752
|
+
r || i.snapshotCatalog(), a.updateOptions(u), o.renderValues(), o.renderOptions(u), s.afterChange && !v(c, i.getSelected()) && s.afterChange(i.getSelectedOptions());
|
|
1753
|
+
}
|
|
1754
|
+
applySelection(e, t, n) {
|
|
1755
|
+
let { store: r, select: i, render: a, events: o } = this.deps, s = r.getSelected(), c = L(r, e);
|
|
1756
|
+
if (v(s, c)) return;
|
|
1757
|
+
r.setSelectedBy("id", c), i.setSelectedByValue(r.getSelectedValues()), a.renderValues();
|
|
1758
|
+
let l = a.content.search.input.value.trim();
|
|
1759
|
+
l === "" ? a.canUpdateOptionSelectionInPlace() ? a.updateOptionSelection() : a.renderOptions(r.getData(false)) : a.hasRenderedOptions() ? a.updateOptionSelection() : this.deps.search && this.deps.search(l), n && o.afterChange && !v(s, r.getSelected()) && o.afterChange(r.getSelectedOptions());
|
|
1760
|
+
}
|
|
1761
|
+
applyAddOption(e) {
|
|
1762
|
+
let { store: t, select: n, render: r, events: i } = this.deps, a = t.getSelected(), o = r.content.search.input.value.trim() !== "" && !!this.deps.search, s = e.value ?? e.text ?? "", c = (e) => {
|
|
1763
|
+
for (let t of e) {
|
|
1764
|
+
if (t instanceof j) {
|
|
1765
|
+
if (t.options.some((e) => (e.value ?? e.text) === s)) return true;
|
|
1766
|
+
continue;
|
|
1767
|
+
}
|
|
1768
|
+
if ((t.value ?? t.text) === s) return true;
|
|
1769
|
+
}
|
|
1770
|
+
return false;
|
|
1771
|
+
};
|
|
1772
|
+
if (!c(t.getData(false))) if (o) {
|
|
1773
|
+
let n = t.getCatalogData();
|
|
1774
|
+
c(n) || t.setData([...n, new A(e)], true), t.snapshotCatalog();
|
|
1775
|
+
} else t.addOption(e), t.snapshotCatalog();
|
|
1776
|
+
let l = t.getData(false);
|
|
1777
|
+
n.updateOptions(l), r.renderValues(), r.renderOptions(l), i.afterChange && !v(a, t.getSelected()) && i.afterChange(t.getSelectedOptions());
|
|
1778
|
+
}
|
|
1779
|
+
}, z = class {
|
|
1780
|
+
selectEl;
|
|
1781
|
+
settings;
|
|
1782
|
+
cssClasses;
|
|
1783
|
+
select;
|
|
1784
|
+
store;
|
|
1785
|
+
render;
|
|
1786
|
+
sync;
|
|
1787
|
+
lifecycle;
|
|
1788
|
+
globalEvents;
|
|
1789
|
+
searchGeneration = 0;
|
|
1790
|
+
events = {
|
|
1791
|
+
search: void 0,
|
|
1792
|
+
searchFilter: (e, t) => e.text.toLowerCase().indexOf(t.toLowerCase()) !== -1,
|
|
1793
|
+
addable: void 0,
|
|
1794
|
+
beforeChange: void 0,
|
|
1795
|
+
afterChange: void 0,
|
|
1796
|
+
beforeOpen: void 0,
|
|
1797
|
+
afterOpen: void 0,
|
|
1798
|
+
beforeClose: void 0,
|
|
1799
|
+
afterClose: void 0
|
|
1800
|
+
};
|
|
1801
|
+
constructor(t) {
|
|
1802
|
+
if (this.selectEl = typeof t.select == "string" ? document.querySelector(t.select) : t.select, !this.selectEl) {
|
|
1803
|
+
t.events && t.events.error && t.events.error(/* @__PURE__ */ Error("Could not find select element"));
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1806
|
+
if (this.selectEl.tagName !== "SELECT") {
|
|
1807
|
+
t.events && t.events.error && t.events.error(/* @__PURE__ */ Error("Element isnt of type select"));
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
this.selectEl.dataset.ssid && this.destroy(), this.settings = new d(t.settings), this.cssClasses = new e(t.cssClasses);
|
|
1811
|
+
let n = [
|
|
1812
|
+
"beforeOpen",
|
|
1813
|
+
"afterOpen",
|
|
1814
|
+
"afterClose"
|
|
1815
|
+
];
|
|
1816
|
+
for (let e in t.events) t.events.hasOwnProperty(e) && (n.indexOf(e) === -1 ? this.events[e] = t.events[e] : this.events[e] = _(t.events[e], 100));
|
|
1817
|
+
this.settings.disabled = t.settings?.disabled ? t.settings.disabled : this.selectEl.disabled, this.settings.isMultiple = this.selectEl.multiple, this.settings.style = this.selectEl.style.cssText, this.settings.class = this.selectEl.className.split(" "), this.select = new F(this.selectEl), this.selectEl.id || (this.selectEl.id = this.settings.id), this.select.updateSelect(this.settings.id, this.settings.style, this.settings.class), this.select.hideUI(), this.select.onClassChange = (e) => {
|
|
1818
|
+
this.settings.class = e, this.render.updateClassStyles();
|
|
1819
|
+
}, this.select.onDisabledChange = (e) => {
|
|
1820
|
+
e ? this.disable() : this.enable();
|
|
1821
|
+
}, this.select.onLabelClick = () => {
|
|
1822
|
+
this.settings.disabled || (this.settings.isOpen ? this.close({
|
|
1823
|
+
source: "toggle",
|
|
1824
|
+
selectionChanged: false
|
|
1825
|
+
}) : this.open());
|
|
1826
|
+
};
|
|
1827
|
+
let r = t.data ? t.data : this.select.getData();
|
|
1828
|
+
this.store = new M(this.settings.isMultiple ? "multiple" : "single", r), t.data && this.select.updateOptions(this.store.getData());
|
|
1829
|
+
let i = {
|
|
1830
|
+
open: this.open.bind(this),
|
|
1831
|
+
close: this.close.bind(this),
|
|
1832
|
+
addable: this.events.addable ? this.events.addable : void 0,
|
|
1833
|
+
setSelected: (e, t) => {
|
|
1834
|
+
this.sync.enqueue({
|
|
1835
|
+
type: "selection",
|
|
1836
|
+
values: e,
|
|
1837
|
+
source: "ui",
|
|
1838
|
+
runAfterChange: t
|
|
1839
|
+
});
|
|
1840
|
+
},
|
|
1841
|
+
addOption: (e) => {
|
|
1842
|
+
this.sync.enqueue({
|
|
1843
|
+
type: "addOption",
|
|
1844
|
+
option: e,
|
|
1845
|
+
source: "ui"
|
|
1846
|
+
});
|
|
1847
|
+
},
|
|
1848
|
+
search: this.search.bind(this),
|
|
1849
|
+
beforeChange: this.events.beforeChange,
|
|
1850
|
+
afterChange: this.events.afterChange
|
|
1851
|
+
};
|
|
1852
|
+
this.settings.modalTitle = t.settings?.modalTitle ?? m(this.selectEl), this.render = new N(this.settings, this.cssClasses, this.store, i), this.settings.timeoutDelay = a(this.render.content.main, t.settings?.timeoutDelay), this.sync = new R({
|
|
1853
|
+
select: this.select,
|
|
1854
|
+
store: this.store,
|
|
1855
|
+
render: this.render,
|
|
1856
|
+
events: this.events,
|
|
1857
|
+
search: this.search.bind(this)
|
|
1858
|
+
}), this.select.onValueChange = (e) => {
|
|
1859
|
+
this.sync.enqueue({
|
|
1860
|
+
type: "selection",
|
|
1861
|
+
values: e.map((e) => e.id),
|
|
1862
|
+
source: "native"
|
|
1863
|
+
});
|
|
1864
|
+
}, this.select.onOptionsChange = (e) => {
|
|
1865
|
+
this.sync.enqueue({
|
|
1866
|
+
type: "structure",
|
|
1867
|
+
data: e || [],
|
|
1868
|
+
source: "native"
|
|
1869
|
+
});
|
|
1870
|
+
}, this.lifecycle = new k({
|
|
1871
|
+
beforeOpen: this.events.beforeOpen,
|
|
1872
|
+
afterOpen: this.events.afterOpen,
|
|
1873
|
+
beforeClose: (e) => this.events.beforeClose?.(e),
|
|
1874
|
+
onClose: (e) => this.applyClose(e),
|
|
1875
|
+
afterClose: () => {
|
|
1876
|
+
this.render.clearDirectionClasses(), this.render.finalizeModalClose(), this.events.afterClose && this.events.afterClose();
|
|
1877
|
+
},
|
|
1878
|
+
onOpenReady: () => this.globalEvents.attachDocumentClick(),
|
|
1879
|
+
onCloseReady: () => this.globalEvents.detachDocumentClick()
|
|
1880
|
+
}, {
|
|
1881
|
+
timeoutDelay: this.settings.timeoutDelay,
|
|
1882
|
+
waitForAnimation: (e, t) => this.render.waitForAnimation(e, t)
|
|
1883
|
+
}), this.globalEvents = new O({
|
|
1884
|
+
onDocumentClick: this.documentClick.bind(this),
|
|
1885
|
+
onWindowResize: () => {
|
|
1886
|
+
!this.settings.isOpen && !this.settings.isFullOpen || this.render.moveContent();
|
|
1887
|
+
},
|
|
1888
|
+
onWindowScroll: () => {
|
|
1889
|
+
!this.settings.isOpen && !this.settings.isFullOpen || this.render.moveContent();
|
|
1890
|
+
},
|
|
1891
|
+
onVisibilityChange: () => {
|
|
1892
|
+
document.hidden && this.close({
|
|
1893
|
+
source: "api",
|
|
1894
|
+
selectionChanged: false
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
}), this.render.renderValues(), this.render.renderOptions(this.store.getData(false));
|
|
1898
|
+
let o = this.selectEl.getAttribute("aria-label"), s = this.selectEl.getAttribute("aria-labelledby");
|
|
1899
|
+
if (o) this.render.main.main.setAttribute("aria-label", o);
|
|
1900
|
+
else if (s) this.render.main.main.removeAttribute("aria-label"), this.render.main.main.setAttribute("aria-labelledby", s);
|
|
1901
|
+
else if (this.selectEl.labels && this.selectEl.labels.length > 0) {
|
|
1902
|
+
let e = Array.from(this.selectEl.labels).map((e, t) => (e.id ||= `${this.settings.id}-label-${t}`, e.id));
|
|
1903
|
+
this.render.main.main.removeAttribute("aria-label"), this.render.main.main.setAttribute("aria-labelledby", e.join(" "));
|
|
1904
|
+
}
|
|
1905
|
+
this.selectEl.parentNode && this.selectEl.parentNode.insertBefore(this.render.main.main, this.selectEl.nextSibling), this.globalEvents.attach({ listenScroll: this.settings.openPosition === "auto" }), this.settings.disabled && this.disable(), this.settings.alwaysOpen && this.open(), this.select.setupLabelHandlers(), this.selectEl.slim = this;
|
|
1906
|
+
}
|
|
1907
|
+
enable() {
|
|
1908
|
+
this.settings.disabled = false, this.select.enable(), this.render.enable();
|
|
1909
|
+
}
|
|
1910
|
+
disable() {
|
|
1911
|
+
this.settings.disabled = true, this.select.disable(), this.render.disable();
|
|
1912
|
+
}
|
|
1913
|
+
getData() {
|
|
1914
|
+
return this.store.getData();
|
|
1915
|
+
}
|
|
1916
|
+
setData(e) {
|
|
1917
|
+
this.sync.enqueue({
|
|
1918
|
+
type: "structure",
|
|
1919
|
+
data: e,
|
|
1920
|
+
source: "api"
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
getSelected() {
|
|
1924
|
+
let e = this.store.getSelectedOptions();
|
|
1925
|
+
return this.settings.keepOrder && (e = this.store.selectedOrderOptions(e)), e.map((e) => e.value);
|
|
1926
|
+
}
|
|
1927
|
+
setSelected(e, t = true) {
|
|
1928
|
+
this.sync.enqueue({
|
|
1929
|
+
type: "selection",
|
|
1930
|
+
values: e,
|
|
1931
|
+
source: "api",
|
|
1932
|
+
runAfterChange: t
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
addOption(e) {
|
|
1936
|
+
this.sync.enqueue({
|
|
1937
|
+
type: "addOption",
|
|
1938
|
+
option: e,
|
|
1939
|
+
source: "api"
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
open() {
|
|
1943
|
+
if (this.settings.disabled || this.settings.isOpen) return;
|
|
1944
|
+
this.lifecycle.cancelPending(), this.render.open(), this.settings.showSearch && this.settings.focusSearch && this.render.searchFocus(), this.settings.isOpen = true, this.lifecycle.requestOpen().then(() => {
|
|
1945
|
+
this.settings.isOpen && (this.settings.isFullOpen = this.lifecycle.isFullOpen, this.settings.isOpen = this.lifecycle.isOpen);
|
|
1946
|
+
}), this.settings.contentPosition === "absolute" && !this.render.isModalViewActive() && this.render.startPositionTracking();
|
|
1947
|
+
let e = this.render.content.search.input.value.trim();
|
|
1948
|
+
e !== "" && this.search(e);
|
|
1949
|
+
}
|
|
1950
|
+
close(e = {
|
|
1951
|
+
source: "api",
|
|
1952
|
+
selectionChanged: false
|
|
1953
|
+
}) {
|
|
1954
|
+
!this.settings.isOpen || this.settings.alwaysOpen || this.lifecycle.requestClose(e).then((e) => {
|
|
1955
|
+
e && (this.settings.isOpen || (this.settings.isOpen = this.lifecycle.isOpen, this.settings.isFullOpen = this.lifecycle.isFullOpen));
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
applyClose(e) {
|
|
1959
|
+
this.render.close(), !this.settings.keepSearch && this.render.content.search.input.value !== "" && (this.sync.flush(), this.search(""));
|
|
1960
|
+
let t = e.source === "outside" || e.source === "toggle";
|
|
1961
|
+
this.render.mainFocus(t ? "click" : null), this.settings.isOpen = false, this.settings.isFullOpen = false, this.render.stopPositionTracking();
|
|
1962
|
+
}
|
|
1963
|
+
search(e) {
|
|
1964
|
+
let t = e.trim();
|
|
1965
|
+
if (t === "") {
|
|
1966
|
+
this.render.content.search.input.value = "", this.clearSearch();
|
|
1967
|
+
return;
|
|
1968
|
+
}
|
|
1969
|
+
if (this.render.content.search.input.value !== e && (this.render.content.search.input.value = e), this.events.search) {
|
|
1970
|
+
this.runApiSearch(t);
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
this.runLocalSearch(t);
|
|
1974
|
+
}
|
|
1975
|
+
clearSearch() {
|
|
1976
|
+
if (this.searchGeneration++, !this.events.search && this.render.canFilterOptionsInPlace()) {
|
|
1977
|
+
this.render.filterOptionsInPlace("", this.events.searchFilter), this.render.resetSearchFilterState();
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
this.render.resetSearchFilterState(), this.sync.enqueue({
|
|
1981
|
+
type: "structure",
|
|
1982
|
+
data: this.store.getCatalogData(),
|
|
1983
|
+
source: "api",
|
|
1984
|
+
preserveSelection: true
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
runLocalSearch(e) {
|
|
1988
|
+
if (this.render.canFilterOptionsInPlace()) {
|
|
1989
|
+
this.render.filterOptionsInPlace(e, this.events.searchFilter);
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
let t = this.store.search(e, this.events.searchFilter);
|
|
1993
|
+
this.render.renderOptions(t);
|
|
1994
|
+
}
|
|
1995
|
+
runApiSearch(e) {
|
|
1996
|
+
let t = ++this.searchGeneration;
|
|
1997
|
+
this.render.renderSearching();
|
|
1998
|
+
let n = this.events.search(e, this.store.getSelectedOptions(), this.store.getCatalogData()), r = (n) => {
|
|
1999
|
+
t === this.searchGeneration && this.render.content.search.input.value.trim() === e && this.sync.enqueue({
|
|
2000
|
+
type: "structure",
|
|
2001
|
+
data: n,
|
|
2002
|
+
source: "api",
|
|
2003
|
+
preserveSelection: true,
|
|
2004
|
+
isSearchResult: true
|
|
2005
|
+
});
|
|
2006
|
+
};
|
|
2007
|
+
if (n instanceof Promise) {
|
|
2008
|
+
n.then(r).catch((e) => {
|
|
2009
|
+
t === this.searchGeneration && this.render.renderError(typeof e == "string" ? e : e.message);
|
|
2010
|
+
});
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
if (Array.isArray(n)) {
|
|
2014
|
+
r(n);
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
this.render.renderError("Search event must return a promise or an array of data");
|
|
2018
|
+
}
|
|
2019
|
+
destroy() {
|
|
2020
|
+
this.lifecycle.destroy(), this.render.stopPositionTracking(), this.globalEvents.detach({ listenScroll: this.settings.openPosition === "auto" }), this.store.setData([]), this.render.destroy(), this.select.destroy(), delete this.selectEl.slim;
|
|
2021
|
+
}
|
|
2022
|
+
documentClick(e) {
|
|
2023
|
+
this.settings.isOpen && e.target && !g(e.target, this.settings.id) && this.close({
|
|
2024
|
+
source: "outside",
|
|
2025
|
+
selectionChanged: false
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2029
|
+
|
|
2030
|
+
const i18nDsSelect = {
|
|
2031
|
+
de: {
|
|
2032
|
+
searchPlaceholder: 'Suchen…',
|
|
2033
|
+
noResults: 'Keine Ergebnisse',
|
|
2034
|
+
},
|
|
2035
|
+
en: {
|
|
2036
|
+
searchPlaceholder: 'Search…',
|
|
2037
|
+
noResults: 'No results',
|
|
2038
|
+
},
|
|
2039
|
+
fr: {
|
|
2040
|
+
searchPlaceholder: 'Rechercher…',
|
|
2041
|
+
noResults: 'Aucun résultat',
|
|
2042
|
+
},
|
|
2043
|
+
it: {
|
|
2044
|
+
searchPlaceholder: 'Cerca…',
|
|
2045
|
+
noResults: 'Nessun risultato',
|
|
2046
|
+
},
|
|
2047
|
+
nl: {
|
|
2048
|
+
searchPlaceholder: 'Zoeken…',
|
|
2049
|
+
noResults: 'Geen resultaten',
|
|
2050
|
+
},
|
|
2051
|
+
es: {
|
|
2052
|
+
searchPlaceholder: 'Buscar…',
|
|
2053
|
+
noResults: 'Sin resultados',
|
|
2054
|
+
},
|
|
2055
|
+
pl: {
|
|
2056
|
+
searchPlaceholder: 'Szukaj…',
|
|
2057
|
+
noResults: 'Brak wyników',
|
|
2058
|
+
},
|
|
2059
|
+
pt: {
|
|
2060
|
+
searchPlaceholder: 'Pesquisar…',
|
|
2061
|
+
noResults: 'Sem resultados',
|
|
2062
|
+
},
|
|
2063
|
+
sv: {
|
|
2064
|
+
searchPlaceholder: 'Sök…',
|
|
2065
|
+
noResults: 'Inga resultat',
|
|
2066
|
+
},
|
|
2067
|
+
fi: {
|
|
2068
|
+
searchPlaceholder: 'Hae…',
|
|
2069
|
+
noResults: 'Ei tuloksia',
|
|
2070
|
+
},
|
|
2071
|
+
};
|
|
2072
|
+
|
|
2073
|
+
function buildSlimData(options, optionGroups, placeholder, value) {
|
|
2074
|
+
const selected = Array.isArray(value) ? value : value ? [value] : [];
|
|
2075
|
+
const data = [];
|
|
2076
|
+
data.push({ text: placeholder || '', placeholder: true });
|
|
2077
|
+
if (optionGroups.length > 0) {
|
|
2078
|
+
data.push(...optionGroups.map(group => ({
|
|
2079
|
+
label: group.label,
|
|
2080
|
+
options: group.options.map(opt => ({
|
|
2081
|
+
text: opt.label,
|
|
2082
|
+
value: opt.value,
|
|
2083
|
+
disabled: !!opt.disabled,
|
|
2084
|
+
selected: selected.includes(opt.value),
|
|
2085
|
+
})),
|
|
2086
|
+
})));
|
|
2087
|
+
}
|
|
2088
|
+
else {
|
|
2089
|
+
data.push(...options.map(opt => ({
|
|
2090
|
+
text: opt.label,
|
|
2091
|
+
value: opt.value,
|
|
2092
|
+
disabled: !!opt.disabled,
|
|
2093
|
+
selected: selected.includes(opt.value),
|
|
2094
|
+
})));
|
|
2095
|
+
}
|
|
2096
|
+
return data;
|
|
2097
|
+
}
|
|
2098
|
+
const TYPEAHEAD_TIMEOUT_MS = 500;
|
|
2099
|
+
class SelectPickerController {
|
|
2100
|
+
constructor(config) {
|
|
2101
|
+
this.typeAheadBuffer = '';
|
|
2102
|
+
this.typeAheadLastTime = 0;
|
|
2103
|
+
this.config = config;
|
|
2104
|
+
this.init();
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* PUBLIC API
|
|
2108
|
+
* ------------------------------------------------------
|
|
2109
|
+
*/
|
|
2110
|
+
open() {
|
|
2111
|
+
var _a;
|
|
2112
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.open();
|
|
2113
|
+
}
|
|
2114
|
+
close() {
|
|
2115
|
+
var _a;
|
|
2116
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
2117
|
+
}
|
|
2118
|
+
focus() {
|
|
2119
|
+
var _a;
|
|
2120
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.focus();
|
|
2121
|
+
}
|
|
2122
|
+
blur() {
|
|
2123
|
+
var _a;
|
|
2124
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.blur();
|
|
2125
|
+
}
|
|
2126
|
+
setData(data) {
|
|
2127
|
+
var _a;
|
|
2128
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.setData(data);
|
|
2129
|
+
}
|
|
2130
|
+
setSelected(value) {
|
|
2131
|
+
var _a;
|
|
2132
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.setSelected(value);
|
|
2133
|
+
}
|
|
2134
|
+
setDisabled(disabled) {
|
|
2135
|
+
var _a, _b;
|
|
2136
|
+
if (disabled) {
|
|
2137
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.disable();
|
|
2138
|
+
}
|
|
2139
|
+
else {
|
|
2140
|
+
(_b = this.slimSelect) === null || _b === void 0 ? void 0 : _b.enable();
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
updateSearchPlaceholder(language) {
|
|
2144
|
+
const searchInput = this.config.shadowRoot.querySelector('.ss-search input');
|
|
2145
|
+
if (searchInput)
|
|
2146
|
+
searchInput.placeholder = i18nDsSelect[language].searchPlaceholder;
|
|
2147
|
+
}
|
|
2148
|
+
destroy() {
|
|
2149
|
+
var _a;
|
|
2150
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
2151
|
+
this.slimSelect = undefined;
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* PRIVATE
|
|
2155
|
+
* ------------------------------------------------------
|
|
2156
|
+
*/
|
|
2157
|
+
get trigger() {
|
|
2158
|
+
return this.config.shadowRoot.querySelector('.ss-main');
|
|
2159
|
+
}
|
|
2160
|
+
init() {
|
|
2161
|
+
const { selectEl, popupEl, language, searchable, placeholder, disabled, readonly, multiple, clearable, data } = this.config;
|
|
2162
|
+
this.slimSelect = new z({
|
|
2163
|
+
select: selectEl,
|
|
2164
|
+
settings: {
|
|
2165
|
+
contentLocation: popupEl,
|
|
2166
|
+
contentPosition: 'relative',
|
|
2167
|
+
searchHighlight: true,
|
|
2168
|
+
showSearch: searchable,
|
|
2169
|
+
focusSearch: searchable,
|
|
2170
|
+
searchPlaceholder: i18nDsSelect[language].searchPlaceholder,
|
|
2171
|
+
searchText: i18nDsSelect[language].noResults,
|
|
2172
|
+
placeholderText: placeholder || ' ',
|
|
2173
|
+
disabled: disabled || readonly,
|
|
2174
|
+
closeOnSelect: !multiple,
|
|
2175
|
+
allowDeselect: clearable,
|
|
2176
|
+
modal: 'off',
|
|
2177
|
+
},
|
|
2178
|
+
data,
|
|
2179
|
+
events: {
|
|
2180
|
+
afterChange: (newVal) => this.config.onChange(newVal),
|
|
2181
|
+
afterOpen: () => {
|
|
2182
|
+
this.highlightFirstOption();
|
|
2183
|
+
this.config.onOpen();
|
|
2184
|
+
},
|
|
2185
|
+
afterClose: () => this.config.onClose(),
|
|
2186
|
+
},
|
|
2187
|
+
});
|
|
2188
|
+
this.connectLabelToTrigger();
|
|
2189
|
+
this.fixSearchListener();
|
|
2190
|
+
this.fixKeyboardOpen();
|
|
2191
|
+
this.fixOptionFocus();
|
|
2192
|
+
this.fixTypeAhead();
|
|
2193
|
+
this.highlightFirstOption();
|
|
2194
|
+
}
|
|
2195
|
+
// slim-select never auto-highlights an option: arrow keys are the only built-in trigger.
|
|
2196
|
+
// We want the first matching option highlighted whenever the list opens or a search
|
|
2197
|
+
// narrows the results, so keyboard users can immediately Enter/Space it. Skip it if
|
|
2198
|
+
// something is already highlighted (e.g. from a previous arrow-key navigation).
|
|
2199
|
+
highlightFirstOption() {
|
|
2200
|
+
var _a;
|
|
2201
|
+
if (this.config.popupEl.querySelector('.ss-highlighted'))
|
|
2202
|
+
return;
|
|
2203
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.render.highlight('down');
|
|
2204
|
+
}
|
|
2205
|
+
// Shadow DOM event retargeting makes e.target null inside slim-select's keyup handler.
|
|
2206
|
+
// Intercept during capture phase (before slim-select's bubble listener), stop propagation,
|
|
2207
|
+
// and drive the search programmatically from the element reference instead.
|
|
2208
|
+
fixSearchListener() {
|
|
2209
|
+
if (!this.config.searchable)
|
|
2210
|
+
return;
|
|
2211
|
+
const searchInput = this.config.shadowRoot.querySelector('.ss-search input');
|
|
2212
|
+
if (!searchInput)
|
|
2213
|
+
return;
|
|
2214
|
+
searchInput.addEventListener('input', ev => {
|
|
2215
|
+
var _a, _b;
|
|
2216
|
+
ev.stopImmediatePropagation();
|
|
2217
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.search((_b = searchInput.value) !== null && _b !== void 0 ? _b : '');
|
|
2218
|
+
this.highlightFirstOption();
|
|
2219
|
+
}, { capture: true });
|
|
2220
|
+
}
|
|
2221
|
+
// SlimSelect's Space/Enter listener uses document.activeElement to find its trigger,
|
|
2222
|
+
// but Shadow DOM retargeting returns the host element instead of .ss-main after a
|
|
2223
|
+
// programmatic focus() call — so Space stops working after the first selection.
|
|
2224
|
+
// We intercept keydown on the trigger directly to reopen the dropdown ourselves.
|
|
2225
|
+
fixKeyboardOpen() {
|
|
2226
|
+
const trigger = this.trigger;
|
|
2227
|
+
if (!trigger)
|
|
2228
|
+
return;
|
|
2229
|
+
trigger.addEventListener('keydown', ev => {
|
|
2230
|
+
var _a;
|
|
2231
|
+
const target = ev.target;
|
|
2232
|
+
if ((ev.key === ' ' || ev.key === 'Enter') &&
|
|
2233
|
+
target === trigger &&
|
|
2234
|
+
!target.classList.contains('ss-value-delete') &&
|
|
2235
|
+
!trigger.classList.contains('ss-open')) {
|
|
2236
|
+
ev.preventDefault();
|
|
2237
|
+
(_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.open();
|
|
2238
|
+
}
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
// Options are plain non-focusable divs, so a mouse click's mousedown phase makes the
|
|
2242
|
+
// browser blur .ss-main by default (before slim-select's own click handler ever runs).
|
|
2243
|
+
// Arrow-key navigation is wired to .ss-main's keydown, so once it loses focus keyboard
|
|
2244
|
+
// navigation silently breaks — and for multiple selects (closeOnSelect: false) slim-select
|
|
2245
|
+
// never re-focuses .ss-main afterwards, since it only does so on close. Prevent the browser's
|
|
2246
|
+
// default focus-shift at the source so .ss-main simply never loses focus during option clicks.
|
|
2247
|
+
fixOptionFocus() {
|
|
2248
|
+
this.config.popupEl.addEventListener('mousedown', ev => {
|
|
2249
|
+
const target = ev.target;
|
|
2250
|
+
if (target.closest('.ss-option'))
|
|
2251
|
+
ev.preventDefault();
|
|
2252
|
+
}, { capture: true });
|
|
2253
|
+
}
|
|
2254
|
+
// Non-searchable selects have no way to jump to an option by typing, unlike a native
|
|
2255
|
+
// <select> which supports "hidden" keyboard search: typing a letter jumps to the first
|
|
2256
|
+
// option starting with it, and repeating the same letter cycles through matches. We
|
|
2257
|
+
// replicate that here — highlighting the match while open, or selecting it directly
|
|
2258
|
+
// when closed — since slim-select itself doesn't offer this for non-searchable mode.
|
|
2259
|
+
fixTypeAhead() {
|
|
2260
|
+
if (this.config.searchable)
|
|
2261
|
+
return;
|
|
2262
|
+
const trigger = this.trigger;
|
|
2263
|
+
if (!trigger)
|
|
2264
|
+
return;
|
|
2265
|
+
trigger.addEventListener('keydown', ev => this.handleTypeAhead(ev));
|
|
2266
|
+
}
|
|
2267
|
+
handleTypeAhead(ev) {
|
|
2268
|
+
var _a;
|
|
2269
|
+
const key = ev.key;
|
|
2270
|
+
if (key.length !== 1 || key === ' ' || ev.ctrlKey || ev.metaKey || ev.altKey)
|
|
2271
|
+
return;
|
|
2272
|
+
const render = (_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.render;
|
|
2273
|
+
if (!render)
|
|
2274
|
+
return;
|
|
2275
|
+
const now = Date.now();
|
|
2276
|
+
const withinTimeout = now - this.typeAheadLastTime <= TYPEAHEAD_TIMEOUT_MS;
|
|
2277
|
+
this.typeAheadLastTime = now;
|
|
2278
|
+
const isRepeat = withinTimeout && this.typeAheadBuffer.length > 0 && [...this.typeAheadBuffer].every(c => c === key);
|
|
2279
|
+
this.typeAheadBuffer = withinTimeout ? this.typeAheadBuffer + key : key;
|
|
2280
|
+
const options = render.getOptions(true, true, true);
|
|
2281
|
+
if (options.length === 0)
|
|
2282
|
+
return;
|
|
2283
|
+
const highlightedClass = render.classes.getFirst('highlighted');
|
|
2284
|
+
const highlighted = this.config.popupEl.querySelector(`.${highlightedClass}`);
|
|
2285
|
+
const startIndex = highlighted ? options.indexOf(highlighted) : -1;
|
|
2286
|
+
const match = isRepeat
|
|
2287
|
+
? this.findNextTypeAheadMatch(options, key, startIndex)
|
|
2288
|
+
: options.find(o => this.optionText(o).startsWith(this.typeAheadBuffer.toLowerCase()));
|
|
2289
|
+
if (!match)
|
|
2290
|
+
return;
|
|
2291
|
+
ev.preventDefault();
|
|
2292
|
+
const isOpen = render.content.main.classList.contains(render.classes.getFirst('contentOpen'));
|
|
2293
|
+
if (isOpen) {
|
|
2294
|
+
this.setHighlightedOption(match);
|
|
2295
|
+
}
|
|
2296
|
+
else {
|
|
2297
|
+
match.click();
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
findNextTypeAheadMatch(options, char, startIndex) {
|
|
2301
|
+
var _a;
|
|
2302
|
+
const lower = char.toLowerCase();
|
|
2303
|
+
const matches = options.filter(o => this.optionText(o).startsWith(lower));
|
|
2304
|
+
if (matches.length === 0)
|
|
2305
|
+
return undefined;
|
|
2306
|
+
return (_a = matches.find(o => options.indexOf(o) > startIndex)) !== null && _a !== void 0 ? _a : matches[0];
|
|
2307
|
+
}
|
|
2308
|
+
optionText(option) {
|
|
2309
|
+
var _a;
|
|
2310
|
+
return ((_a = option.textContent) !== null && _a !== void 0 ? _a : '').trim().toLowerCase();
|
|
2311
|
+
}
|
|
2312
|
+
setHighlightedOption(target) {
|
|
2313
|
+
var _a;
|
|
2314
|
+
const render = (_a = this.slimSelect) === null || _a === void 0 ? void 0 : _a.render;
|
|
2315
|
+
if (!render)
|
|
2316
|
+
return;
|
|
2317
|
+
const highlightedClass = render.classes.highlighted;
|
|
2318
|
+
const current = this.config.popupEl.querySelector(`.${render.classes.getFirst('highlighted')}`);
|
|
2319
|
+
if (current && current !== target)
|
|
2320
|
+
render.removeClasses(current, highlightedClass);
|
|
2321
|
+
render.addClasses(target, highlightedClass);
|
|
2322
|
+
render.ensureElementInView(render.content.list, target);
|
|
2323
|
+
if (target.id)
|
|
2324
|
+
render.main.main.setAttribute('aria-activedescendant', target.id);
|
|
2325
|
+
}
|
|
2326
|
+
connectLabelToTrigger() {
|
|
2327
|
+
const ssMain = this.trigger;
|
|
2328
|
+
if (ssMain) {
|
|
2329
|
+
ssMain.id = this.config.triggerId;
|
|
2330
|
+
ssMain.setAttribute('aria-labelledby', 'label');
|
|
2331
|
+
ssMain.removeAttribute('aria-label');
|
|
2332
|
+
}
|
|
2333
|
+
// <label for="..."> only focuses native labelable elements; .ss-main is a div,
|
|
2334
|
+
// so the browser ignores the for/id link. Wire it manually.
|
|
2335
|
+
const label = this.config.shadowRoot.querySelector('label');
|
|
2336
|
+
if (label && ssMain) {
|
|
2337
|
+
label.addEventListener('click', ev => {
|
|
2338
|
+
ev.preventDefault();
|
|
2339
|
+
ssMain.focus();
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
const selectHostCss = () => `:root{--ss-primary-color:#5897fb;--ss-bg-color:#ffffff;--ss-font-color:#4d4d4d;--ss-placeholder-color:#8d8d8d;--ss-disabled-color:#dcdee2;--ss-border-color:#dcdee2;--ss-highlight-color:#fffb8c;--ss-focus-color:var(--ss-primary-color);--ss-success-color:#00b755;--ss-error-color:#dc3545;--ss-main-height:40px;--ss-content-height:300px;--ss-modal-height:85vh;--ss-modal-width:min(90vw, 400px);--ss-search-height:var(--ss-main-height);--ss-option-height:var(--ss-main-height);--ss-spacing-l:9px;--ss-spacing-m:7px;--ss-spacing-s:5px;--ss-animation-timing:0.2s;--ss-border-radius:4px;--ss-modal-z-index:1000001}@-webkit-keyframes ss-valueIn{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes ss-valueIn{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes ss-valueOut{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(0);transform:scale(0);opacity:0}}@keyframes ss-valueOut{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(0);transform:scale(0);opacity:0}}.ss-hide{display:none !important}.ss-main{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--ss-font-color);min-height:var(--ss-main-height);width:100%;padding:0 var(--ss-spacing-s);cursor:pointer;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:background-color var(--ss-animation-timing),border-radius var(--ss-animation-timing);transition:background-color var(--ss-animation-timing),border-radius var(--ss-animation-timing)}@media (prefers-reduced-motion: reduce){.ss-main{-webkit-transition:background-color var(--ss-animation-timing);transition:background-color var(--ss-animation-timing)}}.ss-main{overflow:hidden}.ss-main:focus{-webkit-box-shadow:0 0 5px var(--ss-focus-color);box-shadow:0 0 5px var(--ss-focus-color)}.ss-main.ss-disabled{background-color:var(--ss-disabled-color);cursor:not-allowed}.ss-main.ss-disabled .ss-values .ss-disabled{color:var(--ss-font-color)}.ss-main.ss-disabled .ss-values .ss-value .ss-value-delete{cursor:not-allowed}.ss-main.ss-dir-above{border-top-left-radius:0px;border-top-right-radius:0px}.ss-main.ss-dir-below{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.ss-main .ss-values{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;-ms-flex-item-align:stretch;align-self:stretch;gap:var(--ss-spacing-m);-ms-flex:1 1 0%;flex:1 1 0%;min-width:0;max-width:100%;padding:var(--ss-spacing-s) 0;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.ss-main .ss-values:has(.ss-multi-string){-ms-flex-wrap:nowrap;flex-wrap:nowrap;gap:0}.ss-main .ss-values:has(.ss-single),.ss-main .ss-values:has(.ss-placeholder){-ms-flex-wrap:nowrap;flex-wrap:nowrap}.ss-main .ss-values .ss-single,.ss-main .ss-values .ss-placeholder,.ss-main .ss-values .ss-multi-string{display:block;-ms-flex:1 1 0%;flex:1 1 0%;min-width:0;width:100%;max-width:100%;margin:0;padding:0 var(--ss-spacing-m) 0 calc(var(--ss-spacing-l) - var(--ss-spacing-s));line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box}.ss-main .ss-values .ss-placeholder{color:var(--ss-placeholder-color)}.ss-main .ss-values .ss-max{display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-align:center;align-items:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;font-size:12px;color:var(--ss-bg-color);line-height:1;padding:var(--ss-spacing-s) var(--ss-spacing-m);background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius)}.ss-main .ss-values .ss-value{display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-align:center;align-items:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:100%;background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius);-webkit-animation-name:ss-valueIn;animation-name:ss-valueIn;-webkit-animation-duration:var(--ss-animation-timing);animation-duration:var(--ss-animation-timing);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}@media (prefers-reduced-motion: reduce){.ss-main .ss-values .ss-value{-webkit-animation:none;animation:none}}.ss-main .ss-values .ss-value.ss-value-out{-webkit-animation-name:ss-valueOut;animation-name:ss-valueOut;-webkit-animation-duration:var(--ss-animation-timing);animation-duration:var(--ss-animation-timing);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}.ss-main .ss-values .ss-value .ss-value-text{-ms-flex:1;flex:1;min-width:0;font-size:12px;line-height:1;color:var(--ss-bg-color);padding:var(--ss-spacing-s) var(--ss-spacing-m);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ss-main .ss-values .ss-value .ss-value-delete{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:var(--ss-spacing-l);width:var(--ss-spacing-l);padding:var(--ss-spacing-s) var(--ss-spacing-m);cursor:pointer;border-left:solid 1px var(--ss-bg-color);-webkit-box-sizing:content-box;box-sizing:content-box}.ss-main .ss-values .ss-value .ss-value-delete svg{height:var(--ss-spacing-l);width:var(--ss-spacing-l)}.ss-main .ss-values .ss-value .ss-value-delete svg path{fill:none;stroke:var(--ss-bg-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-deselect{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:auto;padding:0 var(--ss-spacing-m) 0 var(--ss-spacing-m)}.ss-main .ss-deselect svg{width:8px;height:8px}.ss-main .ss-deselect svg path{fill:none;stroke:var(--ss-font-color);stroke-width:20;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-arrow{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;width:12px;height:12px;margin:auto var(--ss-spacing-m) auto var(--ss-spacing-m)}.ss-main .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition:var(--ss-animation-timing);transition:var(--ss-animation-timing)}.ss-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ss-content{position:absolute;display:-ms-flexbox;display:flex;height:auto;-ms-flex-direction:column;flex-direction:column;width:auto;max-height:var(--ss-content-height);-webkit-box-sizing:border-box;box-sizing:border-box;border:solid 1px var(--ss-border-color);background-color:var(--ss-bg-color);min-height:0;-webkit-transition:opacity var(--ss-animation-timing),-webkit-transform var(--ss-animation-timing);transition:opacity var(--ss-animation-timing),-webkit-transform var(--ss-animation-timing);transition:transform var(--ss-animation-timing),opacity var(--ss-animation-timing);transition:transform var(--ss-animation-timing),opacity var(--ss-animation-timing),-webkit-transform var(--ss-animation-timing);opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0);overflow:hidden;z-index:10000}@media (prefers-reduced-motion: reduce){.ss-content{-webkit-transition:none;transition:none}}.ss-content.ss-relative{position:relative;height:100%}.ss-content.ss-fixed{position:fixed}.ss-content.ss-dir-above{-webkit-transform-origin:center bottom;transform-origin:center bottom;-ms-flex-direction:column-reverse;flex-direction:column-reverse;border-top-left-radius:var(--ss-border-radius);border-top-right-radius:var(--ss-border-radius)}.ss-content.ss-dir-below{-webkit-transform-origin:center top;transform-origin:center top;border-bottom-left-radius:var(--ss-border-radius);border-bottom-right-radius:var(--ss-border-radius)}.ss-content.ss-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}.ss-content .ss-search{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;gap:var(--ss-spacing-s);min-height:var(--ss-search-height);padding:0 var(--ss-spacing-s);-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid var(--ss-border-color)}.ss-content .ss-search input{display:-ms-inline-flexbox;display:inline-flex;font-size:inherit;line-height:inherit;-ms-flex:1 1 auto;flex:1 1 auto;width:100%;min-width:0;min-height:0;height:100%;padding:0 var(--ss-spacing-m);margin:0;border:none;background-color:var(--ss-bg-color);outline:0;text-align:left;-webkit-box-sizing:border-box;box-sizing:border-box}.ss-content .ss-search input::-webkit-input-placeholder{color:var(--ss-placeholder-color);vertical-align:middle}.ss-content .ss-search input::-moz-placeholder{color:var(--ss-placeholder-color);vertical-align:middle}.ss-content .ss-search input:-ms-input-placeholder{color:var(--ss-placeholder-color);vertical-align:middle}.ss-content .ss-search input::-ms-input-placeholder{color:var(--ss-placeholder-color);vertical-align:middle}.ss-content .ss-search input::placeholder{color:var(--ss-placeholder-color);vertical-align:middle}.ss-content .ss-search input:focus{-webkit-box-shadow:none;box-shadow:none}.ss-content .ss-search .ss-addable{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-sizing:border-box;box-sizing:border-box;width:22px;height:22px;margin:auto 0;padding:0;border:none;border-radius:var(--ss-border-radius);background-color:var(--ss-primary-color)}.ss-content .ss-search .ss-addable svg{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex:0 0 auto;flex:0 0 auto;width:10px;height:10px;margin:0}.ss-content .ss-search .ss-addable svg path{fill:none;stroke:var(--ss-bg-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-content.ss-dir-above .ss-search{border-bottom:none;border-top:1px solid var(--ss-border-color)}.ss-content .ss-list{-ms-flex:1 1 auto;flex:1 1 auto;height:auto;min-height:0;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ss-primary-color) var(--ss-bg-color)}.ss-content .ss-list .ss-error{color:var(--ss-error-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-searching{color:var(--ss-font-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup .ss-option{min-height:0;-webkit-transition:max-height var(--ss-animation-timing) ease,min-height var(--ss-animation-timing) ease,opacity var(--ss-animation-timing) ease,padding-top var(--ss-animation-timing) ease,padding-bottom var(--ss-animation-timing) ease,margin-top var(--ss-animation-timing) ease,margin-bottom var(--ss-animation-timing) ease;transition:max-height var(--ss-animation-timing) ease,min-height var(--ss-animation-timing) ease,opacity var(--ss-animation-timing) ease,padding-top var(--ss-animation-timing) ease,padding-bottom var(--ss-animation-timing) ease,margin-top var(--ss-animation-timing) ease,margin-bottom var(--ss-animation-timing) ease}.ss-content .ss-list .ss-optgroup:not(.ss-close):not(.ss-open) .ss-option{min-height:var(--ss-option-height)}.ss-content .ss-list .ss-optgroup.ss-open .ss-option{min-height:var(--ss-option-height);max-height:100px;opacity:1;overflow:visible}.ss-content .ss-list .ss-optgroup.ss-close .ss-option{min-height:0 !important;padding-top:0 !important;padding-bottom:0 !important;margin-top:0 !important;margin-bottom:0 !important;max-height:0;opacity:0;overflow:hidden}.ss-content .ss-list .ss-optgroup .ss-optgroup-label{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;min-height:var(--ss-option-height);padding:0 var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-label-text{-ms-flex:1 1 auto;flex:1 1 auto;font-weight:bold;color:var(--ss-font-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label:has(.ss-arrow){cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--ss-spacing-m)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall{-ms-flex:0 0 auto;flex:0 0 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall:hover{opacity:.5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall.ss-selected svg path{stroke:var(--ss-error-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall span{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:60%;text-align:center;padding:0 var(--ss-spacing-s) 0 0}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg{-ms-flex:0 1 auto;flex:0 1 auto;width:13px;height:13px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg path{fill:none;stroke:var(--ss-success-color);stroke-linecap:round;stroke-linejoin:round}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:first-child{stroke-width:5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:last-child{stroke-width:11}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow{-ms-flex:1 1 auto;flex:1 1 auto;width:10px;height:10px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition:var(--ss-animation-timing);transition:var(--ss-animation-timing)}.ss-content .ss-list .ss-optgroup .ss-option{padding:0 var(--ss-spacing-l) 0 calc(var(--ss-spacing-l)*3)}.ss-content .ss-list .ss-option{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:var(--ss-option-height);padding:0 var(--ss-spacing-l);white-space:normal;color:var(--ss-font-color);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;content-visibility:auto;contain-intrinsic-size:auto var(--ss-option-height)}.ss-content .ss-list .ss-option:hover:not(.ss-disabled){color:var(--ss-bg-color);background-color:var(--ss-primary-color);border-left:5px solid var(--ss-primary-color);-webkit-transition:border-left var(--ss-animation-timing) ease;transition:border-left var(--ss-animation-timing) ease}.ss-content .ss-list .ss-option.ss-highlighted,.ss-content .ss-list .ss-option:not(.ss-disabled).ss-selected{color:var(--ss-bg-color);background-color:var(--ss-primary-color)}.ss-content .ss-list .ss-option.ss-disabled{cursor:not-allowed;background-color:var(--ss-disabled-color)}.ss-content .ss-list .ss-option.ss-disabled:hover{color:var(--ss-font-color)}.ss-content .ss-list .ss-option .ss-search-highlight{display:inline-block;background-color:var(--ss-highlight-color)}.ss-content .ss-list .ss-search{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;min-height:var(--ss-search-height);padding:0 var(--ss-spacing-l)}.ss-modal-overlay{position:fixed;inset:0;z-index:var(--ss-modal-z-index);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--ss-spacing-l);-webkit-box-sizing:border-box;box-sizing:border-box;background-color:rgba(0,0,0,.8);opacity:0;-webkit-transition:opacity var(--ss-animation-timing);transition:opacity var(--ss-animation-timing)}@media (prefers-reduced-motion: reduce){.ss-modal-overlay{-webkit-transition:none;transition:none}}.ss-modal-overlay.ss-open{opacity:1}.ss-modal-overlay .ss-modal-dialog{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;max-width:var(--ss-modal-width);max-height:var(--ss-modal-height);overflow:visible}.ss-modal-overlay .ss-modal-dialog .ss-modal-title{-ms-flex:0 0 auto;flex:0 0 auto;width:100%;padding:0 0 var(--ss-spacing-l);-webkit-box-sizing:border-box;box-sizing:border-box;font-weight:bold;font-size:1.35em;line-height:1.3;color:#fff;text-align:left;background:none;border:none}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content{position:relative !important;top:auto !important;left:auto !important;width:100% !important;max-width:100%;max-height:var(--ss-modal-height);min-height:0;margin:0 !important;-webkit-transform-origin:center center;transform-origin:center center;z-index:1;border-radius:var(--ss-border-radius);overflow:visible}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-modal-close{position:absolute;top:0;right:0;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:28px;height:28px;padding:0;margin:0;border:none;border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);color:var(--ss-font-color);cursor:pointer;outline:0;-webkit-box-shadow:0 1px 4px rgba(0,0,0,.5);box-shadow:0 1px 4px rgba(0,0,0,.5);-webkit-transform:translate(50%, -50%);transform:translate(50%, -50%)}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-modal-close:hover{background-color:var(--ss-bg-color);-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16)}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-modal-close:focus{-webkit-box-shadow:0 0 5px var(--ss-focus-color);box-shadow:0 0 5px var(--ss-focus-color)}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-modal-close svg{width:10px;height:10px}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-modal-close svg path{fill:none;stroke:currentColor;stroke-width:20;stroke-linecap:round;stroke-linejoin:round}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-list{min-height:0;overflow-x:hidden;overflow-y:auto;border-radius:0 0 var(--ss-border-radius) var(--ss-border-radius);scrollbar-color:var(--ss-primary-color) var(--ss-bg-color)}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content .ss-search.ss-hide~.ss-list{border-radius:var(--ss-border-radius)}.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content.ss-dir-above,.ss-modal-overlay .ss-modal-dialog .ss-content.ss-modal-content.ss-dir-below{-ms-flex-direction:column;flex-direction:column;-webkit-transform-origin:center center;transform-origin:center center}:host{--_form-field-gap:var(--form-field-gap, var(--mod-form-field-gap, 0.25rem));--_form-container-background:var(--form-container-background, var(--mod-form-container-background, var(--ds-form-container-color-base-background)));--_form-container-border-color:var(--form-container-border-color, var(--mod-form-container-border-color, var(--ds-form-container-color-base-border)));--_form-container-border-width:var(--form-container-border-width, var(--mod-form-container-border-width, var(--ds-form-container-border-width)));--_form-container-radius:var(--form-container-radius, var(--mod-form-container-radius, var(--ds-form-container-radius)));--_form-container-hover-background:var(--form-container-hover-background, var(--mod-form-container-hover-background, var(--ds-form-container-color-hover-background)));--_form-container-active-background:var(--form-container-active-background, var(--mod-form-container-active-background, var(--ds-form-container-color-active-background)));--_form-container-focus-background:var(--form-container-focus-background, var(--mod-form-container-focus-background, var(--ds-form-container-color-focus-background)));--_form-container-hover-border:var(--form-container-hover-border, var(--mod-form-container-hover-border, var(--ds-form-container-color-hover-border)));--_form-container-active-border:var(--form-container-active-border, var(--mod-form-container-active-border, var(--ds-form-container-color-active-border)));--_form-container-focus-border:var(--form-container-focus-border, var(--mod-form-container-focus-border, var(--ds-form-container-color-focus-border)));--_form-label-color:var(--form-label-color, var(--mod-form-label-color, var(--ds-form-label-color-base)));--_form-label-family:var(--form-label-family, var(--mod-form-label-family, var(--ds-form-label-family)));--_form-label-weight:var(--form-label-weight, var(--mod-form-label-weight, var(--ds-form-label-weight)));--_form-label-line-height:var(--form-label-line-height, var(--mod-form-label-line-height, var(--ds-form-label-line-height)));--_form-label-size:var(--form-label-size, var(--mod-form-label-size, var(--ds-form-label-size-device)));--_form-description-color:var(--form-description-color, var(--mod-form-description-color, var(--ds-form-description-color-base)));--_form-description-family:var(--form-description-family, var(--mod-form-description-family, var(--ds-form-description-family)));--_form-description-weight:var(--form-description-weight, var(--mod-form-description-weight, var(--ds-form-description-weight)));--_form-description-line-height:var(--form-description-line-height, var(--mod-form-description-line-height, var(--ds-form-description-line-height)));--_form-description-size:var(--form-description-size, var(--mod-form-description-size, var(--ds-form-description-size-device)));--_select-family:var(--select-family, var(--mod-select-family, var(--ds-form-control-family)));--_select-weight:var(--select-weight, var(--mod-select-weight, var(--ds-form-control-weight)));--_select-line-height:var(--select-line-height, var(--mod-select-line-height, var(--ds-form-control-line-height)));--_select-size:var(--select-size, var(--mod-select-size, var(--ds-form-control-size-device)));--_select-color:var(--select-color, var(--mod-select-color, var(--ds-form-control-color-value-base)));--_select-placeholder:var(--select-placeholder, var(--mod-select-placeholder, var(--ds-form-control-color-placeholder-base)));--_select-background-color:var(--select-background-color, var(--mod-select-background-color, var(--ds-select-color-background-base)));--_select-text-color:var(--select-text-color, var(--mod-select-text-color, var(--ds-select-color-text-base)));--_select-primary-color:var(--select-primary-color, var(--mod-select-primary-color, var(--ds-select-color-primary-base)));--_select-placeholder-color:var(--select-placeholder-color, var(--mod-select-placeholder-color, var(--ds-select-color-placeholder-base)));--_select-disabled-color:var(--select-disabled-color, var(--mod-select-disabled-color, var(--ds-select-color-disabled)));--_select-border-color:var(--select-border-color, var(--mod-select-border-color, var(--ds-select-color-border-base)));--_select-highlight-color:var(--select-highlight-color, var(--mod-select-highlight-color, var(--ds-select-color-highlight-base)));--_select-focus-color:var(--select-focus-color, var(--mod-select-focus-color, var(--ds-select-color-focus-base)));--_select-success-color:var(--select-success-color, var(--mod-select-success-color, var(--ds-select-color-success)));--_select-error-color:var(--select-error-color, var(--mod-select-error-color, var(--ds-select-color-error)));--_select-radius:var(--select-radius, var(--mod-select-radius, var(--ds-select-radius)));--_select-content-family:var(--select-content-family, var(--mod-select-content-family, var(--ds-select-content-family)));--_select-content-background-color:var(--select-content-background-color, var(--mod-select-content-background-color, var(--ds-select-content-color-background-base)));--_select-content-shadow:var(--select-content-shadow, var(--mod-select-content-shadow, var(--ds-select-content-shadow)));--_select-search-text-color:var(--select-search-text-color, var(--mod-select-search-text-color, var(--ds-select-search-color-text-base)));--_select-option-text-color:var(--select-option-text-color, var(--mod-select-option-text-color, var(--ds-select-option-color-text-base)));--_select-option-background-color:var(--select-option-background-color, var(--mod-select-option-background-color, var(--ds-select-option-color-background-base)));--_select-option-border-color:var(--select-option-border-color, var(--mod-select-option-border-color, var(--ds-select-option-color-border-base)));--_select-option-selected-weight:var(--select-option-selected-weight, var(--mod-select-option-selected-weight, var(--ds-select-option-weight-selected)));--_select-option-selected-icon-color:var(--select-option-selected-icon-color, var(--mod-select-option-selected-icon-color, var(--ds-select-option-color-icon-selected)));--_select-option-selected-text-color:var(--select-option-selected-text-color, var(--mod-select-option-selected-text-color, var(--ds-select-option-color-text-selected)));--_select-option-selected-background-color:var(--select-option-selected-background-color, var(--mod-select-option-selected-background-color, var(--ds-select-option-color-background-selected)));--_select-option-hover-text-color:var(--select-option-hover-text-color, var(--mod-select-option-hover-text-color, var(--ds-select-option-color-text-hover)));--_select-option-hover-background-color:var(--select-option-hover-background-color, var(--mod-select-option-hover-background-color, var(--ds-select-option-color-background-hover)));--_select-option-highlight-text-color:var(--select-option-highlight-text-color, var(--mod-select-option-highlight-text-color, var(--ds-select-option-color-text-highlight)));--_select-option-highlight-background-color:var(--select-option-highlight-background-color, var(--mod-select-option-highlight-background-color, var(--ds-select-option-color-background-highlight)));--_select-option-disabled-text-color:var(--select-option-disabled-text-color, var(--mod-select-option-disabled-text-color, var(--ds-select-option-color-text-disabled)));--_select-option-disabled-background-color:var(--select-option-disabled-background-color, var(--mod-select-option-disabled-background-color, var(--ds-select-option-color-background-disabled)));--_select-optgroup-background-color:var(--select-optgroup-background-color, var(--mod-select-optgroup-background-color, var(--ds-select-optgroup-color-background-base)));--_select-optgroup-text-color:var(--select-optgroup-text-color, var(--mod-select-optgroup-text-color, var(--ds-select-optgroup-color-text-base)));--_select-optgroup-weight:var(--select-optgroup-weight, var(--mod-select-optgroup-weight, var(--ds-select-optgroup-weight)));--_select-icon-color:var(--select-icon-color, var(--mod-select-icon-color, var(--ds-select-icon-color-base)));--_select-icon-hover-color:var(--select-icon-hover-color, var(--mod-select-icon-hover-color, var(--ds-select-icon-color-hover)));--_select-icon-active-color:var(--select-icon-active-color, var(--mod-select-icon-active-color, var(--ds-select-icon-color-active)));--_select-tag-background-color:var(--select-tag-background-color, var(--mod-select-tag-background-color, var(--ds-select-chip-color-base-background)));--_select-tag-text-color:var(--select-tag-text-color, var(--mod-select-tag-text-color, var(--ds-select-chip-color-base-text)));--_select-tag-family:var(--select-tag-family, var(--mod-select-tag-family, var(--ds-select-chip-family)));--_select-checkbox-border-color:var(--select-checkbox-border-color, var(--mod-select-checkbox-border-color, var(--ds-select-checkbox-color-border-base)));--_select-checkbox-selected-background-color:var(--select-checkbox-selected-background-color, var(--mod-select-checkbox-selected-background-color, var(--ds-select-checkbox-color-background-selected)));--_select-checkbox-selected-border-color:var(--select-checkbox-selected-border-color, var(--mod-select-checkbox-selected-border-color, var(--ds-select-checkbox-color-border-selected)));--_select-focus-ring-color:var(--select-focus-ring-color, var(--mod-select-focus-ring-color, var(--ds-select-color-focus-ring-base)));--ss-bg-color:var(--_select-background-color);--ss-font-color:var(--_select-text-color);--ss-primary-color:var(--_select-primary-color);--ss-placeholder-color:var(--_select-placeholder-color);--ss-disabled-color:var(--_select-disabled-color);--ss-border-color:var(--_select-border-color);--ss-highlight-color:var(--_select-highlight-color);--ss-focus-color:var(--_select-focus-color);--ss-success-color:var(--_select-success-color);--ss-error-color:var(--_select-error-color);--ss-main-height:40px;--ss-content-height:300px;--ss-modal-height:85vh;--ss-modal-width:min(90vw, 400px);--ss-search-height:var(--ss-main-height);--ss-option-height:var(--ss-main-height);--ss-spacing-l:8px;--ss-spacing-m:4px;--ss-spacing-s:2px;--ss-icon-spacing:10px;--ss-animation-timing:0.2s;--ss-border-radius:var(--_select-radius);--ss-modal-z-index:1000001}:host{position:relative;display:grid;gap:var(--_form-field-gap)}:host #container{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;min-height:3rem;gap:.25rem;padding-inline:.5rem;background:var(--_form-container-background);border:var(--_form-container-border-width) solid var(--_form-container-border-color);border-radius:var(--_form-container-radius)}@media (hover: hover)and (pointer: fine){:host #container:hover,:host #container.is-hovered{background:var(--_form-container-hover-background);border-color:var(--_form-container-hover-border)}}:host #container:active,:host #container.is-pressed{background:var(--_form-container-active-background);border-color:var(--_form-container-active-border)}:host #container:focus-within:not(:active),:host #container.is-focused:not(:active){background:var(--_form-container-focus-background);border-color:var(--_form-container-focus-border)}:host :where(fieldset){margin:0;padding:0;border:none}:host :where(legend){padding:0;float:left;width:100%}:host label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;color:var(--_form-label-color);font-family:var(--_form-label-family);font-weight:var(--_form-label-weight);font-size:var(--_form-label-size);line-height:var(--_form-label-line-height)}:host #description{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;gap:.25rem;min-height:1.125rem;color:var(--_form-description-color);font-family:var(--_form-description-family);font-weight:var(--_form-description-weight);font-size:var(--_form-description-size);line-height:var(--_form-description-line-height)}:host #description ds-icon{--icon-color:var(--_form-description-color)}:host #inner{position:relative;display:grid;gap:var(--_form-field-gap)}:host select{display:none}:host #container{position:relative;padding-inline:0;cursor:pointer}:host(.is-danger){--mod-form-container-border-color:var(--ds-form-container-color-danger-border);--mod-form-description-color:var(--ds-form-description-color-danger);--mod-form-container-hover-border:var(--ds-form-container-color-danger-border);--mod-form-container-active-border:var(--ds-form-container-color-danger-border)}:host(.is-success){--mod-form-container-border-color:var(--ds-form-container-color-success-border);--mod-form-description-color:var(--ds-form-description-color-success);--mod-form-container-hover-border:var(--ds-form-container-color-success-border);--mod-form-container-active-border:var(--ds-form-container-color-success-border)}:host(.is-warning){--mod-form-container-border-color:var(--ds-form-container-color-warning-border);--mod-form-description-color:var(--ds-form-description-color-warning);--mod-form-container-hover-border:var(--ds-form-container-color-warning-border);--mod-form-container-active-border:var(--ds-form-container-color-warning-border)}:host(.is-disabled){pointer-events:none;cursor:default;--mod-form-container-background:var(--ds-form-container-color-disabled-background);--mod-form-container-border-color:var(--ds-form-container-color-disabled-border);--mod-form-label-color:var(--ds-form-label-color-disabled);--mod-form-description-color:var(--ds-form-description-color-disabled);--mod-select-color:var(--ds-form-control-color-value-disabled);--mod-select-placeholder:var(--ds-form-control-color-placeholder-disabled)}:host #container{position:relative}:host #popup{display:block}:host .ss-main{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;user-drag:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}@media print{:host .ss-main{display:none !important}}:host .ss-main{padding:0;margin:0;border:none;-webkit-box-shadow:none;box-shadow:none;font-family:var(--_select-content-family);z-index:var(--ds-alias-z-index-popup)}:host .ss-content{background-color:var(--_select-content-background-color);-webkit-box-shadow:var(--_select-content-shadow);box-shadow:var(--_select-content-shadow);border:none;margin:0 !important;position:absolute;top:100%;left:0;width:100%;min-height:0;max-height:300px;height:auto}@media (prefers-reduced-motion: reduce){:host .ss-content{-webkit-transition:none !important;transition:none !important;-webkit-animation:none !important;animation:none !important}}:host .ss-content .ss-search{border-width:2px;border-color:var(--_form-container-border-color)}:host .ss-content .ss-search input{color:var(--_select-search-text-color)}:host .ss-content .ss-search input[type=search]::-ms-clear{display:none;width:0;height:0}:host .ss-content .ss-search input[type=search]::-ms-reveal{display:none;width:0;height:0}:host .ss-content .ss-search input[type=search]::-webkit-search-decoration,:host .ss-content .ss-search input[type=search]::-webkit-search-cancel-button,:host .ss-content .ss-search input[type=search]::-webkit-search-results-button,:host .ss-content .ss-search input[type=search]::-webkit-search-results-decoration{display:none}:host .ss-content .ss-list .ss-option .ss-search-highlight{font-weight:var(--_select-option-selected-weight);color:var(--_select-option-highlight-text-color);border-radius:var(--_select-radius)}:host .ss-content .ss-list .ss-option{color:var(--_select-option-text-color);background-color:var(--_select-option-background-color);border-left:none !important;border-bottom:2px solid var(--_select-option-border-color)}:host .ss-content .ss-list .ss-option:last-child{border-bottom:none}:host .ss-content .ss-list .ss-option::after{display:block;content:"";width:14px;height:14px;-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;margin-left:auto}:host .ss-content .ss-list .ss-option.ss-selected{font-weight:var(--_select-option-selected-weight);background-color:var(--_select-option-selected-background-color);color:var(--_select-option-selected-text-color)}:host .ss-content .ss-list .ss-option.ss-selected::after{-webkit-mask-image:url("data:image/svg+xml,<svg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M13.637 1.19792C14.0627 1.54974 14.1227 2.18006 13.7708 2.60579L5.73084 12.335L5.72842 12.3379C5.54554 12.5575 5.31602 12.7336 5.05655 12.8534C4.79707 12.9731 4.51417 13.0336 4.22842 13.0302L4.22752 13.0302C3.93709 13.0266 3.65125 12.9573 3.39146 12.8274C3.13254 12.6979 2.9062 12.5117 2.72931 12.2826C2.72871 12.2818 2.72812 12.281 2.72752 12.2802L0.210633 9.04426C-0.128437 8.60831 -0.0499029 7.98003 0.386044 7.64096C0.821992 7.30189 1.45027 7.38043 1.78934 7.81638L4.25291 10.9838L12.2291 1.33176C12.5809 0.906034 13.2113 0.846112 13.637 1.19792Z'/></svg>");mask-image:url("data:image/svg+xml,<svg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M13.637 1.19792C14.0627 1.54974 14.1227 2.18006 13.7708 2.60579L5.73084 12.335L5.72842 12.3379C5.54554 12.5575 5.31602 12.7336 5.05655 12.8534C4.79707 12.9731 4.51417 13.0336 4.22842 13.0302L4.22752 13.0302C3.93709 13.0266 3.65125 12.9573 3.39146 12.8274C3.13254 12.6979 2.9062 12.5117 2.72931 12.2826C2.72871 12.2818 2.72812 12.281 2.72752 12.2802L0.210633 9.04426C-0.128437 8.60831 -0.0499029 7.98003 0.386044 7.64096C0.821992 7.30189 1.45027 7.38043 1.78934 7.81638L4.25291 10.9838L12.2291 1.33176C12.5809 0.906034 13.2113 0.846112 13.637 1.19792Z'/></svg>");-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;background-color:var(--_select-option-selected-icon-color)}:host .ss-content .ss-list .ss-option:hover:not(.ss-disabled),:host .ss-content .ss-list .ss-option:active:not(.ss-disabled){background-color:var(--_select-option-hover-background-color);color:var(--_select-option-hover-text-color)}:host .ss-content .ss-list .ss-option.ss-highlighted{background-color:var(--_select-option-highlight-background-color);color:var(--_select-option-highlight-text-color)}:host .ss-content .ss-list .ss-option.ss-disabled{background-color:var(--_select-option-disabled-background-color);color:var(--_select-option-disabled-text-color)}:host .ss-main .ss-deselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;user-drag:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}@media print{:host .ss-main .ss-deselect{display:none !important}}:host .ss-main .ss-deselect{border-radius:var(--ds-alias-radius-rounded);background:rgba(0,0,0,0);width:1.5rem;height:1.5rem;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;vertical-align:middle;cursor:pointer;word-break:normal;-webkit-box-shadow:none;box-shadow:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-transition-property:color,background-color,border-color,text-shadow,-webkit-box-shadow;transition-property:color,background-color,border-color,text-shadow,-webkit-box-shadow;transition-property:color,background-color,border-color,box-shadow,text-shadow;transition-property:color,background-color,border-color,box-shadow,text-shadow,-webkit-box-shadow;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}:host .ss-main .ss-deselect::-moz-focus-inner{border:0}:host .ss-main .ss-deselect:disabled{pointer-events:none}@media (hover: hover)and (pointer: fine){:host .ss-main .ss-deselect:hover,:host .ss-main .ss-deselect.is-hovered{--icon-color:var(--ds-alias-text-color-primary-hover);background:var(--ds-alias-background-color-highlight)}}:host .ss-main .ss-deselect:active,:host .ss-main .ss-deselect.is-pressed{--icon-color:var(--ds-alias-text-color-primary-active);background:var(--ds-alias-background-color-highlight)}@media (hover: hover)and (pointer: fine){:host .ss-main .ss-deselect:focus-visible:not(:active),:host .ss-main .ss-deselect.is-focused:not(:active){-webkit-box-shadow:var(--ds-alias-interaction-focus-color-border) 0 0 0 2px,var(--ds-alias-interaction-focus-color-base) 0 0 0 5px !important;box-shadow:var(--ds-alias-interaction-focus-color-border) 0 0 0 2px,var(--ds-alias-interaction-focus-color-base) 0 0 0 5px !important}}:host .ss-main .ss-deselect::after{position:absolute;content:"";display:block;width:1rem;height:1rem;margin-inline:var(--ss-icon-spacing);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893Z' clip-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893Z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask-size:80%;mask-size:80%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;background-color:var(--_select-icon-color);-webkit-transition:-webkit-transform var(--ss-animation-timing) ease-in-out;transition:-webkit-transform var(--ss-animation-timing) ease-in-out;transition:transform var(--ss-animation-timing) ease-in-out;transition:transform var(--ss-animation-timing) ease-in-out, -webkit-transform var(--ss-animation-timing) ease-in-out}@media (hover: hover)and (pointer: fine){:host .ss-main .ss-deselect:hover::after,:host .ss-main .ss-deselect.is-hovered::after{background-color:var(--_select-icon-hover-color)}}:host .ss-main .ss-deselect:active::after,:host .ss-main .ss-deselect.is-pressed::after{background-color:var(--_select-icon-active-color)}:host .ss-main .ss-deselect svg{display:none}:host .ss-main .ss-arrow{display:block;width:1rem;height:1rem;margin-inline:var(--ss-icon-spacing);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2010%2010'%3E%3Cpath%20fill='black'%20d='M5,7.874a1.238,1.238,0,0,1-.879-.364L.206,3.393A.75.75,0,1,1,1.294,2.36L4.819,6.072a.249.249,0,0,0,.362,0L8.706,2.36A.75.75,0,1,1,9.794,3.393L5.9,7.5A1.269,1.269,0,0,1,5,7.874Z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2010%2010'%3E%3Cpath%20fill='black'%20d='M5,7.874a1.238,1.238,0,0,1-.879-.364L.206,3.393A.75.75,0,1,1,1.294,2.36L4.819,6.072a.249.249,0,0,0,.362,0L8.706,2.36A.75.75,0,1,1,9.794,3.393L5.9,7.5A1.269,1.269,0,0,1,5,7.874Z'/%3E%3C/svg%3E");-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;background-color:var(--_select-icon-color);-webkit-transition:-webkit-transform var(--ss-animation-timing) ease-in-out;transition:-webkit-transform var(--ss-animation-timing) ease-in-out;transition:transform var(--ss-animation-timing) ease-in-out;transition:transform var(--ss-animation-timing) ease-in-out, -webkit-transform var(--ss-animation-timing) ease-in-out}:host .ss-main .ss-arrow path{display:none}:host .ss-main.ss-dir-below .ss-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host .ss-main .ss-values{padding-inline:var(--ss-icon-spacing)}:host .ss-main .ss-values .ss-single{padding-inline:0}:host .ss-main .ss-values .ss-value{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;user-drag:none;min-height:1.5rem;padding-block:var(--ds-tag-space-padding-y-sm);padding-inline:var(--ds-tag-space-padding-x-sm);border-radius:var(--ds-tag-radius-base);background-color:var(--_select-tag-background-color)}:host .ss-main .ss-values .ss-value .ss-value-text{color:var(--_select-tag-text-color);font-family:var(--_select-tag-family);line-height:1;font-size:var(--ds-tag-font-size-sm);font-weight:var(--ds-tag-font-weight-sm);padding:0}:host .ss-main .ss-values .ss-value .ss-value-delete{position:relative;margin:0;padding:0;width:20px;height:20px;border:none;border-radius:var(--ds-close-radius);background-color:var(--ds-close-color-background-base);-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;margin-left:.25rem;margin-right:-0.5rem}:host .ss-main .ss-values .ss-value .ss-value-delete::after{display:block;content:"";width:10px;height:10px;margin-left:5px;margin-right:5px;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893Z' clip-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893Z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;background-color:var(--ds-close-color-icon-base)}:host .ss-main .ss-values .ss-value .ss-value-delete svg{display:none}@media (hover: hover)and (pointer: fine){:host .ss-main .ss-values .ss-value .ss-value-delete:hover{background-color:var(--ds-close-color-background-hover)}}:host .ss-main .ss-values .ss-value .ss-value-delete:active{background-color:var(--ds-close-color-background-active)}@media (hover: hover)and (pointer: fine){:host .ss-main .ss-values .ss-value .ss-value-delete:focus-visible:not(:active){-webkit-box-shadow:var(--ds-alias-interaction-focus-color-border) 0 0 0 2px,var(--_select-focus-ring-color) 0 0 0 5px !important;box-shadow:var(--ds-alias-interaction-focus-color-border) 0 0 0 2px,var(--_select-focus-ring-color) 0 0 0 5px !important}}:host .ss-content .ss-list .ss-optgroup .ss-optgroup-label{background-color:var(--_select-optgroup-background-color);color:var(--_select-optgroup-text-color);font-weight:var(--_select-optgroup-weight)}:host #popup.is-multiple .ss-content .ss-list .ss-option::after{display:none}:host #popup.is-multiple .ss-content .ss-list .ss-option::before{width:16px;height:16px;content:"";border:2px solid var(--_select-checkbox-border-color);border-radius:var(--_select-radius);margin-right:.5rem;-ms-flex-negative:0;flex-shrink:0}:host #popup.is-multiple .ss-content .ss-list .ss-option.ss-selected::before{background-color:var(--_select-checkbox-selected-background-color);border-color:var(--_select-checkbox-selected-border-color);background-image:url("data:image/svg+xml,<svg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'><path fill='%23ffffff' fill-rule='evenodd' clip-rule='evenodd' d='M13.637 1.19792C14.0627 1.54974 14.1227 2.18006 13.7708 2.60579L5.73084 12.335L5.72842 12.3379C5.54554 12.5575 5.31602 12.7336 5.05655 12.8534C4.79707 12.9731 4.51417 13.0336 4.22842 13.0302L4.22752 13.0302C3.93709 13.0266 3.65125 12.9573 3.39146 12.8274C3.13254 12.6979 2.9062 12.5117 2.72931 12.2826C2.72871 12.2818 2.72812 12.281 2.72752 12.2802L0.210633 9.04426C-0.128437 8.60831 -0.0499029 7.98003 0.386044 7.64096C0.821992 7.30189 1.45027 7.38043 1.78934 7.81638L4.25291 10.9838L12.2291 1.33176C12.5809 0.906034 13.2113 0.846112 13.637 1.19792Z'/></svg>");background-size:75%;background-repeat:no-repeat;background-position:center}`;
|
|
2346
|
+
|
|
2347
|
+
const DsSelect = class {
|
|
2348
|
+
constructor(hostRef) {
|
|
2349
|
+
index.registerInstance(this, hostRef);
|
|
2350
|
+
this.dsChange = index.createEvent(this, "dsChange");
|
|
2351
|
+
this.dsFocus = index.createEvent(this, "dsFocus");
|
|
2352
|
+
this.dsBlur = index.createEvent(this, "dsBlur");
|
|
2353
|
+
this.dsClick = index.createEvent(this, "dsClick");
|
|
2354
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
2355
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
2356
|
+
}
|
|
2357
|
+
else {
|
|
2358
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
2359
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
2360
|
+
}
|
|
2361
|
+
this.inheritedAttributes = {};
|
|
2362
|
+
this.initialValue = null;
|
|
2363
|
+
this.selectId = `ds-select-${SelectIds++}`;
|
|
2364
|
+
this.focused = false;
|
|
2365
|
+
this.language = index.defaultConfig.language;
|
|
2366
|
+
this.region = index.defaultConfig.region;
|
|
2367
|
+
this.slottedOptions = [];
|
|
2368
|
+
this.slottedOptionGroups = [];
|
|
2369
|
+
/**
|
|
2370
|
+
* PUBLIC PROPERTY API
|
|
2371
|
+
* ------------------------------------------------------
|
|
2372
|
+
*/
|
|
2373
|
+
/**
|
|
2374
|
+
* The current value of the select.
|
|
2375
|
+
* In single mode: `string | null`.
|
|
2376
|
+
* In multiple mode: `string[]` (array of selected values). As an HTML attribute, multiple
|
|
2377
|
+
* values can also be passed as a comma-separated string, e.g. `value="it,ch"`.
|
|
2378
|
+
*/
|
|
2379
|
+
this.value = null;
|
|
2380
|
+
/**
|
|
2381
|
+
* The name of the control, which is submitted with the form data.
|
|
2382
|
+
*/
|
|
2383
|
+
this.name = this.selectId;
|
|
2384
|
+
/**
|
|
2385
|
+
* The label displayed above the select field.
|
|
2386
|
+
*/
|
|
2387
|
+
this.label = '';
|
|
2388
|
+
/**
|
|
2389
|
+
* The description displayed below the select field.
|
|
2390
|
+
*/
|
|
2391
|
+
this.description = '';
|
|
2392
|
+
/**
|
|
2393
|
+
* Defines the color state of the select field.
|
|
2394
|
+
*/
|
|
2395
|
+
this.color = 'primary';
|
|
2396
|
+
/**
|
|
2397
|
+
* If `true`, the component renders in an invalid state.
|
|
2398
|
+
*/
|
|
2399
|
+
this.invalid = false;
|
|
2400
|
+
/**
|
|
2401
|
+
* Validation message shown when `invalid` is true.
|
|
2402
|
+
*/
|
|
2403
|
+
this.invalidText = '';
|
|
2404
|
+
/**
|
|
2405
|
+
* If `true`, the user must select a value before submitting the form.
|
|
2406
|
+
*/
|
|
2407
|
+
this.required = true;
|
|
2408
|
+
/**
|
|
2409
|
+
* If `true`, the select is non-interactive and excluded from form submission.
|
|
2410
|
+
*/
|
|
2411
|
+
this.disabled = false;
|
|
2412
|
+
/**
|
|
2413
|
+
* If `true`, the value cannot be changed by the user.
|
|
2414
|
+
*/
|
|
2415
|
+
this.readonly = false;
|
|
2416
|
+
/**
|
|
2417
|
+
* If `true`, the user can select multiple options.
|
|
2418
|
+
* The `value` prop and `dsChange` event will carry a `string[]` instead of `string | null`.
|
|
2419
|
+
*/
|
|
2420
|
+
this.multiple = false;
|
|
2421
|
+
/**
|
|
2422
|
+
* If `true`, a search input is shown inside the dropdown to filter options.
|
|
2423
|
+
*/
|
|
2424
|
+
this.searchable = false;
|
|
2425
|
+
/**
|
|
2426
|
+
* If `true`, a clear button is shown inside the trigger that resets the value to `null` (single mode only).
|
|
2427
|
+
*/
|
|
2428
|
+
this.clearable = false;
|
|
2429
|
+
/**
|
|
2430
|
+
* Placeholder text shown when no option is selected.
|
|
2431
|
+
*/
|
|
2432
|
+
this.placeholder = '';
|
|
2433
|
+
/**
|
|
2434
|
+
* The list of selectable options (flat).
|
|
2435
|
+
* Use `optionGroups` when options should be grouped under a label.
|
|
2436
|
+
* If both are set, `optionGroups` takes precedence.
|
|
2437
|
+
*/
|
|
2438
|
+
this.options = [];
|
|
2439
|
+
/**
|
|
2440
|
+
* The list of option groups. Each group has a `label` and an `options` array.
|
|
2441
|
+
* When set, `options` is ignored.
|
|
2442
|
+
*/
|
|
2443
|
+
this.optionGroups = [];
|
|
2444
|
+
/**
|
|
2445
|
+
* If `true`, in Angular reactive forms the control will not be set invalid automatically.
|
|
2446
|
+
*/
|
|
2447
|
+
this.autoInvalidOff = false;
|
|
2448
|
+
this.handleSlotChange = () => {
|
|
2449
|
+
this.readOptionsFromSlot();
|
|
2450
|
+
this.refreshSlimData();
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
createLogger(log) {
|
|
2454
|
+
this.log = log;
|
|
2455
|
+
}
|
|
2456
|
+
valueChanged(newVal) {
|
|
2457
|
+
const normalized = this.normalizeValue(newVal);
|
|
2458
|
+
if (normalized !== newVal) {
|
|
2459
|
+
this.value = normalized;
|
|
2460
|
+
return;
|
|
2461
|
+
}
|
|
2462
|
+
this.syncFormValue(normalized);
|
|
2463
|
+
if (!this.picker)
|
|
2464
|
+
return;
|
|
2465
|
+
this.picker.setSelected(normalized !== null && normalized !== void 0 ? normalized : []);
|
|
2466
|
+
}
|
|
2467
|
+
disabledChanged() {
|
|
2468
|
+
this.syncDisabledState();
|
|
2469
|
+
}
|
|
2470
|
+
readonlyChanged() {
|
|
2471
|
+
this.syncDisabledState();
|
|
2472
|
+
}
|
|
2473
|
+
optionsChanged() {
|
|
2474
|
+
this.refreshSlimData();
|
|
2475
|
+
}
|
|
2476
|
+
optionGroupsChanged() {
|
|
2477
|
+
this.refreshSlimData();
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
|
+
* LIFECYCLE
|
|
2481
|
+
* ------------------------------------------------------
|
|
2482
|
+
*/
|
|
2483
|
+
connectedCallback() {
|
|
2484
|
+
this.value = this.normalizeValue(this.value);
|
|
2485
|
+
this.initialValue = this.value;
|
|
2486
|
+
this.syncFormValue(this.value);
|
|
2487
|
+
}
|
|
2488
|
+
componentWillLoad() {
|
|
2489
|
+
this.inheritedAttributes = attributes.inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
|
|
2490
|
+
}
|
|
2491
|
+
componentDidLoad() {
|
|
2492
|
+
if (!this.selectEl || !this.popupEl || !this.el.shadowRoot)
|
|
2493
|
+
return;
|
|
2494
|
+
this.readOptionsFromSlot();
|
|
2495
|
+
this.picker = new SelectPickerController({
|
|
2496
|
+
selectEl: this.selectEl,
|
|
2497
|
+
popupEl: this.popupEl,
|
|
2498
|
+
shadowRoot: this.el.shadowRoot,
|
|
2499
|
+
triggerId: this.selectId,
|
|
2500
|
+
language: this.language,
|
|
2501
|
+
placeholder: this.placeholder,
|
|
2502
|
+
searchable: this.searchable,
|
|
2503
|
+
disabled: this.disabled,
|
|
2504
|
+
readonly: this.readonly,
|
|
2505
|
+
multiple: this.multiple,
|
|
2506
|
+
clearable: this.clearable,
|
|
2507
|
+
data: this.buildSlimData(),
|
|
2508
|
+
onChange: newVal => this.handleAfterChange(newVal),
|
|
2509
|
+
onOpen: () => {
|
|
2510
|
+
this.focused = true;
|
|
2511
|
+
this.dsFocus.emit(new FocusEvent('focus'));
|
|
2512
|
+
},
|
|
2513
|
+
onClose: () => {
|
|
2514
|
+
this.focused = false;
|
|
2515
|
+
this.dsBlur.emit(new FocusEvent('blur'));
|
|
2516
|
+
},
|
|
2517
|
+
});
|
|
2518
|
+
this.syncFormValue(this.value);
|
|
2519
|
+
this.initialValue = this.value;
|
|
2520
|
+
}
|
|
2521
|
+
disconnectedCallback() {
|
|
2522
|
+
var _a;
|
|
2523
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
2524
|
+
this.picker = undefined;
|
|
2525
|
+
}
|
|
2526
|
+
/**
|
|
2527
|
+
* PUBLIC LISTENERS
|
|
2528
|
+
* ------------------------------------------------------
|
|
2529
|
+
*/
|
|
2530
|
+
listenToClick(ev) {
|
|
2531
|
+
if ((this.disabled || this.readonly) && ev.target === this.el) {
|
|
2532
|
+
formControl.stopEventBubbling(ev);
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
listenToReset(ev) {
|
|
2536
|
+
const form = ev.target;
|
|
2537
|
+
if (form === null || form === void 0 ? void 0 : form.contains(this.el)) {
|
|
2538
|
+
this.value = this.initialValue;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* PUBLIC METHODS
|
|
2543
|
+
* ------------------------------------------------------
|
|
2544
|
+
*/
|
|
2545
|
+
/**
|
|
2546
|
+
* @internal define config for the component
|
|
2547
|
+
*/
|
|
2548
|
+
async configChanged(state) {
|
|
2549
|
+
var _a;
|
|
2550
|
+
this.language = state.language;
|
|
2551
|
+
this.region = state.region;
|
|
2552
|
+
if (this.searchable) {
|
|
2553
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.updateSearchPlaceholder(state.language);
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
/**
|
|
2557
|
+
* Opens the select dropdown.
|
|
2558
|
+
*/
|
|
2559
|
+
async open() {
|
|
2560
|
+
var _a;
|
|
2561
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.open();
|
|
2562
|
+
}
|
|
2563
|
+
/**
|
|
2564
|
+
* Closes the select dropdown.
|
|
2565
|
+
*/
|
|
2566
|
+
async close() {
|
|
2567
|
+
var _a;
|
|
2568
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.close();
|
|
2569
|
+
}
|
|
2570
|
+
/**
|
|
2571
|
+
* Sets focus on the select trigger.
|
|
2572
|
+
*/
|
|
2573
|
+
async setFocus() {
|
|
2574
|
+
var _a;
|
|
2575
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.focus();
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* Removes focus from the select trigger.
|
|
2579
|
+
*/
|
|
2580
|
+
async setBlur() {
|
|
2581
|
+
var _a;
|
|
2582
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.blur();
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* PRIVATE METHODS
|
|
2586
|
+
* ------------------------------------------------------
|
|
2587
|
+
*/
|
|
2588
|
+
// Attributes are always strings, so `value="it,ch"` arrives as a single string in
|
|
2589
|
+
// multiple mode. Split it into the `string[]` the rest of the component expects.
|
|
2590
|
+
normalizeValue(val) {
|
|
2591
|
+
if (this.multiple && typeof val === 'string') {
|
|
2592
|
+
return val
|
|
2593
|
+
.split(',')
|
|
2594
|
+
.map(v => v.trim())
|
|
2595
|
+
.filter(v => v.length > 0);
|
|
2596
|
+
}
|
|
2597
|
+
return val;
|
|
2598
|
+
}
|
|
2599
|
+
refreshSlimData() {
|
|
2600
|
+
var _a;
|
|
2601
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.setData(this.buildSlimData());
|
|
2602
|
+
}
|
|
2603
|
+
buildSlimData() {
|
|
2604
|
+
const options = this.options.length > 0 ? this.options : this.slottedOptions;
|
|
2605
|
+
const optionGroups = this.optionGroups.length > 0 ? this.optionGroups : this.slottedOptionGroups;
|
|
2606
|
+
return buildSlimData(options, optionGroups, this.placeholder, this.value);
|
|
2607
|
+
}
|
|
2608
|
+
// Reads ds-select-option / ds-select-optgroup light-DOM children (the HTML-only alternative
|
|
2609
|
+
// to the options / optionGroups props) into the same shape those props use.
|
|
2610
|
+
readOptionsFromSlot() {
|
|
2611
|
+
var _a;
|
|
2612
|
+
const slot = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot:not([name])');
|
|
2613
|
+
if (!slot)
|
|
2614
|
+
return;
|
|
2615
|
+
const assignedElements = slot.assignedElements({ flatten: true });
|
|
2616
|
+
const optgroups = assignedElements.filter(el => el.tagName.toLowerCase() === 'ds-select-optgroup');
|
|
2617
|
+
if (optgroups.length > 0) {
|
|
2618
|
+
this.slottedOptionGroups = optgroups.map(el => ({
|
|
2619
|
+
label: el.label,
|
|
2620
|
+
options: this.mapSelectOptionElements(Array.from(el.querySelectorAll('ds-select-option'))),
|
|
2621
|
+
}));
|
|
2622
|
+
this.slottedOptions = [];
|
|
2623
|
+
}
|
|
2624
|
+
else {
|
|
2625
|
+
const options = assignedElements.filter(el => el.tagName.toLowerCase() === 'ds-select-option');
|
|
2626
|
+
this.slottedOptions = this.mapSelectOptionElements(options);
|
|
2627
|
+
this.slottedOptionGroups = [];
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
mapSelectOptionElements(elements) {
|
|
2631
|
+
return elements.map(el => {
|
|
2632
|
+
var _a, _b;
|
|
2633
|
+
const option = el;
|
|
2634
|
+
return {
|
|
2635
|
+
label: (_b = (_a = option.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '',
|
|
2636
|
+
value: option.value,
|
|
2637
|
+
disabled: option.disabled,
|
|
2638
|
+
};
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
handleAfterChange(newVal) {
|
|
2642
|
+
var _a, _b;
|
|
2643
|
+
const selected = newVal.filter(o => !o.placeholder);
|
|
2644
|
+
if (this.multiple) {
|
|
2645
|
+
const values = selected.map(o => o.value);
|
|
2646
|
+
this.syncFormValue(values);
|
|
2647
|
+
this.value = values;
|
|
2648
|
+
this.dsChange.emit(values);
|
|
2649
|
+
}
|
|
2650
|
+
else {
|
|
2651
|
+
const value = (_b = (_a = selected[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
|
|
2652
|
+
this.syncFormValue(value);
|
|
2653
|
+
this.value = value;
|
|
2654
|
+
this.dsChange.emit(value);
|
|
2655
|
+
index.raf(() => { var _a; return (_a = this.picker) === null || _a === void 0 ? void 0 : _a.close(); });
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
syncFormValue(val) {
|
|
2659
|
+
if (Array.isArray(val)) {
|
|
2660
|
+
const formData = new FormData();
|
|
2661
|
+
val.forEach(v => formData.append(this.name, v));
|
|
2662
|
+
this.internals.setFormValue(formData);
|
|
2663
|
+
}
|
|
2664
|
+
else {
|
|
2665
|
+
this.internals.setFormValue(val);
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
syncDisabledState() {
|
|
2669
|
+
var _a;
|
|
2670
|
+
(_a = this.picker) === null || _a === void 0 ? void 0 : _a.setDisabled(this.disabled || this.readonly);
|
|
2671
|
+
}
|
|
2672
|
+
/**
|
|
2673
|
+
* RENDER
|
|
2674
|
+
* ------------------------------------------------------
|
|
2675
|
+
*/
|
|
2676
|
+
render() {
|
|
2677
|
+
return (index.h(field_util.Field, { key: 'eecfb4cab9d68210135674b01c7df8ee53723d10', disabled: this.disabled, color: this.color, invalid: this.invalid, label: this.label, description: this.description, invalidText: this.invalidText, required: this.required, language: this.language, inputId: this.selectId, onClick: ev => this.dsClick.emit(ev) }, index.h("select", Object.assign({ key: '1531c1c858bcb110bbe450ba662e2c483943039c', name: this.name, multiple: this.multiple, required: this.required, disabled: this.disabled, "aria-hidden": "true", tabindex: -1, ref: el => (this.selectEl = el) }, this.inheritedAttributes)), index.h("div", { key: '291ee9706eae79cfdf4e2fc3f7021f5e1e8fe8d3', id: "popup", class: {
|
|
2678
|
+
'is-multiple': this.multiple,
|
|
2679
|
+
}, ref: el => (this.popupEl = el) }, index.h("slot", { key: '6599aa56141ef60408922cbdf18e03d44544ec5e', onSlotchange: this.handleSlotChange }))));
|
|
2680
|
+
}
|
|
2681
|
+
static get formAssociated() { return true; }
|
|
2682
|
+
get el() { return index.getElement(this); }
|
|
2683
|
+
static get watchers() { return {
|
|
2684
|
+
"value": [{
|
|
2685
|
+
"valueChanged": 0
|
|
2686
|
+
}],
|
|
2687
|
+
"disabled": [{
|
|
2688
|
+
"disabledChanged": 0
|
|
2689
|
+
}],
|
|
2690
|
+
"readonly": [{
|
|
2691
|
+
"readonlyChanged": 0
|
|
2692
|
+
}],
|
|
2693
|
+
"options": [{
|
|
2694
|
+
"optionsChanged": 0
|
|
2695
|
+
}],
|
|
2696
|
+
"optionGroups": [{
|
|
2697
|
+
"optionGroupsChanged": 0
|
|
2698
|
+
}]
|
|
2699
|
+
}; }
|
|
2700
|
+
};
|
|
2701
|
+
tslib_es6.__decorate([
|
|
2702
|
+
tslib_es6.Logger('select'),
|
|
2703
|
+
tslib_es6.__metadata("design:type", Function),
|
|
2704
|
+
tslib_es6.__metadata("design:paramtypes", [Function]),
|
|
2705
|
+
tslib_es6.__metadata("design:returntype", void 0)
|
|
2706
|
+
], DsSelect.prototype, "createLogger", null);
|
|
2707
|
+
tslib_es6.__decorate([
|
|
2708
|
+
type.Type('string'),
|
|
2709
|
+
tslib_es6.__metadata("design:type", String)
|
|
2710
|
+
], DsSelect.prototype, "name", void 0);
|
|
2711
|
+
tslib_es6.__decorate([
|
|
2712
|
+
type.Type('string'),
|
|
2713
|
+
tslib_es6.__metadata("design:type", String)
|
|
2714
|
+
], DsSelect.prototype, "label", void 0);
|
|
2715
|
+
tslib_es6.__decorate([
|
|
2716
|
+
type.Type('string'),
|
|
2717
|
+
tslib_es6.__metadata("design:type", String)
|
|
2718
|
+
], DsSelect.prototype, "description", void 0);
|
|
2719
|
+
tslib_es6.__decorate([
|
|
2720
|
+
oneOf.OneOf(input_interfaces.INPUT_COLORS),
|
|
2721
|
+
tslib_es6.__metadata("design:type", String)
|
|
2722
|
+
], DsSelect.prototype, "color", void 0);
|
|
2723
|
+
tslib_es6.__decorate([
|
|
2724
|
+
type.Type('boolean'),
|
|
2725
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2726
|
+
], DsSelect.prototype, "invalid", void 0);
|
|
2727
|
+
tslib_es6.__decorate([
|
|
2728
|
+
type.Type('string'),
|
|
2729
|
+
tslib_es6.__metadata("design:type", String)
|
|
2730
|
+
], DsSelect.prototype, "invalidText", void 0);
|
|
2731
|
+
tslib_es6.__decorate([
|
|
2732
|
+
type.Type('boolean'),
|
|
2733
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2734
|
+
], DsSelect.prototype, "required", void 0);
|
|
2735
|
+
tslib_es6.__decorate([
|
|
2736
|
+
type.Type('boolean'),
|
|
2737
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2738
|
+
], DsSelect.prototype, "disabled", void 0);
|
|
2739
|
+
tslib_es6.__decorate([
|
|
2740
|
+
type.Type('boolean'),
|
|
2741
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2742
|
+
], DsSelect.prototype, "readonly", void 0);
|
|
2743
|
+
tslib_es6.__decorate([
|
|
2744
|
+
type.Type('boolean'),
|
|
2745
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2746
|
+
], DsSelect.prototype, "multiple", void 0);
|
|
2747
|
+
tslib_es6.__decorate([
|
|
2748
|
+
type.Type('boolean'),
|
|
2749
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2750
|
+
], DsSelect.prototype, "searchable", void 0);
|
|
2751
|
+
tslib_es6.__decorate([
|
|
2752
|
+
type.Type('boolean'),
|
|
2753
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2754
|
+
], DsSelect.prototype, "clearable", void 0);
|
|
2755
|
+
tslib_es6.__decorate([
|
|
2756
|
+
type.Type('string'),
|
|
2757
|
+
tslib_es6.__metadata("design:type", String)
|
|
2758
|
+
], DsSelect.prototype, "placeholder", void 0);
|
|
2759
|
+
tslib_es6.__decorate([
|
|
2760
|
+
type.Type('boolean'),
|
|
2761
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
2762
|
+
], DsSelect.prototype, "autoInvalidOff", void 0);
|
|
2763
|
+
tslib_es6.__decorate([
|
|
2764
|
+
config_decorator.ListenToConfig(),
|
|
2765
|
+
tslib_es6.__metadata("design:type", Function),
|
|
2766
|
+
tslib_es6.__metadata("design:paramtypes", [Object]),
|
|
2767
|
+
tslib_es6.__metadata("design:returntype", Promise)
|
|
2768
|
+
], DsSelect.prototype, "configChanged", null);
|
|
2769
|
+
let SelectIds = 0;
|
|
2770
|
+
DsSelect.style = selectHostCss();
|
|
2771
|
+
|
|
2772
|
+
exports.ds_select = DsSelect;
|