@oiz/stzh-components 2.2.0-beta → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{animation-utils-cfa35ce7.js → animation-utils-54d784c2.js} +3 -0
- package/dist/cjs/{app-globals-f4ad4e99.js → app-globals-b6d82414.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-accordion-item.cjs.entry.js +5 -2
- package/dist/cjs/stzh-badge_3.cjs.entry.js +2 -2
- package/dist/cjs/stzh-calendar.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card_3.cjs.entry.js +40 -10
- package/dist/cjs/stzh-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chip.cjs.entry.js +6 -5
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-datalist_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +3 -2
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js +2 -2
- package/dist/cjs/stzh-details.cjs.entry.js +4 -1
- package/dist/cjs/stzh-dialog.cjs.entry.js +4 -4
- package/dist/cjs/stzh-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/stzh-flyingfocus.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-input.cjs.entry.js +1 -1
- package/dist/cjs/stzh-link.cjs.entry.js +1 -1
- package/dist/cjs/stzh-menu_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-message.cjs.entry.js +1 -1
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-olmap.cjs.entry.js +1 -1
- package/dist/cjs/stzh-popover.cjs.entry.js +19 -5
- package/dist/cjs/stzh-progressbar-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-textandimage.cjs.entry.js +3 -1
- package/dist/cjs/stzh-toggle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-tooltip.cjs.entry.js +28 -7
- package/dist/cjs/stzh-upload.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +2 -1
- package/dist/collection/assets/i18n/de.json +9 -6
- package/dist/collection/assets/i18n/en.json +10 -7
- package/dist/collection/components/stzh-accordion/stzh-accordion.stories.js +12 -1
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.css +1 -0
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +3 -0
- package/dist/collection/components/stzh-button/stzh-button.css +1 -0
- package/dist/collection/components/stzh-button/stzh-button.stories.js +12 -12
- package/dist/collection/components/stzh-calendar/stzh-calendar.css +1 -0
- package/dist/collection/components/stzh-card/stzh-card.css +36 -0
- package/dist/collection/components/stzh-card/stzh-card.js +26 -4
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.css +1 -0
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.css +1 -0
- package/dist/collection/components/stzh-chip/stzh-chip.css +52 -4
- package/dist/collection/components/stzh-chip/stzh-chip.js +23 -5
- package/dist/collection/components/stzh-chip-select/stzh-chip-select.css +2 -0
- package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +31 -4
- package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +1 -0
- package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.css +11 -0
- package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.js +3 -2
- package/dist/collection/components/stzh-details/stzh-details.js +3 -0
- package/dist/collection/components/stzh-dialog/stzh-dialog.css +1 -0
- package/dist/collection/components/stzh-dialog/stzh-dialog.js +3 -3
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +3 -0
- package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +1 -0
- package/dist/collection/components/stzh-header/stzh-header.stories.js +1 -1
- package/dist/collection/components/stzh-icon/stzh-icon.js +1 -1
- package/dist/collection/components/stzh-input/stzh-input.css +1 -0
- package/dist/collection/components/stzh-link/stzh-link.css +1 -0
- package/dist/collection/components/stzh-menu-item/stzh-menu-item.css +1 -0
- package/dist/collection/components/stzh-message/stzh-message.css +1 -0
- package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js +1 -1
- package/dist/collection/components/stzh-olmap/stzh-olmap.js +1 -1
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.stories.js +1 -1
- package/dist/collection/components/stzh-popover/stzh-popover.css +2 -0
- package/dist/collection/components/stzh-popover/stzh-popover.js +18 -4
- package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.css +107 -6
- package/dist/collection/components/stzh-radio/stzh-radio.css +1 -0
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.css +1 -0
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.css +38 -2
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.js +20 -0
- package/dist/collection/components/stzh-toggle/stzh-toggle.css +1 -0
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.css +1 -0
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +27 -6
- package/dist/collection/components/stzh-upload/stzh-upload.css +1 -0
- package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.js +2 -1
- package/dist/collection/pages/egov.stories.js +9 -9
- package/dist/collection/pages/example.stories.js +1 -1
- package/dist/collection/pages/meinkonto.stories.js +3 -3
- package/dist/collection/patterns/contact.stories.js +56 -30
- package/dist/collection/patterns/subpages.stories.js +5 -5
- package/dist/collection/utils/animation-utils.js +3 -0
- package/dist/components/animation-utils.js +3 -0
- package/dist/components/index.js +1 -1
- package/dist/components/stzh-accordion-item.js +4 -1
- package/dist/components/stzh-button2.js +1 -1
- package/dist/components/stzh-calendar2.js +1 -1
- package/dist/components/stzh-card2.js +9 -5
- package/dist/components/stzh-checkbox.js +1 -1
- package/dist/components/stzh-checkboxgroup.js +1 -1
- package/dist/components/stzh-chip-select2.js +32 -5
- package/dist/components/stzh-chip2.js +7 -5
- package/dist/components/stzh-datalist-item2.js +1 -1
- package/dist/components/stzh-datamessagelist-item.js +3 -2
- package/dist/components/stzh-details.js +3 -0
- package/dist/components/stzh-dialog.js +4 -4
- package/dist/components/stzh-dropdown2.js +1 -1
- package/dist/components/stzh-ghettobox2.js +1 -1
- package/dist/components/stzh-icon2.js +1 -1
- package/dist/components/stzh-input2.js +1 -1
- package/dist/components/stzh-link2.js +1 -1
- package/dist/components/stzh-menu-item2.js +1 -1
- package/dist/components/stzh-message.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +1 -1
- package/dist/components/stzh-olmap.js +1 -1
- package/dist/components/stzh-popover2.js +18 -4
- package/dist/components/stzh-progressbar-item2.js +1 -1
- package/dist/components/stzh-radio2.js +1 -1
- package/dist/components/stzh-radiogroup2.js +1 -1
- package/dist/components/stzh-textandimage.js +4 -1
- package/dist/components/stzh-toggle.js +1 -1
- package/dist/components/stzh-tooltip2.js +27 -6
- package/dist/components/stzh-upload.js +1 -1
- package/dist/components/stzh-vbz-linechip2.js +2 -1
- package/dist/esm/{animation-utils-25c74e5b.js → animation-utils-e234a5f8.js} +3 -0
- package/dist/esm/{app-globals-17c2ba8d.js → app-globals-ff581b69.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-accordion-item.entry.js +5 -2
- package/dist/esm/stzh-badge_3.entry.js +2 -2
- package/dist/esm/stzh-calendar.entry.js +1 -1
- package/dist/esm/stzh-card_3.entry.js +40 -10
- package/dist/esm/stzh-checkbox.entry.js +1 -1
- package/dist/esm/stzh-checkboxgroup.entry.js +1 -1
- package/dist/esm/stzh-chip.entry.js +6 -5
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-datalist_2.entry.js +1 -1
- package/dist/esm/stzh-datamessagelist-item.entry.js +3 -2
- package/dist/esm/stzh-datepicker_3.entry.js +2 -2
- package/dist/esm/stzh-details.entry.js +4 -1
- package/dist/esm/stzh-dialog.entry.js +4 -4
- package/dist/esm/stzh-dropdown.entry.js +1 -1
- package/dist/esm/stzh-flyingfocus.entry.js +1 -1
- package/dist/esm/stzh-ghettobox_2.entry.js +1 -1
- package/dist/esm/stzh-input.entry.js +1 -1
- package/dist/esm/stzh-link.entry.js +1 -1
- package/dist/esm/stzh-menu_2.entry.js +1 -1
- package/dist/esm/stzh-message.entry.js +1 -1
- package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
- package/dist/esm/stzh-olmap.entry.js +1 -1
- package/dist/esm/stzh-popover.entry.js +19 -5
- package/dist/esm/stzh-progressbar-item.entry.js +1 -1
- package/dist/esm/stzh-textandimage.entry.js +3 -1
- package/dist/esm/stzh-toggle.entry.js +1 -1
- package/dist/esm/stzh-tooltip.entry.js +28 -7
- package/dist/esm/stzh-upload.entry.js +1 -1
- package/dist/esm/stzh-vbz-linechip.entry.js +2 -1
- package/dist/esm-es5/animation-utils-e234a5f8.js +1 -0
- package/dist/esm-es5/app-globals-ff581b69.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/stzh-accordion-item.entry.js +1 -1
- package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
- package/dist/esm-es5/stzh-calendar.entry.js +1 -1
- package/dist/esm-es5/stzh-card_3.entry.js +1 -1
- package/dist/esm-es5/stzh-checkbox.entry.js +1 -1
- package/dist/esm-es5/stzh-checkboxgroup.entry.js +1 -1
- package/dist/esm-es5/stzh-chip.entry.js +1 -1
- package/dist/esm-es5/stzh-components.js +1 -1
- package/dist/esm-es5/stzh-datalist_2.entry.js +1 -1
- package/dist/esm-es5/stzh-datamessagelist-item.entry.js +1 -1
- package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -1
- package/dist/esm-es5/stzh-details.entry.js +1 -1
- package/dist/esm-es5/stzh-dialog.entry.js +1 -1
- package/dist/esm-es5/stzh-dropdown.entry.js +1 -1
- package/dist/esm-es5/stzh-flyingfocus.entry.js +1 -1
- package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
- package/dist/esm-es5/stzh-input.entry.js +1 -1
- package/dist/esm-es5/stzh-link.entry.js +1 -1
- package/dist/esm-es5/stzh-menu_2.entry.js +1 -1
- package/dist/esm-es5/stzh-message.entry.js +1 -1
- package/dist/esm-es5/stzh-microsite-teaserlist.entry.js +1 -1
- package/dist/esm-es5/stzh-olmap.entry.js +1 -1
- package/dist/esm-es5/stzh-popover.entry.js +1 -1
- package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
- package/dist/esm-es5/stzh-textandimage.entry.js +1 -1
- package/dist/esm-es5/stzh-toggle.entry.js +1 -1
- package/dist/esm-es5/stzh-tooltip.entry.js +1 -1
- package/dist/esm-es5/stzh-upload.entry.js +1 -1
- package/dist/stzh-components/assets/i18n/de.json +9 -6
- package/dist/stzh-components/assets/i18n/en.json +10 -7
- package/dist/stzh-components/p-06d9b884.system.entry.js +1 -0
- package/dist/stzh-components/{p-1da26ca1.entry.js → p-0743d7fa.entry.js} +1 -1
- package/dist/stzh-components/p-0850a2e1.system.entry.js +1 -0
- package/dist/stzh-components/{p-2b5b1e4a.system.entry.js → p-0cc8bbd7.system.entry.js} +1 -1
- package/dist/stzh-components/p-12a2afe9.entry.js +1 -0
- package/dist/stzh-components/p-17645237.entry.js +1 -0
- package/dist/stzh-components/p-18cb06e2.entry.js +1 -0
- package/dist/stzh-components/p-1ae4d600.system.entry.js +1 -0
- package/dist/stzh-components/{p-037357fc.system.entry.js → p-21cad060.system.entry.js} +1 -1
- package/dist/stzh-components/{p-171c5795.system.entry.js → p-23829f75.system.entry.js} +1 -1
- package/dist/stzh-components/p-2bec3c77.entry.js +1 -0
- package/dist/stzh-components/p-2d340222.system.entry.js +1 -0
- package/dist/stzh-components/{p-2862cdd8.system.entry.js → p-3200f52a.system.entry.js} +1 -1
- package/dist/stzh-components/p-385dda6c.system.entry.js +1 -0
- package/dist/stzh-components/p-3ad67331.entry.js +1 -0
- package/dist/stzh-components/p-3e850dce.entry.js +1 -0
- package/dist/stzh-components/p-4704588f.system.entry.js +1 -0
- package/dist/stzh-components/{p-c26aec94.entry.js → p-4b369bac.entry.js} +1 -1
- package/dist/stzh-components/p-5011f10c.js +1 -0
- package/dist/stzh-components/{p-6267a327.system.js → p-5494f37d.system.js} +1 -1
- package/dist/stzh-components/p-557f07b5.system.entry.js +1 -0
- package/dist/stzh-components/p-5790eb4f.system.entry.js +1 -0
- package/dist/stzh-components/p-57a0f895.entry.js +1 -0
- package/dist/stzh-components/p-57f8596f.system.entry.js +1 -0
- package/dist/stzh-components/p-586a8b3f.entry.js +1 -0
- package/dist/stzh-components/p-63d94a57.system.entry.js +1 -0
- package/dist/stzh-components/{p-f37be5d7.entry.js → p-67c6f0f2.entry.js} +1 -1
- package/dist/stzh-components/{p-f59b3545.system.entry.js → p-6d009f56.system.entry.js} +1 -1
- package/dist/stzh-components/{p-213959b7.entry.js → p-76165227.entry.js} +1 -1
- package/dist/stzh-components/{p-3145cd2f.entry.js → p-7704b10b.entry.js} +1 -1
- package/dist/stzh-components/p-7941cf38.js +1 -0
- package/dist/stzh-components/{p-af63f1a4.entry.js → p-7b86c022.entry.js} +1 -1
- package/dist/stzh-components/p-7c26f80f.system.entry.js +1 -0
- package/dist/stzh-components/p-84b9f66f.system.entry.js +1 -0
- package/dist/stzh-components/p-853a1f92.entry.js +1 -0
- package/dist/stzh-components/p-8991d3bc.entry.js +1 -0
- package/dist/stzh-components/p-8fa2fb95.system.entry.js +1 -0
- package/dist/stzh-components/p-9072a490.system.entry.js +1 -0
- package/dist/stzh-components/p-912706bb.entry.js +1 -0
- package/dist/stzh-components/{p-68400ee7.entry.js → p-aae4655f.entry.js} +1 -1
- package/dist/stzh-components/p-ac1a6085.system.entry.js +1 -0
- package/dist/stzh-components/{p-a17754c7.system.entry.js → p-afedafa6.system.entry.js} +1 -1
- package/dist/stzh-components/{p-5c3c9ad4.entry.js → p-b3dc4913.entry.js} +1 -1
- package/dist/stzh-components/p-b937ae70.system.js +1 -0
- package/dist/stzh-components/p-c63aecaa.system.entry.js +1 -0
- package/dist/stzh-components/p-c87e12de.system.entry.js +1 -0
- package/dist/stzh-components/p-cfd22a5e.system.entry.js +1 -0
- package/dist/stzh-components/p-d240494d.entry.js +1 -0
- package/dist/stzh-components/p-d6ec20c8.system.entry.js +1 -0
- package/dist/stzh-components/{p-af0ab448.system.entry.js → p-d9bf09b1.system.entry.js} +1 -1
- package/dist/stzh-components/p-e016ceb9.entry.js +1 -0
- package/dist/stzh-components/{p-4c7e52aa.entry.js → p-e0f063ac.entry.js} +1 -1
- package/dist/stzh-components/{p-0b9dc96d.system.js → p-e32bc982.system.js} +1 -1
- package/dist/stzh-components/p-ea9ca52b.entry.js +1 -0
- package/dist/stzh-components/{p-34b45788.entry.js → p-ec7b6ce8.entry.js} +1 -1
- package/dist/stzh-components/p-ef3da23b.entry.js +1 -0
- package/dist/stzh-components/{p-3848d8ee.entry.js → p-f133eba2.entry.js} +1 -1
- package/dist/stzh-components/p-fdb906b9.system.entry.js +1 -0
- package/dist/stzh-components/{p-f5db6234.entry.js → p-fee6a938.entry.js} +1 -1
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.js +1 -1
- package/dist/types/components/stzh-datamessagelist-item/stzh-datamessagelist-item.localization.d.ts +1 -0
- package/dist/types/components/stzh-popover/stzh-popover.localization.d.ts +1 -0
- package/dist/types/components/stzh-tooltip/stzh-tooltip.localization.d.ts +1 -0
- package/dist/types/components.d.ts +26 -2
- package/dist/types/index.d.ts +5 -0
- package/dist/vscode-data.json +13 -1
- package/package.json +1 -1
- package/dist/esm-es5/animation-utils-25c74e5b.js +0 -1
- package/dist/esm-es5/app-globals-17c2ba8d.js +0 -1
- package/dist/stzh-components/p-02fd7470.entry.js +0 -1
- package/dist/stzh-components/p-04a45622.system.entry.js +0 -1
- package/dist/stzh-components/p-0b264a7a.entry.js +0 -1
- package/dist/stzh-components/p-1ca12032.system.entry.js +0 -1
- package/dist/stzh-components/p-1fe1169e.entry.js +0 -1
- package/dist/stzh-components/p-231e6e6a.system.entry.js +0 -1
- package/dist/stzh-components/p-2a5855f8.js +0 -1
- package/dist/stzh-components/p-31029226.entry.js +0 -1
- package/dist/stzh-components/p-311813bc.system.entry.js +0 -1
- package/dist/stzh-components/p-38f9cbf3.system.entry.js +0 -1
- package/dist/stzh-components/p-3905ca20.entry.js +0 -1
- package/dist/stzh-components/p-4228cd58.system.entry.js +0 -1
- package/dist/stzh-components/p-4bd7dafb.system.entry.js +0 -1
- package/dist/stzh-components/p-4cd9f5c7.system.entry.js +0 -1
- package/dist/stzh-components/p-55f6fa41.system.entry.js +0 -1
- package/dist/stzh-components/p-5b379647.system.entry.js +0 -1
- package/dist/stzh-components/p-65675e11.entry.js +0 -1
- package/dist/stzh-components/p-7684506e.system.entry.js +0 -1
- package/dist/stzh-components/p-7da446d5.js +0 -1
- package/dist/stzh-components/p-83830baa.system.entry.js +0 -1
- package/dist/stzh-components/p-84c86e4c.system.entry.js +0 -1
- package/dist/stzh-components/p-88cbd2c0.entry.js +0 -1
- package/dist/stzh-components/p-99f92c6d.system.entry.js +0 -1
- package/dist/stzh-components/p-a795868f.entry.js +0 -1
- package/dist/stzh-components/p-ab28e094.system.entry.js +0 -1
- package/dist/stzh-components/p-addc48e5.entry.js +0 -1
- package/dist/stzh-components/p-b0fe9349.entry.js +0 -1
- package/dist/stzh-components/p-c065387a.entry.js +0 -1
- package/dist/stzh-components/p-c42435be.entry.js +0 -1
- package/dist/stzh-components/p-cfc0bc2e.system.entry.js +0 -1
- package/dist/stzh-components/p-d1d5825d.entry.js +0 -1
- package/dist/stzh-components/p-d4405931.system.entry.js +0 -1
- package/dist/stzh-components/p-dce19efd.entry.js +0 -1
- package/dist/stzh-components/p-e2e54f09.system.js +0 -1
- package/dist/stzh-components/p-e71cd5cd.system.entry.js +0 -1
- package/dist/stzh-components/p-e72ca013.system.entry.js +0 -1
- package/dist/stzh-components/p-e812d35e.system.entry.js +0 -1
- package/dist/stzh-components/p-f792fc8f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function s(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function n(t){try{p(r.next(t))}catch(e){i(e)}}function a(t){try{p(r["throw"](t))}catch(e){i(e)}}function p(t){t.done?o(t.value):s(t.value).then(n,a)}p((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(t){return function(e){return p([t,e])}}function p(n){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,s&&(i=n[0]&2?s["return"]:n[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,n[1])).done)return i;if(s=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;s=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){o.label=n[1];break}if(n[0]===6&&o.label<i[1]){o.label=i[1];i=n;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(n);break}if(i[2])o.ops.pop();o.trys.pop();continue}n=e.call(t,o)}catch(a){n=[6,a];s=0}finally{r=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,a as Host,g as getElement}from"./index-011c84fe.js";import{c as computePosition,a as autoUpdate,A as Arrow,o as offset,f as flip,s as shift,b as arrow}from"./arrow-86a679c7.js";import{c as createFocusTrap}from"./focus-trap.esm-074705a3.js";import{i as isStzhElement}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{m as media}from"./media-utils-9b041ceb.js";import{w as waitForEvent}from"./event-utils-7a709e21.js";import{s as stopAnimations,a as animateTo}from"./animation-utils-25c74e5b.js";var stzhPopoverCss=".sc-stzh-popover-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-popover-h{display:none}.sc-stzh-popover-h *.sc-stzh-popover,.sc-stzh-popover-h *.sc-stzh-popover::before,.sc-stzh-popover-h *.sc-stzh-popover::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-popover-h{--width:var(--stzh-popover-width);--min-width:var(--stzh-popover-min-width);--max-width:var(--stzh-popover-max-width);--padding:0;--border-radius:var(--stzh-popover-border-radius)}[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);--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{--padding:var(--stzh-tooltip-padding)}}.stzh-popover__arrow.sc-stzh-popover{position:absolute;display:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.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;-webkit-transform:translateY(-0.5rem);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;-webkit-transform:translateY(0.5rem) rotate(180deg);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;-webkit-transform:translateX(0.75rem) rotate(90deg);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;-webkit-transform:translateX(-0.75rem) rotate(-90deg);transform:translateX(-0.75rem) rotate(-90deg)}@media screen and (max-width: 599px){.stzh-popover__content-wrapper.sc-stzh-popover{z-index:var(--stzh-z-index-dialog);display:-ms-flexbox;display:flex;position:fixed;top:0;left:0;width:100%;height:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:stretch;justify-content:stretch}}@media screen and (max-width: 599px){.stzh-popover__backdrop.sc-stzh-popover{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;text-align:center;background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));opacity:0.8}}@media screen and (max-width: 599px){.stzh-popover__content.sc-stzh-popover{z-index:2;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-positive:1;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(--stzh-color-white);-ms-touch-action:none;touch-action:none;outline:none;border-bottom:0.125rem solid var(--stzh-color-grey13)}@media screen and (min-width: 600px){.stzh-popover__dialog.sc-stzh-popover{z-index:var(--stzh-z-index-popover);position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);left:auto;right:auto;bottom:auto;border-radius:var(--border-radius);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border:none}}.stzh-popover__content-inner.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-popover__content-slot.sc-stzh-popover{padding:var(--padding)}.stzh-popover__action-slot.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.stzh-popover__action-slot.sc-stzh-popover:not(:empty){margin:var(--stzh-space-xsmall) var(--stzh-space-small);margin-bottom:var(--stzh-space-medium)}.stzh-popover__label-wrapper.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-align:center;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-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:normal;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: 1024px){.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{cursor:pointer;display:-ms-flexbox;display:flex;-webkit-appearance:none;-moz-appearance:none;appearance:none;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:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.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{-webkit-box-shadow:0 0 0 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue));box-shadow:0 0 0 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue))}@media screen and (min-width: 600px){.stzh-popover--default.sc-stzh-popover .stzh-popover__close.sc-stzh-popover{position:absolute;top:0;right:0;-webkit-transform:translate(30%, -30%);transform:translate(30%, -30%);background-color:var(--stzh-color-grey5)}.stzh-popover--default.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__close.sc-stzh-popover{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background-color:transparent;padding:0;position:absolute;top:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-xxxsmall);color:var(--stzh-base-lead-color);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-xxsmall)}}@media screen and (min-width: 600px){@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__dialog.sc-stzh-popover{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}}.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__content-slot.sc-stzh-popover{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}";var ANIMATION_SHOW_DURATION=200;var ANIMATION_HIDE_DURATION=300;var ANIMATION_SHOW_DURATION_SMALL=100;var ANIMATION_HIDE_DURATION_SMALL=200;function animationContentWrapperShow(){var t=media("small").matches;return{keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:t?ANIMATION_SHOW_DURATION_SMALL:ANIMATION_SHOW_DURATION,easing:"linear"}}}function animationContentWrapperHide(){var t=media("small").matches;return{keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:t?ANIMATION_HIDE_DURATION_SMALL:ANIMATION_HIDE_DURATION,easing:"linear"}}}function animationDialogShow(){var t=media("small").matches;return{keyframes:[{transform:t?"translateY(-8px)":"translateY(100%)"},{transform:"translateY(0px)"}],options:{duration:t?ANIMATION_SHOW_DURATION_SMALL:ANIMATION_SHOW_DURATION,easing:"linear"}}}function animationDialogHide(){var t=media("small").matches;return{keyframes:[{transform:"translateY(0px)"},{transform:t?"translateY(-8px)":"translateY(100%)"}],options:{duration:t?ANIMATION_HIDE_DURATION_SMALL:ANIMATION_HIDE_DURATION,easing:"linear"}}}var keyCode={ESC:27};var CLASS_BODY_OPEN="stzh-popover-open";var popoverCounter=0;var StzhPopover=function(){function t(t){var e=this;registerInstance(this,t);this.stzhOpen=createEvent(this,"stzhOpen",7);this.stzhOpened=createEvent(this,"stzhOpened",7);this.stzhClose=createEvent(this,"stzhClose",7);this.stzhClosed=createEvent(this,"stzhClosed",7);this.initialTouchX=null;this.initialTouchY=null;this.handleKeydown=function(t){if(t.keyCode===keyCode.ESC){e.hide()}};this.onClickTrigger=function(){e.toggle()};this.computePosition=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,o,r,s,i,n,a,p,h;return __generator(this,(function(l){switch(l.label){case 0:if(!media("small").matches)return[3,2];t=[offset({mainAxis:this.distance,crossAxis:this.skidding}),flip({padding:5}),shift({padding:5})];if(this.variant==="tooltip"){t.push(arrow({element:this.arrowElement,padding:5}))}return[4,computePosition(this.element,this.dialogElement,{strategy:this.strategy,placement:this.placement,middleware:t})];case 1:e=l.sent(),o=e.x,r=o===void 0?0:o,s=e.y,i=s===void 0?0:s,n=e.strategy,a=n===void 0?"absolute":n,p=e.placement,h=e.middlewareData;this.computedPlacement=p;Object.assign(this.dialogElement.style,{position:a,left:"".concat(r,"px"),top:"".concat(i,"px")});if(this.variant==="tooltip"){Object.assign(this.arrowElement.style,{left:r!=null?"".concat(h.arrow.x,"px"):"",top:i!=null?"".concat(h.arrow.y,"px"):""})}return[3,3];case 2:Object.assign(this.dialogElement.style,{position:null,left:null,top:null});if(this.variant==="tooltip"){Object.assign(this.arrowElement.style,{left:null,top:null})}l.label=3;case 3:return[2]}}))}))};this.handleTouchStart=function(t){var o=t.changedTouches[0];e.initialTouchX=o.pageX;e.initialTouchY=o.pageY};this.handleTouchEnd=function(t){var o=t.changedTouches[0];var r=o.pageX-e.initialTouchX;var s=o.pageY-e.initialTouchY;var i=70;var n=Math.abs(s)>=i&&Math.abs(r)<=i;if(n){e.hide()}e.initialTouchY=null;e.initialTouchX=null};this.open=false;this.placement="bottom";this.variant="default";this.skidding=0;this.distance=undefined;this.label="";this.strategy="absolute";this.localization=undefined;this.computedPlacement=undefined}t.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.open){return[2]}this.toggledByMethod=true;this.open=true;return[2,waitForEvent(this.element,"stzhOpened")]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.open){return[2]}this.toggledByMethod=true;this.open=false;return[2,waitForEvent(this.element,"stzhClosed")]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.open)return[3,2];return[4,this.hide()];case 1:return[2,t.sent()];case 2:return[4,this.show()];case 3:return[2,t.sent()]}}))}))};t.prototype.update=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.computePosition()];case 1:return[2,t.sent()]}}))}))};t.prototype.handleOutsideClick=function(t){if(!this.open){return}var e=t.target!==this.dialogElement&&this.dialogElement.contains(t.target)===false;var o=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(e&&!o){this.hide()}};t.prototype.openWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o,r,s;return __generator(this,(function(i){switch(i.label){case 0:if(!t)return[3,3];if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-popover"})}e=animationContentWrapperShow();o=animationDialogShow();return[4,Promise.all([stopAnimations(this.contentWrapperElement),stopAnimations(this.contentElement),stopAnimations(this.dialogElement)])];case 1:i.sent();this.dialogElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentWrapperElement.hidden=false;return[4,Promise.all([animateTo(this.contentWrapperElement,e.keyframes,e.options),animateTo(media("small").matches?this.dialogElement:this.contentElement,o.keyframes,o.options)])];case 2:i.sent();if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-popover"})}return[3,6];case 3:if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-popover"})}r=animationContentWrapperHide();s=animationDialogHide();return[4,Promise.all([stopAnimations(this.contentWrapperElement),stopAnimations(this.contentElement),stopAnimations(this.dialogElement)])];case 4:i.sent();return[4,Promise.all([animateTo(this.contentWrapperElement,r.keyframes,r.options),animateTo(media("small").matches?this.dialogElement:this.contentElement,s.keyframes,s.options)])];case 5:i.sent();this.contentWrapperElement.hidden=true;this.dialogElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-popover"})}i.label=6;case 6:this.toggledByMethod=false;return[2]}}))}))};t.prototype.distanceWatcher=function(t){if(typeof t==="number"){this.distance=t}else{this.distance=this.variant==="tooltip"?16:8}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.labelId="stzh-popover-label-".concat(popoverCounter++);this.distanceWatcher(this.distance);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"popover")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.popoverShown=function(){document.body.classList.add(CLASS_BODY_OPEN);var t=isStzhElement(this.triggerElement.firstElementChild);this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded","true");if(this.trap){this.trap.activate()}};t.prototype.popoverHidden=function(){document.body.classList.remove(CLASS_BODY_OPEN);var t=isStzhElement(this.triggerElement.firstElementChild);this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded","false");if(this.trap){this.trap.deactivate()}};t.prototype.componentDidRender=function(){this.computePosition();this.open?this.popoverShown():this.popoverHidden()};t.prototype.componentDidUpdate=function(){this.trap.updateContainerElements(this.dialogElement)};t.prototype.componentDidLoad=function(){this.autoUpdateCleanup=autoUpdate(this.element,this.dialogElement,this.computePosition);this.contentWrapperElement.hidden=!this.open;this.trap=createFocusTrap(this.dialogElement,{fallbackFocus:this.dialogElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true});if(this.open){this.popoverShown()}};t.prototype.connectedCallback=function(){var t;var e=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!e){var o=Array.from(this.element.children).find((function(t){return!t.hasAttribute("slot")}));e=o}if(e){e.addEventListener("click",this.onClickTrigger)}};t.prototype.disconnectedCallback=function(){if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerElement&&this.triggerElement.firstElementChild){this.triggerElement.firstElementChild.removeEventListener("click",this.onClickTrigger)}};t.prototype.render=function(){var t;var e=this;var o=(t={"stzh-popover":true},t["stzh-popover--open"]=this.open,t["stzh-popover--placement-".concat(this.computedPlacement)]=!!this.computedPlacement,t["stzh-popover--".concat(this.variant)]=!!this.variant,t);return h(Host,null,h("div",{class:o,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},h("div",{ref:function(t){return e.triggerElement=t},class:"stzh-popover__trigger"},h("slot",null)),h("div",{ref:function(t){return e.contentWrapperElement=t},class:"stzh-popover__content-wrapper"},h("div",{class:"stzh-popover__backdrop"}),h("div",{ref:function(t){return e.contentElement=t},class:"stzh-popover__content"},h("div",{ref:function(t){return e.dialogElement=t},class:"stzh-popover__dialog",role:"dialog",tabindex:"-1","aria-modal":"true","aria-labelledby":this.label?this.labelId:null,"aria-hidden":this.open?"false":"true",onKeyDown:this.handleKeydown},this.variant==="tooltip"&&h("div",{class:"stzh-popover__arrow",ref:function(t){return e.arrowElement=t},innerHTML:Arrow}),h("div",{class:"stzh-popover__content-inner"},h("div",{class:"stzh-popover__content-slot"},h("slot",{name:"content"}),h("div",{class:"stzh-popover__action-slot"},h("slot",{name:"action"}))),h("div",{class:"stzh-popover__label-wrapper"},h("h2",{id:this.labelId,class:"stzh-popover__label"},this.label?this.label:h("slot",{name:"label"})),h("button",{class:"stzh-popover__close",onClick:function(){return e.hide()},type:"button"},h("stzh-icon",{name:"close",class:"stzh-popover__icon"}),h("span",{class:"stzh-popover__vhidden"},this.localization.close)))))))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["openWatcher"],distance:["distanceWatcher"]}},enumerable:false,configurable:true});return t}();StzhPopover.style=stzhPopoverCss;export{StzhPopover as stzh_popover};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function i(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function n(t){try{p(r.next(t))}catch(e){s(e)}}function a(t){try{p(r["throw"](t))}catch(e){s(e)}}function p(t){t.done?o(t.value):i(t.value).then(n,a)}p((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(t){return function(e){return p([t,e])}}function p(n){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,i&&(s=n[0]&2?i["return"]:n[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;if(i=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(n[0]===6&&o.label<s[1]){o.label=s[1];s=n;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(n);break}if(s[2])o.ops.pop();o.trys.pop();continue}n=e.call(t,o)}catch(a){n=[6,a];i=0}finally{r=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,a as Host,g as getElement}from"./index-011c84fe.js";import{c as computePosition,a as autoUpdate,A as Arrow,o as offset,f as flip,s as shift,b as arrow}from"./arrow-86a679c7.js";import{c as createFocusTrap}from"./focus-trap.esm-074705a3.js";import{i as isStzhElement}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{m as media}from"./media-utils-9b041ceb.js";import{w as waitForEvent}from"./event-utils-7a709e21.js";import{s as stopAnimations,a as animateTo}from"./animation-utils-e234a5f8.js";var stzhPopoverCss=".sc-stzh-popover-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-popover-h{display:none}.sc-stzh-popover-h *.sc-stzh-popover,.sc-stzh-popover-h *.sc-stzh-popover::before,.sc-stzh-popover-h *.sc-stzh-popover::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-popover-h{--width:var(--stzh-popover-width);--min-width:var(--stzh-popover-min-width);--max-width:var(--stzh-popover-max-width);--padding:0;--border-radius:var(--stzh-popover-border-radius)}[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);--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{--padding:var(--stzh-tooltip-padding)}}.stzh-popover__arrow.sc-stzh-popover{position:absolute;display:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.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;-webkit-transform:translateY(-0.5rem);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;-webkit-transform:translateY(0.5rem) rotate(180deg);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;-webkit-transform:translateX(0.75rem) rotate(90deg);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;-webkit-transform:translateX(-0.75rem) rotate(-90deg);transform:translateX(-0.75rem) rotate(-90deg)}@media screen and (max-width: 599px){.stzh-popover__content-wrapper.sc-stzh-popover{z-index:var(--stzh-z-index-dialog);display:-ms-flexbox;display:flex;position:fixed;top:0;left:0;width:100%;height:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:stretch;justify-content:stretch}}@media screen and (max-width: 599px){.stzh-popover__backdrop.sc-stzh-popover{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;text-align:center;background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));opacity:0.8}}@media screen and (max-width: 599px){.stzh-popover__content.sc-stzh-popover{z-index:2;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-positive:1;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(--stzh-color-white);-ms-touch-action:none;touch-action:none;outline:none;border-bottom:0.125rem solid var(--stzh-color-grey13)}@media screen and (min-width: 600px){.stzh-popover__dialog.sc-stzh-popover{z-index:var(--stzh-z-index-popover);position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);left:auto;right:auto;bottom:auto;border-radius:var(--border-radius);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border:none}}.stzh-popover__content-inner.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-popover__content-slot.sc-stzh-popover{padding:var(--padding)}.stzh-popover__action-slot.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.stzh-popover__action-slot.sc-stzh-popover:not(:empty){margin:var(--stzh-space-xsmall) var(--stzh-space-small);margin-bottom:var(--stzh-space-medium)}.stzh-popover__label-wrapper.sc-stzh-popover{display:-ms-flexbox;display:flex;-ms-flex-align:center;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-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:normal;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: 1024px){.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{cursor:pointer;display:-ms-flexbox;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:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.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{-webkit-box-shadow:0 0 0 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue));box-shadow:0 0 0 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue))}@media screen and (min-width: 600px){.stzh-popover--default.sc-stzh-popover .stzh-popover__close.sc-stzh-popover{position:absolute;top:0;right:0;-webkit-transform:translate(30%, -30%);transform:translate(30%, -30%);background-color:var(--stzh-color-grey5)}.stzh-popover--default.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__close.sc-stzh-popover{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;padding:0;position:absolute;top:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-xxxsmall);color:var(--stzh-base-lead-color);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-xxsmall)}}@media screen and (min-width: 600px){@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__dialog.sc-stzh-popover{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}}.stzh-popover--tooltip.sc-stzh-popover .stzh-popover__content-slot.sc-stzh-popover{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}";var ANIMATION_SHOW_DURATION=200;var ANIMATION_HIDE_DURATION=300;var ANIMATION_SHOW_DURATION_SMALL=100;var ANIMATION_HIDE_DURATION_SMALL=200;function animationContentWrapperShow(){var t=media("small").matches;return{keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:t?ANIMATION_SHOW_DURATION_SMALL:ANIMATION_SHOW_DURATION,easing:"linear"}}}function animationContentWrapperHide(){var t=media("small").matches;return{keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:t?ANIMATION_HIDE_DURATION_SMALL:ANIMATION_HIDE_DURATION,easing:"linear"}}}function animationDialogShow(){var t=media("small").matches;return{keyframes:[{transform:t?"translateY(-8px)":"translateY(100%)"},{transform:"translateY(0px)"}],options:{duration:t?ANIMATION_SHOW_DURATION_SMALL:ANIMATION_SHOW_DURATION,easing:"linear"}}}function animationDialogHide(){var t=media("small").matches;return{keyframes:[{transform:"translateY(0px)"},{transform:t?"translateY(-8px)":"translateY(100%)"}],options:{duration:t?ANIMATION_HIDE_DURATION_SMALL:ANIMATION_HIDE_DURATION,easing:"linear"}}}var keyCode={ESC:27};var CLASS_BODY_OPEN="stzh-popover-open";var popoverCounter=0;var StzhPopover=function(){function t(t){var e=this;registerInstance(this,t);this.stzhOpen=createEvent(this,"stzhOpen",7);this.stzhOpened=createEvent(this,"stzhOpened",7);this.stzhClose=createEvent(this,"stzhClose",7);this.stzhClosed=createEvent(this,"stzhClosed",7);this.initialTouchX=null;this.initialTouchY=null;this.handleKeydown=function(t){if(t.keyCode===keyCode.ESC){e.hide()}};this.onClickTrigger=function(){e.toggle()};this.computePosition=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,o,r,i,s,n,a,p,l;return __generator(this,(function(h){switch(h.label){case 0:if(!media("small").matches)return[3,2];t=[offset({mainAxis:this.distance,crossAxis:this.skidding}),flip({padding:5}),shift({padding:5})];if(this.variant==="tooltip"){t.push(arrow({element:this.arrowElement,padding:5}))}return[4,computePosition(this.element,this.dialogElement,{strategy:this.strategy,placement:this.placement,middleware:t})];case 1:e=h.sent(),o=e.x,r=o===void 0?0:o,i=e.y,s=i===void 0?0:i,n=e.strategy,a=n===void 0?"absolute":n,p=e.placement,l=e.middlewareData;this.computedPlacement=p;Object.assign(this.dialogElement.style,{position:a,left:"".concat(r,"px"),top:"".concat(s,"px")});if(this.variant==="tooltip"){Object.assign(this.arrowElement.style,{left:r!=null?"".concat(l.arrow.x,"px"):"",top:s!=null?"".concat(l.arrow.y,"px"):""})}return[3,3];case 2:Object.assign(this.dialogElement.style,{position:null,left:null,top:null});if(this.variant==="tooltip"){Object.assign(this.arrowElement.style,{left:null,top:null})}h.label=3;case 3:return[2]}}))}))};this.handleTouchStart=function(t){var o=t.changedTouches[0];e.initialTouchX=o.pageX;e.initialTouchY=o.pageY};this.handleTouchEnd=function(t){var o=t.changedTouches[0];var r=o.pageX-e.initialTouchX;var i=o.pageY-e.initialTouchY;var s=70;var n=Math.abs(i)>=s&&Math.abs(r)<=s;if(n){e.hide()}e.initialTouchY=null;e.initialTouchX=null};this.open=false;this.placement="bottom";this.variant="default";this.skidding=0;this.distance=undefined;this.label="";this.strategy="absolute";this.localization=undefined;this.computedPlacement=undefined}t.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.open){return[2]}this.toggledByMethod=true;this.open=true;return[2,waitForEvent(this.element,"stzhOpened")]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.open){return[2]}this.toggledByMethod=true;this.open=false;return[2,waitForEvent(this.element,"stzhClosed")]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.open)return[3,2];return[4,this.hide()];case 1:return[2,t.sent()];case 2:return[4,this.show()];case 3:return[2,t.sent()]}}))}))};t.prototype.update=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.computePosition()];case 1:return[2,t.sent()]}}))}))};t.prototype.handleOutsideClick=function(t){if(!this.open){return}var e=t.target!==this.dialogElement&&this.dialogElement.contains(t.target)===false;var o=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(e&&!o){this.hide()}};t.prototype.openWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o,r,i;return __generator(this,(function(s){switch(s.label){case 0:if(!this.dialogElement){return[2]}if(!t)return[3,3];if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-popover"})}e=animationContentWrapperShow();o=animationDialogShow();return[4,Promise.all([stopAnimations(this.contentWrapperElement),stopAnimations(this.contentElement),stopAnimations(this.dialogElement)])];case 1:s.sent();this.dialogElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentWrapperElement.hidden=false;return[4,Promise.all([animateTo(this.contentWrapperElement,e.keyframes,e.options),animateTo(media("small").matches?this.dialogElement:this.contentElement,o.keyframes,o.options)])];case 2:s.sent();if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-popover"})}return[3,6];case 3:if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-popover"})}r=animationContentWrapperHide();i=animationDialogHide();return[4,Promise.all([stopAnimations(this.contentWrapperElement),stopAnimations(this.contentElement),stopAnimations(this.dialogElement)])];case 4:s.sent();return[4,Promise.all([animateTo(this.contentWrapperElement,r.keyframes,r.options),animateTo(media("small").matches?this.dialogElement:this.contentElement,i.keyframes,i.options)])];case 5:s.sent();this.contentWrapperElement.hidden=true;this.dialogElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-popover"})}s.label=6;case 6:this.toggledByMethod=false;return[2]}}))}))};t.prototype.distanceWatcher=function(t){if(typeof t==="number"){this.distance=t}else{this.distance=this.variant==="tooltip"?16:8}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.id="stzh-popover-".concat(popoverCounter++);this.distanceWatcher(this.distance);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"popover")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.popoverShown=function(){document.body.classList.add(CLASS_BODY_OPEN);var t=isStzhElement(this.triggerElement.firstElementChild);this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded","true");if(this.trap){this.trap.activate()}};t.prototype.popoverHidden=function(){document.body.classList.remove(CLASS_BODY_OPEN);var t=isStzhElement(this.triggerElement.firstElementChild);this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded","false");if(this.trap){this.trap.deactivate()}};t.prototype.componentDidRender=function(){this.computePosition();this.open?this.popoverShown():this.popoverHidden();var t=isStzhElement(this.triggerElement.firstElementChild);if(t&&!this.triggerElement.firstElementChild.getAttribute("a11y-describedby")||this.triggerElement.firstElementChild.getAttribute("aria-describedby")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-describedby":"aria-describedby","".concat(this.id,"-trigger-description"))}if(t&&!this.triggerElement.firstElementChild.getAttribute("a11y-label")||this.triggerElement.firstElementChild.getAttribute("aria-label")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-label":"aria-label",this.label)}};t.prototype.componentDidUpdate=function(){this.trap.updateContainerElements(this.dialogElement)};t.prototype.componentDidLoad=function(){this.autoUpdateCleanup=autoUpdate(this.element,this.dialogElement,this.computePosition);this.contentWrapperElement.hidden=!this.open;this.trap=createFocusTrap(this.dialogElement,{fallbackFocus:this.dialogElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true});if(this.open){this.popoverShown()}};t.prototype.connectedCallback=function(){var t;var e=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!e){var o=Array.from(this.element.children).find((function(t){return!t.hasAttribute("slot")}));e=o}if(e){e.addEventListener("click",this.onClickTrigger)}};t.prototype.disconnectedCallback=function(){if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerElement&&this.triggerElement.firstElementChild){this.triggerElement.firstElementChild.removeEventListener("click",this.onClickTrigger)}};t.prototype.render=function(){var t;var e=this;var o=(t={"stzh-popover":true},t["stzh-popover--open"]=this.open,t["stzh-popover--placement-".concat(this.computedPlacement)]=!!this.computedPlacement,t["stzh-popover--".concat(this.variant)]=!!this.variant,t);return h(Host,null,h("div",{class:o,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},h("div",{ref:function(t){return e.triggerElement=t},class:"stzh-popover__trigger"},h("slot",null)),h("div",{class:"stzh-popover__vhidden",id:"".concat(this.id,"-trigger-description")},this.localization.open),h("div",{ref:function(t){return e.contentWrapperElement=t},class:"stzh-popover__content-wrapper"},h("div",{class:"stzh-popover__backdrop"}),h("div",{ref:function(t){return e.contentElement=t},class:"stzh-popover__content"},h("div",{ref:function(t){return e.dialogElement=t},class:"stzh-popover__dialog",role:"dialog",tabindex:"-1","aria-modal":"true","aria-labelledby":this.label?"".concat(this.id,"-label"):null,"aria-hidden":this.open?"false":"true",onKeyDown:this.handleKeydown},this.variant==="tooltip"&&h("div",{class:"stzh-popover__arrow",ref:function(t){return e.arrowElement=t},innerHTML:Arrow}),h("div",{class:"stzh-popover__content-inner"},h("div",{class:"stzh-popover__content-slot"},h("slot",{name:"content"}),h("div",{class:"stzh-popover__action-slot"},h("slot",{name:"action"}))),h("div",{class:"stzh-popover__label-wrapper"},h("h2",{id:"".concat(this.id,"-label"),class:"stzh-popover__label"},this.label?this.label:h("slot",{name:"label"})),h("button",{class:"stzh-popover__close",onClick:function(){return e.hide()},type:"button"},h("stzh-icon",{name:"close",class:"stzh-popover__icon"}),h("span",{class:"stzh-popover__vhidden"},this.localization.close)))))))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["openWatcher"],distance:["distanceWatcher"]}},enumerable:false,configurable:true});return t}();StzhPopover.style=stzhPopoverCss;export{StzhPopover as stzh_popover};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,F as Fragment,a as Host}from"./index-011c84fe.js";var stzhProgressbarItemCss='.sc-stzh-progressbar-item-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-progressbar-item-h{display:none}.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item,.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item::before,.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hide].sc-stzh-progressbar-item-h{display:none}.stzh-progressbar-item.sc-stzh-progressbar-item{text-align:center}.stzh-progressbar-item__button.sc-stzh-progressbar-item{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;cursor:pointer;border-radius:var(--stzh-form-input-border-radius)}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{background-color:var(--stzh-color-primary8)}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__label-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing);position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:2.1875rem;height:2.1875rem;background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-grey13);border-radius:1.3125rem;text-align:center;margin-bottom:var(--stzh-space-large);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--stzh-color-grey55);-webkit-transition-property:color, border-color;transition-property:color, border-color;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 1024px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}@media screen and (min-width: 600px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{width:2.625rem;height:2.625rem}}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:none;content:"";position:absolute;top:1rem;right:2.125rem;width:100vw;height:0.0625rem;background-color:var(--stzh-color-grey13);z-index:-2;overflow:hidden}@media screen and (min-width: 600px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:1.25rem;right:2.5625rem}}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item::after{content:"";z-index:0;position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:1.3125rem;-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed)}.stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-size:0.875rem;line-height:1.28;color:var(--stzh-color-grey55);padding:var(--stzh-space-xxsmall) var(--stzh-space-small);letter-spacing:0.01em;display:none;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-progressbar-item__label-block.sc-stzh-progressbar-item{display:block}}.stzh-progressbar-item__number.sc-stzh-progressbar-item,.stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{z-index:1}.stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{--size:var(--stzh-icon-size-xsmall);position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{--size:var(--stzh-icon-size-small);color:currentColor}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;top:0.1875rem;width:1.6875rem;height:1.6875rem;background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-grey13);border-radius:50%;cursor:pointer;-webkit-transition-property:color, border-color;transition-property:color, border-color;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus{border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover::after,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus::after{background-color:var(--stzh-color-primary8)}@media screen and (min-width: 600px){.stzh-progressbar-item__dotted.sc-stzh-progressbar-item{top:0.3125rem;width:1.9375rem;height:1.9375rem}}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before,.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:block}.stzh-progressbar-item--first.sc-stzh-progressbar-item{position:relative}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{right:calc((100% / var(--steps)) - (0.84375rem))}@media screen and (min-width: 600px){.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{right:calc((100% / var(--steps)) - (0.96875rem))}}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:transparent}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item:hover{text-decoration:none}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));border:solid 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue));color:var(--stzh-color-white)}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:block;background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));z-index:-1}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:var(--stzh-color-white)}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{background-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{margin-bottom:0}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{display:none}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item{padding-left:0;padding-right:0}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{position:relative;z-index:0;top:0.3125rem;width:1.6875rem;height:1.6875rem;border:none;background-color:transparent}@media screen and (min-width: 600px){.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{top:0.5rem;width:1.9375rem;height:1.9375rem}}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:0.75rem;right:1.625rem}@media screen and (min-width: 600px){.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:0.8125rem;right:1.875rem}}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{display:none}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{background-color:var(--stzh-color-white);z-index:1}';var StzhProgressbarItem=function(){function r(r){var s=this;registerInstance(this,r);this.stzhClick=createEvent(this,"stzhClick",7);this.stzhDottedClick=createEvent(this,"stzhDottedClick",7);this.onClick=function(r){s.stzhClick.emit({component:"stzh-progressbar-item",originalEvent:r})};this.onDottedClick=function(r){s.stzhDottedClick.emit({component:"stzh-progressbar-item",originalEvent:r})};this.first=false;this.last=false;this.passed=false;this.current=false;this.hide=false;this.dotted=false;this.step=1;this.icon=""}r.prototype.render=function(){var r={"stzh-progressbar-item":true,"stzh-progressbar-item--first":this.first,"stzh-progressbar-item--last":this.last,"stzh-progressbar-item--passed":this.passed,"stzh-progressbar-item--current":this.current,"stzh-progressbar-item--hide":this.hide,"stzh-progressbar-item--dotted":this.dotted,"stzh-progressbar-item--has-icon":!!this.icon};var s=h("button",{class:"stzh-progressbar-item__dotted",onClick:this.onDottedClick},h("stzh-icon",{class:"stzh-progressbar-item__dotted-icon",name:"more-horizontal"}));return h(Host,{role:"listitem"},h("div",{class:r},this.last&&this.dotted&&s,h("button",{class:"stzh-progressbar-item__button",disabled:this.dotted&&this.first,onClick:this.onClick},h("span",{class:"stzh-progressbar-item__number-block"},this.icon?h("stzh-icon",{class:"stzh-progressbar-item__user-icon",name:this.icon}):h(Fragment,null,h("span",{class:"stzh-progressbar-item__number"},this.step),this.passed&&h("stzh-icon",{class:"stzh-progressbar-item__icon",name:"checkmark"}))),h("span",{class:"stzh-progressbar-item__label-block"},h("slot",null))),this.first&&this.dotted&&s))};return r}();StzhProgressbarItem.style=stzhProgressbarItemCss;export{StzhProgressbarItem as stzh_progressbar_item};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,F as Fragment,a as Host}from"./index-011c84fe.js";var stzhProgressbarItemCss='.sc-stzh-progressbar-item-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-progressbar-item-h{display:none}.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item,.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item::before,.sc-stzh-progressbar-item-h *.sc-stzh-progressbar-item::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hide].sc-stzh-progressbar-item-h{display:none}.stzh-progressbar-item.sc-stzh-progressbar-item{text-align:center}.stzh-progressbar-item__button.sc-stzh-progressbar-item{-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;background-color:transparent;border:none;cursor:pointer;border-radius:var(--stzh-form-input-border-radius)}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:Highlight;border-color:Highlight}}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{background-color:var(--stzh-color-primary8)}.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__label-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__label-block.sc-stzh-progressbar-item,.stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{color:Highlight}}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing);position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:2.1875rem;height:2.1875rem;background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-grey13);border-radius:1.3125rem;text-align:center;margin-bottom:var(--stzh-space-large);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--stzh-color-grey55);-webkit-transition-property:color, border-color;transition-property:color, border-color;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 1024px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}@media screen and (min-width: 600px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item{width:2.625rem;height:2.625rem}}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:none;content:"";position:absolute;top:1rem;right:2.125rem;width:100vw;height:0.0625rem;background-color:var(--stzh-color-grey13);z-index:-2;overflow:hidden}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{background-color:CanvasText}}@media screen and (min-width: 600px){.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:1.25rem;right:2.5625rem}}.stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item::after{content:"";z-index:0;position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:1.3125rem;-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed)}.stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-size:0.875rem;line-height:1.28;color:var(--stzh-color-grey55);padding:var(--stzh-space-xxsmall) var(--stzh-space-small);letter-spacing:0.01em;display:none;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-progressbar-item__label-block.sc-stzh-progressbar-item{display:block}}.stzh-progressbar-item__number.sc-stzh-progressbar-item,.stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{z-index:1}.stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{--size:var(--stzh-icon-size-xsmall);position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{color:CanvasText}}.stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{--size:var(--stzh-icon-size-small);color:currentColor}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;position:absolute;top:0.1875rem;width:1.6875rem;height:1.6875rem;background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-grey13);border-radius:50%;cursor:pointer;-webkit-transition-property:color, border-color;transition-property:color, border-color;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus{border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus{border-color:Highlight}}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover::after,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus::after{background-color:var(--stzh-color-primary8)}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover::after,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus::after{background-color:Canvas}}@media screen and (min-width: 600px){.stzh-progressbar-item__dotted.sc-stzh-progressbar-item{top:0.3125rem;width:1.9375rem;height:1.9375rem}}.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:hover .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item,.stzh-progressbar-item__dotted.sc-stzh-progressbar-item:focus .stzh-progressbar-item__dotted-icon.sc-stzh-progressbar-item{color:Highlight}}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before,.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:block}.stzh-progressbar-item--first.sc-stzh-progressbar-item{position:relative}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{right:calc((100% / var(--steps)) - (0.84375rem))}@media screen and (min-width: 600px){.stzh-progressbar-item--last.sc-stzh-progressbar-item .stzh-progressbar-item__dotted.sc-stzh-progressbar-item{right:calc((100% / var(--steps)) - (0.96875rem))}}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{background-color:var(--stzh-color-white);border:solid 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{background-color:Canvas;border-color:CanvasText}}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{border-color:Highlight}}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:transparent}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:Canvas}}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item--passed.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:Highlight}}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{color:SelectedItem}}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item:hover{text-decoration:none}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));border:solid 0.0625rem var(--stzh-color-primary, var(--stzh-color-zueriblue));color:var(--stzh-color-white)}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:SelectedItem;border-color:SelectedItem;background-color:Canvas}}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{display:block;background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));z-index:-1}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{background-color:CanvasText}}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:var(--stzh-color-white)}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{color:Highlight}}.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{background-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{background-color:Canvas}}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:SelectedItem}}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__icon.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:hover .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item,.stzh-progressbar-item--current.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item:focus .stzh-progressbar-item__user-icon.sc-stzh-progressbar-item{color:Highlight}}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{margin-bottom:0}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::after{display:none}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__button.sc-stzh-progressbar-item{padding-left:0;padding-right:0}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{position:relative;z-index:0;top:0.3125rem;width:1.6875rem;height:1.6875rem;border:none;background-color:transparent}@media screen and (min-width: 600px){.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item{top:0.5rem;width:1.9375rem;height:1.9375rem}}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:0.75rem;right:1.625rem}@media screen and (min-width: 600px){.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{top:0.8125rem;right:1.875rem}}.stzh-progressbar-item--dotted.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__label-block.sc-stzh-progressbar-item{display:none}.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{background-color:var(--stzh-color-white);z-index:1}@media (forced-colors: active), (-ms-high-contrast: active){.stzh-progressbar-item--first.sc-stzh-progressbar-item .stzh-progressbar-item__number-block.sc-stzh-progressbar-item::before{background-color:Canvas}}';var StzhProgressbarItem=function(){function r(r){var s=this;registerInstance(this,r);this.stzhClick=createEvent(this,"stzhClick",7);this.stzhDottedClick=createEvent(this,"stzhDottedClick",7);this.onClick=function(r){s.stzhClick.emit({component:"stzh-progressbar-item",originalEvent:r})};this.onDottedClick=function(r){s.stzhDottedClick.emit({component:"stzh-progressbar-item",originalEvent:r})};this.first=false;this.last=false;this.passed=false;this.current=false;this.hide=false;this.dotted=false;this.step=1;this.icon=""}r.prototype.render=function(){var r={"stzh-progressbar-item":true,"stzh-progressbar-item--first":this.first,"stzh-progressbar-item--last":this.last,"stzh-progressbar-item--passed":this.passed,"stzh-progressbar-item--current":this.current,"stzh-progressbar-item--hide":this.hide,"stzh-progressbar-item--dotted":this.dotted,"stzh-progressbar-item--has-icon":!!this.icon};var s=h("button",{class:"stzh-progressbar-item__dotted",onClick:this.onDottedClick},h("stzh-icon",{class:"stzh-progressbar-item__dotted-icon",name:"more-horizontal"}));return h(Host,{role:"listitem"},h("div",{class:r},this.last&&this.dotted&&s,h("button",{class:"stzh-progressbar-item__button",disabled:this.dotted&&this.first,onClick:this.onClick},h("span",{class:"stzh-progressbar-item__number-block"},this.icon?h("stzh-icon",{class:"stzh-progressbar-item__user-icon",name:this.icon}):h(Fragment,null,h("span",{class:"stzh-progressbar-item__number"},this.step),this.passed&&h("stzh-icon",{class:"stzh-progressbar-item__icon",name:"checkmark"}))),h("span",{class:"stzh-progressbar-item__label-block"},h("slot",null))),this.first&&this.dotted&&s))};return r}();StzhProgressbarItem.style=stzhProgressbarItemCss;export{StzhProgressbarItem as stzh_progressbar_item};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,a as Host,g as getElement}from"./index-011c84fe.js";import{h as hasSlot}from"./utils-92a77db5.js";var stzhTextandimageCss='@charset "UTF-8";:host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 600px){:host{--col-left-width:50%}}@media screen and (min-width: 1260px){:host{--col-left-width:45%}}@media screen and (min-width: 1260px){:host([size=small]){--col-left-width:33%}}@media screen and (min-width: 1260px){:host([size=large]){--col-left-width:55%}}:host ::slotted([slot=left]){margin-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 600px){:host ::slotted([slot=left]){margin-bottom:0}}:host([floating]:not([floating=false])) ::slotted([slot=left]){float:left;width:100%}@media screen and (min-width: 600px){:host([floating]:not([floating=false])) ::slotted([slot=left]){width:calc(var(--col-left-width) - var(--stzh-space-large) / 2);margin-right:var(--stzh-space-large)}}.stzh-textandimage{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start;margin:0 calc(var(--stzh-space-large) / -2);}.stzh-textandimage__left,.stzh-textandimage__right{width:auto;padding:0 calc(var(--stzh-space-large) / 2)}@media screen and (min-width: 600px){.stzh-textandimage__left{width:var(--col-left-width)}}@media screen and (min-width: 600px){.stzh-textandimage__right{width:calc(100% - var(--col-left-width))}}.stzh-textandimage--is-floating .stzh-textandimage__left{width:auto}';var StzhTextandimage=function(){function t(t){registerInstance(this,t);this.floating=false;this.size="default"}t.prototype.render=function(){var t;var e=hasSlot(this.element,"left");var a=hasSlot(this.element,"right");var i=(t={"stzh-textandimage":true,"stzh-textandimage--has-left":e,"stzh-textandimage--has-right":a,"stzh-textandimage--is-floating":this.floating},t["stzh-textandimage--size-".concat(this.size)]=!!this.size,t);return h(Host,null,h("div",{class:i},h("div",{class:"stzh-textandimage__left"},h("slot",{name:"left"}),this.floating&&h("slot",{name:"right"})),!this.floating&&h("div",{class:"stzh-textandimage__right"},h("slot",{name:"right"}))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();StzhTextandimage.style=stzhTextandimageCss;export{StzhTextandimage as stzh_textandimage};
|
|
1
|
+
import{r as registerInstance,h,a as Host,g as getElement}from"./index-011c84fe.js";import{h as hasSlot}from"./utils-92a77db5.js";var stzhTextandimageCss='@charset "UTF-8";:host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 600px){:host{--col-left-width:50%}}@media screen and (min-width: 1260px){:host{--col-left-width:45%}}@media screen and (min-width: 1260px){:host([size=small]){--col-left-width:33%}}@media screen and (min-width: 1260px){:host([size=large]){--col-left-width:55%}}@media screen and (min-width: 600px){:host([floating]:not([floating=false])){--col-left-width:45%}}@media screen and (min-width: 600px){:host([size=small][floating]:not([floating=false])){--col-left-width:33%}}@media screen and (min-width: 600px){:host([size=large][floating]:not([floating=false])){--col-left-width:55%}}:host ::slotted([slot=left]){margin-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 600px){:host ::slotted([slot=left]){margin-bottom:0}}:host([fullwidth]:not([fullwidth=false])) ::slotted([slot=left]){margin-bottom:var(--stzh-space-xxlarge)}@media screen and (min-width: 1024px){:host([fullwidth]:not([fullwidth=false])) ::slotted([slot=left]){margin-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){:host([fullwidth]:not([fullwidth=false])) ::slotted([slot=left]){margin-bottom:var(--stzh-space-xxxxlarge)}}:host([floating]:not([floating=false]):not([fullwidth]:not([fullwidth=false]))) ::slotted([slot=left]){float:left;width:100%}@media screen and (min-width: 600px){:host([floating]:not([floating=false]):not([fullwidth]:not([fullwidth=false]))) ::slotted([slot=left]){width:calc(var(--col-left-width) - var(--stzh-space-large) / 2);margin-right:var(--stzh-space-large)}}.stzh-textandimage{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start;margin:0 calc(var(--stzh-space-large) / -2);}.stzh-textandimage__left,.stzh-textandimage__right{width:auto;padding:0 calc(var(--stzh-space-large) / 2)}@media screen and (min-width: 600px){.stzh-textandimage__left{width:var(--col-left-width)}}@media screen and (min-width: 600px){.stzh-textandimage__right{width:calc(100% - var(--col-left-width))}}.stzh-textandimage--is-fullwidth .stzh-textandimage__left,.stzh-textandimage--is-fullwidth .stzh-textandimage__right{width:100%}.stzh-textandimage--is-floating .stzh-textandimage__left{width:auto}';var StzhTextandimage=function(){function t(t){registerInstance(this,t);this.floating=false;this.fullwidth=false;this.size="default"}t.prototype.render=function(){var t;var e=hasSlot(this.element,"left");var a=hasSlot(this.element,"right");var i=(t={"stzh-textandimage":true,"stzh-textandimage--has-left":e,"stzh-textandimage--has-right":a,"stzh-textandimage--is-fullwidth":this.fullwidth,"stzh-textandimage--is-floating":this.floating},t["stzh-textandimage--size-".concat(this.size)]=!!this.size,t);return h(Host,null,h("div",{class:i},h("div",{class:"stzh-textandimage__left"},h("slot",{name:"left"}),this.floating&&h("slot",{name:"right"})),!this.floating&&h("div",{class:"stzh-textandimage__right"},h("slot",{name:"right"}))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();StzhTextandimage.style=stzhTextandimageCss;export{StzhTextandimage as stzh_textandimage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,s){function r(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,l){function i(t){try{n(s.next(t))}catch(e){l(e)}}function g(t){try{n(s["throw"](t))}catch(e){l(e)}}function n(t){t.done?o(t.value):r(t.value).then(i,g)}n((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},s,r,l,i;return i={next:g(0),throw:g(1),return:g(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function g(t){return function(e){return n([t,e])}}function n(i){if(s)throw new TypeError("Generator is already executing.");while(o)try{if(s=1,r&&(l=i[0]&2?r["return"]:i[0]?r["throw"]||((l=r["return"])&&l.call(r),0):r.next)&&!(l=l.call(r,i[1])).done)return l;if(r=0,l)i=[i[0]&2,l.value];switch(i[0]){case 0:case 1:l=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;r=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(l=o.trys,l=l.length>0&&l[l.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!l||i[1]>l[0]&&i[1]<l[3])){o.label=i[1];break}if(i[0]===6&&o.label<l[1]){o.label=l[1];l=i;break}if(l&&o.label<l[2]){o.label=l[2];o.ops.push(i);break}if(l[2])o.ops.pop();o.trys.pop();continue}i=e.call(t,o)}catch(g){i=[6,g];r=0}finally{s=l=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-011c84fe.js";import{h as hasSlot}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{S as StzhInputDescription}from"./stzh-input-description-bdd1e340.js";var stzhToggleCss=".sc-stzh-toggle-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-toggle-h{display:none}.sc-stzh-toggle-h *.sc-stzh-toggle,.sc-stzh-toggle-h *.sc-stzh-toggle::before,.sc-stzh-toggle-h *.sc-stzh-toggle::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-toggle-h{display:inline-block;border-radius:var(--stzh-form-input-border-radius)}.sc-stzh-toggle-h .sc-stzh-toggle-s>stzh-text{--color:inherit}.stzh-toggle__marker-symbol.sc-stzh-toggle{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-toggle__marker-text.sc-stzh-toggle{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-toggle__description-wrapper.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-toggle__error.sc-stzh-toggle,.stzh-toggle__description.sc-stzh-toggle{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);color:var(--stzh-base-color)}.stzh-toggle__error.sc-stzh-toggle{color:var(--stzh-color-error)}.stzh-toggle__error-list.sc-stzh-toggle{list-style:none;margin:0;padding:0}.stzh-toggle__description.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-toggle__description-long.sc-stzh-toggle{margin-left:var(--stzh-space-xxsmall);margin-top:0.1875rem}.stzh-toggle__description-long-popover.sc-stzh-toggle{--width:auto;--max-width:27.3125rem}.stzh-toggle__description-long-popover[open].sc-stzh-toggle:not([open=false]) .stzh-toggle__description-long-button.sc-stzh-toggle{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle__description-long-button.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);color:var(--stzh-base-lead-color)}.stzh-toggle__description-long-button.sc-stzh-toggle:hover{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle.sc-stzh-toggle stzh-icon.stzh-toggle__description-long-icon.sc-stzh-toggle{--size:var(--stzh-icon-size-xsmall)}.stzh-toggle--has-error.sc-stzh-toggle .stzh-toggle__error.sc-stzh-toggle,.stzh-toggle--has-description.sc-stzh-toggle .stzh-toggle__description.sc-stzh-toggle{margin-top:var(--stzh-space-xxsmall)}.stzh-toggle__field-wrapper.sc-stzh-toggle{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.stzh-toggle__input.sc-stzh-toggle{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none}.stzh-toggle__mark.sc-stzh-toggle{position:relative;background-color:var(--stzh-color-black8);width:2.75rem;height:1rem;-ms-flex-negative:0;flex-shrink:0;border-radius:0.75rem;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed);margin-top:0.25rem}.stzh-toggle__check.sc-stzh-toggle{position:absolute;border:0.125rem solid var(--stzh-base-color);width:1.5rem;height:1.5rem;border-radius:50%;background-color:var(--stzh-color-white);top:50%;left:0;-webkit-transform:translate(0, -50%);transform:translate(0, -50%);-webkit-transition-property:border-color, background-color, -webkit-transform;transition-property:border-color, background-color, -webkit-transform;transition-property:border-color, background-color, transform;transition-property:border-color, background-color, transform, -webkit-transform;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-toggle__label.sc-stzh-toggle{display:inline-block;color:var(--stzh-base-color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);line-height:1.5rem}.stzh-toggle__label.sc-stzh-toggle:empty{display:none}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-primary48)}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}.stzh-toggle.sc-stzh-toggle:hover .stzh-toggle__label.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle.sc-stzh-toggle:hover .stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:focus:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:focus~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:focus~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle--has-label-right.sc-stzh-toggle .stzh-toggle__label.sc-stzh-toggle{margin-left:var(--stzh-space-xsmall)}.stzh-toggle--has-label-left.sc-stzh-toggle .stzh-toggle__field-wrapper.sc-stzh-toggle{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.stzh-toggle--has-label-left.sc-stzh-toggle .stzh-toggle__label.sc-stzh-toggle{margin-right:var(--stzh-space-xsmall)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-error)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-error)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-black8)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-error)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__field-wrapper.sc-stzh-toggle{cursor:not-allowed}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-grey61)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-grey13)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-black8)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-grey25);border-color:var(--stzh-color-grey25)}";var toggleCounter=0;var StzhToggle=function(){function t(t){var e=this;registerInstance(this,t);this.stzhChange=createEvent(this,"stzhChange",7);this.stzhFocus=createEvent(this,"stzhFocus",7);this.stzhBlur=createEvent(this,"stzhBlur",7);this.onInput=function(t){e.checked=e.input.checked;e.stzhChange.emit({component:"stzh-toggle",originalEvent:t,value:e.value,checked:e.checked})};this.onFocus=function(t){var o=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});e.element.dispatchEvent(o);e.stzhFocus.emit({component:"stzh-toggle",originalEvent:t})};this.onBlur=function(t){var o=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});e.element.dispatchEvent(o);e.stzhBlur.emit({component:"stzh-toggle",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.showMarker=false;this.checked=false;this.label="";this.labelPosition="right";this.description=undefined;this.descriptionLong=undefined;this.error=undefined;this.a11yDescribedby=""}t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.input.focus();return[2]}))}))};t.prototype.errorWatcher=function(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(e){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}this.invalid=this._error.length>0};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.inputId="stzh-toggle-".concat(toggleCounter++);this.errorWatcher(this.error);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"toggle")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.render=function(){var t;var e=this;var o=hasSlot(this.element,"description")||!!this.description;var s=hasSlot(this.element,"description-long")||!!this.descriptionLong;var r=hasSlot(this.element,"error")||!!this.error;var l=(t={"stzh-toggle":true,"stzh-toggle--has-error":r,"stzh-toggle--is-required":this.required,"stzh-toggle--is-invalid":this.invalid,"stzh-toggle--is-disabled":this.disabled,"stzh-toggle--has-description":o,"stzh-toggle--has-description-long":s},t["stzh-toggle--has-label-".concat(this.labelPosition)]=!!this.labelPosition,t);return h("div",{class:l},h("label",{class:"stzh-toggle__field-wrapper"},h("input",{class:"stzh-toggle__input",ref:function(t){return e.input=t},type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":"".concat(this.inputId,"-description ").concat(this.a11yDescribedby),"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),h("div",{class:"stzh-toggle__mark"},h("div",{class:"stzh-toggle__check"})),h("div",{class:"stzh-toggle__label"},this.label?this.label:h("slot",null),this.showMarker&&h("span",{class:"stzh-toggle__marker"},h("span",{class:"stzh-toggle__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),h("span",{class:"stzh-toggle__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),h(StzhInputDescription,{classPrefix:"stzh-toggle",id:"".concat(this.inputId,"-description"),error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongUsed:s,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel}))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{error:["errorWatcher"]}},enumerable:false,configurable:true});return t}();StzhToggle.style=stzhToggleCss;export{StzhToggle as stzh_toggle};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,o,s){function r(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,l){function i(t){try{n(s.next(t))}catch(e){l(e)}}function g(t){try{n(s["throw"](t))}catch(e){l(e)}}function n(t){t.done?o(t.value):r(t.value).then(i,g)}n((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},s,r,l,i;return i={next:g(0),throw:g(1),return:g(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function g(t){return function(e){return n([t,e])}}function n(i){if(s)throw new TypeError("Generator is already executing.");while(o)try{if(s=1,r&&(l=i[0]&2?r["return"]:i[0]?r["throw"]||((l=r["return"])&&l.call(r),0):r.next)&&!(l=l.call(r,i[1])).done)return l;if(r=0,l)i=[i[0]&2,l.value];switch(i[0]){case 0:case 1:l=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;r=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(l=o.trys,l=l.length>0&&l[l.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!l||i[1]>l[0]&&i[1]<l[3])){o.label=i[1];break}if(i[0]===6&&o.label<l[1]){o.label=l[1];l=i;break}if(l&&o.label<l[2]){o.label=l[2];o.ops.push(i);break}if(l[2])o.ops.pop();o.trys.pop();continue}i=e.call(t,o)}catch(g){i=[6,g];r=0}finally{s=l=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-011c84fe.js";import{h as hasSlot}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{S as StzhInputDescription}from"./stzh-input-description-bdd1e340.js";var stzhToggleCss=".sc-stzh-toggle-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-toggle-h{display:none}.sc-stzh-toggle-h *.sc-stzh-toggle,.sc-stzh-toggle-h *.sc-stzh-toggle::before,.sc-stzh-toggle-h *.sc-stzh-toggle::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-toggle-h{display:inline-block;border-radius:var(--stzh-form-input-border-radius)}.sc-stzh-toggle-h .sc-stzh-toggle-s>stzh-text{--color:inherit}.stzh-toggle__marker-symbol.sc-stzh-toggle{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-toggle__marker-text.sc-stzh-toggle{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-toggle__description-wrapper.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-toggle__error.sc-stzh-toggle,.stzh-toggle__description.sc-stzh-toggle{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);color:var(--stzh-base-color)}.stzh-toggle__error.sc-stzh-toggle{color:var(--stzh-color-error)}.stzh-toggle__error-list.sc-stzh-toggle{list-style:none;margin:0;padding:0}.stzh-toggle__description.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-toggle__description-long.sc-stzh-toggle{margin-left:var(--stzh-space-xxsmall);margin-top:0.1875rem}.stzh-toggle__description-long-popover.sc-stzh-toggle{--width:auto;--max-width:27.3125rem}.stzh-toggle__description-long-popover[open].sc-stzh-toggle:not([open=false]) .stzh-toggle__description-long-button.sc-stzh-toggle{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle__description-long-button.sc-stzh-toggle{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);color:var(--stzh-base-lead-color)}.stzh-toggle__description-long-button.sc-stzh-toggle:hover{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle.sc-stzh-toggle stzh-icon.stzh-toggle__description-long-icon.sc-stzh-toggle{--size:var(--stzh-icon-size-xsmall)}.stzh-toggle--has-error.sc-stzh-toggle .stzh-toggle__error.sc-stzh-toggle,.stzh-toggle--has-description.sc-stzh-toggle .stzh-toggle__description.sc-stzh-toggle{margin-top:var(--stzh-space-xxsmall)}.stzh-toggle__field-wrapper.sc-stzh-toggle{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.stzh-toggle__input.sc-stzh-toggle{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none}.stzh-toggle__mark.sc-stzh-toggle{position:relative;background-color:var(--stzh-color-black8);width:2.75rem;height:1rem;-ms-flex-negative:0;flex-shrink:0;border-radius:0.75rem;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed);margin-top:0.25rem}.stzh-toggle__check.sc-stzh-toggle{position:absolute;border:0.125rem solid var(--stzh-base-color);width:1.5rem;height:1.5rem;border-radius:50%;background-color:var(--stzh-color-white);top:50%;left:0;-webkit-transform:translate(0, -50%);transform:translate(0, -50%);-webkit-transition-property:border-color, background-color, -webkit-transform;transition-property:border-color, background-color, -webkit-transform;transition-property:border-color, background-color, transform;transition-property:border-color, background-color, transform, -webkit-transform;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-toggle__label.sc-stzh-toggle{display:inline-block;color:var(--stzh-base-color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);line-height:1.5rem}.stzh-toggle__label.sc-stzh-toggle:empty{display:none}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-primary48)}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}.stzh-toggle.sc-stzh-toggle:hover .stzh-toggle__label.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-toggle.sc-stzh-toggle:hover .stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:focus:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:focus~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle__input.sc-stzh-toggle:checked:hover~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle,.stzh-toggle__input.sc-stzh-toggle:checked:focus~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-toggle--has-label-right.sc-stzh-toggle .stzh-toggle__label.sc-stzh-toggle{margin-left:var(--stzh-space-xsmall)}.stzh-toggle--has-label-left.sc-stzh-toggle .stzh-toggle__field-wrapper.sc-stzh-toggle{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.stzh-toggle--has-label-left.sc-stzh-toggle .stzh-toggle__label.sc-stzh-toggle{margin-right:var(--stzh-space-xsmall)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-error)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-error)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-black8)}.stzh-toggle--is-invalid.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-error)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__field-wrapper.sc-stzh-toggle{cursor:not-allowed}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__label.sc-stzh-toggle{color:var(--stzh-color-grey61)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{border-color:var(--stzh-color-grey13)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle{background-color:var(--stzh-color-black8)}.stzh-toggle--is-disabled.sc-stzh-toggle .stzh-toggle__input.sc-stzh-toggle:checked~.stzh-toggle__mark.sc-stzh-toggle .stzh-toggle__check.sc-stzh-toggle{background-color:var(--stzh-color-grey25);border-color:var(--stzh-color-grey25)}";var toggleCounter=0;var StzhToggle=function(){function t(t){var e=this;registerInstance(this,t);this.stzhChange=createEvent(this,"stzhChange",7);this.stzhFocus=createEvent(this,"stzhFocus",7);this.stzhBlur=createEvent(this,"stzhBlur",7);this.onInput=function(t){e.checked=e.input.checked;e.stzhChange.emit({component:"stzh-toggle",originalEvent:t,value:e.value,checked:e.checked})};this.onFocus=function(t){var o=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});e.element.dispatchEvent(o);e.stzhFocus.emit({component:"stzh-toggle",originalEvent:t})};this.onBlur=function(t){var o=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});e.element.dispatchEvent(o);e.stzhBlur.emit({component:"stzh-toggle",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.showMarker=false;this.checked=false;this.label="";this.labelPosition="right";this.description=undefined;this.descriptionLong=undefined;this.error=undefined;this.a11yDescribedby=""}t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.input.focus();return[2]}))}))};t.prototype.errorWatcher=function(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(e){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}this.invalid=this._error.length>0};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.inputId="stzh-toggle-".concat(toggleCounter++);this.errorWatcher(this.error);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"toggle")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.render=function(){var t;var e=this;var o=hasSlot(this.element,"description")||!!this.description;var s=hasSlot(this.element,"description-long")||!!this.descriptionLong;var r=hasSlot(this.element,"error")||!!this.error;var l=(t={"stzh-toggle":true,"stzh-toggle--has-error":r,"stzh-toggle--is-required":this.required,"stzh-toggle--is-invalid":this.invalid,"stzh-toggle--is-disabled":this.disabled,"stzh-toggle--has-description":o,"stzh-toggle--has-description-long":s},t["stzh-toggle--has-label-".concat(this.labelPosition)]=!!this.labelPosition,t);return h("div",{class:l},h("label",{class:"stzh-toggle__field-wrapper"},h("input",{class:"stzh-toggle__input",ref:function(t){return e.input=t},type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":"".concat(this.inputId,"-description ").concat(this.a11yDescribedby),"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),h("div",{class:"stzh-toggle__mark"},h("div",{class:"stzh-toggle__check"})),h("div",{class:"stzh-toggle__label"},this.label?this.label:h("slot",null),this.showMarker&&h("span",{class:"stzh-toggle__marker"},h("span",{class:"stzh-toggle__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),h("span",{class:"stzh-toggle__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),h(StzhInputDescription,{classPrefix:"stzh-toggle",id:"".concat(this.inputId,"-description"),error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongUsed:s,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel}))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{error:["errorWatcher"]}},enumerable:false,configurable:true});return t}();StzhToggle.style=stzhToggleCss;export{StzhToggle as stzh_toggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,i){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(e){s(e)}}function a(t){try{l(i["throw"](t))}catch(e){s(e)}}function l(t){t.done?o(t.value):n(t.value).then(r,a)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(r){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(s=r[0]&2?n["return"]:r[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;if(n=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;n=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=e.call(t,o)}catch(a){r=[6,a];n=0}finally{i=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,a as Host,g as getElement}from"./index-011c84fe.js";import{c as computePosition,a as autoUpdate,A as Arrow,o as offset,f as flip,s as shift,b as arrow}from"./arrow-86a679c7.js";import{c as createFocusTrap}from"./focus-trap.esm-074705a3.js";import{i as isStzhElement}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{w as waitForEvent}from"./event-utils-7a709e21.js";import{s as stopAnimations,a as animateTo}from"./animation-utils-25c74e5b.js";var stzhTooltipCss=".sc-stzh-tooltip-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-tooltip-h{display:none}.sc-stzh-tooltip-h *.sc-stzh-tooltip,.sc-stzh-tooltip-h *.sc-stzh-tooltip::before,.sc-stzh-tooltip-h *.sc-stzh-tooltip::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-tooltip-h{--width:var(--stzh-tooltip-width);--min-width:var(--stzh-tooltip-min-width);--max-width:var(--stzh-tooltip-max-width);--padding:var(--stzh-tooltip-padding);--border-radius:var(--stzh-tooltip-border-radius)}.stzh-tooltip__arrow.sc-stzh-tooltip{position:absolute;display:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.stzh-tooltip--placement-bottom.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{top:0;-webkit-transform:translateY(-0.5rem);transform:translateY(-0.5rem)}.stzh-tooltip--placement-top.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{bottom:0;-webkit-transform:translateY(0.5rem) rotate(180deg);transform:translateY(0.5rem) rotate(180deg)}.stzh-tooltip--placement-left.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{right:0;-webkit-transform:translateX(0.75rem) rotate(90deg);transform:translateX(0.75rem) rotate(90deg)}.stzh-tooltip--placement-right.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{left:0;-webkit-transform:translateX(-0.75rem) rotate(-90deg);transform:translateX(-0.75rem) rotate(-90deg)}.stzh-tooltip__content.sc-stzh-tooltip{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:absolute;z-index:var(--stzh-z-index-popover);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--border-radius);background-color:var(--stzh-color-white);width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-tooltip__content.sc-stzh-tooltip{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}.stzh-tooltip__content-slot.sc-stzh-tooltip{padding:var(--padding)}.stzh-tooltip__close.sc-stzh-tooltip{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background-color:transparent;padding:0;position:absolute;top:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-xxxsmall);color:var(--stzh-base-lead-color);border-radius:var(--stzh-button-border-radius)}.stzh-tooltip__icon.sc-stzh-tooltip{--size:var(--stzh-icon-size-xxsmall)}.stzh-tooltip__vhidden.sc-stzh-tooltip{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}";var ANIMATION_SHOW={keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:100,easing:"linear"}};var ANIMATION_HIDE={keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:200,easing:"linear"}};var keyCode={ESC:27};var tooltipCounter=0;var StzhTooltip=function(){function t(t){var e=this;registerInstance(this,t);this.stzhOpen=createEvent(this,"stzhOpen",7);this.stzhOpened=createEvent(this,"stzhOpened",7);this.stzhClose=createEvent(this,"stzhClose",7);this.stzhClosed=createEvent(this,"stzhClosed",7);this.toggledByMethod=false;this.isHovering=false;this.onEscKey=function(t){if(t.keyCode===keyCode.ESC){e.hide()}};this.computePosition=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,o,i,n,s,r,a,l;return __generator(this,(function(h){switch(h.label){case 0:if(!this.open){return[2]}return[4,computePosition(this.triggerElement.firstElementChild,this.contentElement,{strategy:this.strategy,placement:this.placement,middleware:[offset({mainAxis:this.distance,crossAxis:this.skidding}),flip({padding:5}),shift({padding:5}),arrow({element:this.arrowElement,padding:5})]})];case 1:t=h.sent(),e=t.x,o=e===void 0?0:e,i=t.y,n=i===void 0?0:i,s=t.strategy,r=s===void 0?"absolute":s,a=t.placement,l=t.middlewareData;this.middlewareData=l;this.computedPlacement=a;Object.assign(this.contentElement.style,{position:r,left:"".concat(o,"px"),top:"".concat(n,"px")});Object.assign(this.arrowElement.style,{left:o!=null?"".concat(l.arrow.x,"px"):"",top:n!=null?"".concat(l.arrow.y,"px"):""});return[2]}}))}))};this.onClickTrigger=function(){if(e.hasTrigger("click")){e.toggle()}};this.onMouseEnterTrigger=function(){if(e.hasTrigger("hover")){e.isHovering=true;e.show()}};this.onMouseLeaveTrigger=function(){if(e.hasTrigger("hover")){e.isHovering=false;document.addEventListener("mousemove",e.onMouseMoveDocument)}};this.onFocusTrigger=function(){if(e.hasTrigger("focus")){e.show()}};this.onBlurTrigger=function(){if(e.hasTrigger("focus")){e.hide()}};this.onMouseMoveDocument=function(t){var o=t.clientX,i=t.clientY;if(!e.computedPlacement){return true}var n=e.computedPlacement.split("-")[0];var s=e.middlewareData.offset;var r=e.contentElement.getBoundingClientRect();if(!s){return true}var a=n==="bottom"?s.y:0;var l=n==="top"?s.y:0;var h=n==="right"?s.x:0;var c=n==="left"?s.x:0;var p=r.top-i>a;var u=i-r.bottom>l;var d=r.left-o>h;var f=o-r.right>c;if(p||u||d||f){document.removeEventListener("mousemove",e.onMouseMoveDocument);if(!e.isHovering){e.hide()}}};this.open=false;this.label="";this.content="";this.placement="bottom";this.strategy="absolute";this.skidding=0;this.distance=16;this.interactive=false;this.trigger="hover focus";this.localization=undefined;this.computedPlacement=undefined}t.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.open){return[2]}this.toggledByMethod=true;this.open=true;return[2,waitForEvent(this.element,"stzhOpened")]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.open){return[2]}this.toggledByMethod=true;this.open=false;return[2,waitForEvent(this.element,"stzhClosed")]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.open)return[3,2];return[4,this.hide()];case 1:return[2,t.sent()];case 2:return[4,this.show()];case 3:return[2,t.sent()]}}))}))};t.prototype.update=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.computePosition()];case 1:return[2,t.sent()]}}))}))};t.prototype.openWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!t)return[3,3];if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-tooltip"})}return[4,stopAnimations(this.contentElement)];case 1:e.sent();this.contentElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentElement.hidden=false;return[4,animateTo(this.contentElement,ANIMATION_SHOW.keyframes,ANIMATION_SHOW.options)];case 2:e.sent();if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-tooltip"})}return[3,6];case 3:if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-tooltip"})}return[4,stopAnimations(this.contentElement)];case 4:e.sent();return[4,animateTo(this.contentElement,ANIMATION_HIDE.keyframes,ANIMATION_HIDE.options)];case 5:e.sent();this.contentElement.hidden=true;this.contentElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-tooltip"})}e.label=6;case 6:this.toggledByMethod=false;return[2]}}))}))};t.prototype.triggerWatcher=function(t){this._trigger=t.split(" ")};t.prototype.handleDocumentClick=function(t){if(!this.open){return}var e=t.target!==this.contentElement&&this.contentElement.contains(t.target)===false;var o=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(e&&!o&&this.hasTrigger("click")){this.hide()}};t.prototype.hasTrigger=function(t){return this._trigger.indexOf(t)>-1};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.labelId="stzh-tooltip-label-".concat(tooltipCounter++);this.triggerWatcher(this.trigger);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"tooltip")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.componentDidRender=function(){this.computePosition();if(this.interactive){var t=isStzhElement(this.triggerElement.firstElementChild);this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded",this.open?"true":"false")}if(this.trap){this.open?this.trap.activate():this.trap.deactivate()}};t.prototype.componentDidUpdate=function(){if(this.trap){this.trap.updateContainerElements(this.contentElement)}};t.prototype.componentDidLoad=function(){this.autoUpdateCleanup=autoUpdate(this.element,this.contentElement,this.computePosition);if(this.interactive){this.trap=createFocusTrap(this.contentElement,{fallbackFocus:this.contentElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true});if(this.open){this.trap.activate()}}this.contentElement.hidden=!this.open};t.prototype.connectedCallback=function(){var t;var e=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!e){var o=Array.from(this.element.children).find((function(t){return!t.hasAttribute("slot")}));e=o}if(e){e.addEventListener("click",this.onClickTrigger);e.addEventListener("mouseenter",this.onMouseEnterTrigger);e.addEventListener("mouseleave",this.onMouseLeaveTrigger);e.addEventListener("focusin",this.onFocusTrigger);e.addEventListener("focusout",this.onBlurTrigger)}};t.prototype.disconnectedCallback=function(){if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerElement&&this.triggerElement.firstElementChild){this.triggerElement.firstElementChild.removeEventListener("click",this.onClickTrigger);this.triggerElement.firstElementChild.removeEventListener("mouseenter",this.onMouseEnterTrigger);this.triggerElement.firstElementChild.removeEventListener("mouseleave",this.onMouseLeaveTrigger);this.triggerElement.firstElementChild.removeEventListener("focusin",this.onFocusTrigger);this.triggerElement.firstElementChild.removeEventListener("focusout",this.onBlurTrigger)}};t.prototype.render=function(){var t;var e=this;var o=(t={"stzh-tooltip":true},t["stzh-tooltip--open"]=this.open,t["stzh-tooltip--placement-".concat(this.computedPlacement)]=!!this.computedPlacement,t);return h(Host,null,h("div",{class:o},h("div",{class:"stzh-tooltip__trigger",ref:function(t){return e.triggerElement=t}},h("slot",null)),h("div",{class:"stzh-tooltip__content",ref:function(t){return e.contentElement=t},tabindex:"-1","aria-labelledby":this.label?this.labelId:null,"aria-hidden":this.open?"false":"true",onKeyDown:this.onEscKey,onMouseEnter:this.onMouseEnterTrigger,onMouseLeave:this.onMouseLeaveTrigger,onFocusin:this.onFocusTrigger,onFocusout:this.onBlurTrigger},h("div",{class:"stzh-tooltip__arrow",ref:function(t){return e.arrowElement=t},innerHTML:Arrow}),this.label&&h("h2",{id:this.labelId,class:"stzh-tooltip__vhidden"},this.label),h("div",{class:"stzh-tooltip__content-slot"},this.content?this.content:h("slot",{name:"content"})),this.hasTrigger("click")&&h("button",{class:"stzh-tooltip__close",onClick:function(){return e.hide()},type:"button"},h("stzh-icon",{name:"close",class:"stzh-tooltip__icon"}),h("span",{class:"stzh-tooltip__vhidden"},this.localization.close)))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["openWatcher"],trigger:["triggerWatcher"]}},enumerable:false,configurable:true});return t}();StzhTooltip.style=stzhTooltipCss;export{StzhTooltip as stzh_tooltip};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,o){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,n){function s(t){try{l(o.next(t))}catch(e){n(e)}}function a(t){try{l(o["throw"](t))}catch(e){n(e)}}function l(t){t.done?i(t.value):r(t.value).then(s,a)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,r,n,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,r&&(n=s[0]&2?r["return"]:s[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;if(r=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){i.label=s[1];break}if(s[0]===6&&i.label<n[1]){i.label=n[1];n=s;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(s);break}if(n[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(a){s=[6,a];r=0}finally{o=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,a as Host,g as getElement}from"./index-011c84fe.js";import{c as computePosition,a as autoUpdate,A as Arrow,o as offset,f as flip,s as shift,b as arrow}from"./arrow-86a679c7.js";import{c as createFocusTrap}from"./focus-trap.esm-074705a3.js";import{i as isStzhElement}from"./utils-92a77db5.js";import{f as fetchTranslations}from"./translation-utils-2623783f.js";import{w as waitForEvent}from"./event-utils-7a709e21.js";import{s as stopAnimations,a as animateTo}from"./animation-utils-e234a5f8.js";var stzhTooltipCss=".sc-stzh-tooltip-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-tooltip-h{display:none}.sc-stzh-tooltip-h *.sc-stzh-tooltip,.sc-stzh-tooltip-h *.sc-stzh-tooltip::before,.sc-stzh-tooltip-h *.sc-stzh-tooltip::after{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-stzh-tooltip-h{--width:var(--stzh-tooltip-width);--min-width:var(--stzh-tooltip-min-width);--max-width:var(--stzh-tooltip-max-width);--padding:var(--stzh-tooltip-padding);--border-radius:var(--stzh-tooltip-border-radius)}.stzh-tooltip__arrow.sc-stzh-tooltip{position:absolute;display:-ms-flexbox;display:flex;color:var(--stzh-color-white)}.stzh-tooltip--placement-bottom.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{top:0;-webkit-transform:translateY(-0.5rem);transform:translateY(-0.5rem)}.stzh-tooltip--placement-top.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{bottom:0;-webkit-transform:translateY(0.5rem) rotate(180deg);transform:translateY(0.5rem) rotate(180deg)}.stzh-tooltip--placement-left.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{right:0;-webkit-transform:translateX(0.75rem) rotate(90deg);transform:translateX(0.75rem) rotate(90deg)}.stzh-tooltip--placement-right.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{left:0;-webkit-transform:translateX(-0.75rem) rotate(-90deg);transform:translateX(-0.75rem) rotate(-90deg)}.stzh-tooltip__content.sc-stzh-tooltip{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:absolute;z-index:var(--stzh-z-index-popover);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--border-radius);background-color:var(--stzh-color-white);width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-tooltip__content.sc-stzh-tooltip{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}.stzh-tooltip__content-slot.sc-stzh-tooltip{padding:var(--padding)}.stzh-tooltip__close.sc-stzh-tooltip{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;padding:0;position:absolute;top:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:var(--stzh-space-xxsmall);padding-bottom:var(--stzh-space-xxxsmall);color:var(--stzh-base-lead-color);border-radius:var(--stzh-button-border-radius)}.stzh-tooltip__icon.sc-stzh-tooltip{--size:var(--stzh-icon-size-xxsmall)}.stzh-tooltip__vhidden.sc-stzh-tooltip{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}";var ANIMATION_SHOW={keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:100,easing:"linear"}};var ANIMATION_HIDE={keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:200,easing:"linear"}};var keyCode={ESC:27};var tooltipCounter=0;var StzhTooltip=function(){function t(t){var e=this;registerInstance(this,t);this.stzhOpen=createEvent(this,"stzhOpen",7);this.stzhOpened=createEvent(this,"stzhOpened",7);this.stzhClose=createEvent(this,"stzhClose",7);this.stzhClosed=createEvent(this,"stzhClosed",7);this.toggledByMethod=false;this.isHovering=false;this.onEscKey=function(t){if(t.keyCode===keyCode.ESC){e.hide()}};this.computePosition=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,i,o,r,n,s,a,l;return __generator(this,(function(h){switch(h.label){case 0:if(!this.open){return[2]}return[4,computePosition(this.triggerElement.firstElementChild,this.contentElement,{strategy:this.strategy,placement:this.placement,middleware:[offset({mainAxis:this.distance,crossAxis:this.skidding}),flip({padding:5}),shift({padding:5}),arrow({element:this.arrowElement,padding:5})]})];case 1:t=h.sent(),e=t.x,i=e===void 0?0:e,o=t.y,r=o===void 0?0:o,n=t.strategy,s=n===void 0?"absolute":n,a=t.placement,l=t.middlewareData;this.middlewareData=l;this.computedPlacement=a;Object.assign(this.contentElement.style,{position:s,left:"".concat(i,"px"),top:"".concat(r,"px")});Object.assign(this.arrowElement.style,{left:i!=null?"".concat(l.arrow.x,"px"):"",top:r!=null?"".concat(l.arrow.y,"px"):""});return[2]}}))}))};this.onClickTrigger=function(){if(e.hasTrigger("click")){e.toggle()}};this.onMouseEnterTrigger=function(){if(e.hasTrigger("hover")){e.isHovering=true;e.show()}};this.onMouseLeaveTrigger=function(){if(e.hasTrigger("hover")){e.isHovering=false;document.addEventListener("mousemove",e.onMouseMoveDocument)}};this.onFocusTrigger=function(){if(e.hasTrigger("focus")){e.show()}};this.onBlurTrigger=function(){if(e.hasTrigger("focus")){e.hide()}};this.onMouseMoveDocument=function(t){var i=t.clientX,o=t.clientY;if(!e.computedPlacement){return true}var r=e.computedPlacement.split("-")[0];var n=e.middlewareData.offset;var s=e.contentElement.getBoundingClientRect();if(!n){return true}var a=r==="bottom"?n.y:0;var l=r==="top"?n.y:0;var h=r==="right"?n.x:0;var c=r==="left"?n.x:0;var p=s.top-o>a;var d=o-s.bottom>l;var u=s.left-i>h;var f=i-s.right>c;if(p||d||u||f){document.removeEventListener("mousemove",e.onMouseMoveDocument);if(!e.isHovering){e.hide()}}};this.open=false;this.label="";this.content="";this.placement="bottom";this.strategy="absolute";this.skidding=0;this.distance=16;this.interactive=false;this.trigger="hover focus";this.localization=undefined;this.computedPlacement=undefined}t.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.open){return[2]}this.toggledByMethod=true;this.open=true;return[2,waitForEvent(this.element,"stzhOpened")]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.open){return[2]}this.toggledByMethod=true;this.open=false;return[2,waitForEvent(this.element,"stzhClosed")]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.open)return[3,2];return[4,this.hide()];case 1:return[2,t.sent()];case 2:return[4,this.show()];case 3:return[2,t.sent()]}}))}))};t.prototype.update=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.computePosition()];case 1:return[2,t.sent()]}}))}))};t.prototype.openWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.contentElement){return[2]}if(!t)return[3,3];if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-tooltip"})}return[4,stopAnimations(this.contentElement)];case 1:e.sent();this.contentElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentElement.hidden=false;return[4,animateTo(this.contentElement,ANIMATION_SHOW.keyframes,ANIMATION_SHOW.options)];case 2:e.sent();if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-tooltip"})}return[3,6];case 3:if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-tooltip"})}return[4,stopAnimations(this.contentElement)];case 4:e.sent();return[4,animateTo(this.contentElement,ANIMATION_HIDE.keyframes,ANIMATION_HIDE.options)];case 5:e.sent();this.contentElement.hidden=true;this.contentElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-tooltip"})}e.label=6;case 6:this.toggledByMethod=false;return[2]}}))}))};t.prototype.triggerWatcher=function(t){this._trigger=t.split(" ")};t.prototype.handleDocumentClick=function(t){if(!this.open){return}var e=t.target!==this.contentElement&&this.contentElement.contains(t.target)===false;var i=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(e&&!i&&this.hasTrigger("click")){this.hide()}};t.prototype.hasTrigger=function(t){return this._trigger.indexOf(t)>-1};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:this.id="stzh-tooltip-".concat(tooltipCounter++);this.triggerWatcher(this.trigger);if(!!this.localization)return[3,2];t=this;return[4,fetchTranslations(this.element,"tooltip")];case 1:t.localization=e.sent();e.label=2;case 2:return[2]}}))}))};t.prototype.componentDidRender=function(){this.computePosition();var t=isStzhElement(this.triggerElement.firstElementChild);if(this.hasTrigger("click")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-expanded":"aria-expanded",this.open?"true":"false");if(t&&!this.triggerElement.firstElementChild.getAttribute("a11y-describedby")||this.triggerElement.firstElementChild.getAttribute("aria-describedby")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-describedby":"aria-describedby","".concat(this.id,"-trigger-description"))}if(t&&!this.triggerElement.firstElementChild.getAttribute("a11y-label")||this.triggerElement.firstElementChild.getAttribute("aria-label")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-label":"aria-label",this.label)}}else{if(t&&!this.triggerElement.firstElementChild.getAttribute("a11y-describedby")||this.triggerElement.firstElementChild.getAttribute("aria-describedby")){this.triggerElement.firstElementChild.setAttribute(t?"a11y-describedby":"aria-describedby","".concat(this.id,"-content"))}}if(this.trap){this.open?this.trap.activate():this.trap.deactivate()}};t.prototype.componentDidUpdate=function(){if(this.trap){this.trap.updateContainerElements(this.contentElement)}};t.prototype.componentDidLoad=function(){this.autoUpdateCleanup=autoUpdate(this.element,this.contentElement,this.computePosition);if(this.interactive){this.trap=createFocusTrap(this.contentElement,{fallbackFocus:this.contentElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true});if(this.open){this.trap.activate()}}this.contentElement.hidden=!this.open};t.prototype.connectedCallback=function(){var t;var e=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!e){var i=Array.from(this.element.children).find((function(t){return!t.hasAttribute("slot")}));e=i}if(e){e.addEventListener("click",this.onClickTrigger);e.addEventListener("mouseenter",this.onMouseEnterTrigger);e.addEventListener("mouseleave",this.onMouseLeaveTrigger);e.addEventListener("focusin",this.onFocusTrigger);e.addEventListener("focusout",this.onBlurTrigger)}};t.prototype.disconnectedCallback=function(){if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerElement&&this.triggerElement.firstElementChild){this.triggerElement.firstElementChild.removeEventListener("click",this.onClickTrigger);this.triggerElement.firstElementChild.removeEventListener("mouseenter",this.onMouseEnterTrigger);this.triggerElement.firstElementChild.removeEventListener("mouseleave",this.onMouseLeaveTrigger);this.triggerElement.firstElementChild.removeEventListener("focusin",this.onFocusTrigger);this.triggerElement.firstElementChild.removeEventListener("focusout",this.onBlurTrigger)}};t.prototype.render=function(){var t;var e=this;var i=(t={"stzh-tooltip":true},t["stzh-tooltip--open"]=this.open,t["stzh-tooltip--placement-".concat(this.computedPlacement)]=!!this.computedPlacement,t);return h(Host,null,h("div",{class:i},h("div",{class:"stzh-tooltip__trigger",ref:function(t){return e.triggerElement=t}},h("slot",null)),this.hasTrigger("click")&&h("div",{class:"stzh-tooltip__vhidden",id:"".concat(this.id,"-trigger-description")},this.localization.open),h("div",{class:"stzh-tooltip__content",id:"".concat(this.id,"-content"),ref:function(t){return e.contentElement=t},tabindex:"-1","aria-labelledby":this.label?"".concat(this.id,"-label"):null,"aria-hidden":this.open?"false":"true",onKeyDown:this.onEscKey,onMouseEnter:this.onMouseEnterTrigger,onMouseLeave:this.onMouseLeaveTrigger,onFocusin:this.onFocusTrigger,onFocusout:this.onBlurTrigger},h("div",{class:"stzh-tooltip__arrow",ref:function(t){return e.arrowElement=t},innerHTML:Arrow}),this.label&&h("h2",{id:"".concat(this.id,"-label"),class:"stzh-tooltip__vhidden"},this.label),h("div",{class:"stzh-tooltip__content-slot"},this.content?this.content:h("slot",{name:"content"})),this.hasTrigger("click")&&h("button",{class:"stzh-tooltip__close",onClick:function(){return e.hide()},type:"button"},h("stzh-icon",{name:"close",class:"stzh-tooltip__icon"}),h("span",{class:"stzh-tooltip__vhidden"},this.localization.close)))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["openWatcher"],trigger:["triggerWatcher"]}},enumerable:false,configurable:true});return t}();StzhTooltip.style=stzhTooltipCss;export{StzhTooltip as stzh_tooltip};
|