@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
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-92254d32.js');
|
|
6
|
+
const arrow = require('./arrow-6135123b.js');
|
|
7
|
+
const focusTrap_esm = require('./focus-trap.esm-46ebbbcb.js');
|
|
8
|
+
const utils = require('./utils-475fb329.js');
|
|
9
|
+
const mediaUtils = require('./media-utils-fa9f86b8.js');
|
|
10
|
+
const eventUtils = require('./event-utils-20e7b8b1.js');
|
|
11
|
+
const animationUtils = require('./animation-utils-925ee0e0.js');
|
|
12
|
+
require('./string-utils-5dd70320.js');
|
|
13
|
+
|
|
14
|
+
const stzhPopoverCss = ".sc-stzh-popover-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-popover-h{display:none}.sc-stzh-popover-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-popover-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-popover-h *.sc-stzh-popover,.sc-stzh-popover-h *.sc-stzh-popover::before,.sc-stzh-popover-h *.sc-stzh-popover::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-popover-h .has-focus.sc-stzh-popover{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-popover-h .stzh-fylingfocus-focused.sc-stzh-popover{outline-style:none !important}.sc-stzh-popover-h .stzh-fylingfocus-focused.sc-stzh-popover::-moz-focus-inner{border:0 !important}.sc-stzh-popover-h{display:contents;--color:var(--stzh-color-black);--width:var(--stzh-popover-width);--min-width:var(--stzh-popover-min-width);--max-width:var(--stzh-popover-max-width);--height:auto;--min-height:initial;--max-height:initial;--padding:var(--stzh-popover-padding);--content-padding:var(--stzh-popover-content-padding);--border-radius:var(--stzh-popover-border-radius);--background-color:var(--stzh-popover-background-color);--backdrop-opacity:var(--stzh-dialog-backdrop-opacity);--backdrop-background-color:var(--stzh-dialog-backdrop-background-color)}[size=large].sc-stzh-popover-h{--content-padding:var(--stzh-popover-large-content-padding)}[variant=secondary].sc-stzh-popover-h{--background-color:var(--stzh-color-secondary20)}[variant=tooltip].sc-stzh-popover-h{--width:var(--stzh-tooltip-width);--min-width:var(--stzh-tooltip-min-width);--max-width:var(--stzh-tooltip-max-width);--content-padding:var(--stzh-space-small) var(--stzh-space-large);--border-radius:var(--stzh-tooltip-border-radius)}@media screen and (min-width: 600px){[variant=tooltip].sc-stzh-popover-h{--content-padding:var(--stzh-tooltip-padding);--color:var(--stzh-color-white);--link-color:var(--stzh-color-white);--hover-link-color:var(--stzh-color-white70op);--background-color:var(--stzh-color-coolgrey60)}}.stzh-popover.sc-stzh-popover{display:contents}.stzh-popover__arrow.sc-stzh-popover{position:absolute;display:flex;color:var(--background-color)}.stzh-popover--placement-bottom.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-bottom-start.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-bottom-end.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover{top:0;transform:translateY(-0.5rem)}.stzh-popover--placement-top.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-top-start.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-top-end.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover{bottom:0;transform:translateY(0.5rem) rotate(180deg)}.stzh-popover--placement-left.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-left-start.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-left-end.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover{right:0;transform:translateX(0.75rem) rotate(90deg)}.stzh-popover--placement-right.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-right-start.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover,.stzh-popover--placement-right-end.sc-stzh-popover .stzh-popover__arrow.sc-stzh-popover{left:0;transform:translateX(-0.75rem) rotate(-90deg)}.stzh-popover__trigger.sc-stzh-popover{display:contents}.stzh-popover__content-wrapper.sc-stzh-popover{display:contents}@media screen and (max-width: 599px){.stzh-popover__content-wrapper.sc-stzh-popover{z-index:var(--stzh-z-index-dialog);display:flex;position:fixed;top:0;left:0;width:100%;height:100%;flex-direction:column;align-items:stretch;justify-content:stretch}}.stzh-popover__backdrop.sc-stzh-popover{display:contents}@media screen and (max-width: 599px){.stzh-popover__backdrop.sc-stzh-popover{z-index:1;position:absolute;display:block;top:0px;left:0px;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;text-align:center;background-color:var(--backdrop-background-color);opacity:var(--backdrop-opacity)}}.stzh-popover__content.sc-stzh-popover{display:contents}@media screen and (max-width: 599px){.stzh-popover__content.sc-stzh-popover{z-index:2;position:relative;display:flex;flex-direction:column;align-items:center;flex-grow:1;overflow:auto}}.stzh-popover__dialog.sc-stzh-popover{margin-top:auto;width:100%;overflow:visible;border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;background-color:var(--background-color);touch-action:none;outline:none;border-bottom:0.125rem solid var(--stzh-color-old-grey13);color:var(--color);--stzh-base-color:var(--color);--stzh-link-color:var(--link-color);--stzh-link-hover-color:var(--hover-link-color)}@media screen and (min-width: 600px){.stzh-popover__dialog.sc-stzh-popover{z-index:var(--stzh-z-index-popover);position:absolute;display:flex;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);left:auto;right:auto;bottom:auto;border-radius:var(--border-radius);box-shadow:var(--stzh-box-shadow-popover);border:none}}.stzh-popover__content-inner.sc-stzh-popover,.stzh-popover__content-slot-wrapper.sc-stzh-popover{display:flex;flex-direction:column;width:100%}.stzh-popover__content-slot-wrapper.sc-stzh-popover{padding:var(--padding)}.stzh-popover__content-slot.sc-stzh-popover{overflow-y:auto;overflow-x:hidden;overflow-scrolling:touch;padding:var(--content-padding)}.stzh-popover__action-slot.sc-stzh-popover{display:flex;flex-direction:column}.stzh-popover__label-wrapper.sc-stzh-popover{display:flex;align-items:center;padding:var(--stzh-space-small) var(--stzh-space-large);padding-right:var(--stzh-space-medium);border-bottom:0.0625rem solid var(--stzh-base-border-color);color:var(--stzh-color-old-grey70)}@media screen and (min-width: 600px){.stzh-popover__label-wrapper.sc-stzh-popover{padding:0;border-bottom:0}}.stzh-popover__label.sc-stzh-popover{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-curve-p2-default-font-size, var(--stzh-font-micro-font-size));line-height:var(--stzh-font-curve-p2-default-text-line-height, var(--stzh-font-micro-text-line-height));margin:0;margin-right:var(--stzh-space-small)}@media screen and (min-width: 900px){.stzh-popover__label.sc-stzh-popover{font-size:var(--stzh-font-curve-p2-medium-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p2-medium-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p2-medium-text-letter-spacing)}}@media screen and (min-width: 600px){.stzh-popover__label.sc-stzh-popover{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-popover__close.sc-stzh-popover{visibility:var(--stzh-popover-close-visibility);cursor:pointer;display:flex;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;padding:0;margin-left:auto;border-radius:50%;color:var(--stzh-base-lead-color);padding:var(--stzh-space-xxsmall)}.stzh-popover__icon.sc-stzh-popover{--size:var(--stzh-icon-size-xsmall)}.stzh-popover__arrow.sc-stzh-popover{position:absolute;display:none}@media screen and (min-width: 600px){.stzh-popover__arrow.sc-stzh-popover{display:flex}}.stzh-popover__vhidden.sc-stzh-popover{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-popover--default.sc-stzh-popover .stzh-popover__close.sc-stzh-popover:focus,.stzh-popover--secondary.sc-stzh-popover .stzh-popover__close.sc-stzh-popover:focus{box-shadow:0 0 0 0.0625rem var(--stzh-color-primary)}@media screen and (min-width: 600px){.stzh-popover--default.sc-stzh-popover .stzh-popover__close.sc-stzh-popover,.stzh-popover--secondary.sc-stzh-popover .stzh-popover__close.sc-stzh-popover{position:absolute;top:0;right:0;transform:translate(30%, -30%);background-color:var(--stzh-color-old-grey5)}.stzh-popover--default.sc-stzh-popover .stzh-popover__close.sc-stzh-popover:not(:focus):not(:active),.stzh-popover--secondary.sc-stzh-popover .stzh-popover__close.sc-stzh-popover:not(:focus):not(:active){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}}@media screen and (min-width: 600px){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__content-inner.sc-stzh-popover{flex-direction:row-reverse;align-items:flex-start}}.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__close.sc-stzh-popover{visibility:visible}@media screen and (min-width: 600px){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__close.sc-stzh-popover{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;display:flex;width:2.75rem;height:2.75rem;flex-shrink:0;justify-content:center;align-items:center;color:var(--stzh-color-white);border-radius:var(--stzh-button-border-radius)}}@media screen and (min-width: 600px){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__icon.sc-stzh-popover{--size:var(--stzh-icon-size-small)}}@media screen and (min-width: 600px){@supports (filter: var(--stzh-tooltip-drop-shadow)){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__dialog.sc-stzh-popover{box-shadow:none;filter:var(--stzh-tooltip-drop-shadow)}}}@media screen and (min-width: 600px){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__content-slot.sc-stzh-popover{font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height)}}@media screen and (min-width: 600px){.stzh-popover--popover-fullwidth-horizontal.sc-stzh-popover .stzh-popover__dialog.sc-stzh-popover{left:0 !important;right:0 !important;width:100%}}@media screen and (min-width: 600px){.stzh-popover--popover-fullwidth-vertical.sc-stzh-popover .stzh-popover__dialog.sc-stzh-popover{top:0 !important;bottom:0 !important;height:100%}}";
|
|
15
|
+
|
|
16
|
+
const ANIMATION_SHOW_DURATION = 200;
|
|
17
|
+
const ANIMATION_HIDE_DURATION = 300;
|
|
18
|
+
const ANIMATION_SHOW_DURATION_SMALL = 100;
|
|
19
|
+
const ANIMATION_HIDE_DURATION_SMALL = 200;
|
|
20
|
+
function animationContentWrapperShow() {
|
|
21
|
+
const isSmall = mediaUtils.media("small").matches;
|
|
22
|
+
return {
|
|
23
|
+
keyframes: [{ opacity: "0" }, { opacity: "1" }],
|
|
24
|
+
options: {
|
|
25
|
+
duration: isSmall ? ANIMATION_SHOW_DURATION_SMALL : ANIMATION_SHOW_DURATION,
|
|
26
|
+
easing: "linear",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function animationContentWrapperHide() {
|
|
31
|
+
const isSmall = mediaUtils.media("small").matches;
|
|
32
|
+
return {
|
|
33
|
+
keyframes: [{ opacity: "1" }, { opacity: "0" }],
|
|
34
|
+
options: {
|
|
35
|
+
duration: isSmall ? ANIMATION_HIDE_DURATION_SMALL : ANIMATION_HIDE_DURATION,
|
|
36
|
+
easing: "linear",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function animationDialogShow() {
|
|
41
|
+
const isSmall = mediaUtils.media("small").matches;
|
|
42
|
+
return {
|
|
43
|
+
keyframes: [{ transform: isSmall ? "translateY(-8px)" : "translateY(100%)" }, { transform: "translateY(0px)" }],
|
|
44
|
+
options: {
|
|
45
|
+
duration: isSmall ? ANIMATION_SHOW_DURATION_SMALL : ANIMATION_SHOW_DURATION,
|
|
46
|
+
easing: "linear",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function animationDialogHide() {
|
|
51
|
+
const isSmall = mediaUtils.media("small").matches;
|
|
52
|
+
return {
|
|
53
|
+
keyframes: [{ transform: "translateY(0px)" }, { transform: isSmall ? "translateY(-8px)" : "translateY(100%)" }],
|
|
54
|
+
options: {
|
|
55
|
+
duration: isSmall ? ANIMATION_HIDE_DURATION_SMALL : ANIMATION_HIDE_DURATION,
|
|
56
|
+
easing: "linear",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const keyCode = {
|
|
61
|
+
ESC: 27,
|
|
62
|
+
};
|
|
63
|
+
const CLASS_BODY_OPEN = "stzh-popover-open";
|
|
64
|
+
let popoverCounter = 0;
|
|
65
|
+
const StzhPopover = class {
|
|
66
|
+
constructor(hostRef) {
|
|
67
|
+
index.registerInstance(this, hostRef);
|
|
68
|
+
this.stzhOpen = index.createEvent(this, "stzhOpen", 7);
|
|
69
|
+
this.stzhOpened = index.createEvent(this, "stzhOpened", 7);
|
|
70
|
+
this.stzhClose = index.createEvent(this, "stzhClose", 7);
|
|
71
|
+
this.stzhClosed = index.createEvent(this, "stzhClosed", 7);
|
|
72
|
+
this.initialTouchX = null;
|
|
73
|
+
this.initialTouchY = null;
|
|
74
|
+
this.mediaChangeHandler = () => {
|
|
75
|
+
const isStzhHeaderStuck = document.documentElement.style.getPropertyValue("--stzh-header-is-stuck");
|
|
76
|
+
this.isHeaderStuckAndViewportMicro =
|
|
77
|
+
!mediaUtils.media("small").matches && isStzhHeaderStuck === "1" && this.hasStzhHeaderParent;
|
|
78
|
+
if (this.open && this.isBranchedOutToBody && !this.isHeaderStuckAndViewportMicro) {
|
|
79
|
+
this.branchInFromBody();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.handleKeydown = (event) => {
|
|
83
|
+
if (event.keyCode === keyCode.ESC) {
|
|
84
|
+
this.hide();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this.onClickTrigger = () => {
|
|
88
|
+
this.toggle();
|
|
89
|
+
};
|
|
90
|
+
this.computePosition = async () => {
|
|
91
|
+
if (mediaUtils.media("small").matches) {
|
|
92
|
+
const middleware = [
|
|
93
|
+
arrow.offset({
|
|
94
|
+
mainAxis: this.distance,
|
|
95
|
+
crossAxis: this.skidding,
|
|
96
|
+
}),
|
|
97
|
+
arrow.flip({
|
|
98
|
+
padding: 5,
|
|
99
|
+
}),
|
|
100
|
+
arrow.shift({
|
|
101
|
+
padding: 5,
|
|
102
|
+
}),
|
|
103
|
+
];
|
|
104
|
+
if (this.variant === "tooltip") {
|
|
105
|
+
middleware.push(arrow.arrow({
|
|
106
|
+
element: this.arrowElement,
|
|
107
|
+
padding: 5,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
const { x = 0, y = 0, strategy = "absolute", placement, middlewareData, } = await arrow.computePosition(this.triggerFirstElement, this.dialogElement, {
|
|
111
|
+
strategy: this.strategy,
|
|
112
|
+
placement: this.placement,
|
|
113
|
+
middleware,
|
|
114
|
+
});
|
|
115
|
+
this.computedPlacement = placement;
|
|
116
|
+
Object.assign(this.dialogElement.style, {
|
|
117
|
+
position: strategy,
|
|
118
|
+
left: `${x}px`,
|
|
119
|
+
top: `${y}px`,
|
|
120
|
+
});
|
|
121
|
+
if (this.variant === "tooltip") {
|
|
122
|
+
Object.assign(this.arrowElement.style, {
|
|
123
|
+
left: x != null ? `${middlewareData.arrow.x}px` : "",
|
|
124
|
+
top: y != null ? `${middlewareData.arrow.y}px` : "",
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
Object.assign(this.dialogElement.style, {
|
|
130
|
+
position: null,
|
|
131
|
+
left: null,
|
|
132
|
+
top: null,
|
|
133
|
+
});
|
|
134
|
+
if (this.variant === "tooltip") {
|
|
135
|
+
Object.assign(this.arrowElement.style, {
|
|
136
|
+
left: null,
|
|
137
|
+
top: null,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
this.handleTouchStart = (event) => {
|
|
143
|
+
const touch = event.changedTouches[0];
|
|
144
|
+
this.initialTouchX = touch.pageX;
|
|
145
|
+
this.initialTouchY = touch.pageY;
|
|
146
|
+
};
|
|
147
|
+
// private handleTouchMove = (event: TouchEvent) => {
|
|
148
|
+
// event.preventDefault()
|
|
149
|
+
// }
|
|
150
|
+
this.handleTouchEnd = (event) => {
|
|
151
|
+
const touch = event.changedTouches[0];
|
|
152
|
+
const distX = touch.pageX - this.initialTouchX; // get horizontal dist traveled
|
|
153
|
+
const distY = touch.pageY - this.initialTouchY; // get vertical dist traveled
|
|
154
|
+
const threshold = 70;
|
|
155
|
+
const isYSwipe = Math.abs(distY) >= threshold && Math.abs(distX) <= threshold;
|
|
156
|
+
if (isYSwipe) {
|
|
157
|
+
const isInDropdown = event.target.closest('.stzh-dropdown') !== null;
|
|
158
|
+
if (!isInDropdown) {
|
|
159
|
+
this.hide();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
this.initialTouchY = null;
|
|
163
|
+
this.initialTouchX = null;
|
|
164
|
+
};
|
|
165
|
+
this.init = () => {
|
|
166
|
+
var _a;
|
|
167
|
+
let trigger = (_a = this.triggerElement) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
168
|
+
if (!trigger) {
|
|
169
|
+
const defaultSlot = Array.from(this.element.children).find(child => !child.hasAttribute("slot"));
|
|
170
|
+
trigger = defaultSlot;
|
|
171
|
+
}
|
|
172
|
+
if (trigger) {
|
|
173
|
+
this.triggerFirstElement = trigger;
|
|
174
|
+
trigger.addEventListener("click", this.onClickTrigger);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
this.initializedPopover = false;
|
|
178
|
+
this.open = false;
|
|
179
|
+
this.placement = "bottom";
|
|
180
|
+
this.fullwidth = "";
|
|
181
|
+
this.variant = "default";
|
|
182
|
+
this.size = "default";
|
|
183
|
+
this.skidding = 0;
|
|
184
|
+
this.distance = undefined;
|
|
185
|
+
this.label = "";
|
|
186
|
+
this.strategy = "absolute";
|
|
187
|
+
this.localization = undefined;
|
|
188
|
+
this.computedPlacement = undefined;
|
|
189
|
+
this.isHeaderStuckAndViewportMicro = undefined;
|
|
190
|
+
this.isBranchedOutToBody = undefined;
|
|
191
|
+
this.hasStzhHeaderParent = undefined;
|
|
192
|
+
}
|
|
193
|
+
/** Show popover content */
|
|
194
|
+
async show() {
|
|
195
|
+
if (this.open) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this.mediaChangeHandler();
|
|
199
|
+
if (this.isHeaderStuckAndViewportMicro) {
|
|
200
|
+
this.branchOutToBody();
|
|
201
|
+
}
|
|
202
|
+
this.toggledByMethod = true;
|
|
203
|
+
this.open = true;
|
|
204
|
+
return eventUtils.waitForEvent(this.element, "stzhOpened");
|
|
205
|
+
}
|
|
206
|
+
/** Hide popover content */
|
|
207
|
+
async hide() {
|
|
208
|
+
if (!this.open) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
this.toggledByMethod = true;
|
|
212
|
+
this.open = false;
|
|
213
|
+
await eventUtils.waitForEvent(this.element, "stzhClosed");
|
|
214
|
+
this.mediaChangeHandler();
|
|
215
|
+
if (this.isHeaderStuckAndViewportMicro) {
|
|
216
|
+
this.branchInFromBody();
|
|
217
|
+
}
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
/** Toggle popover content */
|
|
221
|
+
async toggle() {
|
|
222
|
+
if (this.open) {
|
|
223
|
+
return await this.hide();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
return await this.show();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async update() {
|
|
230
|
+
return await this.computePosition();
|
|
231
|
+
}
|
|
232
|
+
handleOutsideClick(event) {
|
|
233
|
+
if (!this.open) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const isClickOutside = event.target !== this.dialogElement && this.dialogElement.contains(event.target) === false;
|
|
237
|
+
const isClickTrigger = event.target === this.triggerElement || this.triggerElement.contains(event.target);
|
|
238
|
+
if (isClickOutside && !isClickTrigger) {
|
|
239
|
+
this.hide();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
async openWatcher(newValue) {
|
|
243
|
+
if (!this.dialogElement) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (newValue) {
|
|
247
|
+
if (this.toggledByMethod) {
|
|
248
|
+
this.stzhOpen.emit({
|
|
249
|
+
component: "stzh-popover",
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
const animationShow = animationContentWrapperShow();
|
|
253
|
+
const animationShowDialog = animationDialogShow();
|
|
254
|
+
await Promise.all([
|
|
255
|
+
animationUtils.stopAnimations(this.contentWrapperElement),
|
|
256
|
+
animationUtils.stopAnimations(this.contentElement),
|
|
257
|
+
animationUtils.stopAnimations(this.dialogElement),
|
|
258
|
+
]);
|
|
259
|
+
// safari seems to need will-change,
|
|
260
|
+
// otherwise it has problems animating the element with the drop shadow
|
|
261
|
+
this.dialogElement.style.willChange = "transform, opacity, position, top, left, bottom, right";
|
|
262
|
+
this.contentWrapperElement.hidden = false;
|
|
263
|
+
await Promise.all([
|
|
264
|
+
animationUtils.animateTo(mediaUtils.media("small").matches ? this.dialogElement : this.contentWrapperElement, animationShow.keyframes, animationShow.options),
|
|
265
|
+
animationUtils.animateTo(mediaUtils.media("small").matches ? this.dialogElement : this.contentElement, animationShowDialog.keyframes, animationShowDialog.options),
|
|
266
|
+
]);
|
|
267
|
+
if (this.toggledByMethod) {
|
|
268
|
+
this.stzhOpened.emit({
|
|
269
|
+
component: "stzh-popover",
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
if (this.toggledByMethod) {
|
|
275
|
+
this.stzhClose.emit({
|
|
276
|
+
component: "stzh-popover",
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const animationHide = animationContentWrapperHide();
|
|
280
|
+
const animationHideDialog = animationDialogHide();
|
|
281
|
+
await Promise.all([
|
|
282
|
+
animationUtils.stopAnimations(this.contentWrapperElement),
|
|
283
|
+
animationUtils.stopAnimations(this.contentElement),
|
|
284
|
+
animationUtils.stopAnimations(this.dialogElement),
|
|
285
|
+
]);
|
|
286
|
+
await Promise.all([
|
|
287
|
+
animationUtils.animateTo(mediaUtils.media("small").matches ? this.dialogElement : this.contentWrapperElement, animationHide.keyframes, animationHide.options),
|
|
288
|
+
animationUtils.animateTo(mediaUtils.media("small").matches ? this.dialogElement : this.contentElement, animationHideDialog.keyframes, animationHideDialog.options),
|
|
289
|
+
]);
|
|
290
|
+
this.contentWrapperElement.hidden = true;
|
|
291
|
+
this.dialogElement.style.willChange = "auto";
|
|
292
|
+
if (this.toggledByMethod) {
|
|
293
|
+
this.stzhClosed.emit({
|
|
294
|
+
component: "stzh-popover",
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
this.toggledByMethod = false;
|
|
299
|
+
}
|
|
300
|
+
distanceWatcher(newValue) {
|
|
301
|
+
if (typeof newValue === "number") {
|
|
302
|
+
this.distance = newValue;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.distance = this.variant === "tooltip" ? 12 : 8;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
setStzhHeaderParent() {
|
|
309
|
+
let parent = this.element.parentElement;
|
|
310
|
+
while (parent) {
|
|
311
|
+
if (parent.tagName && parent.tagName.toLowerCase() === "stzh-header") {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
parent = parent.parentElement;
|
|
315
|
+
}
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
branchOutToBody() {
|
|
319
|
+
document.body.append(this.element);
|
|
320
|
+
this.parentNode.appendChild(this.triggerElement);
|
|
321
|
+
this.isBranchedOutToBody = true;
|
|
322
|
+
}
|
|
323
|
+
branchInFromBody() {
|
|
324
|
+
this.parentNode.appendChild(this.element);
|
|
325
|
+
this.rootElement.prepend(this.triggerElement);
|
|
326
|
+
this.isBranchedOutToBody = false;
|
|
327
|
+
}
|
|
328
|
+
async componentWillLoad() {
|
|
329
|
+
this.id = `stzh-popover-${popoverCounter++}`;
|
|
330
|
+
this.parentNode = this.element.parentNode;
|
|
331
|
+
this.hasStzhHeaderParent = this.setStzhHeaderParent();
|
|
332
|
+
this.distanceWatcher(this.distance);
|
|
333
|
+
if (!this.localization) {
|
|
334
|
+
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "popover");
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
popoverShown() {
|
|
338
|
+
document.body.classList.add(CLASS_BODY_OPEN);
|
|
339
|
+
const isStzh = utils.isStzhElement(this.triggerFirstElement);
|
|
340
|
+
this.triggerFirstElement.setAttribute(isStzh ? "a11y-expanded" : "aria-expanded", "true");
|
|
341
|
+
if (this.trap) {
|
|
342
|
+
this.trap.activate();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
popoverHidden() {
|
|
346
|
+
document.body.classList.remove(CLASS_BODY_OPEN);
|
|
347
|
+
const isStzh = utils.isStzhElement(this.triggerFirstElement);
|
|
348
|
+
this.triggerFirstElement.setAttribute(isStzh ? "a11y-expanded" : "aria-expanded", "false");
|
|
349
|
+
if (this.trap) {
|
|
350
|
+
this.trap.deactivate();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
componentDidRender() {
|
|
354
|
+
this.mediaChangeHandler();
|
|
355
|
+
const isStzh = utils.isStzhElement(this.triggerFirstElement);
|
|
356
|
+
if ((isStzh && !this.triggerFirstElement.getAttribute("a11y-describedby")) ||
|
|
357
|
+
(!isStzh && !this.triggerFirstElement.getAttribute("aria-describedby"))) {
|
|
358
|
+
this.triggerFirstElement.setAttribute(isStzh ? "a11y-describedby" : "aria-describedby", `${this.id}-trigger-description`);
|
|
359
|
+
}
|
|
360
|
+
if ((isStzh && !this.triggerFirstElement.getAttribute("a11y-label")) ||
|
|
361
|
+
(!isStzh && !this.triggerFirstElement.getAttribute("aria-label"))) {
|
|
362
|
+
this.triggerFirstElement.setAttribute(isStzh ? "a11y-label" : "aria-label", this.label);
|
|
363
|
+
}
|
|
364
|
+
if ((isStzh && !this.triggerFirstElement.getAttribute("analytics-id")) ||
|
|
365
|
+
(!isStzh && !this.triggerFirstElement.getAttribute("s-object-id"))) {
|
|
366
|
+
this.triggerFirstElement.setAttribute(isStzh ? "analytics-id" : "s-object-id", this.label);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
componentDidUpdate() {
|
|
370
|
+
if (this.open && !this.initializedPopover) {
|
|
371
|
+
this.initializeAutoUpdate();
|
|
372
|
+
this.initializeFocusTrap();
|
|
373
|
+
this.popoverShown();
|
|
374
|
+
this.initializedPopover = true;
|
|
375
|
+
}
|
|
376
|
+
if (this.initializedPopover) {
|
|
377
|
+
if (this.open) {
|
|
378
|
+
this.popoverShown();
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
this.popoverHidden();
|
|
382
|
+
}
|
|
383
|
+
this.computePosition();
|
|
384
|
+
if (this.trap) {
|
|
385
|
+
this.trap.updateContainerElements(this.dialogElement);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
initializeAutoUpdate() {
|
|
390
|
+
this.autoUpdateCleanup = arrow.autoUpdate(this.triggerFirstElement, this.dialogElement, this.computePosition);
|
|
391
|
+
}
|
|
392
|
+
initializeFocusTrap() {
|
|
393
|
+
this.trap = focusTrap_esm.createFocusTrap(this.dialogElement, {
|
|
394
|
+
fallbackFocus: this.dialogElement,
|
|
395
|
+
clickOutsideDeactivates: true,
|
|
396
|
+
returnFocusOnDeactivate: true,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
componentDidLoad() {
|
|
400
|
+
this.contentWrapperElement.hidden = !this.open;
|
|
401
|
+
this.open ? this.popoverShown() : this.popoverHidden();
|
|
402
|
+
}
|
|
403
|
+
connectedCallback() {
|
|
404
|
+
mediaUtils.addMediaChangeListener(this.mediaChangeHandler);
|
|
405
|
+
this.init();
|
|
406
|
+
this.observer = new MutationObserver(this.init);
|
|
407
|
+
this.observer.observe(this.element, {
|
|
408
|
+
childList: true,
|
|
409
|
+
subtree: true,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
disconnectedCallback() {
|
|
413
|
+
mediaUtils.removeMediaChangeListener(this.mediaChangeHandler);
|
|
414
|
+
if (this.observer) {
|
|
415
|
+
this.observer.disconnect();
|
|
416
|
+
}
|
|
417
|
+
if (this.autoUpdateCleanup) {
|
|
418
|
+
this.autoUpdateCleanup();
|
|
419
|
+
}
|
|
420
|
+
if (this.triggerFirstElement) {
|
|
421
|
+
this.triggerFirstElement.removeEventListener("click", this.onClickTrigger);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
render() {
|
|
425
|
+
const classes = {
|
|
426
|
+
"stzh-popover": true,
|
|
427
|
+
[`stzh-popover--open`]: this.open,
|
|
428
|
+
[`stzh-popover--placement-${this.computedPlacement}`]: !!this.computedPlacement,
|
|
429
|
+
[`stzh-popover--fullwidth-${this.fullwidth}`]: !!this.fullwidth,
|
|
430
|
+
[`stzh-popover--${this.size}`]: !!this.size,
|
|
431
|
+
[`stzh-popover--${this.variant}`]: !!this.variant,
|
|
432
|
+
};
|
|
433
|
+
return (index.h(index.Host, null, index.h("div", { class: classes, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd, ref: el => (this.rootElement = el) }, index.h("div", { ref: el => (this.triggerElement = el), class: "stzh-popover__trigger" }, index.h("slot", null)), index.h("div", { class: "stzh-popover__vhidden", id: `${this.id}-trigger-description` }, this.localization.open), index.h("div", { ref: el => (this.contentWrapperElement = el), class: "stzh-popover__content-wrapper" }, index.h("div", { class: "stzh-popover__backdrop" }), index.h("div", { ref: el => (this.contentElement = el), class: "stzh-popover__content" }, index.h("div", { ref: el => (this.dialogElement = el), class: "stzh-popover__dialog", role: "dialog", tabindex: "-1", "aria-modal": "true", "aria-labelledby": this.label ? `${this.id}-label` : null, "aria-hidden": this.open ? "false" : "true", onKeyDown: this.handleKeydown }, this.variant === "tooltip" && (index.h("div", { class: "stzh-popover__arrow", ref: el => (this.arrowElement = el), innerHTML: arrow.Arrow })), index.h("div", { class: "stzh-popover__content-inner" }, index.h("div", { class: "stzh-popover__label-wrapper" }, index.h("h2", { id: `${this.id}-label`, class: "stzh-popover__label" }, this.label ? this.label : index.h("slot", { name: "label" })), index.h("button", { class: "stzh-popover__close", onClick: () => this.hide(), type: "button" }, index.h("stzh-icon", { name: "close", class: "stzh-popover__icon" }), index.h("span", { class: "stzh-popover__vhidden" }, this.localization.close))), index.h("div", { class: "stzh-popover__content-slot-wrapper" }, index.h("div", { class: "stzh-popover__content-slot" }, index.h("slot", { name: "content" })), index.h("div", { class: "stzh-popover__action-slot" }, index.h("slot", { name: "action" }))))))))));
|
|
434
|
+
}
|
|
435
|
+
get element() { return index.getElement(this); }
|
|
436
|
+
static get watchers() { return {
|
|
437
|
+
"open": ["openWatcher"],
|
|
438
|
+
"distance": ["distanceWatcher"]
|
|
439
|
+
}; }
|
|
440
|
+
};
|
|
441
|
+
StzhPopover.style = stzhPopoverCss;
|
|
442
|
+
|
|
443
|
+
exports.stzh_popover = StzhPopover;
|
|
444
|
+
|
|
445
|
+
//# sourceMappingURL=stzh-popover.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"stzh-popover.entry.cjs.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,cAAc,GAAG,ihVAAihV;;ACqBxiV,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAE1C,SAAS,2BAA2B;EAClC,MAAM,OAAO,GAA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AqB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAC,QAAQ,IAC3EA,uBAAW,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,GAAa,EAC/DA,kBAAM,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAQ,CAC7D,CACL,EACNA,iBAAK,KAAK,EAAC,oCAAoC,IAC7CA,iBAAK,KAAK,EAAC,4BAA4B,IACrCA,kBAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,EACNA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,kBAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,CACF,CACF,CACF,CACF,CACF,CACD,EACP;GACH;;;;;;;;;;;","names":["media","offset","flip","shift","arrow","computePosition","waitForEvent","stopAnimations","animateTo","isStzhElement","autoUpdate","createFocusTrap","addMediaChangeListener","removeMediaChangeListener","h","Host","Arrow"],"sources":["src/components/stzh-popover/stzh-popover.scss?tag=stzh-popover&encapsulation=scoped","src/components/stzh-popover/stzh-popover.tsx"],"sourcesContent":["/**\n * @prop --width: Width of popover above small breakpoint\n * @prop --min-width: Minimum width of popover above small breakpoint\n * @prop --max-width: Maximum width of popover above small breakpoint\n * @prop --padding: Padding of popover\n * @prop --content-padding: Padding of popover content\n * @prop --border-radius: Border radius of popover\n * @prop --backdrop-opacity: Opacity of popover backdrop (used on mikro breakpoint)\n *\n * @prop --stzh-popover-width: **Global**: Width of popover above small breakpoint (default `223px`)\n * @prop --stzh-popover-min-width: **Global**: Minimum width of popover above small breakpoint (default `initial`)\n * @prop --stzh-popover-max-width: **Global**: Maximum width of popover above small breakpoint (default `initial`)\n * @prop --stzh-popover-padding: **Global**: Padding of popover (default `0px`)\n * @prop --stzh-popover-content-padding: **Global**: Padding of popover content (default `8px 0px`)\n * @prop --stzh-popover-border-radius: **Global**: Border radius of popover above small breakpoint (default `3px`)\n *\n * @prop --stzh-dialog-backdrop-opacity: **Global**: Opacity of backdrops\n * @prop --stzh-dialog-backdrop-background-color: **Global**: Background color of backdrops\n */\n\n:host {\n display: contents;\n\n --color: #{$colorBlack};\n --width: #{$popoverWidth};\n --min-width: #{$popoverMinWidth};\n --max-width: #{$popoverMaxWidth};\n --height: auto;\n --min-height: initial;\n --max-height: initial;\n --padding: #{$popoverPadding};\n --content-padding: #{$popoverContentPadding};\n --border-radius: #{$popoverBorderRadius};\n --background-color: #{$popoverBackgroundColor};\n --backdrop-opacity: #{$dialogBackdropOpacity};\n --backdrop-background-color: #{$dialogBackdropBackgroundColor};\n\n &[size=\"large\"] {\n --content-padding: #{$popoverLargeContentPadding};\n }\n\n &[variant=\"secondary\"] {\n --background-color: #{$colorSecondary20};\n }\n\n &[variant=\"tooltip\"] {\n --width: #{$tooltipWidth};\n --min-width: #{$tooltipMinWidth};\n --max-width: #{$tooltipMaxWidth};\n --content-padding: #{space('small')} #{space('large')};\n --border-radius: #{$tooltipBorderRadius};\n\n @include mq($from: small) {\n --content-padding: #{$tooltipPadding};\n --color: #{$colorWhite};\n --link-color: #{$colorWhite};\n --hover-link-color: #{$colorWhite70op};\n --background-color: #{$colorCoolgrey60};\n }\n }\n}\n\n.stzh-popover {\n @include tooltip-arrow;\n display: contents;\n\n &__trigger {\n display: contents;\n }\n\n &__content-wrapper {\n // position: absolute;\n // width: 100%;\n // height: 100%;\n // pointer-events: none;\n display: contents;\n\n @include mq($to: small) {\n z-index: $zIndexDialog;\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: stretch;\n justify-content: stretch;\n }\n }\n\n &__backdrop {\n display: contents;\n\n @include mq($to: small) {\n z-index: 1;\n position: absolute;\n display: block;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n text-align: center;\n background-color: var(--backdrop-background-color);\n opacity: var(--backdrop-opacity);\n }\n }\n\n &__content {\n // pointer-events: all;\n display: contents;\n\n @include mq($to: small) {\n z-index: 2;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-grow: 1;\n overflow: auto;\n }\n }\n\n &__dialog {\n margin-top: auto;\n width: 100%;\n overflow: visible;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n background-color: var(--background-color);\n touch-action: none;\n outline: none;\n border-bottom: 2px solid $colorOldGrey13;\n color: var(--color);\n\n --stzh-base-color: var(--color);\n --stzh-link-color: var(--link-color);\n // TODO: check with designer\n --stzh-link-hover-color: var(--hover-link-color);\n\n @include mq($from: small) {\n z-index: $zIndexPopover;\n position: absolute;\n display: flex;\n width: var(--width);\n min-width: var(--min-width);\n max-width: var(--max-width);\n // max-width: calc(100vw - var(--stzh-scrollbar-width) - #{space('small')});\n height: var(--height);\n min-height: var(--min-height);\n max-height: var(--max-height);\n left: auto;\n right: auto;\n bottom: auto;\n border-radius: var(--border-radius);\n box-shadow: $boxShadowPopover;\n border: none;\n }\n }\n\n &__content-inner,\n &__content-slot-wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n &__content-slot-wrapper {\n padding: var(--padding);\n }\n\n &__content-slot {\n overflow-y: auto;\n overflow-x: hidden;\n overflow-scrolling: touch;\n padding: var(--content-padding);\n }\n\n &__action-slot {\n display: flex;\n flex-direction: column;\n\n // &:not(:empty) {\n // margin: space('xsmall') space('small');\n // margin-bottom: space('medium');\n // }\n }\n\n &__label-wrapper {\n display: flex;\n align-items: center;\n padding: space('small') space('large');\n padding-right: space('medium');\n border-bottom: 1px solid $baseBorderColor;\n color: $colorOldGrey70;\n\n @include mq($from: small) {\n padding: 0;\n border-bottom: 0;\n }\n }\n\n &__label {\n @include font('heavy');\n @include fontCurve('p2');\n margin: 0;\n margin-right: space('small');\n\n @include mq($from: small) {\n @include visuallyhidden;\n }\n }\n\n &__close {\n visibility: $popoverCloseVisibility;\n cursor: pointer;\n display: flex;\n appearance: none;\n font-family: inherit;\n border: none;\n background-color: transparent;\n padding: 0;\n margin-left: auto;\n border-radius: 50%;\n color: $baseLeadColor;\n padding: space('xxsmall');\n }\n\n &__icon {\n --size: #{iconSize('xsmall')};\n }\n\n &__arrow {\n position: absolute;\n display: none;\n\n @include mq($from: small) {\n display: flex;\n }\n }\n\n &__vhidden {\n @include visuallyhidden;\n }\n\n /* Only non tooltip variants */\n\n &--default &__close,\n &--secondary &__close {\n &:focus {\n box-shadow: 0 0 0 1px $colorPrimary;\n }\n\n @include mq($from: small) {\n @include visuallyhiddenFocusable;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(30%, -30%);\n background-color: $colorOldGrey5;\n }\n }\n\n /* Tooltip variant */\n\n &--tooltip &__content-inner {\n @include mq($from: small) {\n flex-direction: row-reverse;\n align-items: flex-start;\n }\n }\n\n &--tooltip &__close {\n visibility: visible;\n\n @include mq($from: small) {\n @include tooltip__close;\n }\n }\n\n &--tooltip &__icon {\n @include mq($from: small) {\n @include tooltip__icon;\n }\n }\n\n &--tooltip &__dialog {\n @include mq($from: small) {\n @include tooltip-dropshadow;\n }\n }\n\n &--tooltip &__content-slot {\n @include mq($from: small) {\n @include tooltip-fontsize;\n }\n }\n\n /* Has fullwidth popover */\n\n &--popover-fullwidth-horizontal &__dialog {\n @include mq($from: small) {\n left: 0 !important;\n right: 0 !important;\n width: 100%;\n }\n }\n\n &--popover-fullwidth-vertical &__dialog {\n @include mq($from: small) {\n top: 0 !important;\n bottom: 0 !important;\n height: 100%;\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from \"@stencil/core\";\n\nimport {\n StzhPopoverClosedEvent,\n StzhPopoverCloseEvent,\n StzhPopoverOpenedEvent,\n StzhPopoverOpenEvent,\n} from \"../../index\";\n\nimport { arrow, autoUpdate, computePosition, flip, offset, Placement, shift } from \"@floating-ui/dom\";\n\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\nimport { isStzhElement } from \"../../utils/utils\";\nimport { addMediaChangeListener, media, removeMediaChangeListener } from \"../../utils/media-utils\";\nimport { waitForEvent } from \"../../utils/event-utils\";\nimport { animateTo, stopAnimations } from \"../../utils/animation-utils\";\n\nimport { StzhPopoverLocalizedText } from \"./stzh-popover.localization\";\n\nimport Arrow from \"../stzh-tooltip/assets/arrow.svg\";\n\nconst ANIMATION_SHOW_DURATION = 200;\nconst ANIMATION_HIDE_DURATION = 300;\nconst ANIMATION_SHOW_DURATION_SMALL = 100;\nconst ANIMATION_HIDE_DURATION_SMALL = 200;\n\nfunction animationContentWrapperShow() {\n const isSmall = media(\"small\").matches;\n return {\n keyframes: [{ opacity: \"0\" }, { opacity: \"1\" }],\n options: {\n duration: isSmall ? ANIMATION_SHOW_DURATION_SMALL : ANIMATION_SHOW_DURATION,\n easing: \"linear\",\n },\n };\n}\n\nfunction animationContentWrapperHide() {\n const isSmall = media(\"small\").matches;\n return {\n keyframes: [{ opacity: \"1\" }, { opacity: \"0\" }],\n options: {\n duration: isSmall ? ANIMATION_HIDE_DURATION_SMALL : ANIMATION_HIDE_DURATION,\n easing: \"linear\",\n },\n };\n}\n\nfunction animationDialogShow() {\n const isSmall = media(\"small\").matches;\n return {\n keyframes: [{ transform: isSmall ? \"translateY(-8px)\" : \"translateY(100%)\" }, { transform: \"translateY(0px)\" }],\n options: {\n duration: isSmall ? ANIMATION_SHOW_DURATION_SMALL : ANIMATION_SHOW_DURATION,\n easing: \"linear\",\n },\n };\n}\n\nfunction animationDialogHide() {\n const isSmall = media(\"small\").matches;\n return {\n keyframes: [{ transform: \"translateY(0px)\" }, { transform: isSmall ? \"translateY(-8px)\" : \"translateY(100%)\" }],\n options: {\n duration: isSmall ? ANIMATION_HIDE_DURATION_SMALL : ANIMATION_HIDE_DURATION,\n easing: \"linear\",\n },\n };\n}\n\nconst keyCode = {\n ESC: 27,\n};\n\nconst CLASS_BODY_OPEN = \"stzh-popover-open\";\n\nlet popoverCounter = 0;\n\n/**\n * @slot - Trigger element for popover\n * @slot content - Any element used as popover content\n * @slot action - `stzh-button` element\n * @slot label - Label for mobile view (alternative for label property)\n */\n@Component({\n tag: \"stzh-popover\",\n styleUrl: \"stzh-popover.scss\",\n scoped: true,\n})\nexport class StzhPopover {\n /** Whether popover should be open */\n @Prop({ mutable: true, reflect: true }) open: boolean = false;\n\n /** Default placement of popover relative to trigger element */\n @Prop({ reflect: true }) placement: Placement = \"bottom\";\n\n /** Whether to stretch popover to fullwith of parent */\n @Prop({ reflect: true }) fullwidth: \"horizontal\" | \"vertical\" | \"\" = \"\";\n\n /** Variant */\n @Prop({ reflect: true }) variant: \"default\" | \"secondary\" | \"tooltip\" = \"default\";\n\n /** Size */\n @Prop({ reflect: true }) size: \"default\" | \"large\" = \"default\";\n\n /** Shifting of popover content */\n @Prop() skidding: number = 0;\n\n /** Distance from popover content to trigger. \"8\" when default variant, \"16\" when tooltip variant, arrow height (8px) + spacing (4px) = 12. */\n @Prop() distance: number;\n\n /** Label for mobile view (use label slot as alternative) */\n @Prop() label: string = \"\";\n\n /** Position strategy */\n @Prop() strategy: \"absolute\" | \"fixed\" = \"absolute\";\n\n /** Translation strings. */\n @Prop() localization: StzhPopoverLocalizedText;\n\n @Element() element: HTMLStzhPopoverElement;\n\n /** Popover open event */\n @Event() stzhOpen: EventEmitter<StzhPopoverOpenEvent>;\n\n /** Popover opened event (after animation) */\n @Event() stzhOpened: EventEmitter<StzhPopoverOpenedEvent>;\n\n /** Popover close event */\n @Event() stzhClose: EventEmitter<StzhPopoverCloseEvent>;\n\n /** Popover closed event (after animation) */\n @Event() stzhClosed: EventEmitter<StzhPopoverClosedEvent>;\n\n private parentNode: Node;\n\n /** Show popover content */\n @Method()\n async show() {\n if (this.open) {\n return;\n }\n\n this.mediaChangeHandler();\n if (this.isHeaderStuckAndViewportMicro) {\n this.branchOutToBody();\n }\n\n this.toggledByMethod = true;\n this.open = true;\n return waitForEvent(this.element, \"stzhOpened\");\n }\n\n /** Hide popover content */\n @Method()\n async hide() {\n if (!this.open) {\n return;\n }\n\n this.toggledByMethod = true;\n this.open = false;\n\n await waitForEvent(this.element, \"stzhClosed\");\n\n this.mediaChangeHandler();\n if (this.isHeaderStuckAndViewportMicro) {\n this.branchInFromBody();\n }\n\n return true;\n }\n\n /** Toggle popover content */\n @Method()\n async toggle() {\n if (this.open) {\n return await this.hide();\n } else {\n return await this.show();\n }\n }\n\n @Method()\n async update() {\n return await this.computePosition();\n }\n\n @Listen(\"click\", { target: \"document\", capture: true })\n handleOutsideClick(event: MouseEvent) {\n if (!this.open) {\n return;\n }\n\n const isClickOutside =\n event.target !== this.dialogElement && this.dialogElement.contains(event.target as HTMLElement) === false;\n\n const isClickTrigger =\n event.target === this.triggerElement || this.triggerElement.contains(event.target as HTMLElement);\n\n if (isClickOutside && !isClickTrigger) {\n this.hide();\n }\n }\n\n @Watch(\"open\")\n async openWatcher(newValue: boolean) {\n if (!this.dialogElement) {\n return;\n }\n\n if (newValue) {\n if (this.toggledByMethod) {\n this.stzhOpen.emit({\n component: \"stzh-popover\",\n });\n }\n\n const animationShow = animationContentWrapperShow();\n const animationShowDialog = animationDialogShow();\n\n await Promise.all([\n stopAnimations(this.contentWrapperElement),\n stopAnimations(this.contentElement),\n stopAnimations(this.dialogElement),\n ]);\n\n // safari seems to need will-change,\n // otherwise it has problems animating the element with the drop shadow\n this.dialogElement.style.willChange = \"transform, opacity, position, top, left, bottom, right\";\n this.contentWrapperElement.hidden = false;\n\n await Promise.all([\n animateTo(\n media(\"small\").matches ? this.dialogElement : this.contentWrapperElement,\n animationShow.keyframes,\n animationShow.options\n ),\n animateTo(\n media(\"small\").matches ? this.dialogElement : this.contentElement,\n animationShowDialog.keyframes,\n animationShowDialog.options\n ),\n ]);\n\n if (this.toggledByMethod) {\n this.stzhOpened.emit({\n component: \"stzh-popover\",\n });\n }\n } else {\n if (this.toggledByMethod) {\n this.stzhClose.emit({\n component: \"stzh-popover\",\n });\n }\n\n const animationHide = animationContentWrapperHide();\n const animationHideDialog = animationDialogHide();\n\n await Promise.all([\n stopAnimations(this.contentWrapperElement),\n stopAnimations(this.contentElement),\n stopAnimations(this.dialogElement),\n ]);\n\n await Promise.all([\n animateTo(\n media(\"small\").matches ? this.dialogElement : this.contentWrapperElement,\n animationHide.keyframes,\n animationHide.options\n ),\n animateTo(\n media(\"small\").matches ? this.dialogElement : this.contentElement,\n animationHideDialog.keyframes,\n animationHideDialog.options\n ),\n ]);\n\n this.contentWrapperElement.hidden = true;\n this.dialogElement.style.willChange = \"auto\";\n\n if (this.toggledByMethod) {\n this.stzhClosed.emit({\n component: \"stzh-popover\",\n });\n }\n }\n\n this.toggledByMethod = false;\n }\n\n @Watch(\"distance\")\n distanceWatcher(newValue: number) {\n if (typeof newValue === \"number\") {\n this.distance = newValue;\n } else {\n this.distance = this.variant === \"tooltip\" ? 12 : 8;\n }\n }\n\n @State() computedPlacement: Placement;\n @State() isHeaderStuckAndViewportMicro: boolean;\n @State() isBranchedOutToBody: boolean;\n @State() hasStzhHeaderParent: boolean;\n\n private observer: MutationObserver;\n\n private contentWrapperElement: HTMLElement;\n private contentElement: HTMLElement;\n private arrowElement: HTMLElement;\n private rootElement: HTMLElement;\n private triggerElement: HTMLElement;\n private triggerFirstElement: HTMLElement;\n private dialogElement: HTMLElement;\n private autoUpdateCleanup: Function;\n\n private initialTouchX: number = null;\n private initialTouchY: number = null;\n\n private id: string;\n private trap: FocusTrap;\n private toggledByMethod: boolean;\n\n private setStzhHeaderParent(): boolean {\n let parent = this.element.parentElement;\n while (parent) {\n if (parent.tagName && parent.tagName.toLowerCase() === \"stzh-header\") {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n }\n\n private mediaChangeHandler = () => {\n const isStzhHeaderStuck = document.documentElement.style.getPropertyValue(\"--stzh-header-is-stuck\");\n this.isHeaderStuckAndViewportMicro =\n !media(\"small\").matches && isStzhHeaderStuck === \"1\" && this.hasStzhHeaderParent;\n\n if (this.open && this.isBranchedOutToBody && !this.isHeaderStuckAndViewportMicro) {\n this.branchInFromBody();\n }\n };\n\n private branchOutToBody() {\n document.body.append(this.element);\n this.parentNode.appendChild(this.triggerElement);\n this.isBranchedOutToBody = true;\n }\n\n private branchInFromBody() {\n this.parentNode.appendChild(this.element);\n this.rootElement.prepend(this.triggerElement);\n this.isBranchedOutToBody = false;\n }\n\n private handleKeydown = (event: KeyboardEvent) => {\n if (event.keyCode === keyCode.ESC) {\n this.hide();\n }\n };\n\n private onClickTrigger = () => {\n this.toggle();\n };\n\n private computePosition = async () => {\n if (media(\"small\").matches) {\n const middleware = [\n offset({\n mainAxis: this.distance,\n crossAxis: this.skidding,\n }),\n flip({\n padding: 5,\n }),\n shift({\n padding: 5,\n }),\n ];\n\n if (this.variant === \"tooltip\") {\n middleware.push(\n arrow({\n element: this.arrowElement,\n padding: 5,\n })\n );\n }\n\n const {\n x = 0,\n y = 0,\n strategy = \"absolute\",\n placement,\n middlewareData,\n } = await computePosition(this.triggerFirstElement, this.dialogElement, {\n strategy: this.strategy,\n placement: this.placement,\n middleware,\n });\n\n this.computedPlacement = placement;\n\n Object.assign(this.dialogElement.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n });\n\n if (this.variant === \"tooltip\") {\n Object.assign(this.arrowElement.style, {\n left: x != null ? `${middlewareData.arrow.x}px` : \"\",\n top: y != null ? `${middlewareData.arrow.y}px` : \"\",\n });\n }\n } else {\n Object.assign(this.dialogElement.style, {\n position: null,\n left: null,\n top: null,\n });\n\n if (this.variant === \"tooltip\") {\n Object.assign(this.arrowElement.style, {\n left: null,\n top: null,\n });\n }\n }\n };\n\n private handleTouchStart = (event: TouchEvent) => {\n const touch = event.changedTouches[0];\n this.initialTouchX = touch.pageX;\n this.initialTouchY = touch.pageY;\n };\n\n // private handleTouchMove = (event: TouchEvent) => {\n // event.preventDefault()\n // }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const touch = event.changedTouches[0];\n const distX = touch.pageX - this.initialTouchX; // get horizontal dist traveled\n const distY = touch.pageY - this.initialTouchY; // get vertical dist traveled\n const threshold = 70;\n\n const isYSwipe = Math.abs(distY) >= threshold && Math.abs(distX) <= threshold;\n\n if (isYSwipe) {\n const isInDropdown = (event.target as HTMLElement).closest('.stzh-dropdown') !== null;\n if (!isInDropdown){\n this.hide();\n }\n }\n\n this.initialTouchY = null;\n this.initialTouchX = null;\n };\n\n private init = () => {\n let trigger = this.triggerElement?.firstElementChild as HTMLElement;\n\n if (!trigger) {\n const defaultSlot = Array.from(this.element.children).find(child => !child.hasAttribute(\"slot\")) as HTMLElement;\n\n trigger = defaultSlot;\n }\n\n if (trigger) {\n this.triggerFirstElement = trigger;\n trigger.addEventListener(\"click\", this.onClickTrigger);\n }\n };\n\n async componentWillLoad() {\n this.id = `stzh-popover-${popoverCounter++}`;\n this.parentNode = this.element.parentNode;\n this.hasStzhHeaderParent = this.setStzhHeaderParent();\n\n this.distanceWatcher(this.distance);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"popover\");\n }\n }\n\n private popoverShown() {\n document.body.classList.add(CLASS_BODY_OPEN);\n\n const isStzh = isStzhElement(this.triggerFirstElement);\n\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-expanded\" : \"aria-expanded\", \"true\");\n\n if (this.trap) {\n this.trap.activate();\n }\n }\n\n private popoverHidden() {\n document.body.classList.remove(CLASS_BODY_OPEN);\n\n const isStzh = isStzhElement(this.triggerFirstElement);\n\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-expanded\" : \"aria-expanded\", \"false\");\n\n if (this.trap) {\n this.trap.deactivate();\n }\n }\n\n componentDidRender() {\n this.mediaChangeHandler();\n const isStzh = isStzhElement(this.triggerFirstElement);\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"a11y-describedby\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"aria-describedby\"))\n ) {\n this.triggerFirstElement.setAttribute(\n isStzh ? \"a11y-describedby\" : \"aria-describedby\",\n `${this.id}-trigger-description`\n );\n }\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"a11y-label\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"aria-label\"))\n ) {\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-label\" : \"aria-label\", this.label);\n }\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"analytics-id\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"s-object-id\"))\n ) {\n this.triggerFirstElement.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", this.label);\n }\n }\n\n private initializedPopover = false\n\n componentDidUpdate() {\n if (this.open && !this.initializedPopover) {\n this.initializeAutoUpdate();\n this.initializeFocusTrap();\n this.popoverShown();\n this.initializedPopover = true\n }\n\n if (this.initializedPopover) {\n if (this.open) {\n this.popoverShown();\n } else {\n this.popoverHidden();\n }\n\n this.computePosition();\n if (this.trap) {\n this.trap.updateContainerElements(this.dialogElement);\n }\n }\n }\n\n initializeAutoUpdate() {\n this.autoUpdateCleanup = autoUpdate(this.triggerFirstElement, this.dialogElement, this.computePosition);\n }\n\n initializeFocusTrap() {\n this.trap = createFocusTrap(this.dialogElement, {\n fallbackFocus: this.dialogElement,\n clickOutsideDeactivates: true,\n returnFocusOnDeactivate: true,\n });\n }\n\n componentDidLoad() {\n this.contentWrapperElement.hidden = !this.open;\n this.open ? this.popoverShown() : this.popoverHidden();\n }\n\n connectedCallback() {\n addMediaChangeListener(this.mediaChangeHandler);\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n removeMediaChangeListener(this.mediaChangeHandler);\n if (this.observer) {\n this.observer.disconnect();\n }\n\n if (this.autoUpdateCleanup) {\n this.autoUpdateCleanup();\n }\n\n if (this.triggerFirstElement) {\n this.triggerFirstElement.removeEventListener(\"click\", this.onClickTrigger);\n }\n }\n\n render() {\n const classes = {\n \"stzh-popover\": true,\n [`stzh-popover--open`]: this.open,\n [`stzh-popover--placement-${this.computedPlacement}`]: !!this.computedPlacement,\n [`stzh-popover--fullwidth-${this.fullwidth}`]: !!this.fullwidth,\n [`stzh-popover--${this.size}`]: !!this.size,\n [`stzh-popover--${this.variant}`]: !!this.variant,\n };\n\n return (\n <Host>\n <div\n class={classes}\n onTouchStart={this.handleTouchStart}\n onTouchEnd={this.handleTouchEnd}\n ref={el => (this.rootElement = el as HTMLDivElement)}\n >\n <div ref={el => (this.triggerElement = el as HTMLDivElement)} class=\"stzh-popover__trigger\">\n <slot></slot>\n </div>\n <div class=\"stzh-popover__vhidden\" id={`${this.id}-trigger-description`}>\n {this.localization.open}\n </div>\n <div ref={el => (this.contentWrapperElement = el as HTMLDivElement)} class=\"stzh-popover__content-wrapper\">\n <div class=\"stzh-popover__backdrop\"></div>\n <div ref={el => (this.contentElement = el as HTMLDivElement)} class=\"stzh-popover__content\">\n <div\n ref={el => (this.dialogElement = el as HTMLDivElement)}\n class=\"stzh-popover__dialog\"\n role=\"dialog\"\n tabindex=\"-1\"\n aria-modal=\"true\"\n aria-labelledby={this.label ? `${this.id}-label` : null}\n aria-hidden={this.open ? \"false\" : \"true\"}\n onKeyDown={this.handleKeydown}\n >\n {this.variant === \"tooltip\" && (\n <div\n class=\"stzh-popover__arrow\"\n ref={el => (this.arrowElement = el as HTMLDivElement)}\n innerHTML={Arrow}\n ></div>\n )}\n <div class=\"stzh-popover__content-inner\">\n <div class=\"stzh-popover__label-wrapper\">\n <h2 id={`${this.id}-label`} class=\"stzh-popover__label\">\n {this.label ? this.label : <slot name=\"label\"></slot>}\n </h2>\n <button class=\"stzh-popover__close\" onClick={() => this.hide()} type=\"button\">\n <stzh-icon name=\"close\" class=\"stzh-popover__icon\"></stzh-icon>\n <span class=\"stzh-popover__vhidden\">{this.localization.close}</span>\n </button>\n </div>\n <div class=\"stzh-popover__content-slot-wrapper\">\n <div class=\"stzh-popover__content-slot\">\n <slot name=\"content\"></slot>\n </div>\n <div class=\"stzh-popover__action-slot\">\n <slot name=\"action\"></slot>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -10,7 +10,16 @@ let saptchaCounter = 0;
|
|
|
10
10
|
const StzhSaptcha = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
|
+
this.stzhChange = index.createEvent(this, "stzhChange", 7);
|
|
13
14
|
this._numbers = [];
|
|
15
|
+
this.onInputChange = (event) => {
|
|
16
|
+
this.value = event.detail.value;
|
|
17
|
+
this.stzhChange.emit({
|
|
18
|
+
component: "stzh-saptcha",
|
|
19
|
+
originalEvent: event,
|
|
20
|
+
value: this.value
|
|
21
|
+
});
|
|
22
|
+
};
|
|
14
23
|
this.localization = undefined;
|
|
15
24
|
this.numbers = [];
|
|
16
25
|
this.value = "";
|
|
@@ -18,10 +27,6 @@ const StzhSaptcha = class {
|
|
|
18
27
|
this.error = undefined;
|
|
19
28
|
this.invalid = false;
|
|
20
29
|
this.disabled = false;
|
|
21
|
-
this.inputValue = "";
|
|
22
|
-
}
|
|
23
|
-
valueWatcher(newValue) {
|
|
24
|
-
this.inputValue = newValue;
|
|
25
30
|
}
|
|
26
31
|
numbersWatcher(newValue) {
|
|
27
32
|
if (typeof newValue === "string") {
|
|
@@ -52,9 +57,6 @@ const StzhSaptcha = class {
|
|
|
52
57
|
this._error = [];
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
|
-
componentDidLoad() {
|
|
56
|
-
this.inputValue = this.value;
|
|
57
|
-
}
|
|
58
60
|
async componentWillLoad() {
|
|
59
61
|
this.saptchaId = `stzh-saptcha-${saptchaCounter++}`;
|
|
60
62
|
this.numbersWatcher(this.numbers);
|
|
@@ -70,11 +72,10 @@ const StzhSaptcha = class {
|
|
|
70
72
|
return (index.h(index.Host, { "is-invalid": this.invalid || this._error.length > 0 }, index.h("div", { class: classes }, index.h("div", { class: "stzh-saptcha__box" }, index.h("div", { class: "stzh-saptcha__info", id: `${this.saptchaId}-info` }, this.localization.info, " ", this.localization.question), index.h("div", { class: "stzh-saptcha__answer", id: `${this.saptchaId}-answer` }, this._numbers.map((number, index$1) => index.h("span", { class: "stzh-saptcha__number" }, number, index$1 < this._numbers.length - 1 &&
|
|
71
73
|
(index$1 === this._numbers.length - 2
|
|
72
74
|
? this.localization.answerOr
|
|
73
|
-
: ", ")))), index.h("stzh-input", { class: "stzh-saptcha__input", label: this.localization.answer, name: this.name, invalid: this.invalid, error: this.error, disabled: this.disabled, value: this.
|
|
75
|
+
: ", ")))), index.h("stzh-input", { class: "stzh-saptcha__input", label: this.localization.answer, name: this.name, invalid: this.invalid, error: this.error, disabled: this.disabled, value: this.value, onStzhChange: this.onInputChange, required: true, a11yDescribedby: `${this.saptchaId}-info ${this.saptchaId}-answer` })))));
|
|
74
76
|
}
|
|
75
77
|
get element() { return index.getElement(this); }
|
|
76
78
|
static get watchers() { return {
|
|
77
|
-
"value": ["valueWatcher"],
|
|
78
79
|
"numbers": ["numbersWatcher"],
|
|
79
80
|
"error": ["errorWatcher"]
|
|
80
81
|
}; }
|