@oiz/stzh-components 3.4.0-beta1 → 3.4.0-beta2
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/dist/cjs/{app-globals-1074eba6.js → app-globals-d9805497.js} +2 -2
- package/dist/cjs/{app-globals-1074eba6.js.map → app-globals-d9805497.js.map} +1 -1
- package/dist/cjs/index-92254d32.js +40 -16
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-actions.cjs.entry.js +10 -8
- package/dist/cjs/stzh-actions.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-archivelist.cjs.entry.js +6 -16
- package/dist/cjs/stzh-archivelist.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-card_2.cjs.entry.js → stzh-card.cjs.entry.js} +55 -143
- package/dist/cjs/stzh-card.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-sortable.cjs.entry.js → stzh-cardlist_2.cjs.entry.js} +92 -1
- package/dist/cjs/stzh-cardlist_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-checkbox_4.cjs.entry.js → stzh-checkbox_3.cjs.entry.js} +4 -91
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-chip_2.cjs.entry.js → stzh-chip.cjs.entry.js} +1 -215
- package/dist/cjs/stzh-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-chipgroup.cjs.entry.js +25 -0
- package/dist/cjs/stzh-chipgroup.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-chipselect.cjs.entry.js +234 -0
- package/dist/cjs/stzh-chipselect.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-dropdown.cjs.entry.js +53 -55
- package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-fieldset.cjs.entry.js +1 -1
- package/dist/cjs/stzh-fieldset.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js +98 -41
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-input.cjs.entry.js +6 -2
- package/dist/cjs/stzh-input.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-chipgroup_2.cjs.entry.js → stzh-message.cjs.entry.js} +1 -18
- package/dist/cjs/stzh-message.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-overlay.cjs.entry.js +97 -0
- package/dist/cjs/stzh-overlay.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-poicard.cjs.entry.js +52 -0
- package/dist/cjs/stzh-poicard.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-poilist.cjs.entry.js +122 -0
- package/dist/cjs/stzh-poilist.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-popover.cjs.entry.js +445 -0
- package/dist/cjs/stzh-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-saptcha.cjs.entry.js +10 -9
- package/dist/cjs/stzh-saptcha.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +52 -3
- package/dist/cjs/stzh-search.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-section.cjs.entry.js +1 -1
- package/dist/cjs/stzh-section.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-popover_2.cjs.entry.js → stzh-text.cjs.entry.js} +1 -438
- package/dist/cjs/stzh-text.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-vbz-connection-finder.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-connection-finder.cjs.entry.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +9 -0
- package/dist/collection/assets/i18n/en.json +9 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/stzh-actions/stzh-actions.css +27 -0
- package/dist/collection/components/stzh-actions/stzh-actions.js +30 -10
- package/dist/collection/components/stzh-actions/stzh-actions.js.map +1 -1
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.css +3 -0
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.js +42 -16
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.js.map +1 -1
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.stories.js +109 -102
- package/dist/collection/components/stzh-card/stzh-card.css +5 -0
- package/dist/collection/components/stzh-card/stzh-card.js +72 -51
- package/dist/collection/components/stzh-card/stzh-card.js.map +1 -1
- package/dist/collection/components/stzh-cardlist/stzh-cardlist.css +5 -0
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.css +8 -8
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js +13 -1
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js.map +1 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +11 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +89 -55
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js.map +1 -1
- package/dist/collection/components/stzh-fieldset/stzh-fieldset.css +120 -0
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.css +2 -0
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js +156 -51
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js.map +1 -1
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.stories.js +64 -63
- package/dist/collection/components/stzh-input/stzh-input.css +6 -0
- package/dist/collection/components/stzh-input/stzh-input.js +23 -1
- package/dist/collection/components/stzh-input/stzh-input.js.map +1 -1
- package/dist/collection/components/stzh-pi-teaser/stzh-pi-teaser.css +18 -3
- package/dist/collection/components/stzh-pi-teaser/stzh-pi-teaser.stories.js +30 -29
- package/dist/collection/components/stzh-poicard/stzh-poicard.css +231 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.e2e.js +16 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.e2e.js.map +1 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.js +86 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.js.map +1 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.stories.js +117 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.css +210 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.e2e.js +16 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.e2e.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.js +181 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.localization.js +2 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.localization.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.stories.js +31 -0
- package/dist/collection/components/stzh-richtext/stzh-richtext.stories.js +31 -16
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.js +34 -17
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.js.map +1 -1
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.stories.js +3 -0
- package/dist/collection/components/stzh-search/stzh-search.css +4 -4
- package/dist/collection/components/stzh-search/stzh-search.js +122 -2
- package/dist/collection/components/stzh-search/stzh-search.js.map +1 -1
- package/dist/collection/components/stzh-section/stzh-section.css +19 -6
- package/dist/collection/components/stzh-vbz-connection-finder/stzh-vbz-connection-finder.js +1 -1
- package/dist/collection/components/stzh-vbz-connection-finder/stzh-vbz-connection-finder.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/pages/jobsearch/jobsearch.e2e.js +16 -0
- package/dist/collection/pages/jobsearch/jobsearch.e2e.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-actions.js +12 -9
- package/dist/components/stzh-actions.js.map +1 -1
- package/dist/components/stzh-archivelist.js +20 -22
- package/dist/components/stzh-archivelist.js.map +1 -1
- package/dist/components/stzh-card2.js +55 -51
- package/dist/components/stzh-card2.js.map +1 -1
- package/dist/components/stzh-cardlist2.js +1 -1
- package/dist/components/stzh-cardlist2.js.map +1 -1
- package/dist/components/stzh-chipselect2.js +14 -2
- package/dist/components/stzh-chipselect2.js.map +1 -1
- package/dist/components/stzh-dropdown2.js +55 -55
- package/dist/components/stzh-dropdown2.js.map +1 -1
- package/dist/components/stzh-fieldset.js +1 -1
- package/dist/components/stzh-fieldset.js.map +1 -1
- package/dist/components/stzh-geo-ref-data.js +109 -45
- package/dist/components/stzh-geo-ref-data.js.map +1 -1
- package/dist/components/stzh-input2.js +7 -2
- package/dist/components/stzh-input2.js.map +1 -1
- package/dist/components/stzh-pi-teaser.js +1 -1
- package/dist/components/stzh-pi-teaser.js.map +1 -1
- package/dist/components/stzh-poicard.d.ts +11 -0
- package/dist/components/stzh-poicard.js +8 -0
- package/dist/components/stzh-poicard.js.map +1 -0
- package/dist/components/stzh-poicard2.js +108 -0
- package/dist/components/stzh-poicard2.js.map +1 -0
- package/dist/components/stzh-poilist.d.ts +11 -0
- package/dist/components/stzh-poilist.js +246 -0
- package/dist/components/stzh-poilist.js.map +1 -0
- package/dist/components/stzh-saptcha.js +13 -14
- package/dist/components/stzh-saptcha.js.map +1 -1
- package/dist/components/stzh-search.js +57 -3
- package/dist/components/stzh-search.js.map +1 -1
- package/dist/components/stzh-section.js +1 -1
- package/dist/components/stzh-section.js.map +1 -1
- package/dist/components/stzh-vbz-connection-finder.js +1 -1
- package/dist/components/stzh-vbz-connection-finder.js.map +1 -1
- package/dist/esm/{app-globals-fbb949bd.js → app-globals-ca13b6e3.js} +2 -2
- package/dist/esm/{app-globals-fbb949bd.js.map → app-globals-ca13b6e3.js.map} +1 -1
- package/dist/esm/index-e3050b18.js +40 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-actions.entry.js +10 -8
- package/dist/esm/stzh-actions.entry.js.map +1 -1
- package/dist/esm/stzh-archivelist.entry.js +6 -16
- package/dist/esm/stzh-archivelist.entry.js.map +1 -1
- package/dist/esm/{stzh-card_2.entry.js → stzh-card.entry.js} +56 -143
- package/dist/esm/stzh-card.entry.js.map +1 -0
- package/dist/esm/{stzh-sortable.entry.js → stzh-cardlist_2.entry.js} +92 -2
- package/dist/esm/stzh-cardlist_2.entry.js.map +1 -0
- package/dist/esm/{stzh-checkbox_4.entry.js → stzh-checkbox_3.entry.js} +5 -91
- package/dist/esm/stzh-checkbox_3.entry.js.map +1 -0
- package/dist/esm/{stzh-chip_2.entry.js → stzh-chip.entry.js} +3 -216
- package/dist/esm/stzh-chip.entry.js.map +1 -0
- package/dist/esm/stzh-chipgroup.entry.js +21 -0
- package/dist/esm/stzh-chipgroup.entry.js.map +1 -0
- package/dist/esm/stzh-chipselect.entry.js +230 -0
- package/dist/esm/stzh-chipselect.entry.js.map +1 -0
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-dropdown.entry.js +53 -55
- package/dist/esm/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm/stzh-fieldset.entry.js +1 -1
- package/dist/esm/stzh-fieldset.entry.js.map +1 -1
- package/dist/esm/stzh-geo-ref-data.entry.js +98 -41
- package/dist/esm/stzh-geo-ref-data.entry.js.map +1 -1
- package/dist/esm/stzh-input.entry.js +6 -2
- package/dist/esm/stzh-input.entry.js.map +1 -1
- package/dist/esm/{stzh-chipgroup_2.entry.js → stzh-message.entry.js} +3 -19
- package/dist/esm/stzh-message.entry.js.map +1 -0
- package/dist/esm/stzh-overlay.entry.js +93 -0
- package/dist/esm/stzh-overlay.entry.js.map +1 -0
- package/dist/esm/stzh-pi-teaser.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser.entry.js.map +1 -1
- package/dist/esm/stzh-poicard.entry.js +48 -0
- package/dist/esm/stzh-poicard.entry.js.map +1 -0
- package/dist/esm/stzh-poilist.entry.js +118 -0
- package/dist/esm/stzh-poilist.entry.js.map +1 -0
- package/dist/esm/stzh-popover.entry.js +441 -0
- package/dist/esm/stzh-popover.entry.js.map +1 -0
- package/dist/esm/stzh-saptcha.entry.js +11 -10
- package/dist/esm/stzh-saptcha.entry.js.map +1 -1
- package/dist/esm/stzh-search.entry.js +52 -3
- package/dist/esm/stzh-search.entry.js.map +1 -1
- package/dist/esm/stzh-section.entry.js +1 -1
- package/dist/esm/stzh-section.entry.js.map +1 -1
- package/dist/esm/{stzh-popover_2.entry.js → stzh-text.entry.js} +3 -439
- package/dist/esm/stzh-text.entry.js.map +1 -0
- package/dist/esm/stzh-vbz-connection-finder.entry.js +1 -1
- package/dist/esm/stzh-vbz-connection-finder.entry.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +9 -0
- package/dist/stzh-components/assets/i18n/en.json +9 -0
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/{p-206ec94f.entry.js → p-0846f5a7.entry.js} +2 -2
- package/dist/stzh-components/p-0846f5a7.entry.js.map +1 -0
- package/dist/stzh-components/p-0d092d58.entry.js +2 -0
- package/dist/stzh-components/p-0d092d58.entry.js.map +1 -0
- package/dist/stzh-components/{p-38cd406c.entry.js → p-10c2c688.entry.js} +2 -2
- package/dist/stzh-components/p-10c2c688.entry.js.map +1 -0
- package/dist/stzh-components/{p-23de5712.entry.js → p-1391115f.entry.js} +2 -2
- package/dist/stzh-components/{p-23de5712.entry.js.map → p-1391115f.entry.js.map} +1 -1
- package/dist/stzh-components/p-1b2fb680.entry.js +9 -0
- package/dist/stzh-components/p-1b2fb680.entry.js.map +1 -0
- package/dist/stzh-components/p-1e121c5f.entry.js +2 -0
- package/dist/stzh-components/p-1e121c5f.entry.js.map +1 -0
- package/dist/stzh-components/p-35d842ce.entry.js +2 -0
- package/dist/stzh-components/p-35d842ce.entry.js.map +1 -0
- package/dist/stzh-components/p-3e2b4d92.entry.js +2 -0
- package/dist/stzh-components/p-3e2b4d92.entry.js.map +1 -0
- package/dist/stzh-components/p-47cb71af.entry.js +2 -0
- package/dist/stzh-components/p-47cb71af.entry.js.map +1 -0
- package/dist/stzh-components/p-4e2db8e9.entry.js +8 -0
- package/dist/stzh-components/p-4e2db8e9.entry.js.map +1 -0
- package/dist/stzh-components/{p-cded8c4a.js → p-57caee36.js} +2 -2
- package/dist/stzh-components/p-616ae3be.entry.js +2 -0
- package/dist/stzh-components/p-616ae3be.entry.js.map +1 -0
- package/dist/stzh-components/{p-15d008ea.entry.js → p-72c9db89.entry.js} +3 -3
- package/dist/stzh-components/p-72c9db89.entry.js.map +1 -0
- package/dist/stzh-components/p-7bb2eb4e.entry.js +2 -0
- package/dist/stzh-components/p-7bb2eb4e.entry.js.map +1 -0
- package/dist/stzh-components/p-8c4d543d.entry.js +2 -0
- package/dist/stzh-components/p-8c4d543d.entry.js.map +1 -0
- package/dist/stzh-components/p-9506f599.entry.js +2 -0
- package/dist/stzh-components/p-9506f599.entry.js.map +1 -0
- package/dist/stzh-components/p-9b1267a6.entry.js +2 -0
- package/dist/stzh-components/p-9b1267a6.entry.js.map +1 -0
- package/dist/stzh-components/p-a9216459.entry.js +2 -0
- package/dist/stzh-components/p-a9216459.entry.js.map +1 -0
- package/dist/stzh-components/p-b2920d7f.entry.js +2 -0
- package/dist/stzh-components/p-b2920d7f.entry.js.map +1 -0
- package/dist/stzh-components/p-b6f19446.entry.js +2 -0
- package/dist/stzh-components/p-b6f19446.entry.js.map +1 -0
- package/dist/stzh-components/p-b75800da.entry.js +2 -0
- package/dist/stzh-components/p-b75800da.entry.js.map +1 -0
- package/dist/stzh-components/{p-d058fc1e.entry.js → p-c4bbdbfe.entry.js} +2 -2
- package/dist/stzh-components/p-c4bbdbfe.entry.js.map +1 -0
- package/dist/stzh-components/p-c6504f41.entry.js +2 -0
- package/dist/stzh-components/p-c6504f41.entry.js.map +1 -0
- package/dist/stzh-components/p-d29fd503.entry.js +2 -0
- package/dist/stzh-components/p-d29fd503.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/types/components/stzh-actions/stzh-actions.d.ts +3 -1
- package/dist/types/components/stzh-archivelist/stzh-archivelist.d.ts +4 -0
- package/dist/types/components/stzh-card/stzh-card.d.ts +4 -2
- package/dist/types/components/stzh-dropdown/stzh-dropdown.d.ts +6 -2
- package/dist/types/components/stzh-geo-ref-data/stzh-geo-ref-data.d.ts +16 -2
- package/dist/types/components/stzh-input/stzh-input.d.ts +2 -0
- package/dist/types/components/stzh-poicard/stzh-poicard.d.ts +14 -0
- package/dist/types/components/stzh-poilist/stzh-poilist.d.ts +31 -0
- package/dist/types/components/stzh-poilist/stzh-poilist.localization.d.ts +10 -0
- package/dist/types/components/stzh-saptcha/stzh-saptcha.d.ts +5 -4
- package/dist/types/components/stzh-search/stzh-search.d.ts +13 -0
- package/dist/types/components.d.ts +190 -10
- package/dist/types/index.d.ts +28 -0
- package/dist/vscode-data.json +104 -3
- package/package.json +1 -1
- package/dist/cjs/stzh-card_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-checkbox_4.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-chip_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-chipgroup_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-popover_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-sortable.cjs.entry.js.map +0 -1
- package/dist/esm/stzh-card_2.entry.js.map +0 -1
- package/dist/esm/stzh-checkbox_4.entry.js.map +0 -1
- package/dist/esm/stzh-chip_2.entry.js.map +0 -1
- package/dist/esm/stzh-chipgroup_2.entry.js.map +0 -1
- package/dist/esm/stzh-popover_2.entry.js.map +0 -1
- package/dist/esm/stzh-sortable.entry.js.map +0 -1
- package/dist/stzh-components/p-12851c24.entry.js +0 -2
- package/dist/stzh-components/p-12851c24.entry.js.map +0 -1
- package/dist/stzh-components/p-15d008ea.entry.js.map +0 -1
- package/dist/stzh-components/p-1b31cd8a.entry.js +0 -2
- package/dist/stzh-components/p-1b31cd8a.entry.js.map +0 -1
- package/dist/stzh-components/p-206ec94f.entry.js.map +0 -1
- package/dist/stzh-components/p-38cd406c.entry.js.map +0 -1
- package/dist/stzh-components/p-50c32fd1.entry.js +0 -2
- package/dist/stzh-components/p-50c32fd1.entry.js.map +0 -1
- package/dist/stzh-components/p-55349f2e.entry.js +0 -2
- package/dist/stzh-components/p-55349f2e.entry.js.map +0 -1
- package/dist/stzh-components/p-9c643610.entry.js +0 -2
- package/dist/stzh-components/p-9c643610.entry.js.map +0 -1
- package/dist/stzh-components/p-9cdd5e6f.entry.js +0 -2
- package/dist/stzh-components/p-9cdd5e6f.entry.js.map +0 -1
- package/dist/stzh-components/p-a672aaea.entry.js +0 -8
- package/dist/stzh-components/p-a672aaea.entry.js.map +0 -1
- package/dist/stzh-components/p-a77b49cb.entry.js +0 -2
- package/dist/stzh-components/p-a77b49cb.entry.js.map +0 -1
- package/dist/stzh-components/p-b509dedd.entry.js +0 -2
- package/dist/stzh-components/p-b509dedd.entry.js.map +0 -1
- package/dist/stzh-components/p-b870c799.entry.js +0 -2
- package/dist/stzh-components/p-b870c799.entry.js.map +0 -1
- package/dist/stzh-components/p-d058fc1e.entry.js.map +0 -1
- package/dist/stzh-components/p-da043311.entry.js +0 -9
- package/dist/stzh-components/p-da043311.entry.js.map +0 -1
- package/dist/stzh-components/p-fb077fd5.entry.js +0 -2
- package/dist/stzh-components/p-fb077fd5.entry.js.map +0 -1
- /package/dist/stzh-components/{p-cded8c4a.js.map → p-57caee36.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-chipselect.js","sourceRoot":"","sources":["../../../../src/components/stzh-chipselect/stzh-chipselect.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,KAAK,EACL,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AAQv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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAEtB,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,WAAW,KAAK,EAAE,EAChC,YAAY,EAAC,IAAI,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,GACrC,CACd,CAAC,CACE;YAEN,EAAC,oBAAoB,IACnB,WAAW,EAAC,iBAAiB,EAC7B,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,cAAc,EAC5B,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CAkBO,CAET,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Watch,\n Event,\n EventEmitter,\n State,\n Fragment,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhChipselectItem,\n StzhChipselectChangeEvent,\n // StzhDropdownChangeEvent\n} from \"../../index\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\n// import { hasSlot } from \"../../utils/utils\";\nimport { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nlet chipselectCounter = 0;\n\n/**\n * @slot - Slot for `stzh-checkbox` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-chipselect\",\n styleUrl: \"stzh-chipselect.scss\",\n scoped: true\n})\nexport class StzhChipselect {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** The list of chips */\n @Prop() data: string | StzhChipselectItem[] = [];\n private _data: StzhChipselectItem[] = [];\n // private _dataDropdown: any[] = [];\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string;\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Whether label is hidden. */\n @Prop() labelHidden: boolean = false;\n\n /** Multiple */\n @Prop({ mutable: true }) multiple: boolean = false;\n\n /** Value */\n @Prop({ mutable: true }) value: string | string[] = \"\";\n private _value: string[] = [];\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string | string[] = \"\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Whether all chips are disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form to hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @State() activeFocusOptionIndex: number = 0;\n\n @Element() element: HTMLStzhChipselectElement;\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhChipselectChangeEvent>;\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Watch(\"value\")\n valueWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._value = JSON.parse(newValue);\n } catch(ex) {\n this._value = newValue ? [newValue] : [];\n }\n } else {\n this._value = newValue ? newValue : [];\n }\n }\n\n @Watch(\"data\")\n dataWatcher(newValue: StzhChipselectItem[] | string) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n // this._dataDropdown = this._data.map((data) => {\n // return {\n // text: data.counter\n // ? `${data.label} (${data.counter})`\n // : data.label,\n // value: data.value\n // }\n // });\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n private id: string;\n private renderPromiseResolve: (value?: unknown) => void;\n\n private waitForNextRender() {\n return new Promise(resolve => this.renderPromiseResolve = resolve);\n }\n\n private handleReset = async () => {\n this.value = this.defaultValue;\n\n // this.stzhChange.emit({\n // component: \"stzh-chipselect\",\n // value: this.value\n // });\n }\n\n private handleChipClick = async (data: StzhChipselectItem, index: number) => {\n if (this.multiple) {\n if (data.value === \"\" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === \"\")) {\n this.value = [];\n } else if (data.value !== \"\") {\n this.value = this._value.includes(data.value)\n ? this._value.filter(value => value !== data.value)\n : [...this._value, data.value];\n }\n } else {\n this.value = data.value;\n }\n\n this.activeFocusOptionIndex = index;\n\n await this.waitForNextRender();\n\n this.stzhChange.emit({\n component: \"stzh-chipselect\",\n value: this.multiple ? this._value : this._value[0]\n });\n }\n\n // private handleDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {\n // this.value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n\n // this.activeFocusOptionIndex = this._data.findIndex(data => {\n // return data.value === this.value;\n // });\n\n // await this.waitForNextRender();\n\n // this.stzhChange.emit({\n // component: \"stzh-chipselect\",\n // value: this.value\n // })\n // }\n\n private handleKeydown = (event: KeyboardEvent) => {\n let newActiveIndex: number = null;\n const activeOptionIndex = this.activeFocusOptionIndex;\n\n if (event.key === \"ArrowUp\" || event.key === \"ArrowLeft\") {\n event.preventDefault();\n\n if (activeOptionIndex > 0) {\n newActiveIndex = activeOptionIndex - 1;\n }\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowRight\") {\n event.preventDefault();\n\n if (activeOptionIndex < this._data.length - 1) {\n newActiveIndex = activeOptionIndex + 1;\n }\n } else if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n this.value = this._data[activeOptionIndex].value;\n\n this.stzhChange.emit({\n component: \"stzh-chipselect\",\n value: this.value\n });\n }\n\n if (newActiveIndex !== null) {\n this.activeFocusOptionIndex = newActiveIndex;\n }\n }\n\n componentDidRender() {\n if (this.renderPromiseResolve) {\n this.renderPromiseResolve();\n }\n }\n\n async componentWillLoad() {\n this.id = `stzh-chipselect-${chipselectCounter++}`;\n\n this.dataWatcher(this.data);\n this.errorWatcher(this.error);\n this.valueWatcher(this.value);\n\n this.defaultValue = this.defaultValue || this.value;\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"chipselect\");\n }\n }\n\n render() {\n const descriptionUsed = !!this.description;\n const descriptionLongUsed = !!this.descriptionLong;\n const errorUsed = !!this.error;\n\n const classes = {\n \"stzh-chipselect\": true,\n \"stzh-chipselect--has-description\": descriptionUsed,\n \"stzh-chipselect--has-description-long\": descriptionLongUsed,\n \"stzh-chipselect--has-error\": errorUsed,\n \"stzh-chipselect--is-invalid\": this.invalid || errorUsed,\n \"stzh-chipselect--is-disabled\": this.disabled,\n \"stzh-chipselect--is-required\": this.required,\n \"stzh-chipselect--has-label-hidden\": this.labelHidden,\n };\n\n return (\n <Host is-invalid={this.invalid || errorUsed}>\n <div class={classes}>\n {this.multiple\n ?\n <Fragment>\n {this._value.map((value) =>\n <input type=\"hidden\" name={this.name} value={value} />\n )}\n </Fragment>\n :\n <input\n type=\"hidden\"\n name={this.name}\n value={this.value}\n />\n }\n\n <label class=\"stzh-chipselect__label\" htmlFor={this.id}>\n {this.label ? this.label : <slot></slot>}\n {!this.hideOptional &&\n <span class=\"stzh-chipselect__marker\">\n <span class=\"stzh-chipselect__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-chipselect__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </label>\n\n {this._data.length > 0 &&\n <Fragment>\n <div\n id={this.id}\n class=\"stzh-chipselect__chips\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-multiselectable={this.multiple ? \"true\" : \"false\"}\n aria-activedescendant={`${this.id}-option-${this.activeFocusOptionIndex}`}\n aria-describedby={`${this.id}-description ${this.a11yDescribedby}`}\n onKeyDown={this.handleKeydown}\n >\n {this._data.map((data, index) => (\n <stzh-chip\n role=\"option\"\n class={{\n \"stzh-chipselect__chip\": true,\n \"is-focused\": this.activeFocusOptionIndex === index\n }}\n label={data.label}\n counter={data.counter}\n icon={data.icon}\n type={data.type}\n inverted={data.inverted}\n variant={data.variant}\n size={data.size || \"small\"}\n disabled={this.disabled || data.disabled}\n active={\n this._value.includes(data.value)\n || (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === \"\"))\n || (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === \"\")))\n }\n aria-selected={\n this._value.includes(data.value)\n || (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === \"\"))\n || (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === \"\")))\n ? \"true\" : \"false\"\n }\n id={`${this.id}-option-${index}`}\n a11yTabindex=\"-1\"\n onClick={() => this.handleChipClick(data, index)}\n ></stzh-chip>\n ))}\n </div>\n\n <StzhInputDescription\n classPrefix=\"stzh-chipselect\"\n id={`${this.id}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n\n {/* <stzh-dropdown\n class=\"stzh-chipselect__dropdown\"\n multiple={this.multiple}\n disabled={this.disabled}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n required={this.required}\n invalid={this.invalid}\n items={[this.value]}\n label={this.label}\n labelHidden={this.labelHidden}\n options={this._dataDropdown}\n hideOptional={this.hideOptional}\n onStzhChange={this.handleDropdownChange}\n ></stzh-dropdown> */}\n </Fragment>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-chipselect.js","sourceRoot":"","sources":["../../../../src/components/stzh-chipselect/stzh-chipselect.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,KAAK,EACL,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAK5E,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B;;;;;;GAMG;AAMH,MAAM,OAAO,cAAc;;IAMjB,UAAK,GAAy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AY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CAkBO,CAET,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Watch,\n Event,\n EventEmitter,\n State,\n Fragment,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhChipselectItem,\n StzhChipselectChangeEvent,\n // StzhDropdownChangeEvent\n} from \"../../index\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\n// import { hasSlot } from \"../../utils/utils\";\nimport { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nlet chipselectCounter = 0;\n\n/**\n * @slot - Slot for `stzh-checkbox` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-chipselect\",\n styleUrl: \"stzh-chipselect.scss\",\n scoped: true\n})\nexport class StzhChipselect {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** The list of chips */\n @Prop() data: string | StzhChipselectItem[] = [];\n private _data: StzhChipselectItem[] = [];\n // private _dataDropdown: any[] = [];\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string;\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Whether label is hidden. */\n @Prop() labelHidden: boolean = false;\n\n /** Multiple */\n @Prop({ mutable: true }) multiple: boolean = false;\n\n /** Value */\n @Prop({ mutable: true }) value: string | string[] = \"\";\n private _value: string[] = [];\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string | string[] = \"\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Whether all chips are disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form to hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @State() activeFocusOptionIndex: number = 0;\n\n @Element() element: HTMLStzhChipselectElement;\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhChipselectChangeEvent>;\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Watch(\"value\")\n valueWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._value = JSON.parse(newValue);\n } catch(ex) {\n this._value = newValue ? [newValue] : [];\n }\n } else {\n this._value = newValue ? newValue : [];\n }\n }\n\n @Watch(\"data\")\n dataWatcher(newValue: StzhChipselectItem[] | string) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n // this._dataDropdown = this._data.map((data) => {\n // return {\n // text: data.counter\n // ? `${data.label} (${data.counter})`\n // : data.label,\n // value: data.value\n // }\n // });\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n private id: string;\n private renderPromiseResolve: (value?: unknown) => void;\n\n private waitForNextRender() {\n return new Promise(resolve => this.renderPromiseResolve = resolve);\n }\n\n private handleReset = async () => {\n this.value = this.defaultValue;\n\n // this.stzhChange.emit({\n // component: \"stzh-chipselect\",\n // value: this.value\n // });\n }\n\n private handleChipClick = async (data: StzhChipselectItem, index: number) => {\n if (this.multiple) {\n if (data.value === \"\" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === \"\")) {\n this.value = [];\n } else if (data.value !== \"\") {\n this.value = this._value.includes(data.value)\n ? this._value.filter(value => value !== data.value)\n : [...this._value, data.value];\n }\n } else {\n this.value = data.value;\n }\n\n this.activeFocusOptionIndex = index;\n\n await this.waitForNextRender();\n\n this.stzhChange.emit({\n component: \"stzh-chipselect\",\n value: this.multiple ? this._value : this._value[0]\n });\n }\n\n // private handleDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {\n // this.value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n\n // this.activeFocusOptionIndex = this._data.findIndex(data => {\n // return data.value === this.value;\n // });\n\n // await this.waitForNextRender();\n\n // this.stzhChange.emit({\n // component: \"stzh-chipselect\",\n // value: this.value\n // })\n // }\n\n private handleKeydown = (event: KeyboardEvent) => {\n let newActiveIndex: number = null;\n const activeOptionIndex = this.activeFocusOptionIndex;\n\n if (event.key === \"ArrowUp\" || event.key === \"ArrowLeft\") {\n event.preventDefault();\n\n if (activeOptionIndex > 0) {\n newActiveIndex = activeOptionIndex - 1;\n }\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowRight\") {\n event.preventDefault();\n\n if (activeOptionIndex < this._data.length - 1) {\n newActiveIndex = activeOptionIndex + 1;\n }\n } else if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n if (this.multiple) {\n if (this._data[activeOptionIndex].value === \"\" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === \"\")) {\n this.value = [];\n } else if (this._data[activeOptionIndex].value !== \"\") {\n this.value = this._value.includes(this._data[activeOptionIndex].value)\n ? this._value.filter(value => value !== this._data[activeOptionIndex].value)\n : [...this._value, this._data[activeOptionIndex].value];\n }\n } else {\n this.value = this._data[activeOptionIndex].value; //HERE\n }\n this.stzhChange.emit({\n component: \"stzh-chipselect\",\n value: this.value\n });\n }\n\n if (newActiveIndex !== null) {\n this.activeFocusOptionIndex = newActiveIndex;\n }\n }\n\n componentDidRender() {\n if (this.renderPromiseResolve) {\n this.renderPromiseResolve();\n }\n }\n\n async componentWillLoad() {\n this.id = `stzh-chipselect-${chipselectCounter++}`;\n\n this.dataWatcher(this.data);\n this.errorWatcher(this.error);\n this.valueWatcher(this.value);\n\n this.defaultValue = this.defaultValue || this.value;\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"chipselect\");\n }\n }\n\n render() {\n const descriptionUsed = !!this.description;\n const descriptionLongUsed = !!this.descriptionLong;\n const errorUsed = !!this.error;\n\n const classes = {\n \"stzh-chipselect\": true,\n \"stzh-chipselect--has-description\": descriptionUsed,\n \"stzh-chipselect--has-description-long\": descriptionLongUsed,\n \"stzh-chipselect--has-error\": errorUsed,\n \"stzh-chipselect--is-invalid\": this.invalid || errorUsed,\n \"stzh-chipselect--is-disabled\": this.disabled,\n \"stzh-chipselect--is-required\": this.required,\n \"stzh-chipselect--has-label-hidden\": this.labelHidden,\n };\n\n return (\n <Host is-invalid={this.invalid || errorUsed}>\n <div class={classes}>\n {this.multiple\n ?\n <Fragment>\n {this._value.map((value) =>\n <input type=\"hidden\" name={this.name} value={value} />\n )}\n </Fragment>\n :\n <input\n type=\"hidden\"\n name={this.name}\n value={this.value}\n />\n }\n\n <label class=\"stzh-chipselect__label\" htmlFor={this.id}>\n {this.label ? this.label : <slot></slot>}\n {!this.hideOptional &&\n <span class=\"stzh-chipselect__marker\">\n <span class=\"stzh-chipselect__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-chipselect__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </label>\n\n {this._data.length > 0 &&\n <Fragment>\n <div\n id={this.id}\n class=\"stzh-chipselect__chips\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-multiselectable={this.multiple ? \"true\" : \"false\"}\n aria-activedescendant={`${this.id}-option-${this.activeFocusOptionIndex}`}\n aria-describedby={`${this.id}-description ${this.a11yDescribedby}`}\n onKeyDown={this.handleKeydown}\n >\n {this._data.map((data, index) => (\n <stzh-chip\n role=\"option\"\n class={{\n \"stzh-chipselect__chip\": true,\n \"is-focused\": this.activeFocusOptionIndex === index\n }}\n label={data.label}\n counter={data.counter}\n icon={data.icon}\n type={data.type}\n inverted={data.inverted}\n variant={data.variant}\n size={data.size || \"small\"}\n disabled={this.disabled || data.disabled}\n active={\n this._value.includes(data.value)\n || (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === \"\"))\n || (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === \"\")))\n }\n aria-selected={\n this._value.includes(data.value)\n || (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === \"\"))\n || (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === \"\")))\n ? \"true\" : \"false\"\n }\n id={`${this.id}-option-${index}`}\n a11yTabindex=\"-1\"\n onClick={() => this.handleChipClick(data, index)}\n ></stzh-chip>\n ))}\n </div>\n\n <StzhInputDescription\n classPrefix=\"stzh-chipselect\"\n id={`${this.id}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n\n {/* <stzh-dropdown\n class=\"stzh-chipselect__dropdown\"\n multiple={this.multiple}\n disabled={this.disabled}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n required={this.required}\n invalid={this.invalid}\n items={[this.value]}\n label={this.label}\n labelHidden={this.labelHidden}\n options={this._dataDropdown}\n hideOptional={this.hideOptional}\n onStzhChange={this.handleDropdownChange}\n ></stzh-dropdown> */}\n </Fragment>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -197,7 +197,7 @@ stzh-dropdown {
|
|
|
197
197
|
--icon-color: var(--stzh-color-primary70);
|
|
198
198
|
--icon-angle-color: var(--stzh-color-primary70);
|
|
199
199
|
--label-font-size: var(--stzh-font-micro-font-size);
|
|
200
|
-
--label-line-height: var(--stzh-font-micro-
|
|
200
|
+
--label-line-height: var(--stzh-font-micro-text-line-height);
|
|
201
201
|
--label-letter-spacing: normal;
|
|
202
202
|
--hover-color: var(--stzh-color-secondary60);
|
|
203
203
|
--hover-border-color: var(--stzh-color-secondary50);
|
|
@@ -951,6 +951,7 @@ stzh-dropdown:where([size="tiny"]):where([variant="filter"]) {
|
|
|
951
951
|
/* Has no search */
|
|
952
952
|
/* Filter */
|
|
953
953
|
/* Disabled */
|
|
954
|
+
/* No text wrap */
|
|
954
955
|
}
|
|
955
956
|
.stzh-dropdown__marker-symbol {
|
|
956
957
|
font-family: var(--stzh-font-family-medium);
|
|
@@ -1206,6 +1207,12 @@ stzh-dropdown:where([size="tiny"]):where([variant="filter"]) {
|
|
|
1206
1207
|
max-width: 100%;
|
|
1207
1208
|
margin-bottom: var(--stzh-space-xxxsmall);
|
|
1208
1209
|
}
|
|
1210
|
+
.stzh-dropdown__label.no-label-truncate {
|
|
1211
|
+
white-space: normal;
|
|
1212
|
+
overflow: visible;
|
|
1213
|
+
text-overflow: initial;
|
|
1214
|
+
word-wrap: break-word;
|
|
1215
|
+
}
|
|
1209
1216
|
.stzh-dropdown__label:empty {
|
|
1210
1217
|
display: none;
|
|
1211
1218
|
}
|
|
@@ -1571,4 +1578,7 @@ stzh-dropdown:where([size="tiny"]):where([variant="filter"]) {
|
|
|
1571
1578
|
}
|
|
1572
1579
|
.stzh-dropdown--is-disabled .stzh-dropdown__label, .stzh-dropdown--is-disabled .ts-control, .stzh-dropdown--is-disabled .ts-control > input {
|
|
1573
1580
|
cursor: not-allowed;
|
|
1581
|
+
}
|
|
1582
|
+
.stzh-dropdown--is-inline.stzh-dropdown--has-no-wrap {
|
|
1583
|
+
white-space: nowrap;
|
|
1574
1584
|
}
|
|
@@ -50,6 +50,7 @@ export class StzhDropdown {
|
|
|
50
50
|
this.searchField = ["text"];
|
|
51
51
|
this.multiple = false;
|
|
52
52
|
this.inline = false;
|
|
53
|
+
this.noWrap = false;
|
|
53
54
|
this.maxOptions = null;
|
|
54
55
|
this.searchConjunction = "and";
|
|
55
56
|
this.transformLoadQuery = "trim";
|
|
@@ -80,6 +81,7 @@ export class StzhDropdown {
|
|
|
80
81
|
this.popoverPlacement = "bottom";
|
|
81
82
|
this.popoverFullwidth = "";
|
|
82
83
|
this.label = "";
|
|
84
|
+
this.noLabelTruncate = false;
|
|
83
85
|
this.labelHidden = false;
|
|
84
86
|
this.icon = "";
|
|
85
87
|
this.iconAngle = "angle-down";
|
|
@@ -160,7 +162,7 @@ export class StzhDropdown {
|
|
|
160
162
|
* Returns the value of the control.
|
|
161
163
|
* If multiple items can be selected,
|
|
162
164
|
* this returns an array, otherwise a string.
|
|
163
|
-
|
|
165
|
+
*/
|
|
164
166
|
async getValue() {
|
|
165
167
|
return this.tomSelect.getValue();
|
|
166
168
|
}
|
|
@@ -244,12 +246,12 @@ export class StzhDropdown {
|
|
|
244
246
|
if (this.multiple || this.variant === "filter") {
|
|
245
247
|
plugins["remove_button"] = {
|
|
246
248
|
title: this.localization.removeButtonTitle,
|
|
247
|
-
label: '<stzh-icon name="close-big" class="stzh-dropdown__remove-icon"></stzh-icon>'
|
|
249
|
+
label: '<stzh-icon name="close-big" class="stzh-dropdown__remove-icon"></stzh-icon>',
|
|
248
250
|
};
|
|
249
251
|
}
|
|
250
252
|
const tomSelectOptions = {
|
|
251
253
|
dropdownParent: this.dropdownWrapperElement,
|
|
252
|
-
openDisplay:
|
|
254
|
+
openDisplay: "flex",
|
|
253
255
|
plugins,
|
|
254
256
|
maxItems: this.multiple ? null : 1,
|
|
255
257
|
maxOptions: this.maxOptions,
|
|
@@ -258,9 +260,7 @@ export class StzhDropdown {
|
|
|
258
260
|
searchField: this._searchField,
|
|
259
261
|
searchConjunction: this.searchConjunction,
|
|
260
262
|
allowEmptyOption: this.allowEmptyOption,
|
|
261
|
-
closeAfterSelect: this.closeAfterSelect !== null
|
|
262
|
-
? this.closeAfterSelect
|
|
263
|
-
: !this.multiple,
|
|
263
|
+
closeAfterSelect: this.closeAfterSelect !== null ? this.closeAfterSelect : !this.multiple,
|
|
264
264
|
labelField: this.labelField,
|
|
265
265
|
valueField: this.valueField,
|
|
266
266
|
optgroupField: this.optgroupField,
|
|
@@ -273,15 +273,13 @@ export class StzhDropdown {
|
|
|
273
273
|
return this.transformLoadQuery(inputValue);
|
|
274
274
|
}
|
|
275
275
|
else if (this.transformLoadQuery === "join") {
|
|
276
|
-
const lastQueries = Array.from(this.tomSelect.controlChildren())
|
|
277
|
-
|
|
278
|
-
return (lastQueries.length > 0
|
|
276
|
+
const lastQueries = Array.from(this.tomSelect.controlChildren()).map((element) => element.innerText);
|
|
277
|
+
return ((lastQueries.length > 0
|
|
279
278
|
? lastQueries.join(" ") + (inputValue ? " " : "")
|
|
280
|
-
: "")
|
|
281
|
-
+ inputValue.replace(/\s\s+/g, ' ');
|
|
279
|
+
: "") + inputValue.replace(/\s\s+/g, " "));
|
|
282
280
|
}
|
|
283
281
|
else if (this.transformLoadQuery === "trim-to-single-ws") {
|
|
284
|
-
return inputValue.replace(/\s\s+/g,
|
|
282
|
+
return inputValue.replace(/\s\s+/g, " ");
|
|
285
283
|
}
|
|
286
284
|
else {
|
|
287
285
|
return inputValue.trim();
|
|
@@ -338,13 +336,15 @@ export class StzhDropdown {
|
|
|
338
336
|
${this.localization.noResults.replace(/\{x\}/gi, escape(data.input))}
|
|
339
337
|
</div>`;
|
|
340
338
|
},
|
|
341
|
-
not_loading: this.load === null
|
|
342
|
-
|
|
339
|
+
not_loading: this.load === null
|
|
340
|
+
? null
|
|
341
|
+
: (_data, escape) => {
|
|
342
|
+
return `
|
|
343
343
|
<div class="stzh-dropdown__not-loading" id="${this.dropdownId}-not-loading">
|
|
344
344
|
${this.localization.notLoading.replace(/\{x\}/gi, escape(this.minCharacters.toString()))}
|
|
345
345
|
</div>
|
|
346
346
|
`;
|
|
347
|
-
|
|
347
|
+
},
|
|
348
348
|
optgroup: (data) => {
|
|
349
349
|
let optgroup = document.createElement("div");
|
|
350
350
|
optgroup.className = "stzh-dropdown__optgroup";
|
|
@@ -367,7 +367,7 @@ export class StzhDropdown {
|
|
|
367
367
|
},
|
|
368
368
|
dropdown: () => {
|
|
369
369
|
return `<div class="stzh-dropdown__dropdown"></div>`;
|
|
370
|
-
}
|
|
370
|
+
},
|
|
371
371
|
},
|
|
372
372
|
onChange: (value) => {
|
|
373
373
|
this._items = this.tomSelect.items;
|
|
@@ -375,21 +375,21 @@ export class StzhDropdown {
|
|
|
375
375
|
this.value = this.multiple ? this._items : this._items[0];
|
|
376
376
|
this.stzhChange.emit({
|
|
377
377
|
component: "stzh-dropdown",
|
|
378
|
-
value
|
|
378
|
+
value,
|
|
379
379
|
});
|
|
380
380
|
},
|
|
381
381
|
onItemAdd: (value) => {
|
|
382
382
|
this._items = this.tomSelect.items;
|
|
383
383
|
this.stzhItemAdd.emit({
|
|
384
384
|
component: "stzh-dropdown",
|
|
385
|
-
value
|
|
385
|
+
value,
|
|
386
386
|
});
|
|
387
387
|
},
|
|
388
388
|
onItemRemove: (value) => {
|
|
389
389
|
this._items = this.tomSelect.items;
|
|
390
390
|
this.stzhItemRemove.emit({
|
|
391
391
|
component: "stzh-dropdown",
|
|
392
|
-
value
|
|
392
|
+
value,
|
|
393
393
|
});
|
|
394
394
|
},
|
|
395
395
|
onOptionAdd: (value) => {
|
|
@@ -397,7 +397,7 @@ export class StzhDropdown {
|
|
|
397
397
|
this.updateFilled();
|
|
398
398
|
this.stzhOptionAdd.emit({
|
|
399
399
|
component: "stzh-dropdown",
|
|
400
|
-
value
|
|
400
|
+
value,
|
|
401
401
|
});
|
|
402
402
|
},
|
|
403
403
|
onOptionRemove: (value) => {
|
|
@@ -405,19 +405,19 @@ export class StzhDropdown {
|
|
|
405
405
|
this.updateFilled();
|
|
406
406
|
this.stzhOptionRemove.emit({
|
|
407
407
|
component: "stzh-dropdown",
|
|
408
|
-
value
|
|
408
|
+
value,
|
|
409
409
|
});
|
|
410
410
|
},
|
|
411
411
|
onDropdownOpen: () => {
|
|
412
412
|
this.isOpen = true;
|
|
413
413
|
this.stzhOpen.emit({
|
|
414
|
-
component: "stzh-dropdown"
|
|
414
|
+
component: "stzh-dropdown",
|
|
415
415
|
});
|
|
416
416
|
},
|
|
417
417
|
onDropdownClose: () => {
|
|
418
418
|
this.isOpen = false;
|
|
419
419
|
this.stzhClose.emit({
|
|
420
|
-
component: "stzh-dropdown"
|
|
420
|
+
component: "stzh-dropdown",
|
|
421
421
|
});
|
|
422
422
|
},
|
|
423
423
|
onFocus: () => {
|
|
@@ -426,46 +426,46 @@ export class StzhDropdown {
|
|
|
426
426
|
// to be able to execute load function again, we reset loaded searches
|
|
427
427
|
this.resetLoadedSearches();
|
|
428
428
|
// if results have been preloaded before, load them now directly with load function
|
|
429
|
-
if (this.tomSelect.wrapper.classList.contains(
|
|
429
|
+
if (this.tomSelect.wrapper.classList.contains("preloaded")) {
|
|
430
430
|
// since tomSelect.preload() doesn't call tomSelect.shouldCall() method internally (to check for minCharacters),
|
|
431
431
|
// we will also not call it (this.tomSelect.settings.shouldLoad.call(this.tomSelect, ''))
|
|
432
|
-
this.tomSelect.load(
|
|
432
|
+
this.tomSelect.load("");
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
this.rootElement.classList.add(CLASS_FOCUS);
|
|
436
|
-
const focusEvent = new FocusEvent(
|
|
436
|
+
const focusEvent = new FocusEvent("focus", {
|
|
437
437
|
view: window,
|
|
438
438
|
bubbles: false,
|
|
439
|
-
cancelable: false
|
|
439
|
+
cancelable: false,
|
|
440
440
|
});
|
|
441
441
|
this.element.dispatchEvent(focusEvent);
|
|
442
442
|
this.stzhFocus.emit({
|
|
443
443
|
component: "stzh-dropdown",
|
|
444
444
|
originalEvent: {
|
|
445
|
-
target: this.tomSelect.control
|
|
446
|
-
}
|
|
445
|
+
target: this.tomSelect.control,
|
|
446
|
+
},
|
|
447
447
|
});
|
|
448
448
|
},
|
|
449
449
|
onBlur: () => {
|
|
450
450
|
this.rootElement.classList.remove(CLASS_FOCUS);
|
|
451
|
-
const blurEvent = new FocusEvent(
|
|
451
|
+
const blurEvent = new FocusEvent("blur", {
|
|
452
452
|
view: window,
|
|
453
453
|
bubbles: false,
|
|
454
|
-
cancelable: false
|
|
454
|
+
cancelable: false,
|
|
455
455
|
});
|
|
456
456
|
this.element.dispatchEvent(blurEvent);
|
|
457
457
|
this.stzhBlur.emit({
|
|
458
|
-
component: "stzh-dropdown"
|
|
458
|
+
component: "stzh-dropdown",
|
|
459
459
|
});
|
|
460
460
|
},
|
|
461
461
|
onInitialize: () => {
|
|
462
462
|
this.stzhInit.emit({
|
|
463
|
-
component: "stzh-dropdown"
|
|
463
|
+
component: "stzh-dropdown",
|
|
464
464
|
});
|
|
465
465
|
},
|
|
466
466
|
onLoad: () => {
|
|
467
467
|
this._options = this.tomSelect.options;
|
|
468
|
-
}
|
|
468
|
+
},
|
|
469
469
|
};
|
|
470
470
|
if (this._options) {
|
|
471
471
|
tomSelectOptions.options = this._options;
|
|
@@ -496,13 +496,14 @@ export class StzhDropdown {
|
|
|
496
496
|
}
|
|
497
497
|
render() {
|
|
498
498
|
var _a, _b;
|
|
499
|
-
const iconUsed = hasSlot(this.element,
|
|
500
|
-
const descriptionUsed = hasSlot(this.element,
|
|
501
|
-
const descriptionLongUsed = hasSlot(this.element,
|
|
502
|
-
const errorUsed = hasSlot(this.element,
|
|
499
|
+
const iconUsed = hasSlot(this.element, "icon") || !!this.icon;
|
|
500
|
+
const descriptionUsed = hasSlot(this.element, "description") || !!this.description;
|
|
501
|
+
const descriptionLongUsed = hasSlot(this.element, "description-long") || !!this.descriptionLong;
|
|
502
|
+
const errorUsed = hasSlot(this.element, "error") || ((_a = this._error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
503
503
|
const classes = {
|
|
504
504
|
"stzh-dropdown": true,
|
|
505
505
|
"stzh-dropdown--is-inline": this.inline,
|
|
506
|
+
"stzh-dropdown--has-no-wrap": this.noWrap,
|
|
506
507
|
"stzh-dropdown--is-multiple": this.multiple,
|
|
507
508
|
"stzh-dropdown--is-disabled": this.disabled,
|
|
508
509
|
"stzh-dropdown--is-required": this.required,
|
|
@@ -517,23 +518,20 @@ export class StzhDropdown {
|
|
|
517
518
|
[`stzh-dropdown--popover-placement-${this.popoverPlacement}`]: !!this.popoverPlacement,
|
|
518
519
|
[`stzh-dropdown--popover-fullwidth-${this.popoverFullwidth}`]: !!this.popoverFullwidth,
|
|
519
520
|
[`stzh-dropdown--size-${this.size}`]: !!this.size,
|
|
520
|
-
[`stzh-dropdown--${this.variant}`]: !!this.variant
|
|
521
|
+
[`stzh-dropdown--${this.variant}`]: !!this.variant,
|
|
521
522
|
};
|
|
522
|
-
return (h(Host, { "is-invalid": this.invalid || errorUsed, tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { class: classes, ref: (el) => (this.rootElement = el) }, h("div", { class: "stzh-dropdown__wrapper" }, h("label", { id: `${this.dropdownId}-label`, class:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
h("stzh-
|
|
530
|
-
|
|
531
|
-
h("slot", { name: "icon-angle" })), h("div", { class: "stzh-dropdown__icon-wrapper" }, this.icon ?
|
|
532
|
-
|
|
533
|
-
:
|
|
534
|
-
h("slot", { name: "icon" })), this.hideOptional && this.required &&
|
|
535
|
-
h("div", { id: `${this.dropdownId}-required`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.requiredFieldText), this.invalid &&
|
|
536
|
-
h("div", { id: `${this.dropdownId}-invalid`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.invalidFieldText))), h("div", { class: "stzh-dropdown__dropdown-wrapper", ref: (el) => (this.dropdownWrapperElement = el) }), (((_b = this._error) === null || _b === void 0 ? void 0 : _b.length) > 0 || this.description || this.descriptionLong) && (h(StzhInputDescription, { classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
|
|
523
|
+
return (h(Host, { "is-invalid": this.invalid || errorUsed, tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { class: classes, ref: (el) => (this.rootElement = el) }, h("div", { class: "stzh-dropdown__wrapper" }, h("label", { id: `${this.dropdownId}-label`, class: {
|
|
524
|
+
"stzh-dropdown__label": true,
|
|
525
|
+
"no-label-truncate": this.noLabelTruncate,
|
|
526
|
+
}, htmlFor: this.dropdownId }, this.label ? this.label : h("slot", { name: "label" }), !this.hideOptional && (h("span", { class: "stzh-dropdown__marker" }, h("span", { class: "stzh-dropdown__marker-symbol", "aria-hidden": "true" }, this.required
|
|
527
|
+
? this.localization.$globals.requiredFieldMarker
|
|
528
|
+
: this.localization.$globals.optionalFieldMarker), h("span", { class: "stzh-dropdown__marker-text" }, this.required
|
|
529
|
+
? this.localization.$globals.requiredFieldText
|
|
530
|
+
: this.localization.$globals.optionalFieldText)))), h("div", { class: "stzh-dropdown__field-wrapper" }, h("select", { id: this.dropdownId, class: "stzh-dropdown__select", ref: (el) => (this.select = el), multiple: this.multiple, name: this.name, disabled: this.disabled, "aria-labelledby": `${this.dropdownId}-label ${this.dropdownId}-not-loading ${this.dropdownId}-no-results ${this.hideOptional &&
|
|
531
|
+
this.required &&
|
|
532
|
+
`${this.dropdownId}-required`} ${this.invalid && `${this.dropdownId}-invalid`} ${this.dropdownId}-description ${this.a11yDescribedby}` }, h("slot", null)), this.inline && this.label && (h("div", { class: "stzh-dropdown__sizer" }, this.label)), h("div", { class: "stzh-dropdown__icon-angle-wrapper" }, this.iconAngle ? (h("stzh-icon", { name: this.iconAngle, class: "stzh-dropdown__icon-angle" })) : (h("slot", { name: "icon-angle" }))), h("div", { class: "stzh-dropdown__icon-wrapper" }, this.icon ? (h("stzh-icon", { class: "stzh-dropdown__icon", name: this.icon })) : (h("slot", { name: "icon" }))), this.hideOptional && this.required && (h("div", { id: `${this.dropdownId}-required`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.requiredFieldText)), this.invalid && (h("div", { id: `${this.dropdownId}-invalid`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.invalidFieldText)))), h("div", { class: "stzh-dropdown__dropdown-wrapper", ref: (el) => (this.dropdownWrapperElement = el) }), (((_b = this._error) === null || _b === void 0 ? void 0 : _b.length) > 0 ||
|
|
533
|
+
this.description ||
|
|
534
|
+
this.descriptionLong) && (h(StzhInputDescription, { classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
|
|
537
535
|
}
|
|
538
536
|
static get is() { return "stzh-dropdown"; }
|
|
539
537
|
static get originalStyleUrls() {
|
|
@@ -674,6 +672,24 @@ export class StzhDropdown {
|
|
|
674
672
|
"reflect": true,
|
|
675
673
|
"defaultValue": "false"
|
|
676
674
|
},
|
|
675
|
+
"noWrap": {
|
|
676
|
+
"type": "boolean",
|
|
677
|
+
"mutable": false,
|
|
678
|
+
"complexType": {
|
|
679
|
+
"original": "boolean",
|
|
680
|
+
"resolved": "boolean",
|
|
681
|
+
"references": {}
|
|
682
|
+
},
|
|
683
|
+
"required": false,
|
|
684
|
+
"optional": false,
|
|
685
|
+
"docs": {
|
|
686
|
+
"tags": [],
|
|
687
|
+
"text": "Don't wrap words when using inline (auto width)"
|
|
688
|
+
},
|
|
689
|
+
"attribute": "no-wrap",
|
|
690
|
+
"reflect": true,
|
|
691
|
+
"defaultValue": "false"
|
|
692
|
+
},
|
|
677
693
|
"maxOptions": {
|
|
678
694
|
"type": "number",
|
|
679
695
|
"mutable": false,
|
|
@@ -1197,7 +1213,7 @@ export class StzhDropdown {
|
|
|
1197
1213
|
"type": "string",
|
|
1198
1214
|
"mutable": false,
|
|
1199
1215
|
"complexType": {
|
|
1200
|
-
"original": "\"bottom\"
|
|
1216
|
+
"original": "| \"bottom\"\n | \"bottom-end\"\n | \"bottom-center\"\n | \"top\"\n | \"top-end\"\n | \"top-center\"",
|
|
1201
1217
|
"resolved": "\"bottom\" | \"bottom-center\" | \"bottom-end\" | \"top\" | \"top-center\" | \"top-end\"",
|
|
1202
1218
|
"references": {}
|
|
1203
1219
|
},
|
|
@@ -1247,6 +1263,24 @@ export class StzhDropdown {
|
|
|
1247
1263
|
"reflect": false,
|
|
1248
1264
|
"defaultValue": "\"\""
|
|
1249
1265
|
},
|
|
1266
|
+
"noLabelTruncate": {
|
|
1267
|
+
"type": "boolean",
|
|
1268
|
+
"mutable": false,
|
|
1269
|
+
"complexType": {
|
|
1270
|
+
"original": "boolean",
|
|
1271
|
+
"resolved": "boolean",
|
|
1272
|
+
"references": {}
|
|
1273
|
+
},
|
|
1274
|
+
"required": false,
|
|
1275
|
+
"optional": false,
|
|
1276
|
+
"docs": {
|
|
1277
|
+
"tags": [],
|
|
1278
|
+
"text": "Whether label should be truncate or not"
|
|
1279
|
+
},
|
|
1280
|
+
"attribute": "no-label-truncate",
|
|
1281
|
+
"reflect": false,
|
|
1282
|
+
"defaultValue": "false"
|
|
1283
|
+
},
|
|
1250
1284
|
"labelHidden": {
|
|
1251
1285
|
"type": "boolean",
|
|
1252
1286
|
"mutable": false,
|