@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,5 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement
|
|
2
|
-
import { S as StzhInputDescription } from './stzh-input-description-766446dc.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-e3050b18.js';
|
|
3
2
|
|
|
4
3
|
const stzhChipCss = ".sc-stzh-chip-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-chip-h{display:none}.sc-stzh-chip-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chip-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chip-h *.sc-stzh-chip,.sc-stzh-chip-h *.sc-stzh-chip::before,.sc-stzh-chip-h *.sc-stzh-chip::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-chip-h .has-focus.sc-stzh-chip{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-chip-h .stzh-fylingfocus-focused.sc-stzh-chip{outline-style:none !important}.sc-stzh-chip-h .stzh-fylingfocus-focused.sc-stzh-chip::-moz-focus-inner{border:0 !important}.sc-stzh-chip-h{--font-size:var(--stzh-font-micro-font-size);--line-height:var(--stzh-font-micro-text-line-height);--letter-spacing:normal;--height:2rem;--outer-height:2.5rem;--padding-top:0;--padding-bottom:0;--padding-left:var(--stzh-space-small);--padding-right:var(--stzh-space-small);--border-radius:1rem;--color:var(--stzh-chip-color, var(--stzh-color-primary70));--remove-color:var(--color);--remove-border-radius:1.5rem;--background-color:var(--stzh-chip-background-color, var(--stzh-color-secondary30));--icon-size:var(--stzh-icon-size-xsmall);--icon-color:var(--color);--icon-gap:var(--stzh-space-xsmall);--counter-color:var(--color);--counter-gap:var(--stzh-space-xsmall);--hover-color:var(--stzh-chip-hover-color, var(--stzh-color-primary70));--hover-background-color:var(--stzh-chip-hover-background-color, var(--stzh-color-secondary40));--hover-remove-color:var(--hover-color);--hover-remove-background-color:var(--stzh-color-primary30);--hover-icon-color:var(--hover-color);--hover-counter-color:var(--hover-color);display:inline-flex}@media screen and (min-width: 900px){.sc-stzh-chip-h{--outer-height:auto}}@media (forced-colors: active), (-ms-high-contrast: active){.sc-stzh-chip-h{--hover-color:Highlight;--hover-background-color:Canvas;--hover-remove-background-color:Canvas}}[variant=input].sc-stzh-chip-h{--background-color:var(--stzh-color-primary10);--hover-color:var(--stzh-color-primary90);--hover-background-color:var(--stzh-color-primary20)}[variant=tag].sc-stzh-chip-h{--color:var(--stzh-color-grey90);--background-color:var(--stzh-color-grey20);--hover-color:var(--stzh-color-grey90);--hover-background-color:var(--stzh-color-grey20)}[variant=input].sc-stzh-chip-h:where([size=\"small\"]){--icon-gap:var(--stzh-space-xxsmall)}[variant=tag].sc-stzh-chip-h:where([size=\"small\"]){--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall);--icon-gap:var(--stzh-space-xxsmall)}[variant=tag].sc-stzh-chip-h:where([type=\"warning\"]){--color:var(--stzh-color-warning90);--hover-color:var(--stzh-color-warning90)}[variant=tag].sc-stzh-chip-h:where([type=\"error\"]){--color:var(--stzh-color-error70);--hover-color:var(--stzh-color-error70)}[variant=tag].sc-stzh-chip-h:where([type=\"success\"]){--color:var(--stzh-color-success70);--hover-color:var(--stzh-color-success70)}[variant=tag].sc-stzh-chip-h:where([inverted]:not([inverted=\"false\"])){--color:var(--stzh-color-white);--background-color:var(--stzh-color-grey90);--hover-color:var(--stzh-color-white);--hover-background-color:var(--stzh-color-grey90)}[variant=tag].sc-stzh-chip-h:where([type=\"warning\"][inverted]:not([inverted=\"false\"])){--color:var(--stzh-color-black);--background-color:var(--stzh-color-warning60);--hover-color:var(--stzh-color-black);--hover-background-color:var(--stzh-color-warning60)}[variant=tag].sc-stzh-chip-h:where([type=\"error\"][inverted]:not([inverted=\"false\"])){--background-color:var(--stzh-color-error70);--hover-background-color:var(--stzh-color-error70)}[variant=tag].sc-stzh-chip-h:where([type=\"success\"][inverted]:not([inverted=\"false\"])){--background-color:var(--stzh-color-success70);--hover-background-color:var(--stzh-color-success70)}[active].sc-stzh-chip-h:not([active=false]){--color:var(--stzh-chip-active-color, var(--stzh-color-white));--background-color:var(--stzh-chip-active-background-color, var(--stzh-color-primary70));--hover-color:var(--stzh-chip-active-hover-color, var(--stzh-color-white));--hover-background-color:var(--stzh-chip-active-hover-background-color, var(--stzh-color-primary90));--hover-remove-background-color:var(--stzh-color-primary90)}@media (forced-colors: active), (-ms-high-contrast: active){[active].sc-stzh-chip-h:not([active=false]){--color:Highlight;--background-color:Canvas;--hover-color:Highlight;--hover-background-color:Canvas;--hover-remove-background-color:Canvas}}[non-interactive].sc-stzh-chip-h:not([non-interactive=false]){--hover-color:var(--color);--hover-background-color:var(--background-color);--hover-remove-color:var(--remove-color);--hover-remove-background-color:transparent;--hover-icon-color:var(--icon-color);--hover-counter-color:var(--counter-color)}[disabled].sc-stzh-chip-h:not([disabled=false]){--color:var(--stzh-chip-disabled-color, var(--stzh-color-grey80));--background-color:var(--stzh-chip-disabled-background-color, var(--stzh-color-grey20));--remove-color:var(--color);--icon-color:var(--color);--counter-color:var(--color);--hover-color:var(--color);--hover-background-color:var(--background-color);--hover-remove-color:var(--remove-color);--hover-remove-background-color:transparent;--hover-icon-color:var(--icon-color);--hover-counter-color:var(--counter-color)}[variant=input][disabled].sc-stzh-chip-h:not([disabled=false]){--background-color:var(--stzh-color-grey10)}.sc-stzh-chip-h:where([size=\"small\"]){--font-size:var(--stzh-font-nano-font-size);--line-height:var(--stzh-font-nano-text-line-height);--letter-spacing:normal;--height:1.5rem;--border-radius:0.75rem;--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall)}.sc-stzh-chip-h:where([size=\"large\"]){--height:2.5rem;--border-radius:1.25rem;--padding-left:var(--stzh-space-medium);--padding-right:var(--stzh-space-medium)}@media screen and (min-width: 600px){.sc-stzh-chip-h:where([size-small=\"default\"]){--font-size:var(--stzh-font-micro-font-size);--line-height:var(--stzh-font-micro-text-line-height);--letter-spacing:normal;--height:2rem;--outer-height:2.5rem;--padding-top:0;--padding-bottom:0;--padding-left:var(--stzh-space-small);--padding-right:var(--stzh-space-small);--border-radius:1rem}}@media screen and (min-width: 600px) and (min-width: 900px){.sc-stzh-chip-h:where([size-small=\"default\"]){--outer-height:auto}}@media screen and (min-width: 600px){.sc-stzh-chip-h:where([size-small=\"small\"]){--font-size:var(--stzh-font-nano-font-size);--line-height:var(--stzh-font-nano-text-line-height);--letter-spacing:normal;--height:1.5rem;--border-radius:0.75rem;--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall)}}@media screen and (min-width: 600px){.sc-stzh-chip-h:where([size-small=\"large\"]){--height:2.5rem;--border-radius:1.25rem;--padding-left:var(--stzh-space-medium);--padding-right:var(--stzh-space-medium)}}@media screen and (min-width: 900px){.sc-stzh-chip-h:where([size-medium=\"default\"]){--font-size:var(--stzh-font-micro-font-size);--line-height:var(--stzh-font-micro-text-line-height);--letter-spacing:normal;--height:2rem;--outer-height:2.5rem;--padding-top:0;--padding-bottom:0;--padding-left:var(--stzh-space-small);--padding-right:var(--stzh-space-small);--border-radius:1rem}}@media screen and (min-width: 900px) and (min-width: 900px){.sc-stzh-chip-h:where([size-medium=\"default\"]){--outer-height:auto}}@media screen and (min-width: 900px){.sc-stzh-chip-h:where([size-medium=\"small\"]){--font-size:var(--stzh-font-nano-font-size);--line-height:var(--stzh-font-nano-text-line-height);--letter-spacing:normal;--height:1.5rem;--border-radius:0.75rem;--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall)}}@media screen and (min-width: 900px){.sc-stzh-chip-h:where([size-medium=\"large\"]){--height:2.5rem;--border-radius:1.25rem;--padding-left:var(--stzh-space-medium);--padding-right:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.sc-stzh-chip-h:where([size-large=\"default\"]){--font-size:var(--stzh-font-micro-font-size);--line-height:var(--stzh-font-micro-text-line-height);--letter-spacing:normal;--height:2rem;--outer-height:2.5rem;--padding-top:0;--padding-bottom:0;--padding-left:var(--stzh-space-small);--padding-right:var(--stzh-space-small);--border-radius:1rem}}@media screen and (min-width: 1260px) and (min-width: 900px){.sc-stzh-chip-h:where([size-large=\"default\"]){--outer-height:auto}}@media screen and (min-width: 1260px){.sc-stzh-chip-h:where([size-large=\"small\"]){--font-size:var(--stzh-font-nano-font-size);--line-height:var(--stzh-font-nano-text-line-height);--letter-spacing:normal;--height:1.5rem;--border-radius:0.75rem;--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall)}}@media screen and (min-width: 1260px){.sc-stzh-chip-h:where([size-large=\"large\"]){--height:2.5rem;--border-radius:1.25rem;--padding-left:var(--stzh-space-medium);--padding-right:var(--stzh-space-medium)}}@media screen and (min-width: 1600px){.sc-stzh-chip-h:where([size-ultra=\"default\"]){--font-size:var(--stzh-font-micro-font-size);--line-height:var(--stzh-font-micro-text-line-height);--letter-spacing:normal;--height:2rem;--outer-height:2.5rem;--padding-top:0;--padding-bottom:0;--padding-left:var(--stzh-space-small);--padding-right:var(--stzh-space-small);--border-radius:1rem}}@media screen and (min-width: 1600px) and (min-width: 900px){.sc-stzh-chip-h:where([size-ultra=\"default\"]){--outer-height:auto}}@media screen and (min-width: 1600px){.sc-stzh-chip-h:where([size-ultra=\"small\"]){--font-size:var(--stzh-font-nano-font-size);--line-height:var(--stzh-font-nano-text-line-height);--letter-spacing:normal;--height:1.5rem;--border-radius:0.75rem;--padding-left:var(--stzh-space-xsmall);--padding-right:var(--stzh-space-xsmall)}}@media screen and (min-width: 1600px){.sc-stzh-chip-h:where([size-ultra=\"large\"]){--height:2.5rem;--border-radius:1.25rem;--padding-left:var(--stzh-space-medium);--padding-right:var(--stzh-space-medium)}}.stzh-chip.sc-stzh-chip{position:relative}.stzh-chip__vhidden.sc-stzh-chip{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-chip__button.sc-stzh-chip{font-size:var(--font-size);line-height:var(--line-height);letter-spacing:var(--letter-spacing);min-height:var(--outer-height);font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0px;border:none;background-color:transparent}.stzh-chip__button.is-button.sc-stzh-chip,.stzh-chip__button.is-link.sc-stzh-chip{cursor:pointer}.stzh-chip__button-inner.sc-stzh-chip{height:var(--height);display:flex;flex-direction:row;align-items:center;border-radius:var(--border-radius);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);padding-left:var(--padding-left);padding-right:var(--padding-right);color:var(--color);background-color:var(--background-color);transition-duration:var(--stzh-base-transition-animation-speed);transition-property:color, background-color;-webkit-text-decoration-line:none;text-decoration-line:none}.stzh-chip__label.sc-stzh-chip{text-align:left}.stzh-chip__icon-wrapper.sc-stzh-chip{--stzh-icon-size:var(--icon-size);display:flex;color:var(--icon-color);transition:color var(--stzh-base-transition-animation-speed);flex-shrink:0}.stzh-chip__icon-wrapper.sc-stzh-chip:not(:empty){margin-right:var(--icon-gap)}.stzh-chip__counter.sc-stzh-chip{display:flex;font-variant-numeric:tabular-nums;margin-left:var(--counter-gap);color:var(--counter-color);transition:color var(--stzh-base-transition-animation-speed)}.stzh-chip__remove.sc-stzh-chip{position:absolute;top:50%;transform:translateY(-50%);right:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background:none;padding:0;width:var(--height);height:var(--height);border-radius:var(--remove-border-radius);display:flex;justify-content:center;align-items:center;margin-left:var(--stzh-space-xxsmall);color:var(--remove-color);transition-duration:var(--stzh-base-transition-animation-speed);transition-property:color, background-color, border-color;cursor:pointer}.stzh-chip__remove.sc-stzh-chip:hover{color:var(--hover-remove-color);background-color:var(--hover-remove-background-color)}.stzh-chip__remove-icon.sc-stzh-chip{--size:var(--stzh-icon-size-xxsmall)}.stzh-chip__button.sc-stzh-chip:hover .stzh-chip__button-inner.sc-stzh-chip,.stzh-chip__remove.sc-stzh-chip:hover+.stzh-chip__button.sc-stzh-chip .stzh-chip__button-inner.sc-stzh-chip{color:var(--hover-color);background-color:var(--hover-background-color)}.stzh-chip__button.sc-stzh-chip:hover .stzh-chip__counter.sc-stzh-chip,.stzh-chip__remove.sc-stzh-chip:hover+.stzh-chip__button.sc-stzh-chip .stzh-chip__counter.sc-stzh-chip{color:var(--hover-counter-color)}.stzh-chip__button.sc-stzh-chip:hover .stzh-chip__icon-wrapper.sc-stzh-chip,.stzh-chip__remove.sc-stzh-chip:hover+.stzh-chip__button.sc-stzh-chip .stzh-chip__icon-wrapper.sc-stzh-chip{color:var(--hover-icon-color)}.stzh-chip--is-removable.sc-stzh-chip .stzh-chip__button-inner.sc-stzh-chip{padding-right:calc(var(--height) + var(--stzh-space-xxsmall))}.stzh-chip--is-disabled.sc-stzh-chip .stzh-chip__button.sc-stzh-chip,.stzh-chip--is-disabled.sc-stzh-chip .stzh-chip__remove.sc-stzh-chip{cursor:not-allowed}";
|
|
5
4
|
|
|
@@ -119,218 +118,6 @@ const StzhChip = class {
|
|
|
119
118
|
};
|
|
120
119
|
StzhChip.style = stzhChipCss;
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
export { StzhChip as stzh_chip };
|
|
123
122
|
|
|
124
|
-
|
|
125
|
-
const StzhChipselect = class {
|
|
126
|
-
constructor(hostRef) {
|
|
127
|
-
registerInstance(this, hostRef);
|
|
128
|
-
this.stzhChange = createEvent(this, "stzhChange", 7);
|
|
129
|
-
this._data = [];
|
|
130
|
-
this._value = [];
|
|
131
|
-
this.handleReset = async () => {
|
|
132
|
-
this.value = this.defaultValue;
|
|
133
|
-
// this.stzhChange.emit({
|
|
134
|
-
// component: "stzh-chipselect",
|
|
135
|
-
// value: this.value
|
|
136
|
-
// });
|
|
137
|
-
};
|
|
138
|
-
this.handleChipClick = async (data, index) => {
|
|
139
|
-
if (this.multiple) {
|
|
140
|
-
if (data.value === "" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === "")) {
|
|
141
|
-
this.value = [];
|
|
142
|
-
}
|
|
143
|
-
else if (data.value !== "") {
|
|
144
|
-
this.value = this._value.includes(data.value)
|
|
145
|
-
? this._value.filter(value => value !== data.value)
|
|
146
|
-
: [...this._value, data.value];
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.value = data.value;
|
|
151
|
-
}
|
|
152
|
-
this.activeFocusOptionIndex = index;
|
|
153
|
-
await this.waitForNextRender();
|
|
154
|
-
this.stzhChange.emit({
|
|
155
|
-
component: "stzh-chipselect",
|
|
156
|
-
value: this.multiple ? this._value : this._value[0]
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
// private handleDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {
|
|
160
|
-
// this.value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;
|
|
161
|
-
// this.activeFocusOptionIndex = this._data.findIndex(data => {
|
|
162
|
-
// return data.value === this.value;
|
|
163
|
-
// });
|
|
164
|
-
// await this.waitForNextRender();
|
|
165
|
-
// this.stzhChange.emit({
|
|
166
|
-
// component: "stzh-chipselect",
|
|
167
|
-
// value: this.value
|
|
168
|
-
// })
|
|
169
|
-
// }
|
|
170
|
-
this.handleKeydown = (event) => {
|
|
171
|
-
let newActiveIndex = null;
|
|
172
|
-
const activeOptionIndex = this.activeFocusOptionIndex;
|
|
173
|
-
if (event.key === "ArrowUp" || event.key === "ArrowLeft") {
|
|
174
|
-
event.preventDefault();
|
|
175
|
-
if (activeOptionIndex > 0) {
|
|
176
|
-
newActiveIndex = activeOptionIndex - 1;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
else if (event.key === "ArrowDown" || event.key === "ArrowRight") {
|
|
180
|
-
event.preventDefault();
|
|
181
|
-
if (activeOptionIndex < this._data.length - 1) {
|
|
182
|
-
newActiveIndex = activeOptionIndex + 1;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else if (event.key === " " || event.key === "Enter") {
|
|
186
|
-
event.preventDefault();
|
|
187
|
-
this.value = this._data[activeOptionIndex].value;
|
|
188
|
-
this.stzhChange.emit({
|
|
189
|
-
component: "stzh-chipselect",
|
|
190
|
-
value: this.value
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
if (newActiveIndex !== null) {
|
|
194
|
-
this.activeFocusOptionIndex = newActiveIndex;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
this.localization = undefined;
|
|
198
|
-
this.data = [];
|
|
199
|
-
this.name = undefined;
|
|
200
|
-
this.label = "";
|
|
201
|
-
this.labelHidden = false;
|
|
202
|
-
this.multiple = false;
|
|
203
|
-
this.value = "";
|
|
204
|
-
this.defaultValue = "";
|
|
205
|
-
this.description = undefined;
|
|
206
|
-
this.descriptionLong = undefined;
|
|
207
|
-
this.descriptionLongTitle = undefined;
|
|
208
|
-
this.error = undefined;
|
|
209
|
-
this.invalid = false;
|
|
210
|
-
this.required = false;
|
|
211
|
-
this.disabled = false;
|
|
212
|
-
this.hideOptional = false;
|
|
213
|
-
this.a11yDescribedby = "";
|
|
214
|
-
this.activeFocusOptionIndex = 0;
|
|
215
|
-
}
|
|
216
|
-
resetListener(event) {
|
|
217
|
-
if (event.target.contains(this.element)) {
|
|
218
|
-
requestAnimationFrame(() => {
|
|
219
|
-
this.handleReset();
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
valueWatcher(newValue) {
|
|
224
|
-
if (typeof newValue === "string") {
|
|
225
|
-
try {
|
|
226
|
-
this._value = JSON.parse(newValue);
|
|
227
|
-
}
|
|
228
|
-
catch (ex) {
|
|
229
|
-
this._value = newValue ? [newValue] : [];
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
this._value = newValue ? newValue : [];
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
dataWatcher(newValue) {
|
|
237
|
-
if (typeof newValue === "string") {
|
|
238
|
-
this._data = JSON.parse(newValue);
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
this._data = newValue;
|
|
242
|
-
}
|
|
243
|
-
// this._dataDropdown = this._data.map((data) => {
|
|
244
|
-
// return {
|
|
245
|
-
// text: data.counter
|
|
246
|
-
// ? `${data.label} (${data.counter})`
|
|
247
|
-
// : data.label,
|
|
248
|
-
// value: data.value
|
|
249
|
-
// }
|
|
250
|
-
// });
|
|
251
|
-
}
|
|
252
|
-
errorWatcher(newValue) {
|
|
253
|
-
if (typeof newValue === "string") {
|
|
254
|
-
try {
|
|
255
|
-
this._error = JSON.parse(newValue);
|
|
256
|
-
}
|
|
257
|
-
catch (e) {
|
|
258
|
-
if (newValue) {
|
|
259
|
-
this._error = [newValue];
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
this._error = [];
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
else if (newValue) {
|
|
267
|
-
this._error = newValue;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
this._error = [];
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
waitForNextRender() {
|
|
274
|
-
return new Promise(resolve => this.renderPromiseResolve = resolve);
|
|
275
|
-
}
|
|
276
|
-
componentDidRender() {
|
|
277
|
-
if (this.renderPromiseResolve) {
|
|
278
|
-
this.renderPromiseResolve();
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
async componentWillLoad() {
|
|
282
|
-
this.id = `stzh-chipselect-${chipselectCounter++}`;
|
|
283
|
-
this.dataWatcher(this.data);
|
|
284
|
-
this.errorWatcher(this.error);
|
|
285
|
-
this.valueWatcher(this.value);
|
|
286
|
-
this.defaultValue = this.defaultValue || this.value;
|
|
287
|
-
if (!this.localization) {
|
|
288
|
-
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "chipselect");
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
render() {
|
|
292
|
-
const descriptionUsed = !!this.description;
|
|
293
|
-
const descriptionLongUsed = !!this.descriptionLong;
|
|
294
|
-
const errorUsed = !!this.error;
|
|
295
|
-
const classes = {
|
|
296
|
-
"stzh-chipselect": true,
|
|
297
|
-
"stzh-chipselect--has-description": descriptionUsed,
|
|
298
|
-
"stzh-chipselect--has-description-long": descriptionLongUsed,
|
|
299
|
-
"stzh-chipselect--has-error": errorUsed,
|
|
300
|
-
"stzh-chipselect--is-invalid": this.invalid || errorUsed,
|
|
301
|
-
"stzh-chipselect--is-disabled": this.disabled,
|
|
302
|
-
"stzh-chipselect--is-required": this.required,
|
|
303
|
-
"stzh-chipselect--has-label-hidden": this.labelHidden,
|
|
304
|
-
};
|
|
305
|
-
return (h(Host, { "is-invalid": this.invalid || errorUsed }, h("div", { class: classes }, this.multiple
|
|
306
|
-
?
|
|
307
|
-
h(Fragment, null, this._value.map((value) => h("input", { type: "hidden", name: this.name, value: value })))
|
|
308
|
-
:
|
|
309
|
-
h("input", { type: "hidden", name: this.name, value: this.value }), h("label", { class: "stzh-chipselect__label", htmlFor: this.id }, this.label ? this.label : h("slot", null), !this.hideOptional &&
|
|
310
|
-
h("span", { class: "stzh-chipselect__marker" }, h("span", { class: "stzh-chipselect__marker-symbol", "aria-hidden": "true" }, this.required
|
|
311
|
-
? this.localization.$globals.requiredFieldMarker
|
|
312
|
-
: this.localization.$globals.optionalFieldMarker), h("span", { class: "stzh-chipselect__marker-text" }, this.required
|
|
313
|
-
? this.localization.$globals.requiredFieldText
|
|
314
|
-
: this.localization.$globals.optionalFieldText))), this._data.length > 0 &&
|
|
315
|
-
h(Fragment, null, h("div", { id: this.id, class: "stzh-chipselect__chips", role: "listbox", tabindex: "0", "aria-multiselectable": this.multiple ? "true" : "false", "aria-activedescendant": `${this.id}-option-${this.activeFocusOptionIndex}`, "aria-describedby": `${this.id}-description ${this.a11yDescribedby}`, onKeyDown: this.handleKeydown }, this._data.map((data, index) => (h("stzh-chip", { role: "option", class: {
|
|
316
|
-
"stzh-chipselect__chip": true,
|
|
317
|
-
"is-focused": this.activeFocusOptionIndex === index
|
|
318
|
-
}, label: data.label, counter: data.counter, icon: data.icon, type: data.type, inverted: data.inverted, variant: data.variant, size: data.size || "small", disabled: this.disabled || data.disabled, active: this._value.includes(data.value)
|
|
319
|
-
|| (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === ""))
|
|
320
|
-
|| (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === ""))), "aria-selected": this._value.includes(data.value)
|
|
321
|
-
|| (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === ""))
|
|
322
|
-
|| (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === "")))
|
|
323
|
-
? "true" : "false", id: `${this.id}-option-${index}`, a11yTabindex: "-1", onClick: () => this.handleChipClick(data, index) })))), h(StzhInputDescription, { classPrefix: "stzh-chipselect", id: `${this.id}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
|
|
324
|
-
}
|
|
325
|
-
get element() { return getElement(this); }
|
|
326
|
-
static get watchers() { return {
|
|
327
|
-
"value": ["valueWatcher"],
|
|
328
|
-
"data": ["dataWatcher"],
|
|
329
|
-
"error": ["errorWatcher"]
|
|
330
|
-
}; }
|
|
331
|
-
};
|
|
332
|
-
StzhChipselect.style = stzhChipselectCss;
|
|
333
|
-
|
|
334
|
-
export { StzhChip as stzh_chip, StzhChipselect as stzh_chipselect };
|
|
335
|
-
|
|
336
|
-
//# sourceMappingURL=stzh-chip_2.entry.js.map
|
|
123
|
+
//# sourceMappingURL=stzh-chip.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"stzh-chip.entry.js","mappings":"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","names":[],"sources":["src/components/stzh-chip/stzh-chip.scss?tag=stzh-chip&encapsulation=scoped","src/components/stzh-chip/stzh-chip.tsx"],"sourcesContent":["@mixin chip--size-default() {\n --font-size: var(--stzh-font-micro-font-size);\n --line-height: var(--stzh-font-micro-text-line-height);\n --letter-spacing: normal;\n\n --height: 32px;\n --outer-height: 40px;\n --padding-top: 0;\n --padding-bottom: 0;\n --padding-left: #{space('small')};\n --padding-right: #{space('small')};\n --border-radius: 16px;\n\n @include mq($from: medium) {\n --outer-height: auto;\n }\n}\n\n@mixin chip--size-large() {\n --height: 40px;\n --border-radius: 20px;\n --padding-left: #{space('medium')};\n --padding-right: #{space('medium')};\n}\n\n@mixin chip--size-small() {\n --font-size: var(--stzh-font-nano-font-size);\n --line-height: var(--stzh-font-nano-text-line-height);\n --letter-spacing: normal;\n\n --height: 24px;\n --border-radius: 12px;\n --padding-left: #{space('xsmall')};\n --padding-right: #{space('xsmall')};\n}\n\n:host {\n @include chip--size-default;\n --color: var(--stzh-chip-color, #{$colorPrimary70});\n --remove-color: var(--color);\n --remove-border-radius: 24px;\n --background-color: var(--stzh-chip-background-color, #{$colorSecondary30});\n --icon-size: #{iconSize('xsmall')};\n --icon-color: var(--color);\n --icon-gap: #{space('xsmall')};\n --counter-color: var(--color);\n --counter-gap: #{space('xsmall')};\n\n --hover-color: var(--stzh-chip-hover-color, #{$colorPrimary70});\n --hover-background-color: var(--stzh-chip-hover-background-color, #{$colorSecondary40});\n --hover-remove-color: var(--hover-color);\n --hover-remove-background-color: #{$colorPrimary30};\n --hover-icon-color: var(--hover-color);\n --hover-counter-color: var(--hover-color);\n\n display: inline-flex;\n\n @include highContrast() {\n --hover-color: Highlight;\n --hover-background-color: Canvas;\n --hover-remove-background-color: Canvas;\n }\n\n &[variant=\"input\"] {\n --background-color: #{$colorPrimary10};\n\n --hover-color: #{$colorPrimary90};\n --hover-background-color: #{$colorPrimary20};\n }\n\n &[variant=\"tag\"] {\n --color: #{$colorGrey90};\n --background-color: #{$colorGrey20};\n\n --hover-color: #{$colorGrey90};\n --hover-background-color: #{$colorGrey20};\n }\n\n &[variant=\"input\"]:where([size=\"small\"]) {\n --icon-gap: #{space('xxsmall')};\n }\n\n &[variant=\"tag\"]:where([size=\"small\"]) {\n --padding-left: #{space('xsmall')};\n --padding-right: #{space('xsmall')};\n --icon-gap: #{space('xxsmall')};\n }\n\n &[variant=\"tag\"]:where([type=\"warning\"]) {\n --color: #{$colorWarning90};\n\n --hover-color: #{$colorWarning90};\n }\n\n &[variant=\"tag\"]:where([type=\"error\"]) {\n --color: #{$colorError70};\n\n --hover-color: #{$colorError70};\n }\n\n &[variant=\"tag\"]:where([type=\"success\"]) {\n --color: #{$colorSuccess70};\n\n --hover-color: #{$colorSuccess70};\n }\n\n &[variant=\"tag\"]:where([inverted]:not([inverted=\"false\"])) {\n --color: #{$colorWhite};\n --background-color: #{$colorGrey90};\n\n --hover-color: #{$colorWhite};\n --hover-background-color: #{$colorGrey90};\n }\n\n &[variant=\"tag\"]:where([type=\"warning\"][inverted]:not([inverted=\"false\"])) {\n --color: #{$colorBlack};\n --background-color: #{$colorWarning60};\n\n --hover-color: #{$colorBlack};\n --hover-background-color: #{$colorWarning60};\n }\n\n &[variant=\"tag\"]:where([type=\"error\"][inverted]:not([inverted=\"false\"])) {\n --background-color: #{$colorError70};\n\n --hover-background-color: #{$colorError70};\n }\n\n &[variant=\"tag\"]:where([type=\"success\"][inverted]:not([inverted=\"false\"])) {\n --background-color: #{$colorSuccess70};\n\n --hover-background-color: #{$colorSuccess70};\n }\n\n &[active]:not([active=\"false\"]) {\n --color: var(--stzh-chip-active-color, #{$colorWhite});\n --background-color: var(--stzh-chip-active-background-color, #{$colorPrimary70});\n\n --hover-color: var(--stzh-chip-active-hover-color, #{$colorWhite});\n --hover-background-color: var(--stzh-chip-active-hover-background-color, #{$colorPrimary90});\n --hover-remove-background-color: #{$colorPrimary90};\n\n @include highContrast() {\n --color: Highlight;\n --background-color: Canvas;\n\n --hover-color: Highlight;\n --hover-background-color: Canvas;\n --hover-remove-background-color: Canvas;\n }\n }\n\n &[non-interactive]:not([non-interactive=\"false\"]) {\n --hover-color: var(--color);\n --hover-background-color: var(--background-color);\n --hover-remove-color: var(--remove-color);\n --hover-remove-background-color: transparent;\n --hover-icon-color: var(--icon-color);\n --hover-counter-color: var(--counter-color);\n }\n\n &[disabled]:not([disabled=\"false\"]) {\n --color: var(--stzh-chip-disabled-color, #{$colorGrey80});\n --background-color: var(--stzh-chip-disabled-background-color, #{$colorGrey20});\n --remove-color: var(--color);\n --icon-color: var(--color);\n --counter-color: var(--color);\n\n --hover-color: var(--color);\n --hover-background-color: var(--background-color);\n --hover-remove-color: var(--remove-color);\n --hover-remove-background-color: transparent;\n --hover-icon-color: var(--icon-color);\n --hover-counter-color: var(--counter-color);\n }\n\n &[variant=\"input\"][disabled]:not([disabled=\"false\"]) {\n --background-color: #{$colorGrey10};\n }\n}\n\n:host(:where([size=\"small\"])) {\n @include chip--size-small;\n}\n\n:host(:where([size=\"large\"])) {\n @include chip--size-large;\n}\n\n@each $breakpoint, $size in $breakpoints {\n @include mq($from: $breakpoint) {\n :host(:where([size-#{$breakpoint}=\"default\"])) {\n @include chip--size-default;\n }\n\n :host(:where([size-#{$breakpoint}=\"small\"])) {\n @include chip--size-small;\n }\n\n :host(:where([size-#{$breakpoint}=\"large\"])) {\n @include chip--size-large;\n }\n }\n}\n\n.stzh-chip {\n position: relative;\n\n &__vhidden {\n @include visuallyhidden;\n }\n\n &__button {\n font-size: var(--font-size);\n line-height: var(--line-height);\n letter-spacing: var(--letter-spacing);\n min-height: var(--outer-height);\n font-family: inherit;\n appearance: none;\n padding: 0px;\n border: none;\n background-color: transparent;\n\n &.is-button,\n &.is-link {\n cursor: pointer;\n }\n }\n\n &__button-inner {\n height: var(--height);\n display: flex;\n flex-direction: row;\n align-items: center;\n border-radius: var(--border-radius);\n padding-top: var(--padding-top);\n padding-bottom: var(--padding-bottom);\n padding-left: var(--padding-left);\n padding-right: var(--padding-right);\n color: var(--color);\n background-color: var(--background-color);\n transition-duration: $baseTransitionAnimationSpeed;\n transition-property: color, background-color;\n text-decoration-line: none;\n }\n\n &__label {\n text-align: left;\n }\n\n &__icon-wrapper {\n --stzh-icon-size: var(--icon-size);\n\n display: flex;\n color: var(--icon-color);\n transition: color $baseTransitionAnimationSpeed;\n flex-shrink: 0;\n\n &:not(:empty) {\n margin-right: var(--icon-gap);\n }\n }\n\n &__counter {\n display: flex;\n font-variant-numeric: tabular-nums;\n margin-left: var(--counter-gap);\n color: var(--counter-color);\n transition: color $baseTransitionAnimationSpeed;\n }\n\n &__remove {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 0;\n appearance: none;\n font-family: inherit;\n border: none;\n background: none;\n padding: 0;\n width: var(--height);\n height: var(--height);\n border-radius: var(--remove-border-radius);\n display: flex;\n justify-content: center;\n align-items: center;\n margin-left: space('xxsmall');\n color: var(--remove-color);\n transition-duration: $baseTransitionAnimationSpeed;\n transition-property: color, background-color, border-color;\n cursor: pointer;\n\n &:hover {\n color: var(--hover-remove-color);\n background-color: var(--hover-remove-background-color);\n }\n }\n\n &__remove-icon {\n --size: #{iconSize('xxsmall')};\n }\n\n &__button:hover &__button-inner,\n &__remove:hover + &__button &__button-inner {\n color: var(--hover-color);\n background-color: var(--hover-background-color);\n }\n\n &__button:hover &__counter,\n &__remove:hover + &__button &__counter {\n color: var(--hover-counter-color);\n }\n\n &__button:hover &__icon-wrapper,\n &__remove:hover + &__button &__icon-wrapper {\n color: var(--hover-icon-color);\n }\n\n /* Removeable */\n\n &--is-removable &__button-inner {\n padding-right: calc(var(--height) + #{space('xxsmall')});\n }\n\n /* Disabled */\n\n &--is-disabled &__button,\n &--is-disabled &__remove {\n cursor: not-allowed;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Prop } from \"@stencil/core\";\n\nimport {\n StzhChipBlurEvent,\n StzhChipClickEvent,\n StzhChipFocusEvent,\n StzhChipRemoveEvent,\n StzhChipSize,\n StzhChipType,\n StzhChipVariant,\n} from \"../../index\";\n\n/**\n * @slot - Slot for label\n * @slot icon - Slot for icon\n */\n@Component({\n tag: \"stzh-chip\",\n styleUrl: \"stzh-chip.scss\",\n scoped: true,\n})\nexport class StzhChip {\n /** Label */\n @Prop() label: string = \"\";\n\n /** Icon (use instead of icon slot) */\n @Prop() icon: string;\n\n /** `href` if the chip should be used as link */\n @Prop() href: string = \"\";\n\n /** Target if the button is used as link (if `href` used) */\n @Prop() target: string = \"\";\n\n /** Whether chip is not interactive */\n @Prop({ reflect: true }) nonInteractive: boolean = false;\n\n /** Whether remove button should be shown */\n @Prop({ reflect: true }) removable: boolean = false;\n\n /** Whether inverted style is shown (only available for `tag` variant) */\n @Prop({ reflect: true }) inverted: boolean = false;\n\n /** Variant */\n @Prop({ reflect: true }) variant: StzhChipVariant = \"tag\";\n\n /** Size */\n @Prop({ reflect: true }) size: StzhChipSize = \"default\";\n\n /** Size variant (above small breakpoint) */\n @Prop({ reflect: true }) sizeSmall: StzhChipSize;\n\n /** Size variant (above medium breakpoint) */\n @Prop({ reflect: true }) sizeMedium: StzhChipSize;\n\n /** Size variant (above large breakpoint) */\n @Prop({ reflect: true }) sizeLarge: StzhChipSize;\n\n /** Size variant (above ultra breakpoint) */\n @Prop({ reflect: true }) sizeUltra: StzhChipSize;\n\n /** Type */\n @Prop({ reflect: true }) type: StzhChipType = \"default\";\n\n /** Counter */\n @Prop() counter: string = \"\";\n\n /** Label of remove button for screenreaders */\n @Prop() removeLabel: string = \"\";\n\n /** Active */\n @Prop({ reflect: true }) active: boolean = false;\n\n /** Disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Tabindex of link/button */\n @Prop({ attribute: \"a11y-tabindex\" }) a11yTabindex: string;\n\n /** Accessible label for screen readers to replace visible text */\n @Prop({ attribute: \"a11y-label\" }) a11yLabel: string;\n\n /** Id for element which describes the link/button */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the link/button element.\n * Default value will be taken from `label` prop or default slot.\n */\n @Prop() analyticsId: string;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the remove button element.\n * Default value will be taken from `removeLabel` prop.\n */\n @Prop() removeAnalyticsId: string;\n\n @Element() element: HTMLStzhChipElement;\n\n /** Chip click event */\n @Event() stzhClick: EventEmitter<StzhChipClickEvent>;\n\n /** Chip remove event */\n @Event() stzhRemove: EventEmitter<StzhChipRemoveEvent>;\n\n /** Focus event */\n @Event() stzhFocus: EventEmitter<StzhChipFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhChipBlurEvent>;\n\n private chip: HTMLButtonElement | HTMLAnchorElement;\n private text: HTMLElement;\n private focusedByInput: boolean = false;\n\n componentDidRender() {\n requestAnimationFrame(() => {\n this.chip?.setAttribute(\"s-object-id\", this.analyticsId || this.text.innerText);\n });\n }\n\n private renderInner(): DocumentFragment {\n return (\n <div class=\"stzh-chip__button-inner\">\n <div class=\"stzh-chip__icon-wrapper\">\n {this.icon || (typeof this.icon === \"undefined\" && this.variant === \"tag\" && this.type !== \"default\") ? (\n <stzh-icon\n class=\"stzh-chip__icon\"\n name={\n this.icon ||\n (this.type === \"info\" && \"info-help\") ||\n (this.type === \"warning\" && \"important-warning\") ||\n (this.type === \"error\" && \"warning\") ||\n (this.type === \"success\" && \"checkmark-circle\")\n }\n ></stzh-icon>\n ) : (\n <slot name=\"icon\"></slot>\n )}\n </div>\n\n <stzh-clamp lines={1} class=\"stzh-chip__label\" ref={el => (this.text = el as HTMLElement)}>\n {this.label ? this.label : <slot></slot>}\n {this.counter && this.counter !== \"undefined\" && this.counter !== undefined && (\n <span class=\"stzh-chip__vhidden\"> ({this.counter})</span>\n )}\n </stzh-clamp>\n\n {this.counter && this.counter !== \"undefined\" && this.counter !== undefined && (\n <div class=\"stzh-chip__counter\" aria-hidden=\"true\">\n {this.counter}\n </div>\n )}\n </div>\n );\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.chip.focus();\n }\n\n this.focusedByInput = false;\n };\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent(\"focus\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-chip\",\n originalEvent: event,\n });\n };\n\n private onBlur = (event: FocusEvent) => {\n const blurEvent = new FocusEvent(\"blur\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-chip\",\n originalEvent: event,\n });\n };\n\n private onClick = (event: MouseEvent) => {\n this.stzhClick.emit({\n component: \"stzh-chip\",\n originalEvent: event,\n href: this.href,\n });\n };\n\n private onRemoveClick = (event: MouseEvent) => {\n this.stzhRemove.emit({\n component: \"stzh-chip\",\n originalEvent: event,\n });\n };\n\n render() {\n const classes = {\n \"stzh-chip\": true,\n \"stzh-chip--is-active\": this.active,\n \"stzh-chip--is-disabled\": this.disabled,\n \"stzh-chip--is-removable\": this.removable,\n \"stzh-chip--is-inverted\": this.inverted,\n \"stzh-chip--has-counter\": !!this.counter,\n [`stzh-chip--type-${this.type}`]: !!this.type,\n [`stzh-chip--size-${this.size}`]: !!this.size,\n [`stzh-chip--${this.variant}`]: !!this.variant,\n };\n\n const Chip = this.nonInteractive ? \"div\" : this.href ? \"a\" : \"button\";\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n {this.removable && (\n <button\n class=\"stzh-chip__remove\"\n onClick={this.onRemoveClick}\n disabled={this.disabled}\n aria-label={this.removeLabel}\n type=\"button\"\n s-object-id={this.removeAnalyticsId || this.removeLabel}\n >\n <stzh-icon class=\"stzh-chip__remove-icon\" name=\"close-big\"></stzh-icon>\n </button>\n )}\n\n {this.href ? (\n <Chip\n ref={el => (this.chip = el as HTMLAnchorElement)}\n class={{\n \"stzh-chip__button\": true,\n \"is-button\": !this.nonInteractive && !this.href,\n \"is-link\": !this.nonInteractive && !!this.href,\n }}\n href={this.disabled ? null : this.href}\n target={this.target}\n tabindex={this.a11yTabindex}\n aria-label={this.a11yLabel || null}\n aria-describedby={this.a11yDescribedby || null}\n onClick={this.onClick}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n >\n {this.renderInner()}\n </Chip>\n ) : (\n <Chip\n ref={el => (this.chip = el as HTMLButtonElement)}\n class={{\n \"stzh-chip__button\": true,\n \"is-button\": !this.nonInteractive && !this.href,\n \"is-link\": !this.nonInteractive && !!this.href,\n }}\n disabled={this.disabled}\n type=\"button\"\n tabindex={this.a11yTabindex}\n aria-label={this.a11yLabel || null}\n aria-describedby={this.a11yDescribedby || null}\n onClick={this.onClick}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n >\n {this.renderInner()}\n </Chip>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as registerInstance, h, a as Host, g as getElement } from './index-e3050b18.js';
|
|
2
|
+
|
|
3
|
+
const stzhChipgroupCss = ".sc-stzh-chipgroup-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-chipgroup-h{display:none}.sc-stzh-chipgroup-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chipgroup-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chipgroup-h *.sc-stzh-chipgroup,.sc-stzh-chipgroup-h *.sc-stzh-chipgroup::before,.sc-stzh-chipgroup-h *.sc-stzh-chipgroup::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-chipgroup-h .has-focus.sc-stzh-chipgroup{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-chipgroup-h .stzh-fylingfocus-focused.sc-stzh-chipgroup{outline-style:none !important}.sc-stzh-chipgroup-h .stzh-fylingfocus-focused.sc-stzh-chipgroup::-moz-focus-inner{border:0 !important}.stzh-chipgroup.sc-stzh-chipgroup{display:flex;gap:var(--stzh-space-medium)}";
|
|
4
|
+
|
|
5
|
+
const StzhChipgroup = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const classes = {
|
|
11
|
+
"stzh-chipgroup": true
|
|
12
|
+
};
|
|
13
|
+
return (h(Host, null, h("div", { class: classes }, h("slot", null))));
|
|
14
|
+
}
|
|
15
|
+
get element() { return getElement(this); }
|
|
16
|
+
};
|
|
17
|
+
StzhChipgroup.style = stzhChipgroupCss;
|
|
18
|
+
|
|
19
|
+
export { StzhChipgroup as stzh_chipgroup };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=stzh-chipgroup.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"stzh-chipgroup.entry.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,2zCAA2zC;;MCev0C,aAAa;;;;EAGxB,MAAM;IACJ,MAAM,OAAO,GAAG;MACd,gBAAgB,EAAE,IAAI;KACvB,CAAC;IAEF,QACE,EAAC,IAAI,QACH,WAAK,KAAK,EAAE,OAAO,IACjB,eAAa,CACT,CACD,EACP;GACH;;;;;;;","names":[],"sources":["src/components/stzh-chipgroup/stzh-chipgroup.scss?tag=stzh-chipgroup&encapsulation=scoped","src/components/stzh-chipgroup/stzh-chipgroup.tsx"],"sourcesContent":[":host {\n\n}\n\n.stzh-chipgroup {\n display: flex;\n gap: space('medium');\n}\n","import {\n Component,\n Host,\n h,\n Element\n} from \"@stencil/core\";\n\n/**\n * @slot - Slot for chips\n */\n@Component({\n tag: \"stzh-chipgroup\",\n styleUrl: \"stzh-chipgroup.scss\",\n scoped: true\n})\nexport class StzhChipgroup {\n @Element() element: HTMLStzhChipgroupElement;\n\n render() {\n const classes = {\n \"stzh-chipgroup\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, a as Host, g as getElement } from './index-e3050b18.js';
|
|
2
|
+
import { S as StzhInputDescription } from './stzh-input-description-766446dc.js';
|
|
3
|
+
|
|
4
|
+
const stzhChipselectCss = ".sc-stzh-chipselect-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-chipselect-h{display:none}.sc-stzh-chipselect-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chipselect-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-chipselect-h *.sc-stzh-chipselect,.sc-stzh-chipselect-h *.sc-stzh-chipselect::before,.sc-stzh-chipselect-h *.sc-stzh-chipselect::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-chipselect-h .has-focus.sc-stzh-chipselect{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-chipselect-h .stzh-fylingfocus-focused.sc-stzh-chipselect{outline-style:none !important}.sc-stzh-chipselect-h .stzh-fylingfocus-focused.sc-stzh-chipselect::-moz-focus-inner{border:0 !important}[disabled].sc-stzh-chipselect-h:not([disabled=false]){--description-color:var(--stzh-color-grey70)}.stzh-chipselect__marker-symbol.sc-stzh-chipselect{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-chipselect__marker-text.sc-stzh-chipselect{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-chipselect__description-wrapper.sc-stzh-chipselect{display:flex;flex-direction:column-reverse;min-height:var(--description-min-height, var(--stzh-description-min-height, none))}.stzh-chipselect__error.sc-stzh-chipselect,.stzh-chipselect__description.sc-stzh-chipselect{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-chipselect__error.sc-stzh-chipselect{color:var(--stzh-color-error60)}.stzh-chipselect__error-list.sc-stzh-chipselect{list-style:none;margin:0;padding:0}.stzh-chipselect__description.sc-stzh-chipselect{display:flex;align-items:flex-start;color:var(--stzh-input-description-color, var(--description-color, var(--stzh-color-coolgrey70)));transition:color var(--stzh-base-transition-animation-speed)}.stzh-chipselect__description-long.sc-stzh-chipselect{margin-right:var(--stzh-space-xxsmall);margin-top:0.125rem}@supports (font: -apple-system-body) and (-webkit-appearance: none){.stzh-chipselect__description-long.sc-stzh-chipselect{margin-top:0}}.stzh-chipselect__description-long-popover.sc-stzh-chipselect{--width:auto;--max-width:27.3125rem}.stzh-chipselect__description-long-button.sc-stzh-chipselect{display:flex;justify-content:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer}.stzh-chipselect.sc-stzh-chipselect stzh-icon.stzh-chipselect__description-long-icon.sc-stzh-chipselect{--size:var(--stzh-icon-size-xsmall)}.stzh-chipselect--has-error.sc-stzh-chipselect .stzh-chipselect__error.sc-stzh-chipselect,.stzh-chipselect--has-description.sc-stzh-chipselect .stzh-chipselect__description.sc-stzh-chipselect{margin-top:var(--stzh-space-xxxsmall)}.stzh-chipselect__label.sc-stzh-chipselect{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:var(--stzh-heading-color);display:block;margin-bottom:var(--stzh-space-xsmall)}.stzh-chipselect__label.sc-stzh-chipselect:empty{display:none}.stzh-chipselect__marker.sc-stzh-chipselect{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);margin-left:calc(-0.25em + var(--stzh-space-xsmall))}.stzh-chipselect__chips.sc-stzh-chipselect{display:flex;align-items:center;flex-wrap:wrap;border-radius:var(--stzh-button-border-radius);-moz-column-gap:var(--stzh-space-medium);column-gap:var(--stzh-space-medium)}@media screen and (min-width: 900px){.stzh-chipselect__chips.sc-stzh-chipselect{row-gap:var(--stzh-space-medium)}}.stzh-chipselect__chips.sc-stzh-chipselect:focus-within .is-focused[active].sc-stzh-chipselect{--background-color:var(--stzh-color-primary90)}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-chipselect__chips.sc-stzh-chipselect:focus-within .is-focused[active].sc-stzh-chipselect{--background-color:Canvas}}.stzh-chipselect__chip.is-focused.sc-stzh-chipselect{--background-color:var(--stzh-color-secondary40)}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-chipselect__chip.is-focused.sc-stzh-chipselect{--background-color:Highlight}}.stzh-chipselect--has-error.sc-stzh-chipselect .stzh-chipselect__error.sc-stzh-chipselect,.stzh-chipselect--has-description.sc-stzh-chipselect .stzh-chipselect__description.sc-stzh-chipselect{margin-top:var(--stzh-space-xsmall)}.stzh-chipselect--has-label-hidden.sc-stzh-chipselect .stzh-chipselect__label.sc-stzh-chipselect{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-chipselect--is-disabled.sc-stzh-chipselect .stzh-chipselect__chips.sc-stzh-chipselect,.stzh-chipselect--is-disabled.sc-stzh-chipselect .stzh-chipselect__label.sc-stzh-chipselect{cursor:not-allowed}";
|
|
5
|
+
|
|
6
|
+
let chipselectCounter = 0;
|
|
7
|
+
const StzhChipselect = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.stzhChange = createEvent(this, "stzhChange", 7);
|
|
11
|
+
this._data = [];
|
|
12
|
+
this._value = [];
|
|
13
|
+
this.handleReset = async () => {
|
|
14
|
+
this.value = this.defaultValue;
|
|
15
|
+
// this.stzhChange.emit({
|
|
16
|
+
// component: "stzh-chipselect",
|
|
17
|
+
// value: this.value
|
|
18
|
+
// });
|
|
19
|
+
};
|
|
20
|
+
this.handleChipClick = async (data, index) => {
|
|
21
|
+
if (this.multiple) {
|
|
22
|
+
if (data.value === "" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === "")) {
|
|
23
|
+
this.value = [];
|
|
24
|
+
}
|
|
25
|
+
else if (data.value !== "") {
|
|
26
|
+
this.value = this._value.includes(data.value)
|
|
27
|
+
? this._value.filter(value => value !== data.value)
|
|
28
|
+
: [...this._value, data.value];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.value = data.value;
|
|
33
|
+
}
|
|
34
|
+
this.activeFocusOptionIndex = index;
|
|
35
|
+
await this.waitForNextRender();
|
|
36
|
+
this.stzhChange.emit({
|
|
37
|
+
component: "stzh-chipselect",
|
|
38
|
+
value: this.multiple ? this._value : this._value[0]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
// private handleDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {
|
|
42
|
+
// this.value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;
|
|
43
|
+
// this.activeFocusOptionIndex = this._data.findIndex(data => {
|
|
44
|
+
// return data.value === this.value;
|
|
45
|
+
// });
|
|
46
|
+
// await this.waitForNextRender();
|
|
47
|
+
// this.stzhChange.emit({
|
|
48
|
+
// component: "stzh-chipselect",
|
|
49
|
+
// value: this.value
|
|
50
|
+
// })
|
|
51
|
+
// }
|
|
52
|
+
this.handleKeydown = (event) => {
|
|
53
|
+
let newActiveIndex = null;
|
|
54
|
+
const activeOptionIndex = this.activeFocusOptionIndex;
|
|
55
|
+
if (event.key === "ArrowUp" || event.key === "ArrowLeft") {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
if (activeOptionIndex > 0) {
|
|
58
|
+
newActiveIndex = activeOptionIndex - 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (event.key === "ArrowDown" || event.key === "ArrowRight") {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
if (activeOptionIndex < this._data.length - 1) {
|
|
64
|
+
newActiveIndex = activeOptionIndex + 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (event.key === " " || event.key === "Enter") {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
if (this.multiple) {
|
|
70
|
+
if (this._data[activeOptionIndex].value === "" && this._value.length > 0 && !(this._value.length === 1 && this._value[0] === "")) {
|
|
71
|
+
this.value = [];
|
|
72
|
+
}
|
|
73
|
+
else if (this._data[activeOptionIndex].value !== "") {
|
|
74
|
+
this.value = this._value.includes(this._data[activeOptionIndex].value)
|
|
75
|
+
? this._value.filter(value => value !== this._data[activeOptionIndex].value)
|
|
76
|
+
: [...this._value, this._data[activeOptionIndex].value];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.value = this._data[activeOptionIndex].value; //HERE
|
|
81
|
+
}
|
|
82
|
+
this.stzhChange.emit({
|
|
83
|
+
component: "stzh-chipselect",
|
|
84
|
+
value: this.value
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (newActiveIndex !== null) {
|
|
88
|
+
this.activeFocusOptionIndex = newActiveIndex;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this.localization = undefined;
|
|
92
|
+
this.data = [];
|
|
93
|
+
this.name = undefined;
|
|
94
|
+
this.label = "";
|
|
95
|
+
this.labelHidden = false;
|
|
96
|
+
this.multiple = false;
|
|
97
|
+
this.value = "";
|
|
98
|
+
this.defaultValue = "";
|
|
99
|
+
this.description = undefined;
|
|
100
|
+
this.descriptionLong = undefined;
|
|
101
|
+
this.descriptionLongTitle = undefined;
|
|
102
|
+
this.error = undefined;
|
|
103
|
+
this.invalid = false;
|
|
104
|
+
this.required = false;
|
|
105
|
+
this.disabled = false;
|
|
106
|
+
this.hideOptional = false;
|
|
107
|
+
this.a11yDescribedby = "";
|
|
108
|
+
this.activeFocusOptionIndex = 0;
|
|
109
|
+
}
|
|
110
|
+
resetListener(event) {
|
|
111
|
+
if (event.target.contains(this.element)) {
|
|
112
|
+
requestAnimationFrame(() => {
|
|
113
|
+
this.handleReset();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
valueWatcher(newValue) {
|
|
118
|
+
if (typeof newValue === "string") {
|
|
119
|
+
try {
|
|
120
|
+
this._value = JSON.parse(newValue);
|
|
121
|
+
}
|
|
122
|
+
catch (ex) {
|
|
123
|
+
this._value = newValue ? [newValue] : [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this._value = newValue ? newValue : [];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
dataWatcher(newValue) {
|
|
131
|
+
if (typeof newValue === "string") {
|
|
132
|
+
this._data = JSON.parse(newValue);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this._data = newValue;
|
|
136
|
+
}
|
|
137
|
+
// this._dataDropdown = this._data.map((data) => {
|
|
138
|
+
// return {
|
|
139
|
+
// text: data.counter
|
|
140
|
+
// ? `${data.label} (${data.counter})`
|
|
141
|
+
// : data.label,
|
|
142
|
+
// value: data.value
|
|
143
|
+
// }
|
|
144
|
+
// });
|
|
145
|
+
}
|
|
146
|
+
errorWatcher(newValue) {
|
|
147
|
+
if (typeof newValue === "string") {
|
|
148
|
+
try {
|
|
149
|
+
this._error = JSON.parse(newValue);
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
if (newValue) {
|
|
153
|
+
this._error = [newValue];
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
this._error = [];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else if (newValue) {
|
|
161
|
+
this._error = newValue;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this._error = [];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
waitForNextRender() {
|
|
168
|
+
return new Promise(resolve => this.renderPromiseResolve = resolve);
|
|
169
|
+
}
|
|
170
|
+
componentDidRender() {
|
|
171
|
+
if (this.renderPromiseResolve) {
|
|
172
|
+
this.renderPromiseResolve();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async componentWillLoad() {
|
|
176
|
+
this.id = `stzh-chipselect-${chipselectCounter++}`;
|
|
177
|
+
this.dataWatcher(this.data);
|
|
178
|
+
this.errorWatcher(this.error);
|
|
179
|
+
this.valueWatcher(this.value);
|
|
180
|
+
this.defaultValue = this.defaultValue || this.value;
|
|
181
|
+
if (!this.localization) {
|
|
182
|
+
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "chipselect");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
const descriptionUsed = !!this.description;
|
|
187
|
+
const descriptionLongUsed = !!this.descriptionLong;
|
|
188
|
+
const errorUsed = !!this.error;
|
|
189
|
+
const classes = {
|
|
190
|
+
"stzh-chipselect": true,
|
|
191
|
+
"stzh-chipselect--has-description": descriptionUsed,
|
|
192
|
+
"stzh-chipselect--has-description-long": descriptionLongUsed,
|
|
193
|
+
"stzh-chipselect--has-error": errorUsed,
|
|
194
|
+
"stzh-chipselect--is-invalid": this.invalid || errorUsed,
|
|
195
|
+
"stzh-chipselect--is-disabled": this.disabled,
|
|
196
|
+
"stzh-chipselect--is-required": this.required,
|
|
197
|
+
"stzh-chipselect--has-label-hidden": this.labelHidden,
|
|
198
|
+
};
|
|
199
|
+
return (h(Host, { "is-invalid": this.invalid || errorUsed }, h("div", { class: classes }, this.multiple
|
|
200
|
+
?
|
|
201
|
+
h(Fragment, null, this._value.map((value) => h("input", { type: "hidden", name: this.name, value: value })))
|
|
202
|
+
:
|
|
203
|
+
h("input", { type: "hidden", name: this.name, value: this.value }), h("label", { class: "stzh-chipselect__label", htmlFor: this.id }, this.label ? this.label : h("slot", null), !this.hideOptional &&
|
|
204
|
+
h("span", { class: "stzh-chipselect__marker" }, h("span", { class: "stzh-chipselect__marker-symbol", "aria-hidden": "true" }, this.required
|
|
205
|
+
? this.localization.$globals.requiredFieldMarker
|
|
206
|
+
: this.localization.$globals.optionalFieldMarker), h("span", { class: "stzh-chipselect__marker-text" }, this.required
|
|
207
|
+
? this.localization.$globals.requiredFieldText
|
|
208
|
+
: this.localization.$globals.optionalFieldText))), this._data.length > 0 &&
|
|
209
|
+
h(Fragment, null, h("div", { id: this.id, class: "stzh-chipselect__chips", role: "listbox", tabindex: "0", "aria-multiselectable": this.multiple ? "true" : "false", "aria-activedescendant": `${this.id}-option-${this.activeFocusOptionIndex}`, "aria-describedby": `${this.id}-description ${this.a11yDescribedby}`, onKeyDown: this.handleKeydown }, this._data.map((data, index) => (h("stzh-chip", { role: "option", class: {
|
|
210
|
+
"stzh-chipselect__chip": true,
|
|
211
|
+
"is-focused": this.activeFocusOptionIndex === index
|
|
212
|
+
}, label: data.label, counter: data.counter, icon: data.icon, type: data.type, inverted: data.inverted, variant: data.variant, size: data.size || "small", disabled: this.disabled || data.disabled, active: this._value.includes(data.value)
|
|
213
|
+
|| (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === ""))
|
|
214
|
+
|| (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === ""))), "aria-selected": this._value.includes(data.value)
|
|
215
|
+
|| (!this.multiple && !data.value && (this._value.length === 0 || this._value[0] === ""))
|
|
216
|
+
|| (!data.value && this.multiple && (this._value.length === 0 || (this._value.length === 1 && this._value[0] === "")))
|
|
217
|
+
? "true" : "false", id: `${this.id}-option-${index}`, a11yTabindex: "-1", onClick: () => this.handleChipClick(data, index) })))), h(StzhInputDescription, { classPrefix: "stzh-chipselect", id: `${this.id}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
|
|
218
|
+
}
|
|
219
|
+
get element() { return getElement(this); }
|
|
220
|
+
static get watchers() { return {
|
|
221
|
+
"value": ["valueWatcher"],
|
|
222
|
+
"data": ["dataWatcher"],
|
|
223
|
+
"error": ["errorWatcher"]
|
|
224
|
+
}; }
|
|
225
|
+
};
|
|
226
|
+
StzhChipselect.style = stzhChipselectCss;
|
|
227
|
+
|
|
228
|
+
export { StzhChipselect as stzh_chipselect };
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=stzh-chipselect.entry.js.map
|