@oiz/stzh-components 3.0.0-beta5 → 3.0.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/{app-globals-82cc9313.js → app-globals-1d1f8f2e.js} +2 -2
- package/dist/cjs/{app-globals-82cc9313.js.map → app-globals-1d1f8f2e.js.map} +1 -1
- package/dist/cjs/index-92254d32.js +16 -8
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-actions.cjs.entry.js +8 -2
- package/dist/cjs/stzh-actions.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-badge_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-breadcrumb_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-card_3.cjs.entry.js +2 -0
- package/dist/cjs/stzh-card_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-carousel.cjs.entry.js +1 -2
- package/dist/cjs/stzh-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-chart.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chart.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +9 -10
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-content.cjs.entry.js +1 -1
- package/dist/cjs/stzh-content.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-cspace.cjs.entry.js +1 -1
- package/dist/cjs/stzh-cspace.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-cta.cjs.entry.js +1 -1
- package/dist/cjs/stzh-cta.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-datalist_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datalist_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js +8 -10
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-details.cjs.entry.js +162 -0
- package/dist/cjs/stzh-details.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-eventdata.cjs.entry.js +26 -0
- package/dist/cjs/stzh-eventdata.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-eventinfo.cjs.entry.js +43 -4
- package/dist/cjs/stzh-eventinfo.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-footer.cjs.entry.js +1 -1
- package/dist/cjs/stzh-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-gallery.cjs.entry.js +1 -1
- package/dist/cjs/stzh-gallery.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-header.cjs.entry.js +0 -1
- package/dist/cjs/stzh-header.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-imagecomparison.cjs.entry.js +1 -1
- package/dist/cjs/stzh-imagecomparison.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-details_2.cjs.entry.js → stzh-message.cjs.entry.js} +1 -155
- package/dist/cjs/stzh-message.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js +18 -2
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-pagebottom.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-pagetitle.cjs.entry.js +2 -1
- package/dist/cjs/stzh-pagetitle.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-popover_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-readspeaker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-readspeaker.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-textandimage.cjs.entry.js +3 -2
- package/dist/cjs/stzh-textandimage.cjs.entry.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +3 -1
- package/dist/collection/assets/i18n/en.json +3 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/stzh-accordion/stzh-accordion.css +3 -3
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.css +3 -3
- package/dist/collection/components/stzh-actions/stzh-actions.css +27 -7
- package/dist/collection/components/stzh-actions/stzh-actions.js +8 -1
- package/dist/collection/components/stzh-actions/stzh-actions.js.map +1 -1
- package/dist/collection/components/stzh-actions/stzh-actions.stories.js +2 -2
- package/dist/collection/components/stzh-actionset/stzh-actionset.css +3 -3
- package/dist/collection/components/stzh-amount/stzh-amount.css +3 -3
- package/dist/collection/components/stzh-anchornav/stzh-anchornav.css +3 -3
- package/dist/collection/components/stzh-appointments/stzh-appointments.css +3 -3
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.css +3 -3
- package/dist/collection/components/stzh-audio/stzh-audio.css +3 -3
- package/dist/collection/components/stzh-badge/stzh-badge.css +3 -3
- package/dist/collection/components/stzh-banner/stzh-banner.css +3 -3
- package/dist/collection/components/stzh-breadcrumb/stzh-breadcrumb.css +8 -3
- package/dist/collection/components/stzh-button/stzh-button.css +3 -3
- package/dist/collection/components/stzh-buttongroup/stzh-buttongroup.css +3 -3
- package/dist/collection/components/stzh-calendar/stzh-calendar.css +3 -3
- package/dist/collection/components/stzh-card/stzh-card.css +3 -3
- package/dist/collection/components/stzh-card-navigation/stzh-card-navigation.css +3 -3
- package/dist/collection/components/stzh-card-navigation/stzh-card-navigation.stories.js +1 -1
- package/dist/collection/components/stzh-card-searchresult/stzh-card-searchresult.css +3 -3
- package/dist/collection/components/stzh-card-superteaser/stzh-card-superteaser.css +3 -3
- package/dist/collection/components/stzh-cardlist/stzh-cardlist.css +3 -3
- package/dist/collection/components/stzh-carousel/stzh-carousel.css +8 -3
- package/dist/collection/components/stzh-carousel/stzh-carousel.js +0 -1
- package/dist/collection/components/stzh-carousel/stzh-carousel.js.map +1 -1
- package/dist/collection/components/stzh-cell/stzh-cell.css +3 -3
- package/dist/collection/components/stzh-chart/stzh-chart.css +6 -3
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.css +3 -3
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.css +3 -3
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +9 -12
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js.map +1 -1
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.stories.js +9 -0
- package/dist/collection/components/stzh-chip/stzh-chip.css +3 -3
- package/dist/collection/components/stzh-chipgroup/stzh-chipgroup.css +3 -3
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.css +3 -3
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js +2 -0
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js.map +1 -1
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.stories.js +2 -2
- package/dist/collection/components/stzh-clamp/stzh-clamp.css +3 -3
- package/dist/collection/components/stzh-contact/stzh-contact.css +3 -3
- package/dist/collection/components/stzh-container/stzh-container.css +3 -3
- package/dist/collection/components/stzh-content/stzh-content.css +7 -5
- package/dist/collection/components/stzh-cspace/stzh-cspace.css +9 -9
- package/dist/collection/components/stzh-cta/stzh-cta.css +8 -3
- package/dist/collection/components/stzh-datalist/stzh-datalist.css +3 -3
- package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +9 -69
- package/dist/collection/components/stzh-datamessagelist/stzh-datamessagelist.css +3 -3
- package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.css +3 -3
- package/dist/collection/components/stzh-datatable/stzh-datatable.css +3 -3
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.css +3 -3
- package/dist/collection/components/stzh-daterange/stzh-daterange.css +3 -3
- package/dist/collection/components/stzh-details/stzh-details.css +3 -3
- package/dist/collection/components/stzh-dialog/stzh-dialog.css +3 -3
- package/dist/collection/components/stzh-disturber/stzh-disturber.css +3 -3
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +3 -3
- package/dist/collection/components/stzh-editor/stzh-editor.css +3 -3
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.css +210 -0
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.e2e.js +18 -0
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.e2e.js.map +1 -0
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.js +52 -0
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.js.map +1 -0
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.stories.js +44 -0
- package/dist/collection/components/stzh-eventinfo/stzh-eventinfo.css +157 -12
- package/dist/collection/components/stzh-eventinfo/stzh-eventinfo.js +122 -4
- package/dist/collection/components/stzh-eventinfo/stzh-eventinfo.js.map +1 -1
- package/dist/collection/components/stzh-eventinfo/stzh-eventinfo.localization.js.map +1 -1
- package/dist/collection/components/stzh-eventinfo/stzh-eventinfo.stories.js +14 -1
- package/dist/collection/components/stzh-fieldset/stzh-fieldset.css +3 -3
- package/dist/collection/components/stzh-figure/stzh-figure.css +3 -3
- package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.css +3 -3
- package/dist/collection/components/stzh-footer/stzh-footer.css +7 -4
- package/dist/collection/components/stzh-gallery/stzh-gallery.css +9 -3
- package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +3 -3
- package/dist/collection/components/stzh-header/stzh-header.css +3 -3
- package/dist/collection/components/stzh-header/stzh-header.js +0 -1
- package/dist/collection/components/stzh-header/stzh-header.js.map +1 -1
- package/dist/collection/components/stzh-heading/stzh-heading.css +3 -3
- package/dist/collection/components/stzh-hr/stzh-hr.css +3 -3
- package/dist/collection/components/stzh-hspace/stzh-hspace.css +3 -3
- package/dist/collection/components/stzh-icon/stzh-icon.css +9 -3
- package/dist/collection/components/stzh-iframe/stzh-iframe.css +3 -3
- package/dist/collection/components/stzh-imagecomparison/stzh-imagecomparison.css +10 -3
- package/dist/collection/components/stzh-input/stzh-input.css +3 -3
- package/dist/collection/components/stzh-invert/stzh-invert.css +3 -3
- package/dist/collection/components/stzh-link/stzh-link.css +3 -3
- package/dist/collection/components/stzh-list/stzh-list.css +3 -3
- package/dist/collection/components/stzh-list-item/stzh-list-item.css +3 -3
- package/dist/collection/components/stzh-loader/stzh-loader.css +3 -3
- package/dist/collection/components/stzh-loadingbar/stzh-loadingbar.css +3 -3
- package/dist/collection/components/stzh-menu/stzh-menu.css +3 -3
- package/dist/collection/components/stzh-menu-item/stzh-menu-item.css +3 -3
- package/dist/collection/components/stzh-message/stzh-message.css +3 -3
- package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.css +3 -3
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.css +3 -3
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js +36 -4
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js.map +1 -1
- package/dist/collection/components/stzh-olmap/stzh-olmap.css +3 -3
- package/dist/collection/components/stzh-overlay/stzh-overlay.css +3 -3
- package/dist/collection/components/stzh-page-skiplinks/stzh-page-skiplinks.css +3 -3
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.css +3 -3
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.js +0 -1
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.js.map +1 -1
- package/dist/collection/components/stzh-pagecontent/stzh-pagecontent.css +3 -3
- package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.css +3 -3
- package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.js +2 -1
- package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.js.map +1 -1
- package/dist/collection/components/stzh-pagetitle-hero/stzh-pagetitle-hero.css +3 -3
- package/dist/collection/components/stzh-pagination/stzh-pagination.css +3 -3
- package/dist/collection/components/stzh-panorama/stzh-panorama.css +3 -3
- package/dist/collection/components/stzh-popover/stzh-popover.css +3 -3
- package/dist/collection/components/stzh-print/stzh-print.css +3 -3
- package/dist/collection/components/stzh-progressbar/stzh-progressbar.css +3 -3
- package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.css +3 -3
- package/dist/collection/components/stzh-radio/stzh-radio.css +3 -3
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.css +3 -3
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +8 -12
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js.map +1 -1
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.stories.js +10 -0
- package/dist/collection/components/stzh-ratio/stzh-ratio.css +3 -3
- package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.css +8 -3
- package/dist/collection/components/stzh-richtext/stzh-richtext.css +3 -3
- package/dist/collection/components/stzh-row/stzh-row.css +3 -3
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.css +3 -3
- package/dist/collection/components/stzh-scrollup/stzh-scrollup.css +3 -3
- package/dist/collection/components/stzh-search/stzh-search.css +6 -5
- package/dist/collection/components/stzh-section/stzh-section.css +3 -3
- package/dist/collection/components/stzh-share/stzh-share.css +3 -3
- package/dist/collection/components/stzh-show/stzh-show.css +3 -3
- package/dist/collection/components/stzh-sitemap/stzh-sitemap.css +3 -3
- package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.css +18 -3
- package/dist/collection/components/stzh-skin-storybook-preview/stzh-skin-storybook-preview.css +3 -3
- package/dist/collection/components/stzh-skiplink/stzh-skiplink.css +3 -3
- package/dist/collection/components/stzh-sortable/stzh-sortable.css +3 -3
- package/dist/collection/components/stzh-space/stzh-space.css +3 -3
- package/dist/collection/components/stzh-status/stzh-status.css +3 -3
- package/dist/collection/components/stzh-sticky/stzh-sticky.css +3 -3
- package/dist/collection/components/stzh-sticky-actions/stzh-sticky-actions.css +3 -3
- package/dist/collection/components/stzh-table/stzh-table.css +3 -3
- package/dist/collection/components/stzh-tag/stzh-tag.css +3 -3
- package/dist/collection/components/stzh-text/stzh-text.css +4 -4
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.css +9 -3
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.js +2 -1
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.js.map +1 -1
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.stories.js +2 -0
- package/dist/collection/components/stzh-timeline/stzh-timeline.css +3 -3
- package/dist/collection/components/stzh-timeline-item/stzh-timeline-item.css +3 -3
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.css +3 -3
- package/dist/collection/components/stzh-toast/stzh-toast.css +3 -3
- package/dist/collection/components/stzh-toastbar/stzh-toastbar.css +3 -3
- package/dist/collection/components/stzh-toggle/stzh-toggle.css +3 -3
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.css +3 -3
- package/dist/collection/components/stzh-twocolumns/stzh-twocolumns.css +3 -3
- package/dist/collection/components/stzh-upload/stzh-upload.css +3 -3
- package/dist/collection/components/stzh-vbz-carousel/stzh-vbz-carousel.css +3 -3
- package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.css +3 -3
- package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.css +3 -3
- package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.css +3 -3
- package/dist/collection/components/stzh-visuallyhidden/stzh-visuallyhidden.css +3 -3
- package/dist/collection/components/stzh-vspace/stzh-vspace.css +3 -3
- package/dist/collection/components/stzh-youtube/stzh-youtube.css +3 -3
- package/dist/collection/pages/website/website.e2e.js +1 -1
- package/dist/collection/pages/website/website.e2e.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/stzh-actions.js +8 -2
- package/dist/components/stzh-actions.js.map +1 -1
- package/dist/components/stzh-breadcrumb2.js +1 -1
- package/dist/components/stzh-breadcrumb2.js.map +1 -1
- package/dist/components/stzh-carousel2.js +1 -2
- package/dist/components/stzh-carousel2.js.map +1 -1
- package/dist/components/stzh-chart.js +1 -1
- package/dist/components/stzh-chart.js.map +1 -1
- package/dist/components/stzh-checkboxgroup.js +10 -12
- package/dist/components/stzh-checkboxgroup.js.map +1 -1
- package/dist/components/stzh-chipselect2.js +2 -0
- package/dist/components/stzh-chipselect2.js.map +1 -1
- package/dist/components/stzh-content.js +1 -1
- package/dist/components/stzh-content.js.map +1 -1
- package/dist/components/stzh-cspace.js +1 -1
- package/dist/components/stzh-cspace.js.map +1 -1
- package/dist/components/stzh-cta.js +1 -1
- package/dist/components/stzh-cta.js.map +1 -1
- package/dist/components/stzh-datalist-item2.js +1 -1
- package/dist/components/stzh-datalist-item2.js.map +1 -1
- package/dist/components/stzh-eventdata.d.ts +11 -0
- package/dist/components/stzh-eventdata.js +41 -0
- package/dist/components/stzh-eventdata.js.map +1 -0
- package/dist/components/stzh-eventinfo.js +50 -8
- package/dist/components/stzh-eventinfo.js.map +1 -1
- package/dist/components/stzh-footer.js +1 -1
- package/dist/components/stzh-footer.js.map +1 -1
- package/dist/components/stzh-gallery.js +1 -1
- package/dist/components/stzh-gallery.js.map +1 -1
- package/dist/components/stzh-header.js +0 -1
- package/dist/components/stzh-header.js.map +1 -1
- package/dist/components/stzh-icon2.js +1 -1
- package/dist/components/stzh-icon2.js.map +1 -1
- package/dist/components/stzh-imagecomparison.js +1 -1
- package/dist/components/stzh-imagecomparison.js.map +1 -1
- package/dist/components/stzh-monthyearpicker.js +19 -2
- package/dist/components/stzh-monthyearpicker.js.map +1 -1
- package/dist/components/stzh-pagebottom.js.map +1 -1
- package/dist/components/stzh-pagetitle.js +2 -1
- package/dist/components/stzh-pagetitle.js.map +1 -1
- package/dist/components/stzh-radiogroup2.js +8 -11
- package/dist/components/stzh-radiogroup2.js.map +1 -1
- package/dist/components/stzh-readspeaker.js +1 -1
- package/dist/components/stzh-readspeaker.js.map +1 -1
- package/dist/components/stzh-search.js +1 -1
- package/dist/components/stzh-search.js.map +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js.map +1 -1
- package/dist/components/stzh-text2.js +1 -1
- package/dist/components/stzh-text2.js.map +1 -1
- package/dist/components/stzh-textandimage.js +3 -2
- package/dist/components/stzh-textandimage.js.map +1 -1
- package/dist/esm/{app-globals-d7eff0a5.js → app-globals-f9c4987b.js} +2 -2
- package/dist/esm/{app-globals-d7eff0a5.js.map → app-globals-f9c4987b.js.map} +1 -1
- package/dist/esm/index-e3050b18.js +16 -8
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-actions.entry.js +8 -2
- package/dist/esm/stzh-actions.entry.js.map +1 -1
- package/dist/esm/stzh-badge_3.entry.js +1 -1
- package/dist/esm/stzh-badge_3.entry.js.map +1 -1
- package/dist/esm/stzh-breadcrumb_2.entry.js +1 -1
- package/dist/esm/stzh-breadcrumb_2.entry.js.map +1 -1
- package/dist/esm/stzh-card_3.entry.js +2 -0
- package/dist/esm/stzh-card_3.entry.js.map +1 -1
- package/dist/esm/stzh-carousel.entry.js +1 -2
- package/dist/esm/stzh-carousel.entry.js.map +1 -1
- package/dist/esm/stzh-chart.entry.js +1 -1
- package/dist/esm/stzh-chart.entry.js.map +1 -1
- package/dist/esm/stzh-checkboxgroup.entry.js +9 -10
- package/dist/esm/stzh-checkboxgroup.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-content.entry.js +1 -1
- package/dist/esm/stzh-content.entry.js.map +1 -1
- package/dist/esm/stzh-cspace.entry.js +1 -1
- package/dist/esm/stzh-cspace.entry.js.map +1 -1
- package/dist/esm/stzh-cta.entry.js +1 -1
- package/dist/esm/stzh-cta.entry.js.map +1 -1
- package/dist/esm/stzh-datalist_2.entry.js +1 -1
- package/dist/esm/stzh-datalist_2.entry.js.map +1 -1
- package/dist/esm/stzh-datepicker_3.entry.js +8 -10
- package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm/stzh-details.entry.js +158 -0
- package/dist/esm/stzh-details.entry.js.map +1 -0
- package/dist/esm/stzh-eventdata.entry.js +22 -0
- package/dist/esm/stzh-eventdata.entry.js.map +1 -0
- package/dist/esm/stzh-eventinfo.entry.js +43 -4
- package/dist/esm/stzh-eventinfo.entry.js.map +1 -1
- package/dist/esm/stzh-footer.entry.js +1 -1
- package/dist/esm/stzh-footer.entry.js.map +1 -1
- package/dist/esm/stzh-gallery.entry.js +1 -1
- package/dist/esm/stzh-gallery.entry.js.map +1 -1
- package/dist/esm/stzh-header.entry.js +0 -1
- package/dist/esm/stzh-header.entry.js.map +1 -1
- package/dist/esm/stzh-imagecomparison.entry.js +1 -1
- package/dist/esm/stzh-imagecomparison.entry.js.map +1 -1
- package/dist/esm/{stzh-details_2.entry.js → stzh-message.entry.js} +2 -155
- package/dist/esm/stzh-message.entry.js.map +1 -0
- package/dist/esm/stzh-monthyearpicker.entry.js +18 -2
- package/dist/esm/stzh-monthyearpicker.entry.js.map +1 -1
- package/dist/esm/stzh-pagebottom.entry.js.map +1 -1
- package/dist/esm/stzh-pagetitle.entry.js +2 -1
- package/dist/esm/stzh-pagetitle.entry.js.map +1 -1
- package/dist/esm/stzh-popover_2.entry.js +1 -1
- package/dist/esm/stzh-popover_2.entry.js.map +1 -1
- package/dist/esm/stzh-readspeaker.entry.js +1 -1
- package/dist/esm/stzh-readspeaker.entry.js.map +1 -1
- package/dist/esm/stzh-search.entry.js +1 -1
- package/dist/esm/stzh-search.entry.js.map +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js.map +1 -1
- package/dist/esm/stzh-textandimage.entry.js +3 -2
- package/dist/esm/stzh-textandimage.entry.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +3 -1
- package/dist/stzh-components/assets/i18n/en.json +3 -1
- package/dist/stzh-components/p-14177ccb.entry.js +2 -0
- package/dist/stzh-components/p-14177ccb.entry.js.map +1 -0
- package/dist/stzh-components/p-161ae3d1.entry.js +2 -0
- package/dist/stzh-components/p-161ae3d1.entry.js.map +1 -0
- package/dist/stzh-components/{p-93721591.entry.js → p-1a19bc6e.entry.js} +2 -2
- package/dist/stzh-components/p-1a19bc6e.entry.js.map +1 -0
- package/dist/stzh-components/p-1a3dcde3.entry.js +2 -0
- package/dist/stzh-components/p-1a3dcde3.entry.js.map +1 -0
- package/dist/stzh-components/p-2096f3c6.entry.js +2 -0
- package/dist/stzh-components/p-2096f3c6.entry.js.map +1 -0
- package/dist/stzh-components/p-27d5ad01.entry.js +2 -0
- package/dist/stzh-components/p-27d5ad01.entry.js.map +1 -0
- package/dist/stzh-components/p-3f0d3919.entry.js +2 -0
- package/dist/stzh-components/p-3f0d3919.entry.js.map +1 -0
- package/dist/stzh-components/p-429d2a9b.entry.js +2 -0
- package/dist/stzh-components/p-429d2a9b.entry.js.map +1 -0
- package/dist/stzh-components/{p-e5cfdb8a.entry.js → p-5b1bc446.entry.js} +2 -2
- package/dist/stzh-components/{p-e5cfdb8a.entry.js.map → p-5b1bc446.entry.js.map} +1 -1
- package/dist/stzh-components/{p-0aabd857.entry.js → p-663f31a2.entry.js} +2 -2
- package/dist/stzh-components/p-663f31a2.entry.js.map +1 -0
- package/dist/stzh-components/{p-1be90089.entry.js → p-6f87ad6e.entry.js} +2 -2
- package/dist/stzh-components/{p-1be90089.entry.js.map → p-6f87ad6e.entry.js.map} +1 -1
- package/dist/stzh-components/p-7aac960b.entry.js +2 -0
- package/dist/stzh-components/p-7aac960b.entry.js.map +1 -0
- package/dist/stzh-components/p-8f19c3ec.entry.js +2 -0
- package/dist/stzh-components/p-8f19c3ec.entry.js.map +1 -0
- package/dist/stzh-components/p-91b360c9.entry.js +2 -0
- package/dist/stzh-components/{p-d028e43d.entry.js.map → p-91b360c9.entry.js.map} +1 -1
- package/dist/stzh-components/p-91d7c08d.entry.js +2 -0
- package/dist/stzh-components/p-91d7c08d.entry.js.map +1 -0
- package/dist/stzh-components/{p-f2ec1ede.entry.js → p-929c5234.entry.js} +2 -2
- package/dist/stzh-components/{p-f2ec1ede.entry.js.map → p-929c5234.entry.js.map} +1 -1
- package/dist/stzh-components/p-94947ab0.entry.js.map +1 -1
- package/dist/stzh-components/p-97df1d9f.entry.js +2 -0
- package/dist/stzh-components/p-97df1d9f.entry.js.map +1 -0
- package/dist/stzh-components/{p-9f9d53a0.entry.js → p-9b19785c.entry.js} +2 -2
- package/dist/stzh-components/p-9b19785c.entry.js.map +1 -0
- package/dist/stzh-components/{p-1a50b64a.entry.js → p-ab2aee99.entry.js} +2 -2
- package/dist/stzh-components/{p-1a50b64a.entry.js.map → p-ab2aee99.entry.js.map} +1 -1
- package/dist/stzh-components/p-af7562ba.entry.js +2 -0
- package/dist/stzh-components/p-af7562ba.entry.js.map +1 -0
- package/dist/stzh-components/{p-0bf70420.entry.js → p-af87b81a.entry.js} +2 -2
- package/dist/stzh-components/p-af87b81a.entry.js.map +1 -0
- package/dist/stzh-components/p-c9eecee7.entry.js +2 -0
- package/dist/stzh-components/p-c9eecee7.entry.js.map +1 -0
- package/dist/stzh-components/{p-3fa1c5a4.entry.js → p-ee82f53c.entry.js} +2 -2
- package/dist/stzh-components/{p-3fa1c5a4.entry.js.map → p-ee82f53c.entry.js.map} +1 -1
- package/dist/stzh-components/p-ef849bb1.entry.js +2 -0
- package/dist/stzh-components/p-ef849bb1.entry.js.map +1 -0
- package/dist/stzh-components/p-f06b2737.js +2 -0
- package/dist/stzh-components/{p-05e8c18d.js.map → p-f06b2737.js.map} +1 -1
- package/dist/stzh-components/{p-55cdd473.entry.js → p-f692c5d0.entry.js} +2 -2
- package/dist/stzh-components/p-f692c5d0.entry.js.map +1 -0
- package/dist/stzh-components/p-f7979f2a.entry.js +2 -0
- package/dist/stzh-components/p-f7979f2a.entry.js.map +1 -0
- package/dist/stzh-components/p-fdd6e755.entry.js +2 -0
- package/dist/stzh-components/p-fdd6e755.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.css +1 -1
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/types/components/stzh-actions/stzh-actions.d.ts +1 -0
- package/dist/types/components/stzh-checkboxgroup/stzh-checkboxgroup.d.ts +1 -1
- package/dist/types/components/stzh-eventdata/stzh-eventdata.d.ts +10 -0
- package/dist/types/components/stzh-eventinfo/stzh-eventinfo.d.ts +15 -1
- package/dist/types/components/stzh-eventinfo/stzh-eventinfo.localization.d.ts +2 -0
- package/dist/types/components/stzh-monthyearpicker/stzh-monthyearpicker.d.ts +3 -2
- package/dist/types/components/stzh-pagebottom/stzh-pagebottom.d.ts +0 -1
- package/dist/types/components/stzh-radiogroup/stzh-radiogroup.d.ts +1 -1
- package/dist/types/components.d.ts +61 -0
- package/dist/vscode-data.json +41 -0
- package/package.json +1 -1
- package/dist/cjs/stzh-details_2.cjs.entry.js.map +0 -1
- package/dist/esm/stzh-details_2.entry.js.map +0 -1
- package/dist/stzh-components/p-05e8c18d.js +0 -2
- package/dist/stzh-components/p-0aabd857.entry.js.map +0 -1
- package/dist/stzh-components/p-0bf70420.entry.js.map +0 -1
- package/dist/stzh-components/p-3c2d9cff.entry.js +0 -2
- package/dist/stzh-components/p-3c2d9cff.entry.js.map +0 -1
- package/dist/stzh-components/p-3cd1696a.entry.js +0 -2
- package/dist/stzh-components/p-3cd1696a.entry.js.map +0 -1
- package/dist/stzh-components/p-400f2932.entry.js +0 -2
- package/dist/stzh-components/p-400f2932.entry.js.map +0 -1
- package/dist/stzh-components/p-55cdd473.entry.js.map +0 -1
- package/dist/stzh-components/p-5f5d14cb.entry.js +0 -2
- package/dist/stzh-components/p-5f5d14cb.entry.js.map +0 -1
- package/dist/stzh-components/p-836c4cdf.entry.js +0 -2
- package/dist/stzh-components/p-836c4cdf.entry.js.map +0 -1
- package/dist/stzh-components/p-93721591.entry.js.map +0 -1
- package/dist/stzh-components/p-9f9d53a0.entry.js.map +0 -1
- package/dist/stzh-components/p-accbac61.entry.js +0 -2
- package/dist/stzh-components/p-accbac61.entry.js.map +0 -1
- package/dist/stzh-components/p-bd2a2c30.entry.js +0 -2
- package/dist/stzh-components/p-bd2a2c30.entry.js.map +0 -1
- package/dist/stzh-components/p-beec9a0a.entry.js +0 -2
- package/dist/stzh-components/p-beec9a0a.entry.js.map +0 -1
- package/dist/stzh-components/p-c774915c.entry.js +0 -2
- package/dist/stzh-components/p-c774915c.entry.js.map +0 -1
- package/dist/stzh-components/p-d028e43d.entry.js +0 -2
- package/dist/stzh-components/p-d56d5fe9.entry.js +0 -2
- package/dist/stzh-components/p-d56d5fe9.entry.js.map +0 -1
- package/dist/stzh-components/p-ddfb8df0.entry.js +0 -2
- package/dist/stzh-components/p-ddfb8df0.entry.js.map +0 -1
- package/dist/stzh-components/p-e10aa7bd.entry.js +0 -2
- package/dist/stzh-components/p-e10aa7bd.entry.js.map +0 -1
- package/dist/stzh-components/p-f50e0102.entry.js +0 -2
- package/dist/stzh-components/p-f50e0102.entry.js.map +0 -1
- package/dist/stzh-components/p-f86e53a0.entry.js +0 -2
- package/dist/stzh-components/p-f86e53a0.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-imagecomparison.js","mappings":";;;AAAA,MAAM,sBAAsB,GAAG,
|
|
1
|
+
{"file":"stzh-imagecomparison.js","mappings":";;;AAAA,MAAM,sBAAsB,GAAG,qvIAAqvI;;MC6BvwI,mBAAmB;;;;;IA0BtB,gBAAW,GAAG,CAAC,KAAiB;MACtC,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;MACpC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;MAE3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,sBAAsB;QACjC,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI,CAAC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,KAAK,EAAC,oCAAoC,IAC7C,YAAM,KAAK,EAAC,iCAAiC,IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,YAAM,IAAI,EAAC,WAAW,GAAQ,CAC1D,EACP,YAAM,KAAK,EAAC,kCAAkC,IAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,YAAM,IAAI,EAAC,YAAY,GAAQ,CAC7D,CACH,CACF,CACF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/stzh-imagecomparison/stzh-imagecomparison.scss?tag=stzh-imagecomparison&encapsulation=scoped","src/components/stzh-imagecomparison/stzh-imagecomparison.tsx"],"sourcesContent":[":host {\n --exposure: 50%;\n --divider-width: 2px;\n\n @media print {\n page-break-inside: avoid;\n break-inside: avoid;\n }\n\n ::slotted(*) {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n ::slotted([slot=\"image-after\"]) {\n clip-path: polygon(\n calc(var(--exposure) + (var(--divider-width) / 2)) 0,\n 100% 0,\n 100% 100%,\n calc(var(--exposure) + (var(--divider-width) / 2)) 100%\n );\n }\n}\n\n.stzh-imagecomparison {\n display: flex;\n flex-direction: column;\n user-select: none;\n\n &__control {\n position: absolute;\n inset: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n &__slider-line {\n position: absolute;\n left: var(--exposure);\n height: 100%;\n width: var(--divider-width);\n background-color: $colorWhite;\n transform: translateX(-50%);\n transition: background-color $baseTransitionAnimationSpeed;\n }\n\n &__slider-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 50%;\n left: var(--exposure);\n overflow: hidden;\n width: calc(2 * #{iconSize()} + var(--divider-width));\n height: #{iconSize()};\n transform: translate(-50%, -50%);\n color: $colorPrimary70;\n background-color: $colorWhite;\n transition-property: color, background-color;\n transition-duration: $baseTransitionAnimationSpeed;\n }\n\n &__hint-wrapper {\n pointer-events: none;\n opacity: 0;\n transition: opacity $baseTransitionAnimationSpeed;\n }\n\n &__hint-left,\n &__hint-right {\n @include font('heavy');\n @include fontSize('micro');\n position: absolute;\n top: 0;\n display: flex;\n align-items: center;\n height: 24px;\n padding: 0 space('xsmall');\n background: $colorBlack50op;\n color: $colorWhite;\n }\n\n &__hint-left {\n left: 0;\n }\n\n &__hint-right {\n right: 0;\n }\n\n &__label:hover &__slider-line {\n background-color: $colorPrimary70;\n }\n\n &__label:hover &__slider-icon-wrapper {\n background-color: $colorSecondary30;\n }\n\n &__label:hover + &__hint-wrapper {\n opacity: 1;\n }\n}\n","import {\n Component,\n Host,\n Element,\n Prop,\n h,\n Event,\n EventEmitter\n} from '@stencil/core';\n\nimport {\n StzhImagecomparisonChangeEvent,\n} from \"../../index\";\n\nimport { StzhImagecomparisonLocalizedText } from \"./stzh-imagecomparison.localization\"\n\n/**\n * @slot image-before - Slot for a before image\n * @slot image-after - Slot for a after image\n * @slot hint-left - Slot for a left image hint as alternative for attribute\n * @slot hint-right - Slot for a right image hint as alternative for attribute\n */\n\n@Component({\n tag: 'stzh-imagecomparison',\n styleUrl: 'stzh-imagecomparison.scss',\n scoped: true,\n})\n\nexport class StzhImageComparison {\n /** Translation strings. */\n @Prop() localization: StzhImagecomparisonLocalizedText;\n\n /** Hint left */\n @Prop() hintLeft: string = \"\";\n\n /** Hint right */\n @Prop() hintRight: string = \"\";\n\n /** Width of image before */\n @Prop({ mutable: true }) value: number = 50;\n\n /** Overwrite default label */\n @Prop() label: string;\n\n /** Id for element which describes the label */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @Element() element: HTMLStzhImagecomparisonElement;\n\n /* Image comparison slider on change event */\n @Event() stzhChange: EventEmitter<StzhImagecomparisonChangeEvent>;\n\n private inputElement: HTMLInputElement;\n\n private handleInput = (event: InputEvent) => {\n let value = this.inputElement.value;\n this.value = Number(value);\n\n this.stzhChange.emit({\n component: \"stzh-imagecomparison\",\n originalEvent: event,\n value: this.value\n });\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"imagecomparison\");\n }\n }\n\n render() {\n const classes = {\n \"stzh-imagecomparison\": true,\n };\n\n return (\n <Host\n aria-roledescription={this.localization.label}\n style={{\n '--exposure': `${this.value.toString()}%`\n }}\n >\n <div class={classes}>\n <div class=\"stzh-imagecomparison__element\">\n <slot name=\"image-before\"></slot>\n <slot name=\"image-after\"></slot>\n\n <label\n class=\"stzh-imagecomparison__label\"\n aria-label={this.label || this.localization.label}\n aria-describedby={this.a11yDescribedby || null}\n >\n <div class=\"stzh-imagecomparison__slider-icon-wrapper\">\n <stzh-icon\n class=\"stzh-imagecomparison__slider-icon-left\"\n name=\"angle-left\">\n </stzh-icon>\n <stzh-icon\n class=\"stzh-imagecomparison__slider-icon-right\"\n name=\"angle-right\">\n </stzh-icon>\n </div>\n <div class=\"stzh-imagecomparison__slider-line\"></div>\n\n <input\n type=\"range\"\n class=\"stzh-imagecomparison__control\"\n min=\"0\"\n max=\"100\"\n ref={(el) => (this.inputElement = el as HTMLInputElement)}\n onInput={this.handleInput}\n />\n </label>\n\n <div class=\"stzh-imagecomparison__hint-wrapper\">\n <span class=\"stzh-imagecomparison__hint-left\">\n {this.hintLeft ? this.hintLeft : <slot name=\"hint-left\"></slot>}\n </span>\n <span class=\"stzh-imagecomparison__hint-right\">\n {this.hintRight ? this.hintRight : <slot name=\"hint-right\"></slot>}\n </span>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n\n"],"version":3}
|
|
@@ -30,6 +30,7 @@ const StzhMonthyearpicker$1 = /*@__PURE__*/ proxyCustomElement(class StzhMonthye
|
|
|
30
30
|
this.yearOpen = false;
|
|
31
31
|
this.months = undefined;
|
|
32
32
|
this.years = undefined;
|
|
33
|
+
this.yearSortDirection = "asc";
|
|
33
34
|
this.min = undefined;
|
|
34
35
|
this.max = undefined;
|
|
35
36
|
this.minYear = undefined;
|
|
@@ -138,10 +139,23 @@ const StzhMonthyearpicker$1 = /*@__PURE__*/ proxyCustomElement(class StzhMonthye
|
|
|
138
139
|
});
|
|
139
140
|
this.dropdownMonthOptions = options;
|
|
140
141
|
}
|
|
142
|
+
initializeYears() {
|
|
143
|
+
if (Array.isArray(this.years)) {
|
|
144
|
+
this._years = this.years.map(Number);
|
|
145
|
+
}
|
|
146
|
+
else if (typeof this.years === "string") {
|
|
147
|
+
// If "years" is a string, split in numbers
|
|
148
|
+
this._years = this.years
|
|
149
|
+
.split(",")
|
|
150
|
+
.map((year) => parseInt(year.trim(), 10))
|
|
151
|
+
.filter((year) => !isNaN(year));
|
|
152
|
+
// Delete non valid values
|
|
153
|
+
}
|
|
154
|
+
}
|
|
141
155
|
updateYearOptions() {
|
|
142
156
|
const options = [];
|
|
143
157
|
let years = [];
|
|
144
|
-
if (this._years) {
|
|
158
|
+
if (this._years && this._years.length > 0) {
|
|
145
159
|
years = this._years;
|
|
146
160
|
}
|
|
147
161
|
else {
|
|
@@ -171,8 +185,9 @@ const StzhMonthyearpicker$1 = /*@__PURE__*/ proxyCustomElement(class StzhMonthye
|
|
|
171
185
|
years.push(i);
|
|
172
186
|
}
|
|
173
187
|
}
|
|
188
|
+
years.sort((a, b) => (this.yearSortDirection === "asc" ? a - b : b - a));
|
|
174
189
|
years.forEach((year) => {
|
|
175
|
-
options.push({ text: year
|
|
190
|
+
options.push({ text: `${year}`, value: `${year}` });
|
|
176
191
|
});
|
|
177
192
|
this.dropdownYearOptions = options;
|
|
178
193
|
}
|
|
@@ -180,6 +195,7 @@ const StzhMonthyearpicker$1 = /*@__PURE__*/ proxyCustomElement(class StzhMonthye
|
|
|
180
195
|
if (!this.localization) {
|
|
181
196
|
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "monthyearpicker");
|
|
182
197
|
}
|
|
198
|
+
this.initializeYears();
|
|
183
199
|
this.monthsWatcher(this.months);
|
|
184
200
|
this.yearsWatcher(this.years);
|
|
185
201
|
}
|
|
@@ -203,6 +219,7 @@ const StzhMonthyearpicker$1 = /*@__PURE__*/ proxyCustomElement(class StzhMonthye
|
|
|
203
219
|
"yearOpen": [4, "year-open"],
|
|
204
220
|
"months": [1],
|
|
205
221
|
"years": [1],
|
|
222
|
+
"yearSortDirection": [1025, "year-sort-direction"],
|
|
206
223
|
"min": [1],
|
|
207
224
|
"max": [1],
|
|
208
225
|
"minYear": [2, "min-year"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-monthyearpicker.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,i9DAAi9D;;MC2Bn+DA,qBAAmB;;;;;IA6JtB,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,cAAc,EAAE;QACvB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;OAC7B;KACF,CAAA;IAEO,2BAAsB,GAAG,CAAC,KAA2C;MAC3E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;MAChD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC;MACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KAC5B,CAAA;IAEO,0BAAqB,GAAG,CAAC,KAA2C;MAC1E,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;MAC/C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KAC5B,CAAA;qBA3K4B,KAAK;oBAGN,KAAK;;;;;;;kBAmC2B,SAAS;gBAG7B,EAAE;iBAGc,SAAS;4BAG0D,QAAQ;sBAGtG,EAAE;qB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CAAC,CAAC,CAAC,CAAC,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,eAAe,EAAE,IAAI,CAAC,mBAAmB,EACzC,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,eAAe,EAAE,IAAI,CAAC,mBAAmB,EACzC,OAAO,EAAE,IAAI,CAAC,WAAW,GACV,CACb,CACF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["StzhMonthyearpicker"],"sources":["src/components/stzh-monthyearpicker/stzh-monthyearpicker.scss?tag=stzh-monthyearpicker&encapsulation=scoped","src/components/stzh-monthyearpicker/stzh-monthyearpicker.tsx"],"sourcesContent":[":host {\n width: 100%;\n --separator-height: #{$formInputHeight};\n\n &[size=\"small\"] {\n --separator-height: #{$formInputHeightSmall};\n }\n}\n\n.stzh-monthyearpicker {\n &__wrapper {\n display: flex;\n align-items: flex-start;\n }\n\n &__separator {\n @include fontSize('milli');\n margin-left: space('medium');\n margin-right: space('medium');\n height: var(--separator-height);\n display: flex;\n align-items: center;\n align-self: flex-end;\n }\n}\n","import {\n Component,\n Prop,\n Host,\n Element,\n h,\n Event,\n EventEmitter,\n Watch,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhDropdownOption,\n StzhDropdownChangeEvent,\n StzhMonthyearpickerChangeEvent,\n} from \"../../index\";\n\nimport { StzhMonthyearpickerLocalizedText } from \"./stzh-monthyearpicker.localization\";\n\n/**\n */\n@Component({\n tag: \"stzh-monthyearpicker\",\n styleUrl: \"stzh-monthyearpicker.scss\",\n scoped: true\n})\nexport class StzhMonthyearpicker {\n /** Initial open state of month dropdown */\n @Prop() monthOpen: boolean = false;\n\n /** Initial open state of year dropdown */\n @Prop() yearOpen: boolean = false;\n\n /** Set which months to show (overwrites months from min/max) */\n @Prop() months: number[] | string;\n private _months: number[];\n\n /** Set which years to show (overwrites years from min/max) */\n @Prop() years: number[] | string;\n private _years: number[];\n\n /**\n * Minimum month and year allowed to be picked in `YYYY-MM` format.\n * This setting can be used alone or together with the `max` property.\n */\n @Prop() min: string;\n\n /**\n * Maximum month and year allowed to be picked in `YYYY-MM` format.\n * This setting can be used alone or together with the `min` property.\n */\n @Prop() max: string;\n\n /**\n * Minimum year (will be overwritten if `min` is used).\n * This setting can be used alone or together with the `maxYear` property.\n */\n @Prop() minYear: number;\n\n /**\n * Maximum year (will be overwritten if `max` is used).\n * This setting can be used alone or together with the `minYear` property.\n */\n @Prop() maxYear: number;\n\n /** Picker format. */\n @Prop({ reflect: true }) format: \"default\" | \"creditcard\" = \"default\";\n\n /** Name of the hidden date picker input. */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of hidden input (current selected year and month YYYY-MM). */\n @Prop({ mutable: true, reflect: true }) value: string = \"0000-00\";\n\n /** Popover placement for the dropdown (if applicable) */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Month dropdown label */\n @Prop() monthLabel: string = \"\";\n\n /** Year dropdown label */\n @Prop() yearLabel: string = \"\";\n\n /** Whether the element is readonly or not */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form ot hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Description message for month */\n @Prop() descriptionMonth: string;\n\n /** Description message for year */\n @Prop() descriptionYear: string;\n\n /** Long description message appearing in a popover for month */\n @Prop() descriptionLongMonth: string;\n\n /** Long description message appearing in a popover for year */\n @Prop() descriptionLongYear: string;\n\n /** One or multiple error message for month */\n @Prop() errorMonth: string | string[];\n\n /** One or multiple error message for year */\n @Prop() errorYear: string | string[];\n\n /** Invalid status for month */\n @Prop({ reflect: true }) invalidMonth: boolean = false;\n\n /** Invalid status for year */\n @Prop({ reflect: true }) invalidYear: boolean = false;\n\n /** Id of the element which describes the month dropdown */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedbyMonth: string = \"\";\n\n /** Id of the element which describes the year dropdown */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedbyYear: string = \"\";\n\n /** Translation strings. */\n @Prop() localization: StzhMonthyearpickerLocalizedText;\n\n /** Monthyearpicker change event */\n @Event() stzhChange: EventEmitter<StzhMonthyearpickerChangeEvent>;\n\n @Element() element: HTMLStzhMonthyearpickerElement;\n\n @Watch(\"months\")\n monthsWatcher(newValue: number[] | string) {\n if (typeof newValue === \"string\") {\n this._months = JSON.parse(newValue);\n } else {\n this._months = newValue;\n }\n\n this.updateMonthOptions();\n }\n\n @Watch(\"years\")\n yearsWatcher(newValue: number[] | string) {\n if (typeof newValue === \"string\") {\n this._years = JSON.parse(newValue);\n } else {\n this._years = newValue;\n }\n\n this.updateYearOptions();\n }\n\n @Watch(\"value\")\n @Watch(\"min\")\n @Watch(\"max\")\n minMaxWatcher() {\n this.updateMonthOptions();\n this.updateYearOptions();\n }\n\n @Listen(\"stzhChange\", {capture: true})\n onDropdownChange(event: CustomEvent<StzhDropdownChangeEvent>) {\n if (event.detail.component === \"stzh-dropdown\") {\n if ((event.target as HTMLStzhDropdownElement).name === `${this.name}-year`) {\n this.onYearsDropdownChange(event);\n } else {\n this.onMonthsDropdownChange(event);\n }\n // stop propagating dropdown change event otherwise angular control value accessor won't work\n event.stopPropagation();\n }\n }\n\n private monthsDropdown: HTMLStzhDropdownElement;\n private dropdownMonthOptions: StzhDropdownOption[];\n private dropdownYearOptions: StzhDropdownOption[];\n\n private onRootFocus = () => {\n if (this.monthsDropdown) {\n this.monthsDropdown.focus();\n }\n }\n\n private onMonthsDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const year = this.value.split(\"-\")[0] || \"0000\";\n const month = event.detail.value || \"00\";\n this.onChange(year, month);\n }\n\n private onYearsDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const year = event.detail.value || \"0000\";\n const month = this.value.split(\"-\")[1] || \"00\";\n this.onChange(year, month);\n }\n\n private onChange(year, month) {\n this.value = `${year}-${month}`;\n this.stzhChange.emit({\n component: \"stzh-monthyearpicker\",\n value: this.value,\n valueMonth: month,\n valueYear: year\n });\n }\n\n private updateMonthOptions() {\n const options = [];\n let months = [];\n\n if (this._months) {\n months = this._months;\n } else {\n const currentYear = Number(this.value.split(\"-\")[0] || \"0000\");\n\n let minMonth = 1;\n let maxMonth = 12;\n\n if (this.min) {\n const minDate = new Date(this.min);\n\n if (currentYear === minDate.getFullYear()) {\n minMonth = minDate.getMonth() + 1;\n }\n }\n\n if (this.max) {\n const maxDate = new Date(this.max);\n\n if (currentYear === maxDate.getFullYear()) {\n maxMonth = maxDate.getMonth() + 1;\n }\n }\n\n for (let i = minMonth; i <= maxMonth; i++) {\n months.push(i);\n }\n }\n\n months.forEach((month) => {\n const paddedMonth = (\"00\" + month).slice(-2);\n const monthName = this.localization.$globals.monthNames[month - 1];\n\n options.push({\n text: this.format === \"creditcard\"\n ? `${paddedMonth} (${monthName})`\n : monthName,\n value: paddedMonth\n });\n });\n\n this.dropdownMonthOptions = options;\n }\n\n private updateYearOptions(): void {\n const options = [];\n let years = [];\n\n if (this._years) {\n years = this._years;\n } else {\n const currentMonth = Number(this.value.split(\"-\")[1] || \"00\");\n\n const yearNow = new Date().getFullYear();\n let minYear = this.minYear || (yearNow - 10);\n let maxYear = this.maxYear || (yearNow + 10);\n\n if (this.min) {\n const minDate = new Date(this.min);\n\n if (currentMonth && currentMonth < minDate.getMonth() + 1) {\n minYear = minDate.getFullYear() + 1;\n } else {\n minYear = minDate.getFullYear();\n }\n }\n\n if (this.max) {\n const maxDate = new Date(this.max);\n\n if (currentMonth && currentMonth > maxDate.getMonth() + 1) {\n maxYear = maxDate.getFullYear() - 1;\n } else {\n maxYear = maxDate.getFullYear();\n }\n }\n\n for (let i = minYear; i <= maxYear; i++) {\n years.push(i);\n }\n }\n\n years.forEach((year) => {\n options.push({ text: year, value: year });\n });\n\n this.dropdownYearOptions = options;\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"monthyearpicker\");\n }\n\n this.monthsWatcher(this.months);\n this.yearsWatcher(this.years);\n }\n\n render() {\n const classes = {\n \"stzh-monthyearpicker\": true\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <input\n type=\"hidden\"\n name={this.name}\n value={this.value}\n />\n\n <div class=\"stzh-monthyearpicker__wrapper\">\n <stzh-dropdown\n open={this.monthOpen}\n name={`${this.name}-month`}\n class=\"stzh-monthyearpicker__months-dropdown\"\n label={this.monthLabel || this.localization.monthLabel}\n ref={(el) => (this.monthsDropdown = el as HTMLStzhDropdownElement)}\n options={this.dropdownMonthOptions}\n items={[this.value.split(\"-\")[1]]}\n required={this.required}\n disabled={this.disabled}\n size={this.size}\n hideOptional={this.hideOptional}\n popoverPlacement={this.popoverPlacement}\n description={this.descriptionMonth}\n descriptionLong={this.descriptionLongMonth}\n error={this.errorMonth}\n a11yDescribedby={this.a11yDescribedbyMonth}\n invalid={this.invalidMonth}\n ></stzh-dropdown>\n\n <div class=\"stzh-monthyearpicker__separator\">/</div>\n\n <stzh-dropdown\n open={this.yearOpen}\n name={`${this.name}-year`}\n class=\"stzh-monthyearpicker__years-dropdown\"\n label={this.yearLabel || this.localization.yearLabel}\n options={this.dropdownYearOptions}\n items={[this.value.split(\"-\")[0]]}\n required={this.required}\n disabled={this.disabled}\n size={this.size}\n hideOptional={this.hideOptional}\n popoverPlacement={this.popoverPlacement}\n description={this.descriptionYear}\n descriptionLong={this.descriptionLongYear}\n error={this.errorYear}\n a11yDescribedby={this.a11yDescribedbyYear}\n invalid={this.invalidYear}\n ></stzh-dropdown>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"stzh-monthyearpicker.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,i9DAAi9D;;MCyBn+DA,qBAAmB;;;;;IAgKtB,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,cAAc,EAAE;QACvB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;OAC7B;KACF,CAAA;IAEO,2BAAsB,GAAG,CAAC,KAA2C;MAC3E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;MAChD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC;MACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KAC5B,CAAA;IAEO,0BAAqB,GAAG,CAAC,KAA2C;MAC1E,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;MAC/C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KAC5B,CAAA;qBA9K4B,KAAK;oBAGN,KAAK;;;6BAW4B,KAAK;;;;;kBA2BN,SAAS;gBAG7B,EAAE;iBAGc,SAAS;4BAG0D,QAAQ;sBAGtG,EAAE;qBAGH,EAAE;oBAGe,KAAK;oBAGL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["StzhMonthyearpicker"],"sources":["src/components/stzh-monthyearpicker/stzh-monthyearpicker.scss?tag=stzh-monthyearpicker&encapsulation=scoped","src/components/stzh-monthyearpicker/stzh-monthyearpicker.tsx"],"sourcesContent":[":host {\n width: 100%;\n --separator-height: #{$formInputHeight};\n\n &[size=\"small\"] {\n --separator-height: #{$formInputHeightSmall};\n }\n}\n\n.stzh-monthyearpicker {\n &__wrapper {\n display: flex;\n align-items: flex-start;\n }\n\n &__separator {\n @include fontSize('milli');\n margin-left: space('medium');\n margin-right: space('medium');\n height: var(--separator-height);\n display: flex;\n align-items: center;\n align-self: flex-end;\n }\n}\n","import {\n Component,\n Prop,\n Host,\n Element,\n h,\n Event,\n EventEmitter,\n Watch,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhDropdownOption,\n StzhDropdownChangeEvent,\n StzhMonthyearpickerChangeEvent,\n} from \"../../index\";\n\nimport { StzhMonthyearpickerLocalizedText } from \"./stzh-monthyearpicker.localization\";\n\n@Component({\n tag: \"stzh-monthyearpicker\",\n styleUrl: \"stzh-monthyearpicker.scss\",\n scoped: true\n})\nexport class StzhMonthyearpicker {\n /** Initial open state of month dropdown */\n @Prop() monthOpen: boolean = false;\n\n /** Initial open state of year dropdown */\n @Prop() yearOpen: boolean = false;\n\n /** Set which months to show (overwrites months from min/max) */\n @Prop() months: number[] | string;\n private _months: number[];\n\n /** Set which years to show (overwrites years from min/max) */\n @Prop() years: number[] | string;\n private _years: number[];\n\n /** Sort direction */\n @Prop({ mutable: true }) yearSortDirection: \"asc\" | \"desc\" = \"asc\";\n\n /**\n * Minimum month and year allowed to be picked in `YYYY-MM` format.\n * This setting can be used alone or together with the `max` property.\n */\n @Prop() min: string;\n\n /**\n * Maximum month and year allowed to be picked in `YYYY-MM` format.\n * This setting can be used alone or together with the `min` property.\n */\n @Prop() max: string;\n\n /**\n * Minimum year (will be overwritten if `min` is used).\n * This setting can be used alone or together with the `maxYear` property.\n */\n @Prop() minYear: number;\n\n /**\n * Maximum year (will be overwritten if `max` is used).\n * This setting can be used alone or together with the `minYear` property.\n */\n @Prop() maxYear: number;\n\n /** Picker format. */\n @Prop({ reflect: true }) format: \"default\" | \"creditcard\" = \"default\";\n\n /** Name of the hidden date picker input. */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of hidden input (current selected year and month YYYY-MM). */\n @Prop({ mutable: true, reflect: true }) value: string = \"0000-00\";\n\n /** Popover placement for the dropdown (if applicable) */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Month dropdown label */\n @Prop() monthLabel: string = \"\";\n\n /** Year dropdown label */\n @Prop() yearLabel: string = \"\";\n\n /** Whether the element is readonly or not */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form ot hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Description message for month */\n @Prop() descriptionMonth: string;\n\n /** Description message for year */\n @Prop() descriptionYear: string;\n\n /** Long description message appearing in a popover for month */\n @Prop() descriptionLongMonth: string;\n\n /** Long description message appearing in a popover for year */\n @Prop() descriptionLongYear: string;\n\n /** One or multiple error message for month */\n @Prop() errorMonth: string | string[];\n\n /** One or multiple error message for year */\n @Prop() errorYear: string | string[];\n\n /** Invalid status for month */\n @Prop({ reflect: true }) invalidMonth: boolean = false;\n\n /** Invalid status for year */\n @Prop({ reflect: true }) invalidYear: boolean = false;\n\n /** Id of the element which describes the month dropdown */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedbyMonth: string = \"\";\n\n /** Id of the element which describes the year dropdown */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedbyYear: string = \"\";\n\n /** Translation strings. */\n @Prop() localization: StzhMonthyearpickerLocalizedText;\n\n /** Monthyearpicker change event */\n @Event() stzhChange: EventEmitter<StzhMonthyearpickerChangeEvent>;\n\n @Element() element: HTMLStzhMonthyearpickerElement;\n\n @Watch(\"months\")\n monthsWatcher(newValue: number[] | string) {\n if (typeof newValue === \"string\") {\n this._months = JSON.parse(newValue);\n } else {\n this._months = newValue;\n }\n\n this.updateMonthOptions();\n }\n\n @Watch(\"years\")\n yearsWatcher(newValue: number[] | string) {\n if (typeof newValue === \"string\") {\n this._years = JSON.parse(newValue);\n } else {\n this._years = newValue;\n }\n\n this.updateYearOptions();\n }\n\n @Watch(\"value\")\n @Watch(\"min\")\n @Watch(\"max\")\n minMaxWatcher() {\n this.updateMonthOptions();\n this.updateYearOptions();\n }\n\n @Listen(\"stzhChange\", { capture: true })\n onDropdownChange(event: CustomEvent<StzhDropdownChangeEvent>) {\n if (event.detail.component === \"stzh-dropdown\") {\n if ((event.target as HTMLStzhDropdownElement).name === `${this.name}-year`) {\n this.onYearsDropdownChange(event);\n } else {\n this.onMonthsDropdownChange(event);\n }\n // stop propagating dropdown change event otherwise angular control value accessor won't work\n event.stopPropagation();\n }\n }\n\n private monthsDropdown: HTMLStzhDropdownElement;\n private dropdownMonthOptions: StzhDropdownOption[];\n private dropdownYearOptions: StzhDropdownOption[];\n\n private onRootFocus = () => {\n if (this.monthsDropdown) {\n this.monthsDropdown.focus();\n }\n }\n\n private onMonthsDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const year = this.value.split(\"-\")[0] || \"0000\";\n const month = event.detail.value || \"00\";\n this.onChange(year, month);\n }\n\n private onYearsDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const year = event.detail.value || \"0000\";\n const month = this.value.split(\"-\")[1] || \"00\";\n this.onChange(year, month);\n }\n\n private onChange(year, month) {\n this.value = `${year}-${month}`;\n this.stzhChange.emit({\n component: \"stzh-monthyearpicker\",\n value: this.value,\n valueMonth: month,\n valueYear: year\n });\n }\n\n private updateMonthOptions() {\n const options = [];\n let months = [];\n\n if (this._months) {\n months = this._months;\n } else {\n const currentYear = Number(this.value.split(\"-\")[0] || \"0000\");\n\n let minMonth = 1;\n let maxMonth = 12;\n\n if (this.min) {\n const minDate = new Date(this.min);\n\n if (currentYear === minDate.getFullYear()) {\n minMonth = minDate.getMonth() + 1;\n }\n }\n\n if (this.max) {\n const maxDate = new Date(this.max);\n\n if (currentYear === maxDate.getFullYear()) {\n maxMonth = maxDate.getMonth() + 1;\n }\n }\n\n for (let i = minMonth; i <= maxMonth; i++) {\n months.push(i);\n }\n }\n\n months.forEach((month) => {\n const paddedMonth = (\"00\" + month).slice(-2);\n const monthName = this.localization.$globals.monthNames[month - 1];\n\n options.push({\n text: this.format === \"creditcard\"\n ? `${paddedMonth} (${monthName})`\n : monthName,\n value: paddedMonth\n });\n });\n\n this.dropdownMonthOptions = options;\n }\n\n private initializeYears(): void {\n if (Array.isArray(this.years)) {\n this._years = this.years.map(Number); \n } else if (typeof this.years === \"string\") {\n // If \"years\" is a string, split in numbers\n this._years = this.years\n .split(\",\")\n .map((year) => parseInt(year.trim(), 10))\n .filter((year) => !isNaN(year)); \n // Delete non valid values\n }\n }\n\n private updateYearOptions(): void {\n const options: StzhDropdownOption[] = [];\n let years: number[] = [];\n\n if (this._years && this._years.length > 0) {\n years = this._years;\n } else {\n const currentMonth = Number(this.value.split(\"-\")[1] || \"00\");\n\n const yearNow = new Date().getFullYear();\n let minYear = this.minYear || (yearNow - 10);\n let maxYear = this.maxYear || (yearNow + 10);\n\n if (this.min) {\n const minDate = new Date(this.min);\n if (currentMonth && currentMonth < minDate.getMonth() + 1) {\n minYear = minDate.getFullYear() + 1;\n } else {\n minYear = minDate.getFullYear();\n }\n }\n\n if (this.max) {\n const maxDate = new Date(this.max);\n if (currentMonth && currentMonth > maxDate.getMonth() + 1) {\n maxYear = maxDate.getFullYear() - 1;\n } else {\n maxYear = maxDate.getFullYear();\n }\n }\n\n for (let i = minYear; i <= maxYear; i++) {\n years.push(i);\n }\n }\n\n years.sort((a, b) => (this.yearSortDirection === \"asc\" ? a - b : b - a));\n\n years.forEach((year) => {\n options.push({ text: `${year}`, value: `${year}` });\n });\n\n this.dropdownYearOptions = options;\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"monthyearpicker\");\n }\n\n this.initializeYears();\n this.monthsWatcher(this.months);\n this.yearsWatcher(this.years);\n\n }\n\n render() {\n const classes = {\n \"stzh-monthyearpicker\": true\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <input type=\"hidden\" name={this.name} value={this.value} />\n\n <div class=\"stzh-monthyearpicker__wrapper\">\n <stzh-dropdown\n open={this.monthOpen}\n name={`${this.name}-month`}\n class=\"stzh-monthyearpicker__months-dropdown\"\n label={this.monthLabel || this.localization.monthLabel}\n ref={(el) => (this.monthsDropdown = el as HTMLStzhDropdownElement)}\n options={this.dropdownMonthOptions}\n items={[this.value.split(\"-\")[1]]}\n required={this.required}\n disabled={this.disabled}\n size={this.size}\n hideOptional={this.hideOptional}\n popoverPlacement={this.popoverPlacement}\n description={this.descriptionMonth}\n descriptionLong={this.descriptionLongMonth}\n error={this.errorMonth}\n a11yDescribedby={this.a11yDescribedbyMonth}\n invalid={this.invalidMonth}\n ></stzh-dropdown>\n\n <div class=\"stzh-monthyearpicker__separator\">/</div>\n\n <stzh-dropdown\n open={this.yearOpen}\n name={`${this.name}-year`}\n class=\"stzh-monthyearpicker__years-dropdown\"\n label={this.yearLabel || this.localization.yearLabel}\n options={this.dropdownYearOptions}\n items={[this.value.split(\"-\")[0]]}\n required={this.required}\n disabled={this.disabled}\n size={this.size}\n hideOptional={this.hideOptional}\n popoverPlacement={this.popoverPlacement}\n description={this.descriptionYear}\n descriptionLong={this.descriptionLongYear}\n error={this.errorYear}\n a11yDescribedby={this.a11yDescribedbyYear}\n invalid={this.invalidYear}\n ></stzh-dropdown>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-pagebottom.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,8uHAA8uH;;
|
|
1
|
+
{"file":"stzh-pagebottom.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,8uHAA8uH;;MCoB3vHA,gBAAc;;;;;sBAKI,EAAE;;;;;;oBAqBJ,8BAA8B;;;;EAoBzD,MAAM,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;MACtB,IAAI,CAAC,YAAY,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;KACrG;GACF;EAED,MAAM;;;IAIJ,MAAM,OAAO,GAAG;MACd,iBAAiB,EAAE,IAAI;MACvB,SAAS,EAAE,IAAI;KAChB,CAAC;IAEF,QACE,EAAC,IAAI,QACH,WAAK,KAAK,EAAE,OAAO,IACjB,WAAK,KAAK,EAAC,0BAA0B,IACnC,WAAK,KAAK,EAAC,uBAAuB,IAC/B,IAAI,CAAC,SAAS;MACb,WAAK,KAAK,EAAC,wBAAwB,IACjC,sBACE,mBACE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,EACnC,OAAO,EAAC,gBAAgB,EACxB,IAAI,EAAC,OAAO,EACZ,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,IAAI,EACpB,WAAW,EAAE,IAAI,CAAC,gBAAgB,GACrB,CACJ,CACT,EAGP,CAAC,IAAI,CAAC,aAAa;MAClB,WAAK,KAAK,EAAC,gCAAgC,IACxC,IAAI,CAAC,UAAU;QACd,WAAK,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,UAAU,CAAO,EAEnE,kBACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,GAChB,CACV,CAEJ,EAEN,WAAK,KAAK,EAAC,iCAAiC,IAC1C,YAAM,IAAI,EAAC,gBAAgB,GAAQ,CAC/B,CACF,CAaF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["StzhPagebottom"],"sources":["src/components/stzh-pagebottom/stzh-pagebottom.scss?tag=stzh-pagebottom&encapsulation=scoped","src/components/stzh-pagebottom/stzh-pagebottom.tsx"],"sourcesContent":[":host {\n @media print {\n display: none;\n }\n\n // ::slotted([slot=\"logo\"]) {\n // height: 38px;\n // }\n}\n\n.stzh-pagebottom {\n &__wrapper {\n display: grid;\n }\n\n &__left {\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n row-gap: space('xsmall');\n\n @include mq($from: small) {\n flex-direction: row;\n }\n }\n\n &__share-title {\n @include fontCurve('caption');\n\t\tmargin-bottom: space('small');\n }\n\n &__sticky-actions {\n margin-left: auto;\n margin-top: space('medium');\n\n --stzh-button-white-space: nowrap;\n\n @include mq($from: small) {\n margin-top: 0;\n }\n }\n\n &__print,\n &__share-wrapper {\n flex-shrink: 0;\n }\n\n &__share-wrapper {\n margin-left: -10px;\n\n @include mq($from: medium) {\n margin-left: 0;\n }\n }\n\n &__print {\n @include mq($from: small) {\n margin-right: space('xxlarge');\n }\n\n @include mq($from: medium) {\n @include spaceCurve('margin-right', 'big');\n }\n }\n\n // &__logo {\n // @include mq($from: small) {\n // margin-left: auto;\n // }\n // }\n\n // &__logo-link {\n // &:not(:empty) {\n // display: block;\n // margin-top: space('xlarge');\n\n // @include mq($from: small) {\n // margin-top: 0;\n // margin-left: space('xlarge');\n // }\n // }\n // }\n\n &:has(#{&}__sticky-actions:not(:empty)) &__wrapper {\n grid-template-columns: auto;\n\n @include mq($from: small) {\n grid-template-columns: minmax(0, 1fr) calc(110px + 44px + #{space('small')} + #{space('medium')});\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\n// import { hasSlot } from \"../../utils/utils\";\n\nimport { StzhPagebottomLocalizedText } from \"./stzh-pagebottom.localization\";\n\n/**\n */\n@Component({\n tag: \"stzh-pagebottom\",\n styleUrl: \"stzh-pagebottom.scss\",\n scoped: true\n})\nexport class StzhPagebottom {\n /** Translation strings. */\n @Prop() localization: StzhPagebottomLocalizedText;\n\n /** Share Title */\n @Prop() shareTitle: string = \"\";\n\n /** URL of current site (uses full URL by default) */\n @Prop() shareUrl: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n @Prop() shareServices: ShareService[] | string;\n\n /** Whether to show share */\n @Prop({ reflect: true }) shareDisabled: boolean;\n\n /** Overwrite share mail subject translation */\n @Prop() shareMailSubject: string;\n\n /** Overwrite share mail body translation */\n @Prop() shareMailBody: string;\n\n /** Logo href */\n @Prop() logoHref: string = \"https://www.stadt-zuerich.ch\";\n\n /** Whether to show print button */\n @Prop({ reflect: true }) withPrint: boolean;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute of the print button element.\n */\n @Prop() printAnalyticsId: string;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the logo link element.\n * Default value will be \"Footer Logo\"\n */\n // @Prop() logoAnalyticsId: string;\n\n @Element() element: HTMLStzhPagebottomElement;\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"pagebottom\");\n }\n }\n\n render() {\n // const printUsed: boolean = hasSlot(this.element, \"print\");\n // const logoUsed: boolean = hasSlot(this.element, \"logo\");\n\n const classes = {\n \"stzh-pagebottom\": true,\n \"rs_skip\": true // will prevent component being read by readspeaker\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-pagebottom__wrapper\">\n <div class=\"stzh-pagebottom__left\">\n {this.withPrint &&\n <div class=\"stzh-pagebottom__print\">\n <stzh-print>\n <stzh-button\n label={this.localization.printLabel}\n variant=\"tertiary-plain\"\n size=\"small\"\n noPaddingLeft={true}\n noPaddingRight={true}\n analyticsId={this.printAnalyticsId}\n ></stzh-button>\n </stzh-print>\n </div>\n }\n\n {!this.shareDisabled &&\n <div class=\"stzh-pagebottom__share-wrapper\">\n {this.shareTitle &&\n <div class=\"stzh-pagebottom__share-title\">{this.shareTitle}</div>\n }\n <stzh-share\n url={this.shareUrl}\n services={this.shareServices}\n mailSubject={this.shareMailSubject}\n mailBody={this.shareMailBody}\n ></stzh-share>\n </div>\n }\n </div>\n\n <div class=\"stzh-pagebottom__sticky-actions\">\n <slot name=\"sticky-actions\"></slot>\n </div>\n </div>\n\n {/* {logoUsed &&\n <div class=\"stzh-pagebottom__logo\">\n <a\n href={this.logoHref}\n class=\"stzh-pagebottom__logo-link\"\n s-object-id={this.logoAnalyticsId || \"Footer Logo\"}\n >\n <slot name=\"logo\"></slot>\n </a>\n </div>\n } */}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -34,7 +34,8 @@ const StzhPagetitle$1 = /*@__PURE__*/ proxyCustomElement(class StzhPagetitle ext
|
|
|
34
34
|
const tag = this.element.querySelector('stzh-tag[slot="tag"], [slot="tag"] stzh-tag');
|
|
35
35
|
if (heading) {
|
|
36
36
|
setPropsIfNull(heading, {
|
|
37
|
-
curve: "hero"
|
|
37
|
+
curve: "hero",
|
|
38
|
+
level: "1"
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
if (disturber) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-pagetitle.js","mappings":";;;;;AAAA,MAAM,gBAAgB,GAAG,o7VAAo7V;;MC6Bh8VA,eAAa;;;;IAyChB,oBAAe,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F,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["StzhPagetitle"],"sources":["src/components/stzh-pagetitle/stzh-pagetitle.scss?tag=stzh-pagetitle&encapsulation=scoped","src/components/stzh-pagetitle/stzh-pagetitle.tsx"],"sourcesContent":["/**\n * @prop --background-color: Background color\n * @prop --image-background-color: Background color of image\n *\n * @prop --stzh-pagetitle-disturber-height: Global: Disturber height\n * @prop --stzh-pagetitle-disturber-stuck-height: Global: Disturber height when sticky (below medium breakpoint)\n * @prop --stzh-pagetitle-disturber-is-stuck: **Global**: Whether disturber is currently sticky (readonly variable on `<html>`)\n * @prop --stzh-pagetitle-disturber-is-not-stuck: **Global**: Whether disturber is currently not sticky (readonly variable on `<html>`)\n */\n\n:host {\n --background-color: #{$pagetitleBackgroundColor};\n --image-background-color: #{$ratioBackgroundColor};\n\n ::slotted([slot=\"image\"]) {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &[background=\"default\"] {\n --stzh-readspeaker-background-color: var(--background-color);\n --stzh-readspeaker-audio-track-progress-background-color: #{$colorWhite};\n }\n\n &[background=\"transparent\"] {\n --background-color: transparent;\n }\n}\n\n.stzh-pagetitle {\n background-color: var(--background-color);\n\n &__container {\n @include container;\n }\n\n &__wrapper {\n position: relative;\n display: grid;\n }\n\n &__text {\n @include spaceCurve('padding-top', 'big');\n @include spaceCurve('padding-bottom', 'big');\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n &__image-wrapper {\n position: relative;\n }\n\n &__ratio {\n --background-color: var(--image-background-color);\n }\n\n &__image-inner-wrapper {\n background-color: var(--image-background-color);\n position: absolute;\n inset: 0;\n height: 100%;\n margin-left: calc(#{$containerMargin} / -1);\n margin-right: calc(#{$containerMargin} / -1);\n\n @include mq($from: small) {\n margin-left: calc(#{$containerMarginSmall} / -1);\n margin-right: calc(#{$containerMarginSmall} / -1);\n }\n\n @include mq($from: medium) {\n margin-left: 0;\n margin-right: 0;\n width: calc(100% + #{$containerMarginMedium});\n }\n\n @include mq($from: large) {\n width: calc(100% + #{$containerMarginLarge});\n }\n\n @include mq($from: ultra) {\n width: calc(100% + ((#{map-get($breakpoints, 'ultra')} - #{$containerMaxWidth}) / 2));\n }\n }\n\n &__meta {\n display: flex;\n flex-direction: column-reverse;\n row-gap: space('xsmall');\n\n @include mq($from: medium) {\n flex-direction: row;\n }\n }\n\n &__tag {\n &:not(:empty) {\n margin-right: auto;\n }\n }\n\n &__readspeaker {\n @include mq($from: small, $to: medium) {\n --stzh-readspeaker-dropdown-position: relative;\n --stzh-readspeaker-dropdown-top: auto;\n }\n }\n\n &__dateline {\n @include fontSize('milli');\n @include spaceCurve('margin-top', 'regular');\n color: $colorPrimary70;\n margin-bottom: space('xsmall');\n }\n\n &__lead {\n --stzh-base-lead-color: #{$headingColor};\n }\n\n &__heading:not(:empty) + &__lead:not(:empty) {\n @include spaceCurve('margin-top', 'medium');\n }\n\n &__disturber {\n z-index: $zIndexSticky;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n\n @include mq($from: medium) {\n z-index: initial;\n position: absolute;\n width: calc(((100% - 7 * #{$gridGutterMedium}) / 8 * 3) + 2 * #{$gridGutterMedium});\n left: auto;\n bottom: calc((#{spaceCurveValue('huge', 'medium')} - #{spaceCurveValue('regular', 'medium')}) / -1);\n }\n\n @include mq($from: large) {\n width: calc(((100% - 11 * #{$gridGutterLarge}) / 12 * 4) + 3 * #{$gridGutterLarge});\n bottom: calc(#{spaceCurveValue('huge', 'large')} / -1);\n }\n\n @include mq($from: ultra) {\n width: calc(((100% - 11 * #{$gridGutterUltra}) / 12 * 4) + 3 * #{$gridGutterUltra});\n }\n }\n\n /* Has no image variant */\n\n &--has-no-image &__ratio {\n display: none;\n }\n\n &--has-no-image &__text {\n @include grid;\n }\n\n &--has-no-image &__meta,\n &--has-no-image &__dateline,\n &--has-no-image &__heading,\n &--has-no-image &__lead {\n grid-column: 1 / span 4;\n }\n\n &--has-no-image &__meta,\n &--has-no-image &__dateline,\n &--has-no-image &__heading {\n @include mq($from: medium) {\n grid-column: 1 / span 8;\n }\n }\n\n &--has-no-image &__lead {\n @include mq($from: medium) {\n grid-column: 1 / span 6;\n }\n\n @include mq($from: large) {\n grid-column: 1 / span 7;\n }\n }\n\n /* Has image variant */\n\n &--has-image &__wrapper {\n @include mq($from: medium) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: space('xxlarge');\n }\n }\n\n /* Has meta */\n\n &--has-meta &__text {\n @include spaceCurve('padding-top', 'regular');\n }\n\n /* Has tag */\n\n &--has-tag &__readspeaker {\n @include mq($from: medium) {\n --stzh-readspeaker-dropdown-left: auto;\n --stzh-readspeaker-dropdown-right: 0px;\n\n --stzh-readspeaker-dropdown-settings-left: auto;\n --stzh-readspeaker-dropdown-settings-right: 0px;\n }\n }\n\n /* Default background */\n\n &--background-default &__text {\n --stzh-selection-background-color: #{$colorWhite};\n }\n\n /* Transparent background */\n\n &--background-transparent &__text {\n @include spaceCurve('padding-bottom', 'large');\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhDisturberOpenEvent,\n StzhDisturberCloseEvent\n} from \"../../index\";\n\nimport { hasSlot, setPropsIfNull } from \"../../utils/utils\";\nimport { media } from \"../../utils/media-utils\";\n\n/**\n * @slot heading - Slot for `stzh-heading` element\n * @slot image - Slot for `stzh-figure` or `img` element\n * @slot lead - Slot for `stzh-text` element\n * @slot tag - Slot for `stzh-tag` element\n * @slot readspeaker - Slot for `stzh-readspeaker` element\n */\n@Component({\n tag: \"stzh-pagetitle\",\n styleUrl: \"stzh-pagetitle.scss\",\n scoped: true\n})\nexport class StzhPagetitle {\n @Element() element: HTMLStzhPagetitleElement;\n\n /** Background color */\n @Prop({ reflect: true }) background: \"default\" | \"transparent\" = \"default\";\n\n /** Dateline */\n @Prop() dateline: string;\n\n @Listen(\"resize\", { target: \"window\" })\n handleResize() {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.update);\n }\n\n @Listen(\"stzhOpen\")\n handleStzhOpen(event: CustomEvent<StzhDisturberOpenEvent>) {\n if (event.detail.component === \"stzh-disturber\") {\n this.isDisturberOpen = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n }\n\n @Listen(\"stzhClose\")\n handleStzhClose(event: CustomEvent<StzhDisturberCloseEvent>) {\n if (event.detail.component === \"stzh-disturber\") {\n this.isDisturberOpen = false;\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n }\n\n private observer: MutationObserver;\n private debounceResize: number;\n private disturberElement: HTMLDivElement;\n private isDisturberOpen: boolean = false;\n\n private update = () => {\n if (!this.disturberElement) {\n return;\n }\n\n const isMedium = media(\"medium\").matches;\n const disturberHeight = this.disturberElement?.offsetHeight || 0;\n const hasDisturber = disturberHeight && this.isDisturberOpen;\n const isStuck = hasDisturber && !isMedium;\n\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-height\", hasDisturber ? `${disturberHeight}px` : \"0px\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-stuck-height\", isStuck ? `${disturberHeight}px` : \"0px\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-is-stuck\", isStuck ? \"1\" : \"0\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-is-not-stuck\", isStuck ? \"0\" : \"1\");\n\n // document.documentElement.classList.toggle(\"stzh-pagetitle-disturber-is-stuck\", isStuck);\n }\n\n private init = () => {\n const heading = this.element.querySelector('stzh-heading[slot=\"heading\"], [slot=\"heading\"] stzh-heading');\n const disturber = this.element.querySelector('stzh-disturber[slot=\"disturber\"], [slot=\"disturber\"] stzh-disturber');\n const leads = this.element.querySelectorAll('stzh-text[slot=\"lead\"], [slot=\"lead\"] stzh-text');\n const show = this.element.querySelector('stzh-show[slot=\"disturber\"], [slot=\"disturber\"] stzh-show');\n const readspeakerButton = this.element.querySelector('[slot=\"readspeaker\"] stzh-button');\n const tag = this.element.querySelector('stzh-tag[slot=\"tag\"], [slot=\"tag\"] stzh-tag');\n\n if (heading) {\n setPropsIfNull(heading, {\n curve: \"hero\"\n } as HTMLStzhHeadingElement);\n }\n\n if (disturber) {\n setPropsIfNull(disturber, {\n initialOpenAnimation: true\n } as HTMLStzhDisturberElement);\n }\n\n if (show) {\n setPropsIfNull(show, {\n mikro: true\n } as HTMLStzhShowElement);\n }\n\n if (tag) {\n setPropsIfNull(tag, {\n type: \"secondary\",\n size: \"large\",\n nonInteractive: true\n } as HTMLStzhTagElement);\n }\n\n if (readspeakerButton) {\n setPropsIfNull(readspeakerButton, {\n variant: \"tertiary-plain\",\n noPaddingLeft: true,\n noPaddingRight: true,\n size: \"small\",\n sizeMedium: \"tiny\",\n buttonAccesskey: \"L\"\n } as HTMLStzhButtonElement);\n }\n\n leads.forEach((lead) => {\n setPropsIfNull(lead, {\n lead: true\n } as HTMLStzhTextElement)\n });\n }\n\n componentDidRender() {\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n this.observer?.disconnect();\n }\n\n render() {\n const imageSlotUsed = hasSlot(this.element, 'image');\n const leadSlotUsed = hasSlot(this.element, 'lead');\n const tagSlotUsed = hasSlot(this.element, 'tag');\n const readspeakerSlotUsed = hasSlot(this.element, 'readspeaker');\n\n const classes = {\n \"stzh-pagetitle\": true,\n \"stzh-pagetitle--has-image\": imageSlotUsed,\n \"stzh-pagetitle--has-no-image\": !imageSlotUsed,\n \"stzh-pagetitle--has-lead\": leadSlotUsed,\n \"stzh-pagetitle--has-tag\": tagSlotUsed,\n \"stzh-pagetitle--has-meta\": tagSlotUsed || readspeakerSlotUsed,\n [`stzh-pagetitle--background-${this.background}`]: !!this.background,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-pagetitle__container\">\n <div class=\"stzh-pagetitle__wrapper\">\n <div class=\"stzh-pagetitle__text\">\n\n <div class=\"stzh-pagetitle__meta\">\n <div class=\"stzh-pagetitle__tag\">\n <slot name=\"tag\"></slot>\n </div>\n\n <div class=\"stzh-pagetitle__readspeaker\">\n <slot name=\"readspeaker\"></slot>\n </div>\n </div>\n\n {this.dateline &&\n <div class=\"stzh-pagetitle__dateline\">\n {this.dateline}\n </div>\n }\n\n <div class=\"stzh-pagetitle__heading\">\n <slot name=\"heading\"></slot>\n </div>\n\n <div class=\"stzh-pagetitle__lead\">\n <slot name=\"lead\"></slot>\n </div>\n\n </div>\n\n <div class=\"stzh-pagetitle__image-wrapper\">\n <stzh-ratio\n ratio={\"16:9\"}\n ratioSmall={\"3:2\"}\n ratioMedium={\"16:9\"}\n class=\"stzh-pagetitle__ratio\"\n ></stzh-ratio>\n <div class=\"stzh-pagetitle__image-inner-wrapper\">\n <slot name=\"image\"></slot>\n </div>\n </div>\n\n <div\n class=\"stzh-pagetitle__disturber\"\n ref={(el) => (this.disturberElement = el as HTMLDivElement)}\n >\n <slot name=\"disturber\"></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"stzh-pagetitle.js","mappings":";;;;;AAAA,MAAM,gBAAgB,GAAG,o7VAAo7V;;MC6Bh8VA,eAAa;;;;IAyChB,oBAAe,GAAY,KAAK,CAAC;IAEjC,WAAM,GAAG;;MACf,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC1B,OAAO;OACR;MAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;MACzC,MAAM,eAAe,GAAG,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,YAAY,KAAI,CAAC,CAAC;MACjE,MAAM,YAAY,GAAG,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC;MAC7D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E,OAAO,IACjB,WAAK,KAAK,EAAC,2BAA2B,IACpC,WAAK,KAAK,EAAC,yBAAyB,IAClC,WAAK,KAAK,EAAC,sBAAsB,IAE/B,WAAK,KAAK,EAAC,sBAAsB,IAC/B,WAAK,KAAK,EAAC,qBAAqB,IAC9B,YAAM,IAAI,EAAC,KAAK,GAAQ,CACpB,EAEN,WAAK,KAAK,EAAC,6BAA6B,IACtC,YAAM,IAAI,EAAC,aAAa,GAAQ,CAC5B,CACF,EAEL,IAAI,CAAC,QAAQ;MACZ,WAAK,KAAK,EAAC,0BAA0B,IAClC,IAAI,CAAC,QAAQ,CACV,EAGR,WAAK,KAAK,EAAC,yBAAyB,IAClC,YAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,EAEN,WAAK,KAAK,EAAC,sBAAsB,IAC/B,YAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CAEF,EAEN,WAAK,KAAK,EAAC,+BAA+B,IACxC,kBACE,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAC,uBAAuB,GACjB,EACd,WAAK,KAAK,EAAC,qCAAqC,IAC9C,YAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,CACF,EAEN,WACE,KAAK,EAAC,2BAA2B,EACjC,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,gBAAgB,GAAG,EAAoB,CAAC,IAE3D,YAAM,IAAI,EAAC,WAAW,GAAQ,CAC1B,CACF,CACF,CACF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["StzhPagetitle"],"sources":["src/components/stzh-pagetitle/stzh-pagetitle.scss?tag=stzh-pagetitle&encapsulation=scoped","src/components/stzh-pagetitle/stzh-pagetitle.tsx"],"sourcesContent":["/**\n * @prop --background-color: Background color\n * @prop --image-background-color: Background color of image\n *\n * @prop --stzh-pagetitle-disturber-height: Global: Disturber height\n * @prop --stzh-pagetitle-disturber-stuck-height: Global: Disturber height when sticky (below medium breakpoint)\n * @prop --stzh-pagetitle-disturber-is-stuck: **Global**: Whether disturber is currently sticky (readonly variable on `<html>`)\n * @prop --stzh-pagetitle-disturber-is-not-stuck: **Global**: Whether disturber is currently not sticky (readonly variable on `<html>`)\n */\n\n:host {\n --background-color: #{$pagetitleBackgroundColor};\n --image-background-color: #{$ratioBackgroundColor};\n\n ::slotted([slot=\"image\"]) {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &[background=\"default\"] {\n --stzh-readspeaker-background-color: var(--background-color);\n --stzh-readspeaker-audio-track-progress-background-color: #{$colorWhite};\n }\n\n &[background=\"transparent\"] {\n --background-color: transparent;\n }\n}\n\n.stzh-pagetitle {\n background-color: var(--background-color);\n\n &__container {\n @include container;\n }\n\n &__wrapper {\n position: relative;\n display: grid;\n }\n\n &__text {\n @include spaceCurve('padding-top', 'big');\n @include spaceCurve('padding-bottom', 'big');\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n &__image-wrapper {\n position: relative;\n }\n\n &__ratio {\n --background-color: var(--image-background-color);\n }\n\n &__image-inner-wrapper {\n background-color: var(--image-background-color);\n position: absolute;\n inset: 0;\n height: 100%;\n margin-left: calc(#{$containerMargin} / -1);\n margin-right: calc(#{$containerMargin} / -1);\n\n @include mq($from: small) {\n margin-left: calc(#{$containerMarginSmall} / -1);\n margin-right: calc(#{$containerMarginSmall} / -1);\n }\n\n @include mq($from: medium) {\n margin-left: 0;\n margin-right: 0;\n width: calc(100% + #{$containerMarginMedium});\n }\n\n @include mq($from: large) {\n width: calc(100% + #{$containerMarginLarge});\n }\n\n @include mq($from: ultra) {\n width: calc(100% + ((#{map-get($breakpoints, 'ultra')} - #{$containerMaxWidth}) / 2));\n }\n }\n\n &__meta {\n display: flex;\n flex-direction: column-reverse;\n row-gap: space('xsmall');\n\n @include mq($from: medium) {\n flex-direction: row;\n }\n }\n\n &__tag {\n &:not(:empty) {\n margin-right: auto;\n }\n }\n\n &__readspeaker {\n @include mq($from: small, $to: medium) {\n --stzh-readspeaker-dropdown-position: relative;\n --stzh-readspeaker-dropdown-top: auto;\n }\n }\n\n &__dateline {\n @include fontSize('milli');\n @include spaceCurve('margin-top', 'regular');\n color: $colorPrimary70;\n margin-bottom: space('xsmall');\n }\n\n &__lead {\n --stzh-base-lead-color: #{$headingColor};\n }\n\n &__heading:not(:empty) + &__lead:not(:empty) {\n @include spaceCurve('margin-top', 'medium');\n }\n\n &__disturber {\n z-index: $zIndexSticky;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n\n @include mq($from: medium) {\n z-index: initial;\n position: absolute;\n width: calc(((100% - 7 * #{$gridGutterMedium}) / 8 * 3) + 2 * #{$gridGutterMedium});\n left: auto;\n bottom: calc((#{spaceCurveValue('huge', 'medium')} - #{spaceCurveValue('regular', 'medium')}) / -1);\n }\n\n @include mq($from: large) {\n width: calc(((100% - 11 * #{$gridGutterLarge}) / 12 * 4) + 3 * #{$gridGutterLarge});\n bottom: calc(#{spaceCurveValue('huge', 'large')} / -1);\n }\n\n @include mq($from: ultra) {\n width: calc(((100% - 11 * #{$gridGutterUltra}) / 12 * 4) + 3 * #{$gridGutterUltra});\n }\n }\n\n /* Has no image variant */\n\n &--has-no-image &__ratio {\n display: none;\n }\n\n &--has-no-image &__text {\n @include grid;\n }\n\n &--has-no-image &__meta,\n &--has-no-image &__dateline,\n &--has-no-image &__heading,\n &--has-no-image &__lead {\n grid-column: 1 / span 4;\n }\n\n &--has-no-image &__meta,\n &--has-no-image &__dateline,\n &--has-no-image &__heading {\n @include mq($from: medium) {\n grid-column: 1 / span 8;\n }\n }\n\n &--has-no-image &__lead {\n @include mq($from: medium) {\n grid-column: 1 / span 6;\n }\n\n @include mq($from: large) {\n grid-column: 1 / span 7;\n }\n }\n\n /* Has image variant */\n\n &--has-image &__wrapper {\n @include mq($from: medium) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: space('xxlarge');\n }\n }\n\n /* Has meta */\n\n &--has-meta &__text {\n @include spaceCurve('padding-top', 'regular');\n }\n\n /* Has tag */\n\n &--has-tag &__readspeaker {\n @include mq($from: medium) {\n --stzh-readspeaker-dropdown-left: auto;\n --stzh-readspeaker-dropdown-right: 0px;\n\n --stzh-readspeaker-dropdown-settings-left: auto;\n --stzh-readspeaker-dropdown-settings-right: 0px;\n }\n }\n\n /* Default background */\n\n &--background-default &__text {\n --stzh-selection-background-color: #{$colorWhite};\n }\n\n /* Transparent background */\n\n &--background-transparent &__text {\n @include spaceCurve('padding-bottom', 'large');\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Listen,\n} from \"@stencil/core\";\n\nimport {\n StzhDisturberOpenEvent,\n StzhDisturberCloseEvent\n} from \"../../index\";\n\nimport { hasSlot, setPropsIfNull } from \"../../utils/utils\";\nimport { media } from \"../../utils/media-utils\";\n\n/**\n * @slot heading - Slot for `stzh-heading` element\n * @slot image - Slot for `stzh-figure` or `img` element\n * @slot lead - Slot for `stzh-text` element\n * @slot tag - Slot for `stzh-tag` element\n * @slot readspeaker - Slot for `stzh-readspeaker` element\n */\n@Component({\n tag: \"stzh-pagetitle\",\n styleUrl: \"stzh-pagetitle.scss\",\n scoped: true\n})\nexport class StzhPagetitle {\n @Element() element: HTMLStzhPagetitleElement;\n\n /** Background color */\n @Prop({ reflect: true }) background: \"default\" | \"transparent\" = \"default\";\n\n /** Dateline */\n @Prop() dateline: string;\n\n @Listen(\"resize\", { target: \"window\" })\n handleResize() {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.update);\n }\n\n @Listen(\"stzhOpen\")\n handleStzhOpen(event: CustomEvent<StzhDisturberOpenEvent>) {\n if (event.detail.component === \"stzh-disturber\") {\n this.isDisturberOpen = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n }\n\n @Listen(\"stzhClose\")\n handleStzhClose(event: CustomEvent<StzhDisturberCloseEvent>) {\n if (event.detail.component === \"stzh-disturber\") {\n this.isDisturberOpen = false;\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n }\n\n private observer: MutationObserver;\n private debounceResize: number;\n private disturberElement: HTMLDivElement;\n private isDisturberOpen: boolean = false;\n\n private update = () => {\n if (!this.disturberElement) {\n return;\n }\n\n const isMedium = media(\"medium\").matches;\n const disturberHeight = this.disturberElement?.offsetHeight || 0;\n const hasDisturber = disturberHeight && this.isDisturberOpen;\n const isStuck = hasDisturber && !isMedium;\n\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-height\", hasDisturber ? `${disturberHeight}px` : \"0px\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-stuck-height\", isStuck ? `${disturberHeight}px` : \"0px\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-is-stuck\", isStuck ? \"1\" : \"0\");\n document.documentElement.style.setProperty(\"--stzh-pagetitle-disturber-is-not-stuck\", isStuck ? \"0\" : \"1\");\n\n // document.documentElement.classList.toggle(\"stzh-pagetitle-disturber-is-stuck\", isStuck);\n }\n\n private init = () => {\n const heading = this.element.querySelector('stzh-heading[slot=\"heading\"], [slot=\"heading\"] stzh-heading');\n const disturber = this.element.querySelector('stzh-disturber[slot=\"disturber\"], [slot=\"disturber\"] stzh-disturber');\n const leads = this.element.querySelectorAll('stzh-text[slot=\"lead\"], [slot=\"lead\"] stzh-text');\n const show = this.element.querySelector('stzh-show[slot=\"disturber\"], [slot=\"disturber\"] stzh-show');\n const readspeakerButton = this.element.querySelector('[slot=\"readspeaker\"] stzh-button');\n const tag = this.element.querySelector('stzh-tag[slot=\"tag\"], [slot=\"tag\"] stzh-tag');\n\n if (heading) {\n setPropsIfNull(heading, {\n curve: \"hero\",\n level: \"1\"\n } as HTMLStzhHeadingElement);\n }\n\n if (disturber) {\n setPropsIfNull(disturber, {\n initialOpenAnimation: true\n } as HTMLStzhDisturberElement);\n }\n\n if (show) {\n setPropsIfNull(show, {\n mikro: true\n } as HTMLStzhShowElement);\n }\n\n if (tag) {\n setPropsIfNull(tag, {\n type: \"secondary\",\n size: \"large\",\n nonInteractive: true\n } as HTMLStzhTagElement);\n }\n\n if (readspeakerButton) {\n setPropsIfNull(readspeakerButton, {\n variant: \"tertiary-plain\",\n noPaddingLeft: true,\n noPaddingRight: true,\n size: \"small\",\n sizeMedium: \"tiny\",\n buttonAccesskey: \"L\"\n } as HTMLStzhButtonElement);\n }\n\n leads.forEach((lead) => {\n setPropsIfNull(lead, {\n lead: true\n } as HTMLStzhTextElement)\n });\n }\n\n componentDidRender() {\n requestAnimationFrame(() => {\n requestAnimationFrame(this.update);\n });\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n this.observer?.disconnect();\n }\n\n render() {\n const imageSlotUsed = hasSlot(this.element, 'image');\n const leadSlotUsed = hasSlot(this.element, 'lead');\n const tagSlotUsed = hasSlot(this.element, 'tag');\n const readspeakerSlotUsed = hasSlot(this.element, 'readspeaker');\n\n const classes = {\n \"stzh-pagetitle\": true,\n \"stzh-pagetitle--has-image\": imageSlotUsed,\n \"stzh-pagetitle--has-no-image\": !imageSlotUsed,\n \"stzh-pagetitle--has-lead\": leadSlotUsed,\n \"stzh-pagetitle--has-tag\": tagSlotUsed,\n \"stzh-pagetitle--has-meta\": tagSlotUsed || readspeakerSlotUsed,\n [`stzh-pagetitle--background-${this.background}`]: !!this.background,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-pagetitle__container\">\n <div class=\"stzh-pagetitle__wrapper\">\n <div class=\"stzh-pagetitle__text\">\n\n <div class=\"stzh-pagetitle__meta\">\n <div class=\"stzh-pagetitle__tag\">\n <slot name=\"tag\"></slot>\n </div>\n\n <div class=\"stzh-pagetitle__readspeaker\">\n <slot name=\"readspeaker\"></slot>\n </div>\n </div>\n\n {this.dateline &&\n <div class=\"stzh-pagetitle__dateline\">\n {this.dateline}\n </div>\n }\n\n <div class=\"stzh-pagetitle__heading\">\n <slot name=\"heading\"></slot>\n </div>\n\n <div class=\"stzh-pagetitle__lead\">\n <slot name=\"lead\"></slot>\n </div>\n\n </div>\n\n <div class=\"stzh-pagetitle__image-wrapper\">\n <stzh-ratio\n ratio={\"16:9\"}\n ratioSmall={\"3:2\"}\n ratioMedium={\"16:9\"}\n class=\"stzh-pagetitle__ratio\"\n ></stzh-ratio>\n <div class=\"stzh-pagetitle__image-inner-wrapper\">\n <slot name=\"image\"></slot>\n </div>\n </div>\n\n <div\n class=\"stzh-pagetitle__disturber\"\n ref={(el) => (this.disturberElement = el as HTMLDivElement)}\n >\n <slot name=\"disturber\"></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -22,10 +22,10 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
22
22
|
this.radios = Array.from(this.element.querySelectorAll(SELECTOR_RADIO));
|
|
23
23
|
this.updateRadiosProperty("hide-optional", true);
|
|
24
24
|
this.updateRadiosProperty("a11y-describedby", `${this.radiogroupId}-description`);
|
|
25
|
+
this.updateRadiosProperty("invalid", this.invalid || this.errorUsed);
|
|
25
26
|
this.watchValue(this.value);
|
|
26
27
|
this.watchName(this.name);
|
|
27
28
|
this.watchDisabled(this.disabled);
|
|
28
|
-
this.watchInvalid(this.invalid);
|
|
29
29
|
this.watchRequired(this.required);
|
|
30
30
|
};
|
|
31
31
|
this.localization = undefined;
|
|
@@ -52,9 +52,6 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
52
52
|
watchDisabled(newValue) {
|
|
53
53
|
this.updateRadiosProperty("disabled", newValue);
|
|
54
54
|
}
|
|
55
|
-
watchInvalid(newValue) {
|
|
56
|
-
this.updateRadiosProperty("invalid", newValue);
|
|
57
|
-
}
|
|
58
55
|
watchRequired(newValue) {
|
|
59
56
|
this.updateRadiosProperty("required", newValue);
|
|
60
57
|
}
|
|
@@ -107,6 +104,10 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
107
104
|
}
|
|
108
105
|
});
|
|
109
106
|
}
|
|
107
|
+
get errorUsed() {
|
|
108
|
+
var _a;
|
|
109
|
+
return hasSlot(this.element, 'error') || ((_a = this._error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
110
|
+
}
|
|
110
111
|
updateCheckedRadioByValue(value) {
|
|
111
112
|
this.checkedRadio = this.radios.find(radio => radio.value === value);
|
|
112
113
|
if (this.checkedRadio) {
|
|
@@ -160,22 +161,20 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
render() {
|
|
163
|
-
var _a;
|
|
164
164
|
const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;
|
|
165
165
|
const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;
|
|
166
|
-
const errorUsed = hasSlot(this.element, 'error') || ((_a = this._error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
167
166
|
const classes = {
|
|
168
167
|
"stzh-radiogroup": true,
|
|
169
168
|
"stzh-radiogroup--has-description": descriptionUsed,
|
|
170
169
|
"stzh-radiogroup--has-description-long": descriptionLongUsed,
|
|
171
|
-
"stzh-radiogroup--has-error": errorUsed,
|
|
170
|
+
"stzh-radiogroup--has-error": this.errorUsed,
|
|
172
171
|
"stzh-radiogroup--is-required": this.required,
|
|
173
172
|
"stzh-radiogroup--is-disabled": this.disabled,
|
|
174
|
-
"stzh-radiogroup--is-invalid": this.invalid || errorUsed,
|
|
173
|
+
"stzh-radiogroup--is-invalid": this.invalid || this.errorUsed,
|
|
175
174
|
"stzh-radiogroup--hide-legend": this.hideLegend,
|
|
176
175
|
[`stzh-radiogroup--direction-${this.direction}`]: !!this.direction
|
|
177
176
|
};
|
|
178
|
-
return (h(Host, { "is-invalid": this.invalid || errorUsed }, h("fieldset", { class: classes }, this.legend &&
|
|
177
|
+
return (h(Host, { "is-invalid": this.invalid || this.errorUsed }, h("fieldset", { class: classes }, this.legend &&
|
|
179
178
|
h("legend", { class: "stzh-radiogroup__legend" }, this.legend, !this.hideOptional &&
|
|
180
179
|
h("span", { class: "stzh-radiogroup__marker" }, h("span", { class: "stzh-radiogroup__marker-symbol", "aria-hidden": "true" }, this.required
|
|
181
180
|
? this.localization.$globals.requiredFieldMarker
|
|
@@ -187,7 +186,6 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
187
186
|
static get watchers() { return {
|
|
188
187
|
"name": ["watchName"],
|
|
189
188
|
"disabled": ["watchDisabled"],
|
|
190
|
-
"invalid": ["watchInvalid"],
|
|
191
189
|
"required": ["watchRequired"],
|
|
192
190
|
"value": ["watchValue"],
|
|
193
191
|
"error": ["errorWatcher"],
|
|
@@ -215,7 +213,6 @@ const StzhRadiogroup = /*@__PURE__*/ proxyCustomElement(class StzhRadiogroup ext
|
|
|
215
213
|
}, [[4, "reset", "resetListener"], [0, "stzhChange", "onChange"]], {
|
|
216
214
|
"name": ["watchName"],
|
|
217
215
|
"disabled": ["watchDisabled"],
|
|
218
|
-
"invalid": ["watchInvalid"],
|
|
219
216
|
"required": ["watchRequired"],
|
|
220
217
|
"value": ["watchValue"],
|
|
221
218
|
"error": ["errorWatcher"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-radiogroup2.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,2pJAA2pJ;;ACkBrrJ,MAAM,cAAc,GAAG,gDAAgD,CAAC;AAExE,IAAI,iBAAiB,GAAG,CAAC,CAAC;MAcb,cAAc;;;;IAoDjB,6BAAwB,GAAa,EAAE,CAAC;IAyGxC,gBAAW,GAAG;MACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAChC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ACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/stzh-radiogroup/stzh-radiogroup.scss?tag=stzh-radiogroup&encapsulation=scoped","src/components/stzh-radiogroup/stzh-radiogroup.tsx"],"sourcesContent":[":host {\n &[disabled]:not([disabled=\"false\"]) {\n --description-color: #{$formDisabledColor};\n }\n}\n\n.stzh-radiogroup {\n @include input-description;\n margin: 0;\n padding: 0;\n border: none;\n\n &__fields {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n gap: space('medium');\n }\n\n &__legend {\n @include font('heavy');\n @include fontSize('micro');\n color: $headingColor;\n padding: 0;\n margin-bottom: space('xsmall');\n }\n\n &__marker {\n @include fontSize('nano');\n margin-left: calc(-0.25em + #{space('xsmall')});\n }\n\n &--hide-legend &__legend {\n @include visuallyhidden;\n }\n\n &--direction-horizontal &__fields {\n flex-wrap: wrap;\n flex-direction: row;\n row-gap: space('medium');\n column-gap: space('xxlarge');\n }\n}\n","import {\n Component,\n Prop,\n Element,\n Watch,\n h,\n Listen,\n Host\n} from \"@stencil/core\";\n\nimport { StzhRadioChangeEvent } from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { camelCase } from \"../../utils/string-utils\";\nimport { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nconst SELECTOR_RADIO = 'stzh-radio, stzh-button[type=radio], stzh-card';\n\nlet radiogroupCounter = 0;\n\n/**\n * @slot - Slot for `stzh-radio`, `stzh-button[type=\"radio\"]` or `stzh-card` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-radiogroup\",\n styleUrl: \"stzh-radiogroup.scss\",\n scoped: true\n})\nexport class StzhRadiogroup {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input radio elements, will define the radio group. If you have more than one radio group on a page, every group needs to have its own unique name */\n @Prop({ reflect: true }) name: string;\n\n /** The legend */\n @Prop() legend: string;\n\n /** Hide legend to show only for screenreaders */\n @Prop({ reflect: true }) hideLegend: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form ot hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Select a radio by value */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string = \"\";\n\n /** Direction */\n @Prop({ reflect: true }) direction: \"vertical\" | \"horizontal\" = \"vertical\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Current checked radio element (readonly) */\n @Prop() checkedRadio: HTMLStzhRadioElement | null = null;\n\n /** Prevent updating certain properties of radio elements (possible values inside array: disabled, invalid, required, hide-marker) */\n @Prop() preventUpdateProperties: string[] | string = [];\n private _preventUpdateProperties: string[] = [];\n\n /** Host element */\n @Element() element: HTMLElement;\n\n @Watch(\"name\")\n watchName(newValue: string) {\n this.updateRadiosProperty(\"name\", newValue);\n }\n\n @Watch(\"disabled\")\n watchDisabled(newValue: boolean) {\n this.updateRadiosProperty(\"disabled\", newValue);\n }\n\n @Watch(\"invalid\")\n watchInvalid(newValue: boolean) {\n this.updateRadiosProperty(\"invalid\", newValue);\n }\n\n @Watch(\"required\")\n watchRequired(newValue: boolean) {\n this.updateRadiosProperty(\"required\", newValue);\n }\n\n @Watch(\"value\")\n watchValue(newValue: string) {\n this.updateCheckedRadioByValue(newValue);\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Watch(\"preventUpdateProperties\")\n preventUpdatePropertiesWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._preventUpdateProperties = JSON.parse(newValue);\n } else {\n this._preventUpdateProperties = newValue;\n }\n }\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n\n @Listen(\"stzhChange\")\n onChange(event: CustomEvent<StzhRadioChangeEvent>) {\n this.value = event.detail.value;\n }\n\n /** Radio elements */\n private radios: HTMLStzhRadioElement[];\n private radiogroupId: string;\n private observer: MutationObserver;\n\n private updateRadiosProperty(prop: string, value: any) {\n this.radios.forEach((radio: HTMLStzhRadioElement) => {\n if (prop === \"name\" || (this._preventUpdateProperties.indexOf(prop) === -1)) {\n radio[camelCase(prop)] = value;\n }\n });\n }\n\n private updateCheckedRadioByValue(value: string) {\n this.checkedRadio = this.radios.find(radio => radio.value === value);\n\n if (this.checkedRadio) {\n this.checkedRadio.checked = true;\n }\n\n this.uncheckRadios();\n }\n\n private uncheckRadios() {\n // make sure that no other radios are checked than the current one or no one\n this.radios.forEach((radio: HTMLStzhRadioElement) => {\n if (!this.checkedRadio || radio !== this.checkedRadio) {\n radio.checked = false;\n }\n });\n }\n\n private handleReset = async () => {\n this.value = this.defaultValue;\n }\n\n private init = () => {\n // update radios\n this.radios = Array.from(this.element.querySelectorAll(SELECTOR_RADIO));\n\n this.updateRadiosProperty(\"hide-optional\", true);\n this.updateRadiosProperty(\"a11y-describedby\", `${this.radiogroupId}-description`);\n\n this.watchValue(this.value);\n this.watchName(this.name);\n this.watchDisabled(this.disabled);\n this.watchInvalid(this.invalid);\n this.watchRequired(this.required);\n }\n\n componentDidLoad() {\n this.defaultValue = this.defaultValue ? this.defaultValue : this.value;\n }\n\n async componentWillLoad() {\n this.radiogroupId = `stzh-radiogroup-${radiogroupCounter++}`;\n this.errorWatcher(this.error);\n this.preventUpdatePropertiesWatcher(this.preventUpdateProperties);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'radiogroup');\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return prop !== \"checkedRadio\";\n }\n\n componentDidRender() {\n this.init();\n }\n\n connectedCallback() {\n if (!this.value) {\n this.radios = Array.from(this.element.querySelectorAll(SELECTOR_RADIO));\n\n // try to find a checkbox that might has checked set to true\n const checkedRadio = this.radios.find(radio => radio.checked);\n\n if (checkedRadio) {\n this.value = checkedRadio.value;\n }\n }\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || this._error?.length > 0;\n\n const classes = {\n \"stzh-radiogroup\": true,\n \"stzh-radiogroup--has-description\": descriptionUsed,\n \"stzh-radiogroup--has-description-long\": descriptionLongUsed,\n \"stzh-radiogroup--has-error\": errorUsed,\n \"stzh-radiogroup--is-required\": this.required,\n \"stzh-radiogroup--is-disabled\": this.disabled,\n \"stzh-radiogroup--is-invalid\": this.invalid || errorUsed,\n \"stzh-radiogroup--hide-legend\": this.hideLegend,\n [`stzh-radiogroup--direction-${this.direction}`]: !!this.direction\n };\n\n return (\n <Host is-invalid={this.invalid || errorUsed}>\n <fieldset class={classes}>\n {this.legend &&\n <legend class=\"stzh-radiogroup__legend\">\n {this.legend}\n {!this.hideOptional &&\n <span class=\"stzh-radiogroup__marker\">\n <span class=\"stzh-radiogroup__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-radiogroup__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </legend>\n }\n <div class=\"stzh-radiogroup__fields\">\n <slot></slot>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-radiogroup\"\n id={`${this.radiogroupId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </fieldset>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"stzh-radiogroup2.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,2pJAA2pJ;;ACkBrrJ,MAAM,cAAc,GAAG,gDAAgD,CAAC;AAExE,IAAI,iBAAiB,GAAG,CAAC,CAAC;MAcb,cAAc;;;;IAoDjB,6BAAwB,GAAa,EAAE,CAAC;IAwGxC,gBAAW,GAAG;MACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAChC,CAAA;IAEO,SAAI,GAAG;;MAEb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;MACxE,IAAI,CAAC,oBAAoB,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;MACjD,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,YAAY,cAAc,CAAC,CAAC;MAClF,IAAI,CAAC,oBAAo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I,CAAC,MAAM;MACV,cAAQ,KAAK,EAAC,yBAAyB,IACpC,IAAI,CAAC,MAAM,EACX,CAAC,IAAI,CAAC,YAAY;QACjB,YAAM,KAAK,EAAC,yBAAyB,IACnC,YAAM,KAAK,EAAC,gCAAgC,iBAAa,MAAM,IAC5D,IAAI,CAAC,QAAQ;YACV,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB;YAC9C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,CAE7C,EACP,YAAM,KAAK,EAAC,8BAA8B,IACvC,IAAI,CAAC,QAAQ;YACV,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB;YAC5C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAE3C,CACF,CAEF,EAEX,WAAK,KAAK,EAAC,yBAAyB,IAClC,eAAa,CACT,EACN,EAAC,oBAAoB,IACnB,WAAW,EAAC,iBAAiB,EAC7B,EAAE,EAAE,GAAG,IAAI,CAAC,YAAY,cAAc,EACtC,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACO,CACN,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/stzh-radiogroup/stzh-radiogroup.scss?tag=stzh-radiogroup&encapsulation=scoped","src/components/stzh-radiogroup/stzh-radiogroup.tsx"],"sourcesContent":[":host {\n &[disabled]:not([disabled=\"false\"]) {\n --description-color: #{$formDisabledColor};\n }\n}\n\n.stzh-radiogroup {\n @include input-description;\n margin: 0;\n padding: 0;\n border: none;\n\n &__fields {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n gap: space('medium');\n }\n\n &__legend {\n @include font('heavy');\n @include fontSize('micro');\n color: $headingColor;\n padding: 0;\n margin-bottom: space('xsmall');\n }\n\n &__marker {\n @include fontSize('nano');\n margin-left: calc(-0.25em + #{space('xsmall')});\n }\n\n &--hide-legend &__legend {\n @include visuallyhidden;\n }\n\n &--direction-horizontal &__fields {\n flex-wrap: wrap;\n flex-direction: row;\n row-gap: space('medium');\n column-gap: space('xxlarge');\n }\n}\n","import {\n Component,\n Prop,\n Element,\n Watch,\n h,\n Listen,\n Host\n} from \"@stencil/core\";\n\nimport { StzhRadioChangeEvent } from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { camelCase } from \"../../utils/string-utils\";\nimport { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nconst SELECTOR_RADIO = 'stzh-radio, stzh-button[type=radio], stzh-card';\n\nlet radiogroupCounter = 0;\n\n/**\n * @slot - Slot for `stzh-radio`, `stzh-button[type=\"radio\"]` or `stzh-card` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-radiogroup\",\n styleUrl: \"stzh-radiogroup.scss\",\n scoped: true\n})\nexport class StzhRadiogroup {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input radio elements, will define the radio group. If you have more than one radio group on a page, every group needs to have its own unique name */\n @Prop({ reflect: true }) name: string;\n\n /** The legend */\n @Prop() legend: string;\n\n /** Hide legend to show only for screenreaders */\n @Prop({ reflect: true }) hideLegend: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form ot hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Select a radio by value */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string = \"\";\n\n /** Direction */\n @Prop({ reflect: true }) direction: \"vertical\" | \"horizontal\" = \"vertical\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Current checked radio element (readonly) */\n @Prop() checkedRadio: HTMLStzhRadioElement | null = null;\n\n /** Prevent updating certain properties of radio elements (possible values inside array: disabled, invalid, required, hide-marker) */\n @Prop() preventUpdateProperties: string[] | string = [];\n private _preventUpdateProperties: string[] = [];\n\n /** Host element */\n @Element() element: HTMLElement;\n\n @Watch(\"name\")\n watchName(newValue: string) {\n this.updateRadiosProperty(\"name\", newValue);\n }\n\n @Watch(\"disabled\")\n watchDisabled(newValue: boolean) {\n this.updateRadiosProperty(\"disabled\", newValue);\n }\n\n @Watch(\"required\")\n watchRequired(newValue: boolean) {\n this.updateRadiosProperty(\"required\", newValue);\n }\n\n @Watch(\"value\")\n watchValue(newValue: string) {\n this.updateCheckedRadioByValue(newValue);\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Watch(\"preventUpdateProperties\")\n preventUpdatePropertiesWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._preventUpdateProperties = JSON.parse(newValue);\n } else {\n this._preventUpdateProperties = newValue;\n }\n }\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n\n @Listen(\"stzhChange\")\n onChange(event: CustomEvent<StzhRadioChangeEvent>) {\n this.value = event.detail.value;\n }\n\n /** Radio elements */\n private radios: HTMLStzhRadioElement[];\n private radiogroupId: string;\n private observer: MutationObserver;\n\n private updateRadiosProperty(prop: string, value: any) {\n this.radios.forEach((radio: HTMLStzhRadioElement) => {\n if (prop === \"name\" || (this._preventUpdateProperties.indexOf(prop) === -1)) {\n radio[camelCase(prop)] = value;\n }\n });\n }\n\n private get errorUsed(): boolean {\n return hasSlot(this.element, 'error') || this._error?.length > 0;\n }\n\n private updateCheckedRadioByValue(value: string) {\n this.checkedRadio = this.radios.find(radio => radio.value === value);\n\n if (this.checkedRadio) {\n this.checkedRadio.checked = true;\n }\n\n this.uncheckRadios();\n }\n\n private uncheckRadios() {\n // make sure that no other radios are checked than the current one or no one\n this.radios.forEach((radio: HTMLStzhRadioElement) => {\n if (!this.checkedRadio || radio !== this.checkedRadio) {\n radio.checked = false;\n }\n });\n }\n\n private handleReset = async () => {\n this.value = this.defaultValue;\n }\n\n private init = () => {\n // update radios\n this.radios = Array.from(this.element.querySelectorAll(SELECTOR_RADIO));\n this.updateRadiosProperty(\"hide-optional\", true);\n this.updateRadiosProperty(\"a11y-describedby\", `${this.radiogroupId}-description`);\n this.updateRadiosProperty(\"invalid\", this.invalid || this.errorUsed);\n\n this.watchValue(this.value);\n this.watchName(this.name);\n this.watchDisabled(this.disabled);\n this.watchRequired(this.required);\n }\n\n componentDidLoad() {\n this.defaultValue = this.defaultValue ? this.defaultValue : this.value;\n }\n\n async componentWillLoad() {\n this.radiogroupId = `stzh-radiogroup-${radiogroupCounter++}`;\n this.errorWatcher(this.error);\n this.preventUpdatePropertiesWatcher(this.preventUpdateProperties);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'radiogroup');\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return prop !== \"checkedRadio\";\n }\n\n componentDidRender() {\n this.init();\n }\n\n connectedCallback() {\n if (!this.value) {\n this.radios = Array.from(this.element.querySelectorAll(SELECTOR_RADIO));\n\n // try to find a checkbox that might has checked set to true\n const checkedRadio = this.radios.find(radio => radio.checked);\n\n if (checkedRadio) {\n this.value = checkedRadio.value;\n }\n }\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n\n const classes = {\n \"stzh-radiogroup\": true,\n \"stzh-radiogroup--has-description\": descriptionUsed,\n \"stzh-radiogroup--has-description-long\": descriptionLongUsed,\n \"stzh-radiogroup--has-error\": this.errorUsed,\n \"stzh-radiogroup--is-required\": this.required,\n \"stzh-radiogroup--is-disabled\": this.disabled,\n \"stzh-radiogroup--is-invalid\": this.invalid || this.errorUsed,\n \"stzh-radiogroup--hide-legend\": this.hideLegend,\n [`stzh-radiogroup--direction-${this.direction}`]: !!this.direction\n };\n\n return (\n <Host is-invalid={this.invalid || this.errorUsed}>\n <fieldset class={classes}>\n {this.legend &&\n <legend class=\"stzh-radiogroup__legend\">\n {this.legend}\n {!this.hideOptional &&\n <span class=\"stzh-radiogroup__marker\">\n <span class=\"stzh-radiogroup__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-radiogroup__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </legend>\n }\n <div class=\"stzh-radiogroup__fields\">\n <slot></slot>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-radiogroup\"\n id={`${this.radiogroupId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </fieldset>\n </Host>\n );\n }\n}\n"],"version":3}
|