@oiz/stzh-components 2.11.1 → 2.12.0-beta1
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-7697372c.js → app-globals-749422d7.js} +8 -4
- package/dist/cjs/app-globals-749422d7.js.map +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-accordion.cjs.entry.js +1 -1
- package/dist/cjs/stzh-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-appointments.cjs.entry.js +7 -3
- package/dist/cjs/stzh-appointments.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-container.cjs.entry.js +1 -1
- package/dist/cjs/stzh-container.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 +33 -14
- package/dist/cjs/stzh-datepicker_3.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-progressbar-item.cjs.entry.js +2 -1
- package/dist/cjs/stzh-progressbar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-progressbar.cjs.entry.js +14 -0
- package/dist/cjs/stzh-progressbar.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-sticky.cjs.entry.js +1 -1
- package/dist/cjs/stzh-sticky.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-toastbar.cjs.entry.js +8 -1
- package/dist/cjs/stzh-toastbar.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +7 -3
- package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +7 -3
- package/dist/cjs/stzh-vbz-ticker.cjs.entry.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +12 -0
- package/dist/collection/assets/i18n/en.json +12 -0
- package/dist/collection/components/stzh-accordion/stzh-accordion.css +3 -2
- package/dist/collection/components/stzh-appointments/stzh-appointments.js +9 -3
- package/dist/collection/components/stzh-appointments/stzh-appointments.js.map +1 -1
- package/dist/collection/components/stzh-button/stzh-button.js +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +1 -1
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +1 -1
- package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +1 -1
- package/dist/collection/components/stzh-container/stzh-container.css +8 -8
- package/dist/collection/components/stzh-datalist/stzh-datalist.css +1 -1
- package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.js +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +62 -15
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js.map +1 -1
- package/dist/collection/components/stzh-gallery/stzh-gallery.css +0 -4
- package/dist/collection/components/stzh-input/stzh-input.js +1 -1
- package/dist/collection/components/stzh-link/stzh-link.js +1 -1
- package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +35 -0
- package/dist/collection/components/stzh-progressbar/stzh-progressbar.js.map +1 -1
- package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js +3 -2
- package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js.map +1 -1
- package/dist/collection/components/stzh-radio/stzh-radio.js +1 -1
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +5 -3
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js.map +1 -1
- package/dist/collection/components/stzh-richtext/stzh-richtext.js +1 -1
- package/dist/collection/components/stzh-sticky/stzh-sticky.css +4 -4
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js +1 -1
- package/dist/collection/components/stzh-toastbar/stzh-toastbar.js +8 -1
- package/dist/collection/components/stzh-toastbar/stzh-toastbar.js.map +1 -1
- package/dist/collection/components/stzh-toggle/stzh-toggle.js +1 -1
- package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js +9 -3
- package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js.map +1 -1
- package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js +9 -3
- package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js.map +1 -1
- package/dist/collection/global/js/helpers/utils.js +6 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/translation-utils.js.map +1 -1
- package/dist/components/index.js +7 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-accordion.js +1 -1
- package/dist/components/stzh-accordion.js.map +1 -1
- package/dist/components/stzh-appointments.js +8 -3
- package/dist/components/stzh-appointments.js.map +1 -1
- package/dist/components/stzh-container.js +1 -1
- package/dist/components/stzh-container.js.map +1 -1
- package/dist/components/stzh-datalist2.js +1 -1
- package/dist/components/stzh-datalist2.js.map +1 -1
- package/dist/components/stzh-datepicker2.js +38 -16
- package/dist/components/stzh-datepicker2.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-progressbar-item2.js +2 -1
- package/dist/components/stzh-progressbar-item2.js.map +1 -1
- package/dist/components/stzh-progressbar.js +16 -1
- package/dist/components/stzh-progressbar.js.map +1 -1
- package/dist/components/stzh-radiogroup2.js +1 -1
- package/dist/components/stzh-sticky.js +1 -1
- package/dist/components/stzh-sticky.js.map +1 -1
- package/dist/components/stzh-toastbar.js +8 -1
- package/dist/components/stzh-toastbar.js.map +1 -1
- package/dist/components/stzh-vbz-majorticker.js +8 -3
- package/dist/components/stzh-vbz-majorticker.js.map +1 -1
- package/dist/components/stzh-vbz-ticker.js +8 -3
- package/dist/components/stzh-vbz-ticker.js.map +1 -1
- package/dist/esm/{app-globals-1a77c38b.js → app-globals-5f5be02f.js} +8 -4
- package/dist/esm/app-globals-5f5be02f.js.map +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-accordion.entry.js +1 -1
- package/dist/esm/stzh-accordion.entry.js.map +1 -1
- package/dist/esm/stzh-appointments.entry.js +7 -3
- package/dist/esm/stzh-appointments.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-container.entry.js +1 -1
- package/dist/esm/stzh-container.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 +34 -15
- package/dist/esm/stzh-datepicker_3.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-progressbar-item.entry.js +2 -1
- package/dist/esm/stzh-progressbar-item.entry.js.map +1 -1
- package/dist/esm/stzh-progressbar.entry.js +14 -0
- package/dist/esm/stzh-progressbar.entry.js.map +1 -1
- package/dist/esm/stzh-sticky.entry.js +1 -1
- package/dist/esm/stzh-sticky.entry.js.map +1 -1
- package/dist/esm/stzh-toastbar.entry.js +8 -1
- package/dist/esm/stzh-toastbar.entry.js.map +1 -1
- package/dist/esm/stzh-vbz-majorticker.entry.js +7 -3
- package/dist/esm/stzh-vbz-majorticker.entry.js.map +1 -1
- package/dist/esm/stzh-vbz-ticker.entry.js +7 -3
- package/dist/esm/stzh-vbz-ticker.entry.js.map +1 -1
- package/dist/esm-es5/{app-globals-1a77c38b.js → app-globals-5f5be02f.js} +2 -2
- package/dist/esm-es5/app-globals-5f5be02f.js.map +1 -0
- package/dist/esm-es5/index.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/stzh-accordion.entry.js +1 -1
- package/dist/esm-es5/stzh-accordion.entry.js.map +1 -1
- package/dist/esm-es5/stzh-appointments.entry.js +1 -1
- package/dist/esm-es5/stzh-appointments.entry.js.map +1 -1
- package/dist/esm-es5/stzh-components.js +1 -1
- package/dist/esm-es5/stzh-components.js.map +1 -1
- package/dist/esm-es5/stzh-container.entry.js +1 -1
- package/dist/esm-es5/stzh-container.entry.js.map +1 -1
- package/dist/esm-es5/stzh-datalist_2.entry.js +1 -1
- package/dist/esm-es5/stzh-datalist_2.entry.js.map +1 -1
- package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -1
- package/dist/esm-es5/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm-es5/stzh-gallery.entry.js +1 -1
- package/dist/esm-es5/stzh-gallery.entry.js.map +1 -1
- package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
- package/dist/esm-es5/stzh-progressbar-item.entry.js.map +1 -1
- package/dist/esm-es5/stzh-progressbar.entry.js +1 -1
- package/dist/esm-es5/stzh-progressbar.entry.js.map +1 -1
- package/dist/esm-es5/stzh-sticky.entry.js +1 -1
- package/dist/esm-es5/stzh-sticky.entry.js.map +1 -1
- package/dist/esm-es5/stzh-toastbar.entry.js +1 -1
- package/dist/esm-es5/stzh-toastbar.entry.js.map +1 -1
- package/dist/esm-es5/stzh-vbz-majorticker.entry.js +1 -1
- package/dist/esm-es5/stzh-vbz-majorticker.entry.js.map +1 -1
- package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
- package/dist/esm-es5/stzh-vbz-ticker.entry.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +12 -0
- package/dist/stzh-components/assets/i18n/en.json +12 -0
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/p-0b1b2aa6.system.entry.js +2 -0
- package/dist/stzh-components/p-0b1b2aa6.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-11784b90.entry.js → p-0ba7ce34.entry.js} +2 -2
- package/dist/stzh-components/p-0ba7ce34.entry.js.map +1 -0
- package/dist/stzh-components/p-0bb08043.system.js.map +1 -1
- package/dist/stzh-components/p-222ba06a.entry.js +2 -0
- package/dist/stzh-components/p-222ba06a.entry.js.map +1 -0
- package/dist/stzh-components/{p-c658502d.system.entry.js → p-241997a2.system.entry.js} +2 -2
- package/dist/stzh-components/p-241997a2.system.entry.js.map +1 -0
- package/dist/stzh-components/p-2d88c544.system.entry.js +2 -0
- package/dist/stzh-components/p-2d88c544.system.entry.js.map +1 -0
- package/dist/stzh-components/p-361996d1.entry.js +2 -0
- package/dist/stzh-components/p-361996d1.entry.js.map +1 -0
- package/dist/stzh-components/{p-54dbcd0e.system.entry.js → p-383c2c21.system.entry.js} +2 -2
- package/dist/stzh-components/{p-54dbcd0e.system.entry.js.map → p-383c2c21.system.entry.js.map} +1 -1
- package/dist/stzh-components/{p-15980af0.entry.js → p-534dc28e.entry.js} +2 -2
- package/dist/stzh-components/{p-15980af0.entry.js.map → p-534dc28e.entry.js.map} +1 -1
- package/dist/stzh-components/{p-5fdf0a8e.entry.js → p-5486402c.entry.js} +2 -2
- package/dist/stzh-components/{p-5fdf0a8e.entry.js.map → p-5486402c.entry.js.map} +1 -1
- package/dist/stzh-components/p-55d76b46.system.entry.js +2 -0
- package/dist/stzh-components/p-55d76b46.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-98b60fb7.js → p-5e014c0e.js} +2 -2
- package/dist/stzh-components/p-5e014c0e.js.map +1 -0
- package/dist/stzh-components/{p-e5c1f04c.system.entry.js → p-628b5b0d.system.entry.js} +2 -2
- package/dist/stzh-components/p-628b5b0d.system.entry.js.map +1 -0
- package/dist/stzh-components/p-66b0d1f3.entry.js +2 -0
- package/dist/stzh-components/p-66b0d1f3.entry.js.map +1 -0
- package/dist/stzh-components/{p-8b4cc10d.entry.js → p-761909d5.entry.js} +2 -2
- package/dist/stzh-components/p-761909d5.entry.js.map +1 -0
- package/dist/stzh-components/{p-50914ed3.system.entry.js → p-87a3758c.system.entry.js} +2 -2
- package/dist/stzh-components/p-87a3758c.system.entry.js.map +1 -0
- package/dist/stzh-components/p-a1e1261a.entry.js +2 -0
- package/dist/stzh-components/p-a1e1261a.entry.js.map +1 -0
- package/dist/stzh-components/p-aa9975e6.entry.js +2 -0
- package/dist/stzh-components/p-aa9975e6.entry.js.map +1 -0
- package/dist/stzh-components/{p-bb2fe16f.system.entry.js → p-b3d76f2a.system.entry.js} +2 -2
- package/dist/stzh-components/{p-bb2fe16f.system.entry.js.map → p-b3d76f2a.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-bf7316ab.system.js +2 -0
- package/dist/stzh-components/{p-bde8bb45.system.js.map → p-bf7316ab.system.js.map} +1 -1
- package/dist/stzh-components/{p-aefc1441.entry.js → p-c57402af.entry.js} +2 -2
- package/dist/stzh-components/p-c57402af.entry.js.map +1 -0
- package/dist/stzh-components/{p-cbcb366a.system.entry.js → p-c60ccc16.system.entry.js} +2 -2
- package/dist/stzh-components/p-c60ccc16.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-cc260e20.entry.js → p-d5ee8b1a.entry.js} +2 -2
- package/dist/stzh-components/{p-cc260e20.entry.js.map → p-d5ee8b1a.entry.js.map} +1 -1
- package/dist/stzh-components/{p-d9984b93.system.entry.js → p-dc30c467.system.entry.js} +2 -2
- package/dist/stzh-components/p-dc30c467.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-9bfe7d0d.system.entry.js → p-e69312e4.system.entry.js} +2 -2
- package/dist/stzh-components/p-e69312e4.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-84ae2651.system.js → p-ebb38041.system.js} +2 -2
- package/dist/stzh-components/p-ebb38041.system.js.map +1 -0
- package/dist/stzh-components/p-fa0e39e0.system.entry.js +2 -0
- package/dist/stzh-components/p-fa0e39e0.system.entry.js.map +1 -0
- package/dist/stzh-components/p-ffb4e717.entry.js +2 -0
- package/dist/stzh-components/p-ffb4e717.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/stzh-components/stzh-components.js +1 -1
- package/dist/types/components.d.ts +14 -2
- package/dist/types/utils/translation-utils.d.ts +2 -0
- package/dist/vscode-data.json +7523 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-7697372c.js.map +0 -1
- package/dist/esm/app-globals-1a77c38b.js.map +0 -1
- package/dist/esm-es5/app-globals-1a77c38b.js.map +0 -1
- package/dist/stzh-components/p-07819ba5.entry.js +0 -2
- package/dist/stzh-components/p-07819ba5.entry.js.map +0 -1
- package/dist/stzh-components/p-1095d872.system.entry.js +0 -2
- package/dist/stzh-components/p-1095d872.system.entry.js.map +0 -1
- package/dist/stzh-components/p-11784b90.entry.js.map +0 -1
- package/dist/stzh-components/p-446dcea5.entry.js +0 -2
- package/dist/stzh-components/p-446dcea5.entry.js.map +0 -1
- package/dist/stzh-components/p-50914ed3.system.entry.js.map +0 -1
- package/dist/stzh-components/p-7b0da017.entry.js +0 -2
- package/dist/stzh-components/p-7b0da017.entry.js.map +0 -1
- package/dist/stzh-components/p-7fdd98fe.entry.js +0 -2
- package/dist/stzh-components/p-7fdd98fe.entry.js.map +0 -1
- package/dist/stzh-components/p-84ae2651.system.js.map +0 -1
- package/dist/stzh-components/p-8b4cc10d.entry.js.map +0 -1
- package/dist/stzh-components/p-8f98fc45.system.entry.js +0 -2
- package/dist/stzh-components/p-8f98fc45.system.entry.js.map +0 -1
- package/dist/stzh-components/p-98b60fb7.js.map +0 -1
- package/dist/stzh-components/p-9bfe7d0d.system.entry.js.map +0 -1
- package/dist/stzh-components/p-aafc8687.entry.js +0 -2
- package/dist/stzh-components/p-aafc8687.entry.js.map +0 -1
- package/dist/stzh-components/p-aefc1441.entry.js.map +0 -1
- package/dist/stzh-components/p-afb2885a.entry.js +0 -2
- package/dist/stzh-components/p-afb2885a.entry.js.map +0 -1
- package/dist/stzh-components/p-bde8bb45.system.js +0 -2
- package/dist/stzh-components/p-c658502d.system.entry.js.map +0 -1
- package/dist/stzh-components/p-cbcb366a.system.entry.js.map +0 -1
- package/dist/stzh-components/p-d9984b93.system.entry.js.map +0 -1
- package/dist/stzh-components/p-e278cda2.system.entry.js +0 -2
- package/dist/stzh-components/p-e278cda2.system.entry.js.map +0 -1
- package/dist/stzh-components/p-e5c1f04c.system.entry.js.map +0 -1
- package/dist/stzh-components/p-ff356dc8.system.entry.js +0 -2
- package/dist/stzh-components/p-ff356dc8.system.entry.js.map +0 -1
- package/dist/types/components/stzh-accordion/stzh-accordion.d.ts +0 -15
- package/dist/types/components/stzh-accordion-item/stzh-accordion-item.d.ts +0 -73
- package/dist/types/components/stzh-actions/stzh-actions.d.ts +0 -16
- package/dist/types/components/stzh-actionset/stzh-actionset.d.ts +0 -45
- package/dist/types/components/stzh-amount/stzh-amount.d.ts +0 -73
- package/dist/types/components/stzh-appnav/stzh-appnav.d.ts +0 -23
- package/dist/types/components/stzh-appointments/stzh-appointments.d.ts +0 -73
- package/dist/types/components/stzh-audio/stzh-audio.d.ts +0 -58
- package/dist/types/components/stzh-button/stzh-button.d.ts +0 -105
- package/dist/types/components/stzh-buttongroup/stzh-buttongroup.d.ts +0 -7
- package/dist/types/components/stzh-calendar/stzh-calendar.d.ts +0 -88
- package/dist/types/components/stzh-card/stzh-card.d.ts +0 -127
- package/dist/types/components/stzh-card-list/stzh-card-list.d.ts +0 -31
- package/dist/types/components/stzh-carousel/stzh-carousel.d.ts +0 -175
- package/dist/types/components/stzh-chart/stzh-chart.d.ts +0 -15
- package/dist/types/components/stzh-checkbox/stzh-checkbox.d.ts +0 -57
- package/dist/types/components/stzh-checkboxgroup/stzh-checkboxgroup.d.ts +0 -64
- package/dist/types/components/stzh-chip/stzh-chip.d.ts +0 -74
- package/dist/types/components/stzh-chip-select/stzh-chip-select.d.ts +0 -46
- package/dist/types/components/stzh-clamp/stzh-clamp.d.ts +0 -49
- package/dist/types/components/stzh-contact/stzh-contact.d.ts +0 -54
- package/dist/types/components/stzh-datalist/stzh-datalist.d.ts +0 -51
- package/dist/types/components/stzh-datalist-item/stzh-datalist-item.d.ts +0 -62
- package/dist/types/components/stzh-datamessagelist/stzh-datamessagelist.d.ts +0 -6
- package/dist/types/components/stzh-datamessagelist-item/stzh-datamessagelist-item.d.ts +0 -57
- package/dist/types/components/stzh-datatable/stzh-datatable.d.ts +0 -103
- package/dist/types/components/stzh-datepicker/stzh-datepicker.d.ts +0 -91
- package/dist/types/components/stzh-details/stzh-details.d.ts +0 -35
- package/dist/types/components/stzh-dialog/stzh-dialog.d.ts +0 -64
- package/dist/types/components/stzh-dropdown/stzh-dropdown.d.ts +0 -173
- package/dist/types/components/stzh-figure/stzh-figure.d.ts +0 -21
- package/dist/types/components/stzh-flyingfocus/stzh-flyingfocus.d.ts +0 -35
- package/dist/types/components/stzh-footer/stzh-footer.d.ts +0 -27
- package/dist/types/components/stzh-gallery/stzh-gallery.d.ts +0 -54
- package/dist/types/components/stzh-ghettobox/stzh-ghettobox.d.ts +0 -50
- package/dist/types/components/stzh-header/stzh-header.d.ts +0 -68
- package/dist/types/components/stzh-hr/stzh-hr.d.ts +0 -7
- package/dist/types/components/stzh-iframe/stzh-iframe.d.ts +0 -60
- package/dist/types/components/stzh-imagecomparison/stzh-imagecomparison.d.ts +0 -29
- package/dist/types/components/stzh-input/stzh-input.d.ts +0 -104
- package/dist/types/components/stzh-invert/stzh-invert.d.ts +0 -7
- package/dist/types/components/stzh-langnav/stzh-langnav.d.ts +0 -19
- package/dist/types/components/stzh-link/stzh-link.d.ts +0 -88
- package/dist/types/components/stzh-list/stzh-list.d.ts +0 -9
- package/dist/types/components/stzh-list-item/stzh-list-item.d.ts +0 -7
- package/dist/types/components/stzh-loader/stzh-loader.d.ts +0 -13
- package/dist/types/components/stzh-loadingbar/stzh-loadingbar.d.ts +0 -12
- package/dist/types/components/stzh-logo/stzh-logo.d.ts +0 -9
- package/dist/types/components/stzh-menu-item/stzh-menu-item.d.ts +0 -50
- package/dist/types/components/stzh-message/stzh-message.d.ts +0 -37
- package/dist/types/components/stzh-metanav/stzh-metanav.d.ts +0 -11
- package/dist/types/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.d.ts +0 -33
- package/dist/types/components/stzh-monthyearpicker/stzh-monthyearpicker.d.ts +0 -98
- package/dist/types/components/stzh-olmap/stzh-olmap.d.ts +0 -124
- package/dist/types/components/stzh-overlay/stzh-overlay.d.ts +0 -34
- package/dist/types/components/stzh-page-skiplinks/stzh-page-skiplinks.d.ts +0 -11
- package/dist/types/components/stzh-pagebottom/stzh-pagebottom.d.ts +0 -29
- package/dist/types/components/stzh-pagetitle/stzh-pagetitle.d.ts +0 -15
- package/dist/types/components/stzh-pagetitle-hero/stzh-pagetitle-hero.d.ts +0 -25
- package/dist/types/components/stzh-pagination/stzh-pagination.d.ts +0 -52
- package/dist/types/components/stzh-panorama/stzh-panorama.d.ts +0 -74
- package/dist/types/components/stzh-popover/stzh-popover.d.ts +0 -73
- package/dist/types/components/stzh-print/stzh-print.d.ts +0 -12
- package/dist/types/components/stzh-progressbar/stzh-progressbar.d.ts +0 -49
- package/dist/types/components/stzh-progressbar-item/stzh-progressbar-item.d.ts +0 -34
- package/dist/types/components/stzh-radio/stzh-radio.d.ts +0 -57
- package/dist/types/components/stzh-radiogroup/stzh-radiogroup.d.ts +0 -66
- package/dist/types/components/stzh-ratio/stzh-ratio.d.ts +0 -22
- package/dist/types/components/stzh-readspeaker/stzh-readspeaker.d.ts +0 -18
- package/dist/types/components/stzh-richtext/stzh-richtext.d.ts +0 -22
- package/dist/types/components/stzh-saptcha/stzh-saptcha.d.ts +0 -28
- package/dist/types/components/stzh-scrollup/stzh-scrollup.d.ts +0 -12
- package/dist/types/components/stzh-share/stzh-share.d.ts +0 -21
- package/dist/types/components/stzh-show/stzh-show.d.ts +0 -22
- package/dist/types/components/stzh-sitemap/stzh-sitemap.d.ts +0 -14
- package/dist/types/components/stzh-skiplink/stzh-skiplink.d.ts +0 -38
- package/dist/types/components/stzh-sortable/stzh-sortable.d.ts +0 -59
- package/dist/types/components/stzh-status/stzh-status.d.ts +0 -14
- package/dist/types/components/stzh-sticky/stzh-sticky.d.ts +0 -58
- package/dist/types/components/stzh-table/stzh-table.d.ts +0 -43
- package/dist/types/components/stzh-textandimage/stzh-textandimage.d.ts +0 -14
- package/dist/types/components/stzh-timeline/stzh-timeline.d.ts +0 -23
- package/dist/types/components/stzh-timeline-item/stzh-timeline-item.d.ts +0 -78
- package/dist/types/components/stzh-timepicker/stzh-timepicker.d.ts +0 -62
- package/dist/types/components/stzh-toast/stzh-toast.d.ts +0 -39
- package/dist/types/components/stzh-toastbar/stzh-toastbar.d.ts +0 -41
- package/dist/types/components/stzh-toggle/stzh-toggle.d.ts +0 -59
- package/dist/types/components/stzh-tooltip/stzh-tooltip.d.ts +0 -80
- package/dist/types/components/stzh-upload/stzh-upload.d.ts +0 -236
- package/dist/types/components/stzh-vbz-carousel/stzh-vbz-carousel.d.ts +0 -14
- package/dist/types/components/stzh-vbz-linechip/stzh-vbz-linechip.d.ts +0 -37
- package/dist/types/components/stzh-vbz-majorticker/stzh-vbz-majorticker.d.ts +0 -41
- package/dist/types/components/stzh-vbz-ticker/stzh-vbz-ticker.d.ts +0 -34
- package/dist/types/components/stzh-youtube/stzh-youtube.d.ts +0 -30
- package/dist/types/index.d.ts +0 -899
- package/dist/types/libraries/tom-select/types/constants.d.ts +0 -12
- package/dist/types/libraries/tom-select/types/contrib/highlight.d.ts +0 -13
- package/dist/types/libraries/tom-select/types/contrib/microevent.d.ts +0 -20
- package/dist/types/libraries/tom-select/types/contrib/microplugin.d.ts +0 -71
- package/dist/types/libraries/tom-select/types/defaults.d.ts +0 -51
- package/dist/types/libraries/tom-select/types/getSettings.d.ts +0 -3
- package/dist/types/libraries/tom-select/types/plugins/caret_position/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/change_listener/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/checkbox_options/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/clear_button/plugin.d.ts +0 -17
- package/dist/types/libraries/tom-select/types/plugins/clear_button/types.d.ts +0 -5
- package/dist/types/libraries/tom-select/types/plugins/drag_drop/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/dropdown_header/plugin.d.ts +0 -17
- package/dist/types/libraries/tom-select/types/plugins/dropdown_header/types.d.ts +0 -8
- package/dist/types/libraries/tom-select/types/plugins/dropdown_input/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/input_autogrow/plugin.d.ts +0 -15
- package/dist/types/libraries/tom-select/types/plugins/no_active_items/plugin.d.ts +0 -15
- package/dist/types/libraries/tom-select/types/plugins/no_backspace_delete/plugin.d.ts +0 -15
- package/dist/types/libraries/tom-select/types/plugins/optgroup_columns/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/plugins/remove_button/plugin.d.ts +0 -17
- package/dist/types/libraries/tom-select/types/plugins/remove_button/types.d.ts +0 -6
- package/dist/types/libraries/tom-select/types/plugins/restore_on_backspace/plugin.d.ts +0 -21
- package/dist/types/libraries/tom-select/types/plugins/virtual_scroll/plugin.d.ts +0 -16
- package/dist/types/libraries/tom-select/types/tom-select.complete.d.ts +0 -2
- package/dist/types/libraries/tom-select/types/tom-select.d.ts +0 -596
- package/dist/types/libraries/tom-select/types/tom-select.popular.d.ts +0 -2
- package/dist/types/libraries/tom-select/types/types/core.d.ts +0 -48
- package/dist/types/libraries/tom-select/types/types/index.d.ts +0 -2
- package/dist/types/libraries/tom-select/types/types/settings.d.ts +0 -78
- package/dist/types/libraries/tom-select/types/utils.d.ts +0 -76
- package/dist/types/libraries/tom-select/types/vanilla.d.ts +0 -76
- package/dist/types/types/svg.d.ts +0 -4
|
@@ -34,6 +34,18 @@
|
|
|
34
34
|
"parse": "^(?<H>\\d{1,2})\\.(?<i>\\d{1,2})$"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
+
"$formatsIso": {
|
|
38
|
+
"dateInput": {
|
|
39
|
+
"format": "{Y}.{m}.{d}",
|
|
40
|
+
"parse": "^(?<Y>\\d{4}).(?<m>\\d{1,2}).(?<d>\\d{1,2})$"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"$formatsLegacy": {
|
|
44
|
+
"dateInput": {
|
|
45
|
+
"format": "{d}.{m}.{Y}",
|
|
46
|
+
"parse": "^(?<d>\\d{1,2}).(?<m>\\d{1,2}).(?<Y>\\d{4})$"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
37
49
|
"$globals": {
|
|
38
50
|
"dateRange": " – ",
|
|
39
51
|
"timeRange": "–",
|
|
@@ -72,6 +72,11 @@ export class StzhAppointments {
|
|
|
72
72
|
this.appointmentsTitle = "";
|
|
73
73
|
this.dateAdapter = undefined;
|
|
74
74
|
}
|
|
75
|
+
dateAdapterWatcher(newValue) {
|
|
76
|
+
if (!newValue) {
|
|
77
|
+
this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats, this.localization.$globals);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
75
80
|
currentDateWatcher(newValue) {
|
|
76
81
|
if (!newValue) {
|
|
77
82
|
this._currentDate = this.dateByValue || this.earliestDate;
|
|
@@ -176,9 +181,7 @@ export class StzhAppointments {
|
|
|
176
181
|
if (!this.localization) {
|
|
177
182
|
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "appointments");
|
|
178
183
|
}
|
|
179
|
-
|
|
180
|
-
this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats, this.localization.$globals);
|
|
181
|
-
}
|
|
184
|
+
this.dateAdapterWatcher(this.dateAdapter);
|
|
182
185
|
}
|
|
183
186
|
componentWillRender() {
|
|
184
187
|
const appointments = this.getCurrentDateAppointments();
|
|
@@ -497,6 +500,9 @@ export class StzhAppointments {
|
|
|
497
500
|
static get elementRef() { return "element"; }
|
|
498
501
|
static get watchers() {
|
|
499
502
|
return [{
|
|
503
|
+
"propName": "dateAdapter",
|
|
504
|
+
"methodName": "dateAdapterWatcher"
|
|
505
|
+
}, {
|
|
500
506
|
"propName": "currentDate",
|
|
501
507
|
"methodName": "currentDateWatcher"
|
|
502
508
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-appointments.js","sourceRoot":"","sources":["../../../../src/components/stzh-appointments/stzh-appointments.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,CAAC,EACD,KAAK,EACL,KAAK,EAEN,MAAM,eAAe,CAAC;AASvB,OAAO,EAAE,EAAE,EAAE,MAAM,+BAA+B,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKpE;;GAEG;AAMH,MAAM,OAAO,gBAAgB;;IAwHnB,iBAAY,GAAY,KAAK,CAAC;IAC9B,kBAAa,GAAW,CAAC,CAAC;IAC1B,iBAAY,GAAY,KAAK,CAAC;IAC9B,aAAQ,GAAY,KAAK,CAAC;IAC1B,kBAAa,GAAY,KAAK,CAAC;IAC/B,kBAAa,GAAY,KAAK,CAAC;IAC/B,0BAAqB,GAAY,KAAK,CAAC;IACvC,6BAAwB,GAAY,IAAI,CAAC;IACzC,gBAAW,GAAG,EAAE,CAAC;IAwDjB,mBAAc,GAAG,CAAC,IAAU,EAAE,EAAE;MACtC,MAAM,kBAAkB,GAAY,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC1E,OAAO,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE;aACxD,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE;aAChD,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;MACtD,CAAC,CAAC,CAAC;MAEH,OAAO,CAAC,kBAAkB,CAAC;IAC7B,CAAC,CAAA;IAEO,0BAAqB,GAAG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,CAAC,YAAY,IAAI;oBAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;8BAAe;kBAClG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAC9D;gBACZ,iBAAW,IAAI,EAAC,OAAO,IAAE,WAAW,CAAC,OAAO,CAAa,CAC9C,CACd,CACe;cAEjB,IAAI,CAAC,YAAY;gBAChB,iBACE,KAAK,EAAC,8BAA8B,EACpC,OAAO,EAAE,IAAI,CAAC,WAAW;kBAEzB,iBAAW,IAAI,EAAC,OAAO,IACpB,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,EACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS;oBACjC,CAAC,CAAC,IAAI,CAAC,SAAS;oBAChB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CACf,CACF,CAEV,CACF,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Element,\n Prop,\n h,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhAppointmentsChangeEvent,\n StzhRadioChangeEvent,\n StzhDatepickerChangeEvent,\n StzhDropdownChangeEvent,\n} from \"../../index\";\n\nimport { tc } from \"../../utils/translation-utils\";\n\nimport { printISODate, parseISODate } from \"../../utils/date-utils\";\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport { StzhAppointmentsLocalizedText } from \"./stzh-appointments.localization\"\n\n/**\n * @slot - Slot for any content\n */\n@Component({\n tag: \"stzh-appointments\",\n styleUrl: \"stzh-appointments.scss\",\n scoped: true\n})\nexport class StzhAppointments {\n /** Translation strings */\n @Prop() localization: StzhAppointmentsLocalizedText;\n\n /** Sort by */\n @Prop({ mutable: true }) sortBy: \"start\" | \"place\" = \"start\";\n private _sortBy: \"start\" | \"place\";\n\n /** Initial selected values */\n @Prop() appointments: any[] | string = [];\n private _appointments: any[];\n private appointmentsShown: any[];\n\n /** Current selected date (if undefined, earliest appointment date in list is taken or current selected one by value) */\n @Prop({ mutable: true }) currentDate: Date | string;\n private _currentDate: Date;\n\n /* Selected appointment by value */\n @Prop({ mutable: true }) value: string = \"\";\n\n /* Name of radiogroup form element */\n @Prop({ reflect: true }) name: string = \"appointment\";\n\n /** Nr of items shown */\n @Prop({ mutable: true }) showItems: number = 5;\n\n /** Nr of items shown when more link is clicked */\n @Prop() stepItems: number = 5;\n\n /** Overwrite default calendar title */\n @Prop() calendarTitle = \"\";\n\n /** Overwrite default appointments title */\n @Prop() appointmentsTitle = \"\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n @Element() element: HTMLStzhAppointmentsElement;\n\n /** Appointments change event */\n @Event() stzhChange: EventEmitter<StzhAppointmentsChangeEvent>;\n\n @Watch(\"currentDate\")\n currentDateWatcher(newValue: Date | string) {\n if (!newValue) {\n this._currentDate = this.dateByValue || this.earliestDate;\n\n if (!this.dateByValue) {\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n } else if (typeof newValue === \"string\") {\n this._currentDate = parseISODate(newValue);\n this.setValueToFirstAppointmentOfCurrentDate();\n } else {\n this._currentDate = newValue;\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n }\n\n @Watch(\"sortBy\")\n sortByWatcher() {\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n\n @Watch(\"value\")\n valueWatcher() {\n this.updateDateByValue();\n // update current date if user has not choosen one\n this.currentDateWatcher(this.currentDate);\n }\n\n @Watch(\"appointments\")\n appointmentsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._appointments = JSON.parse(newValue);\n } else {\n this._appointments = newValue;\n }\n\n // convert start and end field to date\n this._appointments.forEach(appointment => {\n appointment.start = new Date(appointment.start);\n appointment.end = new Date(appointment.end);\n })\n\n if (this._appointments.length > 0) {\n // sort with start field and find earliest and latest date\n this._appointments.sort((a, b) => a['start'] > b['start'] ? 1 : -1);\n this.earliestDate = this._appointments[0].start;\n this.latestDate = this._appointments[this._appointments.length - 1].start;\n this.updateDateByValue();\n }\n\n // determine whether all appointments are from the same day\n if (this._appointments.length > 1) {\n const firstDate = this._appointments[0].start;\n this.allAppointsmentOnSameDay = this._appointments\n .map(appointment => appointment.start)\n .every(date => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`\n === `${firstDate.getFullYear()}-${firstDate.getMonth()}-${firstDate.getDate()}`);\n }\n\n // update flags\n this.showCalendar = !this.allAppointsmentOnSameDay;\n this.showAppointmentsTitle = this._appointments.length > 1;\n\n // update current date if user has not choosen one\n this.currentDateWatcher(this.currentDate);\n }\n\n private dateByValue: Date;\n private earliestDate: Date;\n private latestDate: Date;\n private nextDate: Date;\n\n private showMoreLink: boolean = false;\n private moreItemsLeft: number = 0;\n private showCalendar: boolean = false;\n private showSort: boolean = false;\n private showSortStart: boolean = false;\n private showSortPlace: boolean = false;\n private showAppointmentsTitle: boolean = false;\n private allAppointsmentOnSameDay: boolean = true;\n private sortOptions = [];\n\n private inputElement: HTMLStzhRadiogroupElement;\n private datepickerElement: HTMLStzhDatepickerElement;\n private datepickerElementMedium: HTMLStzhDatepickerElement;\n\n private updateDateByValue() {\n this.dateByValue = this.value\n && this._appointments\n .find(appointment => appointment.value === this.value)\n .start;\n }\n\n private getCurrentDateAppointments() {\n let indexOfLastCurrentDayDate = 0;\n\n // filter to current date appointments that can be shown\n const appointmentsCurrentDate = this._appointments\n .filter((appointment, index) => {\n const dateIsInCurrentDay = appointment.start.getFullYear() === this._currentDate.getFullYear()\n && appointment.start.getMonth() === this._currentDate.getMonth()\n && appointment.start.getDate() === this._currentDate.getDate();\n\n if (dateIsInCurrentDay) {\n indexOfLastCurrentDayDate = index;\n }\n\n return dateIsInCurrentDay;\n });\n\n // find next day with dates or set to null\n if (this._appointments[indexOfLastCurrentDayDate + 1]) {\n this.nextDate = this._appointments[indexOfLastCurrentDayDate + 1].start;\n } else {\n this.nextDate = null;\n }\n\n // sort\n appointmentsCurrentDate.sort((a, b) => a[this.sortBy] > b[this.sortBy] ? 1 : -1);\n return appointmentsCurrentDate;\n }\n\n private setValueToFirstAppointmentOfCurrentDate() {\n // choose the first available appointment from current date\n const appointments = this.getCurrentDateAppointments()\n .filter(appointment => !appointment.disabled)\n\n if (appointments.length > 0) {\n this.value = appointments[0].value;\n this.stzhChange.emit({\n component: \"stzh-appointments\",\n value: this.value\n });\n }\n }\n\n private isDateDisabled = (date: Date) => {\n const dateHasAppointment: boolean = !!this._appointments.find(appointment => {\n return appointment.start.getFullYear() === date.getFullYear()\n && appointment.start.getMonth() === date.getMonth()\n && appointment.start.getDate() === date.getDate();\n });\n\n return !dateHasAppointment;\n }\n\n private onNextActiveDateClick = async () => {\n if (this.nextDate) {\n this.currentDate = this.nextDate;\n\n const popover = await this.datepickerElement.getPopover();\n\n if (popover) {\n popover.hide();\n }\n }\n }\n\n private onMoreClick = () => {\n this.showItems = this.stepItems + this.showItems;\n\n // return focus to radiogroup\n const radio = this.inputElement.querySelector('stzh-radio');\n radio.setFocus();\n }\n\n private onDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const target: HTMLStzhDropdownElement = event.target as HTMLStzhDropdownElement;\n\n const sortBy = await target.getValue() as \"start\" | \"place\" | \"\";\n\n if (sortBy) {\n this.sortBy = sortBy;\n }\n }\n\n private onDatepickerChange = (event: CustomEvent<StzhDatepickerChangeEvent>) => {\n if (event.detail.component !== 'stzh-datepicker' || !event.detail.valueAsDate) {\n return;\n }\n\n this.currentDate = event.detail.valueAsDate;\n // reset number of items that should be shown\n this.showItems = this.stepItems;\n }\n\n private onRadioChange = (event: CustomEvent<StzhRadioChangeEvent>) => {\n this.value = event.detail.value;\n this.stzhChange.emit({\n component: \"stzh-appointments\",\n value: this.value\n });\n }\n\n async componentWillLoad() {\n this.appointmentsWatcher(this.appointments);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"appointments\");\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n componentWillRender() {\n const appointments = this.getCurrentDateAppointments();\n\n // slice to max that should be visible\n this.appointmentsShown = appointments.slice(0, this.showItems);\n\n // set flags\n this.showMoreLink = this.showItems < appointments.length;\n this.moreItemsLeft = appointments.length - this.showItems;\n\n // don't show time sort when only one time in the current day\n this.showSortStart = appointments\n .map(appointment => {\n return this.dateAdapter.format(appointment.start, \"time\");\n }).filter((item, pos, self) => {\n return self.indexOf(item) == pos;\n }).length > 1;\n\n // don't show place sort when only one place in the current day\n this.showSortPlace = appointments\n .map(appointment => {\n return appointment.place;\n }).filter((item, pos, self) => {\n return self.indexOf(item) == pos;\n }).length > 1;\n\n this.sortOptions = [];\n\n if (this.showSortStart) {\n this.sortOptions.push({\n text: this.localization.sortByTime,\n value: \"start\"\n });\n }\n\n if (this.showSortPlace) {\n this.sortOptions.push({\n text: this.localization.sortByPlace,\n value: \"place\"\n });\n }\n\n this.showSort = this.appointmentsShown.length > 1;\n\n // determine sort (force alternative sorting if it makes sense)\n this._sortBy =\n (this.showSortStart && !this.showSortPlace && \"start\")\n || (!this.showSortStart && this.showSortPlace && \"place\")\n || this.sortBy;\n }\n\n componentDidRender() {\n // set datepickers values to current date\n if (this.datepickerElement) {\n this.datepickerElement.setDate(this._currentDate);\n }\n\n if (this.datepickerElementMedium) {\n this.datepickerElementMedium.setDate(this._currentDate);\n }\n }\n\n render() {\n const classes = {\n \"stzh-appointments\": true,\n \"stzh-appointments--has-calendar\": this.showCalendar,\n \"stzh-appointments--has-appointments-title\": this.showAppointmentsTitle,\n \"stzh-appointments--has-sort\": this.showSort\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-appointments__wrapper\">\n {this.showCalendar &&\n <div class=\"stzh-appointments__calendar-wrapper\">\n <div class=\"stzh-appointments__calendar-title-wrapper\">\n <div class=\"stzh-appointments__calendar-title\">\n <stzh-icon class=\"stzh-appointments__calendar-icon\" name=\"calendar\"></stzh-icon>\n <stzh-text font=\"heavy\">{this.calendarTitle || this.localization.calendarTitle}</stzh-text>\n </div>\n </div>\n <div class=\"stzh-appointments__calendar-content\">\n <stzh-datepicker\n ref={(el) => (this.datepickerElement = el as HTMLStzhDatepickerElement)}\n onStzhChange={this.onDatepickerChange}\n label={this.localization.datepickerLabel}\n calendarIsDateDisabled={this.isDateDisabled}\n calendarMin={printISODate(this.earliestDate)}\n calendarMax={printISODate(this.latestDate)}\n >\n <stzh-link\n slot=\"action\"\n disabled={!this.nextDate}\n onClick={this.onNextActiveDateClick}\n >\n <stzh-text size=\"milli\">\n {this.localization.nextDayWithAppointments}\n </stzh-text>\n </stzh-link>\n </stzh-datepicker>\n </div>\n <div class=\"stzh-appointments__calendar-content-medium\">\n <stzh-datepicker\n ref={(el) => (this.datepickerElementMedium = el as HTMLStzhDatepickerElement)}\n onStzhChange={this.onDatepickerChange}\n inline\n calendarIsDateDisabled={this.isDateDisabled}\n calendarMin={printISODate(this.earliestDate)}\n calendarMax={printISODate(this.latestDate)}\n >\n {this.nextDate &&\n <stzh-link\n slot=\"action\"\n onClick={this.onNextActiveDateClick}\n >\n <stzh-text size=\"milli\">\n {this.localization.nextDayWithAppointments}\n </stzh-text>\n </stzh-link>\n }\n </stzh-datepicker>\n </div>\n </div>\n }\n <div class=\"stzh-appointments__appointments-wrapper\">\n {this.showAppointmentsTitle &&\n <div class=\"stzh-appointments__appointments-title-wrapper\">\n <div class=\"stzh-appointments__appointments-title\">\n <stzh-icon class=\"stzh-appointments__appointments-icon\" name=\"clock\"></stzh-icon>\n <stzh-text font=\"heavy\">{this.appointmentsTitle || this.localization.appointmentsTitle}</stzh-text>\n </div>\n {this.showSort &&\n <div class=\"stzh-appointments__sort\">\n <stzh-dropdown\n inline\n no-search\n class=\"stzh-appointments__sort-dropdown\"\n variant=\"plain\"\n size=\"small\"\n items={[this._sortBy]}\n options={this.sortOptions}\n onStzhChange={this.onDropdownChange}\n ></stzh-dropdown>\n </div>\n }\n </div>\n }\n\n <div class=\"stzh-appointments__appointments-content\">\n <stzh-radiogroup\n ref={(el) => this.inputElement = el as HTMLStzhRadiogroupElement}\n legend={this.localization.inputLegend}\n hide-legend\n name={this.name}\n value={this.value}\n preventUpdateProperties={[\"disabled\"]}\n >\n {this.appointmentsShown.map((appointment) =>\n <stzh-radio\n onStzhChange={this.onRadioChange}\n value={appointment.value}\n disabled={typeof appointment.disabled !== \"undefined\" ? appointment.disabled : false}\n >\n <stzh-text font=\"heavy\" size=\"milli\">\n {!this.showCalendar && <span>{this.dateAdapter.format(appointment.start, \"dateLong\")}, </span>}\n {this.dateAdapter.formatSpan(appointment.start, appointment.end, \"time\")}\n </stzh-text>\n <stzh-text size=\"milli\">{appointment.caption}</stzh-text>\n </stzh-radio>\n )}\n </stzh-radiogroup>\n\n {this.showMoreLink &&\n <stzh-link\n class=\"stzh-appointments__more-link\"\n onClick={this.onMoreClick}\n >\n <stzh-text size=\"milli\">\n {tc(this.localization.moreTextItems,\n this.moreItemsLeft > this.stepItems\n ? this.stepItems\n : this.moreItemsLeft)}\n </stzh-text>\n </stzh-link>\n }\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1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;oBAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;8BAAe;kBAClG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAC9D;gBACZ,iBAAW,IAAI,EAAC,OAAO,IAAE,WAAW,CAAC,OAAO,CAAa,CAC9C,CACd,CACe;cAEjB,IAAI,CAAC,YAAY;gBAChB,iBACE,KAAK,EAAC,8BAA8B,EACpC,OAAO,EAAE,IAAI,CAAC,WAAW;kBAEzB,iBAAW,IAAI,EAAC,OAAO,IACpB,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,EACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS;oBACjC,CAAC,CAAC,IAAI,CAAC,SAAS;oBAChB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CACf,CACF,CAEV,CACF,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Element,\n Prop,\n h,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhAppointmentsChangeEvent,\n StzhRadioChangeEvent,\n StzhDatepickerChangeEvent,\n StzhDropdownChangeEvent,\n} from \"../../index\";\n\nimport { tc } from \"../../utils/translation-utils\";\n\nimport { printISODate, parseISODate } from \"../../utils/date-utils\";\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport { StzhAppointmentsLocalizedText } from \"./stzh-appointments.localization\"\n\n/**\n * @slot - Slot for any content\n */\n@Component({\n tag: \"stzh-appointments\",\n styleUrl: \"stzh-appointments.scss\",\n scoped: true\n})\nexport class StzhAppointments {\n /** Translation strings */\n @Prop() localization: StzhAppointmentsLocalizedText;\n\n /** Sort by */\n @Prop({ mutable: true }) sortBy: \"start\" | \"place\" = \"start\";\n private _sortBy: \"start\" | \"place\";\n\n /** Initial selected values */\n @Prop() appointments: any[] | string = [];\n private _appointments: any[];\n private appointmentsShown: any[];\n\n /** Current selected date (if undefined, earliest appointment date in list is taken or current selected one by value) */\n @Prop({ mutable: true }) currentDate: Date | string;\n private _currentDate: Date;\n\n /* Selected appointment by value */\n @Prop({ mutable: true }) value: string = \"\";\n\n /* Name of radiogroup form element */\n @Prop({ reflect: true }) name: string = \"appointment\";\n\n /** Nr of items shown */\n @Prop({ mutable: true }) showItems: number = 5;\n\n /** Nr of items shown when more link is clicked */\n @Prop() stepItems: number = 5;\n\n /** Overwrite default calendar title */\n @Prop() calendarTitle = \"\";\n\n /** Overwrite default appointments title */\n @Prop() appointmentsTitle = \"\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n @Element() element: HTMLStzhAppointmentsElement;\n\n /** Appointments change event */\n @Event() stzhChange: EventEmitter<StzhAppointmentsChangeEvent>;\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n @Watch(\"currentDate\")\n currentDateWatcher(newValue: Date | string) {\n if (!newValue) {\n this._currentDate = this.dateByValue || this.earliestDate;\n\n if (!this.dateByValue) {\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n } else if (typeof newValue === \"string\") {\n this._currentDate = parseISODate(newValue);\n this.setValueToFirstAppointmentOfCurrentDate();\n } else {\n this._currentDate = newValue;\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n }\n\n @Watch(\"sortBy\")\n sortByWatcher() {\n this.setValueToFirstAppointmentOfCurrentDate();\n }\n\n @Watch(\"value\")\n valueWatcher() {\n this.updateDateByValue();\n // update current date if user has not choosen one\n this.currentDateWatcher(this.currentDate);\n }\n\n @Watch(\"appointments\")\n appointmentsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._appointments = JSON.parse(newValue);\n } else {\n this._appointments = newValue;\n }\n\n // convert start and end field to date\n this._appointments.forEach(appointment => {\n appointment.start = new Date(appointment.start);\n appointment.end = new Date(appointment.end);\n })\n\n if (this._appointments.length > 0) {\n // sort with start field and find earliest and latest date\n this._appointments.sort((a, b) => a['start'] > b['start'] ? 1 : -1);\n this.earliestDate = this._appointments[0].start;\n this.latestDate = this._appointments[this._appointments.length - 1].start;\n this.updateDateByValue();\n }\n\n // determine whether all appointments are from the same day\n if (this._appointments.length > 1) {\n const firstDate = this._appointments[0].start;\n this.allAppointsmentOnSameDay = this._appointments\n .map(appointment => appointment.start)\n .every(date => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`\n === `${firstDate.getFullYear()}-${firstDate.getMonth()}-${firstDate.getDate()}`);\n }\n\n // update flags\n this.showCalendar = !this.allAppointsmentOnSameDay;\n this.showAppointmentsTitle = this._appointments.length > 1;\n\n // update current date if user has not choosen one\n this.currentDateWatcher(this.currentDate);\n }\n\n private dateByValue: Date;\n private earliestDate: Date;\n private latestDate: Date;\n private nextDate: Date;\n\n private showMoreLink: boolean = false;\n private moreItemsLeft: number = 0;\n private showCalendar: boolean = false;\n private showSort: boolean = false;\n private showSortStart: boolean = false;\n private showSortPlace: boolean = false;\n private showAppointmentsTitle: boolean = false;\n private allAppointsmentOnSameDay: boolean = true;\n private sortOptions = [];\n\n private inputElement: HTMLStzhRadiogroupElement;\n private datepickerElement: HTMLStzhDatepickerElement;\n private datepickerElementMedium: HTMLStzhDatepickerElement;\n\n private updateDateByValue() {\n this.dateByValue = this.value\n && this._appointments\n .find(appointment => appointment.value === this.value)\n .start;\n }\n\n private getCurrentDateAppointments() {\n let indexOfLastCurrentDayDate = 0;\n\n // filter to current date appointments that can be shown\n const appointmentsCurrentDate = this._appointments\n .filter((appointment, index) => {\n const dateIsInCurrentDay = appointment.start.getFullYear() === this._currentDate.getFullYear()\n && appointment.start.getMonth() === this._currentDate.getMonth()\n && appointment.start.getDate() === this._currentDate.getDate();\n\n if (dateIsInCurrentDay) {\n indexOfLastCurrentDayDate = index;\n }\n\n return dateIsInCurrentDay;\n });\n\n // find next day with dates or set to null\n if (this._appointments[indexOfLastCurrentDayDate + 1]) {\n this.nextDate = this._appointments[indexOfLastCurrentDayDate + 1].start;\n } else {\n this.nextDate = null;\n }\n\n // sort\n appointmentsCurrentDate.sort((a, b) => a[this.sortBy] > b[this.sortBy] ? 1 : -1);\n return appointmentsCurrentDate;\n }\n\n private setValueToFirstAppointmentOfCurrentDate() {\n // choose the first available appointment from current date\n const appointments = this.getCurrentDateAppointments()\n .filter(appointment => !appointment.disabled)\n\n if (appointments.length > 0) {\n this.value = appointments[0].value;\n this.stzhChange.emit({\n component: \"stzh-appointments\",\n value: this.value\n });\n }\n }\n\n private isDateDisabled = (date: Date) => {\n const dateHasAppointment: boolean = !!this._appointments.find(appointment => {\n return appointment.start.getFullYear() === date.getFullYear()\n && appointment.start.getMonth() === date.getMonth()\n && appointment.start.getDate() === date.getDate();\n });\n\n return !dateHasAppointment;\n }\n\n private onNextActiveDateClick = async () => {\n if (this.nextDate) {\n this.currentDate = this.nextDate;\n\n const popover = await this.datepickerElement.getPopover();\n\n if (popover) {\n popover.hide();\n }\n }\n }\n\n private onMoreClick = () => {\n this.showItems = this.stepItems + this.showItems;\n\n // return focus to radiogroup\n const radio = this.inputElement.querySelector('stzh-radio');\n radio.setFocus();\n }\n\n private onDropdownChange = async (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const target: HTMLStzhDropdownElement = event.target as HTMLStzhDropdownElement;\n\n const sortBy = await target.getValue() as \"start\" | \"place\" | \"\";\n\n if (sortBy) {\n this.sortBy = sortBy;\n }\n }\n\n private onDatepickerChange = (event: CustomEvent<StzhDatepickerChangeEvent>) => {\n if (event.detail.component !== 'stzh-datepicker' || !event.detail.valueAsDate) {\n return;\n }\n\n this.currentDate = event.detail.valueAsDate;\n // reset number of items that should be shown\n this.showItems = this.stepItems;\n }\n\n private onRadioChange = (event: CustomEvent<StzhRadioChangeEvent>) => {\n this.value = event.detail.value;\n this.stzhChange.emit({\n component: \"stzh-appointments\",\n value: this.value\n });\n }\n\n async componentWillLoad() {\n this.appointmentsWatcher(this.appointments);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"appointments\");\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n }\n\n componentWillRender() {\n const appointments = this.getCurrentDateAppointments();\n\n // slice to max that should be visible\n this.appointmentsShown = appointments.slice(0, this.showItems);\n\n // set flags\n this.showMoreLink = this.showItems < appointments.length;\n this.moreItemsLeft = appointments.length - this.showItems;\n\n // don't show time sort when only one time in the current day\n this.showSortStart = appointments\n .map(appointment => {\n return this.dateAdapter.format(appointment.start, \"time\");\n }).filter((item, pos, self) => {\n return self.indexOf(item) == pos;\n }).length > 1;\n\n // don't show place sort when only one place in the current day\n this.showSortPlace = appointments\n .map(appointment => {\n return appointment.place;\n }).filter((item, pos, self) => {\n return self.indexOf(item) == pos;\n }).length > 1;\n\n this.sortOptions = [];\n\n if (this.showSortStart) {\n this.sortOptions.push({\n text: this.localization.sortByTime,\n value: \"start\"\n });\n }\n\n if (this.showSortPlace) {\n this.sortOptions.push({\n text: this.localization.sortByPlace,\n value: \"place\"\n });\n }\n\n this.showSort = this.appointmentsShown.length > 1;\n\n // determine sort (force alternative sorting if it makes sense)\n this._sortBy =\n (this.showSortStart && !this.showSortPlace && \"start\")\n || (!this.showSortStart && this.showSortPlace && \"place\")\n || this.sortBy;\n }\n\n componentDidRender() {\n // set datepickers values to current date\n if (this.datepickerElement) {\n this.datepickerElement.setDate(this._currentDate);\n }\n\n if (this.datepickerElementMedium) {\n this.datepickerElementMedium.setDate(this._currentDate);\n }\n }\n\n render() {\n const classes = {\n \"stzh-appointments\": true,\n \"stzh-appointments--has-calendar\": this.showCalendar,\n \"stzh-appointments--has-appointments-title\": this.showAppointmentsTitle,\n \"stzh-appointments--has-sort\": this.showSort\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-appointments__wrapper\">\n {this.showCalendar &&\n <div class=\"stzh-appointments__calendar-wrapper\">\n <div class=\"stzh-appointments__calendar-title-wrapper\">\n <div class=\"stzh-appointments__calendar-title\">\n <stzh-icon class=\"stzh-appointments__calendar-icon\" name=\"calendar\"></stzh-icon>\n <stzh-text font=\"heavy\">{this.calendarTitle || this.localization.calendarTitle}</stzh-text>\n </div>\n </div>\n <div class=\"stzh-appointments__calendar-content\">\n <stzh-datepicker\n ref={(el) => (this.datepickerElement = el as HTMLStzhDatepickerElement)}\n onStzhChange={this.onDatepickerChange}\n label={this.localization.datepickerLabel}\n calendarIsDateDisabled={this.isDateDisabled}\n calendarMin={printISODate(this.earliestDate)}\n calendarMax={printISODate(this.latestDate)}\n >\n <stzh-link\n slot=\"action\"\n disabled={!this.nextDate}\n onClick={this.onNextActiveDateClick}\n >\n <stzh-text size=\"milli\">\n {this.localization.nextDayWithAppointments}\n </stzh-text>\n </stzh-link>\n </stzh-datepicker>\n </div>\n <div class=\"stzh-appointments__calendar-content-medium\">\n <stzh-datepicker\n ref={(el) => (this.datepickerElementMedium = el as HTMLStzhDatepickerElement)}\n onStzhChange={this.onDatepickerChange}\n inline\n calendarIsDateDisabled={this.isDateDisabled}\n calendarMin={printISODate(this.earliestDate)}\n calendarMax={printISODate(this.latestDate)}\n >\n {this.nextDate &&\n <stzh-link\n slot=\"action\"\n onClick={this.onNextActiveDateClick}\n >\n <stzh-text size=\"milli\">\n {this.localization.nextDayWithAppointments}\n </stzh-text>\n </stzh-link>\n }\n </stzh-datepicker>\n </div>\n </div>\n }\n <div class=\"stzh-appointments__appointments-wrapper\">\n {this.showAppointmentsTitle &&\n <div class=\"stzh-appointments__appointments-title-wrapper\">\n <div class=\"stzh-appointments__appointments-title\">\n <stzh-icon class=\"stzh-appointments__appointments-icon\" name=\"clock\"></stzh-icon>\n <stzh-text font=\"heavy\">{this.appointmentsTitle || this.localization.appointmentsTitle}</stzh-text>\n </div>\n {this.showSort &&\n <div class=\"stzh-appointments__sort\">\n <stzh-dropdown\n inline\n no-search\n class=\"stzh-appointments__sort-dropdown\"\n variant=\"plain\"\n size=\"small\"\n items={[this._sortBy]}\n options={this.sortOptions}\n onStzhChange={this.onDropdownChange}\n ></stzh-dropdown>\n </div>\n }\n </div>\n }\n\n <div class=\"stzh-appointments__appointments-content\">\n <stzh-radiogroup\n ref={(el) => this.inputElement = el as HTMLStzhRadiogroupElement}\n legend={this.localization.inputLegend}\n hide-legend\n name={this.name}\n value={this.value}\n preventUpdateProperties={[\"disabled\"]}\n >\n {this.appointmentsShown.map((appointment) =>\n <stzh-radio\n onStzhChange={this.onRadioChange}\n value={appointment.value}\n disabled={typeof appointment.disabled !== \"undefined\" ? appointment.disabled : false}\n >\n <stzh-text font=\"heavy\" size=\"milli\">\n {!this.showCalendar && <span>{this.dateAdapter.format(appointment.start, \"dateLong\")}, </span>}\n {this.dateAdapter.formatSpan(appointment.start, appointment.end, \"time\")}\n </stzh-text>\n <stzh-text size=\"milli\">{appointment.caption}</stzh-text>\n </stzh-radio>\n )}\n </stzh-radiogroup>\n\n {this.showMoreLink &&\n <stzh-link\n class=\"stzh-appointments__more-link\"\n onClick={this.onMoreClick}\n >\n <stzh-text size=\"milli\">\n {tc(this.localization.moreTextItems,\n this.moreItemsLeft > this.stepItems\n ? this.stepItems\n : this.moreItemsLeft)}\n </stzh-text>\n </stzh-link>\n }\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -169,7 +169,7 @@ export class StzhButton {
|
|
|
169
169
|
"mutable": false,
|
|
170
170
|
"complexType": {
|
|
171
171
|
"original": "StzhLocaleComponent",
|
|
172
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
172
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
173
173
|
"references": {
|
|
174
174
|
"StzhLocaleComponent": {
|
|
175
175
|
"location": "import",
|
|
@@ -138,7 +138,7 @@ export class StzhCheckbox {
|
|
|
138
138
|
"mutable": false,
|
|
139
139
|
"complexType": {
|
|
140
140
|
"original": "StzhLocaleComponent",
|
|
141
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
141
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
142
142
|
"references": {
|
|
143
143
|
"StzhLocaleComponent": {
|
|
144
144
|
"location": "import",
|
|
@@ -177,7 +177,7 @@ export class StzhCheckboxgroup {
|
|
|
177
177
|
"mutable": false,
|
|
178
178
|
"complexType": {
|
|
179
179
|
"original": "StzhLocaleComponent",
|
|
180
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
180
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
181
181
|
"references": {
|
|
182
182
|
"StzhLocaleComponent": {
|
|
183
183
|
"location": "import",
|
|
@@ -148,7 +148,7 @@ export class StzhChipSelect {
|
|
|
148
148
|
"mutable": false,
|
|
149
149
|
"complexType": {
|
|
150
150
|
"original": "StzhLocaleComponent",
|
|
151
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
151
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
152
152
|
"references": {
|
|
153
153
|
"StzhLocaleComponent": {
|
|
154
154
|
"location": "import",
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
position: relative;
|
|
152
152
|
left: 50%;
|
|
153
153
|
right: 50%;
|
|
154
|
-
margin-left: -50vw;
|
|
155
|
-
margin-right: -50vw;
|
|
156
|
-
width: 100vw;
|
|
157
|
-
max-width: 100vw;
|
|
154
|
+
margin-left: calc(-50vw + var(--stzh-scrollbar-width) / 2);
|
|
155
|
+
margin-right: calc(-50vw + var(--stzh-scrollbar-width) / 2);
|
|
156
|
+
width: calc(100vw - var(--stzh-scrollbar-width));
|
|
157
|
+
max-width: calc(100vw - var(--stzh-scrollbar-width));
|
|
158
158
|
}
|
|
159
159
|
:host ::slotted(*) stzh-section[variant=highlight] {
|
|
160
160
|
--highlight-horizontal-padding: 1.25rem;
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
position: relative;
|
|
180
180
|
left: 50%;
|
|
181
181
|
right: 50%;
|
|
182
|
-
margin-left: -50vw;
|
|
183
|
-
margin-right: -50vw;
|
|
184
|
-
width: 100vw;
|
|
185
|
-
max-width: 100vw;
|
|
182
|
+
margin-left: calc(-50vw + var(--stzh-scrollbar-width) / 2);
|
|
183
|
+
margin-right: calc(-50vw + var(--stzh-scrollbar-width) / 2);
|
|
184
|
+
width: calc(100vw - var(--stzh-scrollbar-width));
|
|
185
|
+
max-width: calc(100vw - var(--stzh-scrollbar-width));
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
:host ::slotted(*) stzh-row stzh-section[variant=highlight] {
|
|
@@ -148,7 +148,7 @@ export class StzhDatalistItem {
|
|
|
148
148
|
"mutable": false,
|
|
149
149
|
"complexType": {
|
|
150
150
|
"original": "StzhLocaleComponent",
|
|
151
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
151
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
152
152
|
"references": {
|
|
153
153
|
"StzhLocaleComponent": {
|
|
154
154
|
"location": "import",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h, Fragment } from "@stencil/core";
|
|
2
|
-
import { printISODate
|
|
2
|
+
import { printISODate } from "../../utils/date-utils";
|
|
3
3
|
/**
|
|
4
4
|
* @slot action - Slot for action below calendar (stzh-link element)
|
|
5
5
|
*/
|
|
@@ -13,15 +13,15 @@ export class StzhDatepicker {
|
|
|
13
13
|
this.onInputChanged = () => {
|
|
14
14
|
const parsedDate = this.dateAdapter.parse(this.input.value, "dateInput");
|
|
15
15
|
if (this.input.value === "" || parsedDate) {
|
|
16
|
-
const
|
|
17
|
-
if (this.value !==
|
|
16
|
+
const formattedDate = this._internalDateAdapter.format(parsedDate, "dateInput");
|
|
17
|
+
if (this.value !== formattedDate) {
|
|
18
18
|
if (this.calendar) {
|
|
19
|
-
this.calendar.value =
|
|
19
|
+
this.calendar.value = printISODate(parsedDate);
|
|
20
20
|
}
|
|
21
|
-
this.value =
|
|
21
|
+
this.value = formattedDate;
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
this.valueWatcher(
|
|
24
|
+
this.valueWatcher(formattedDate);
|
|
25
25
|
}
|
|
26
26
|
this.stzhChange.emit({
|
|
27
27
|
component: "stzh-datepicker",
|
|
@@ -31,7 +31,8 @@ export class StzhDatepicker {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.onCalendarChange = (event) => {
|
|
34
|
-
this.value = event.detail.
|
|
34
|
+
this.value = event.detail.valueAsDate
|
|
35
|
+
&& this._internalDateAdapter.format(event.detail.valueAsDate, "dateInput");
|
|
35
36
|
this.stzhChange.emit({
|
|
36
37
|
component: "stzh-datepicker",
|
|
37
38
|
value: this.value,
|
|
@@ -63,6 +64,7 @@ export class StzhDatepicker {
|
|
|
63
64
|
this.size = "default";
|
|
64
65
|
this.inline = false;
|
|
65
66
|
this.dateAdapter = undefined;
|
|
67
|
+
this.internalDateAdapter = "iso";
|
|
66
68
|
this.localization = undefined;
|
|
67
69
|
this.buttonLabel = undefined;
|
|
68
70
|
}
|
|
@@ -77,18 +79,34 @@ export class StzhDatepicker {
|
|
|
77
79
|
}
|
|
78
80
|
/** Update calendar and input when value prop has changed */
|
|
79
81
|
valueWatcher(newValue) {
|
|
80
|
-
const date =
|
|
82
|
+
const date = this._internalDateAdapter.parse(newValue, "dateInput");
|
|
81
83
|
if (this.calendar) {
|
|
82
|
-
this.calendar.value =
|
|
84
|
+
this.calendar.value = printISODate(date);
|
|
83
85
|
}
|
|
84
86
|
if (this.input) {
|
|
85
87
|
this.input.value = this.dateAdapter.format(date, "dateInput");
|
|
86
88
|
}
|
|
87
89
|
this.updateButtonAccessibleLabel();
|
|
88
90
|
}
|
|
91
|
+
dateAdapterWatcher(newValue) {
|
|
92
|
+
if (!newValue) {
|
|
93
|
+
this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats, this.localization.$globals);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
internalDateAdapterWatcher(newValue) {
|
|
97
|
+
if (newValue === "iso" || !newValue) {
|
|
98
|
+
this._internalDateAdapter = window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formatsIso, this.localization.$globals);
|
|
99
|
+
}
|
|
100
|
+
else if (newValue === "legacy") {
|
|
101
|
+
this._internalDateAdapter = window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formatsLegacy, this.localization.$globals);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this._internalDateAdapter = newValue;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
89
107
|
/** Set value by a JS Date object */
|
|
90
108
|
async setDate(date) {
|
|
91
|
-
this.value =
|
|
109
|
+
this.value = this._internalDateAdapter.format(date, "dateInput");
|
|
92
110
|
}
|
|
93
111
|
/** Return internal popover element */
|
|
94
112
|
async getPopover() {
|
|
@@ -99,7 +117,7 @@ export class StzhDatepicker {
|
|
|
99
117
|
return;
|
|
100
118
|
}
|
|
101
119
|
try {
|
|
102
|
-
const valueAsDate =
|
|
120
|
+
const valueAsDate = this._internalDateAdapter.parse(this.value, "dateInput");
|
|
103
121
|
this.buttonLabel = `${this.label}, ${this.localization.buttonLabel}, ${this.localization.selectedDateMessage} ${this.dateFormatLong.format(valueAsDate)}`;
|
|
104
122
|
}
|
|
105
123
|
catch (err) {
|
|
@@ -113,9 +131,8 @@ export class StzhDatepicker {
|
|
|
113
131
|
if (!this.localization) {
|
|
114
132
|
this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "datepicker");
|
|
115
133
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
134
|
+
this.dateAdapterWatcher(this.dateAdapter);
|
|
135
|
+
this.internalDateAdapterWatcher(this.internalDateAdapter);
|
|
119
136
|
}
|
|
120
137
|
componentDidLoad() {
|
|
121
138
|
this.valueWatcher(this.value);
|
|
@@ -468,9 +485,33 @@ export class StzhDatepicker {
|
|
|
468
485
|
"optional": false,
|
|
469
486
|
"docs": {
|
|
470
487
|
"tags": [],
|
|
471
|
-
"text": "Date adapter, for custom parsing/formatting.\nMust be object with a `parse` function which accepts a `string` and returns a `Date`,\nand a `format` function which accepts a `Date` and returns a `string`."
|
|
488
|
+
"text": "Date adapter visible date shown to the user, for custom parsing/formatting.\nMust be object with a `parse` function which accepts a `string` and returns a `Date`,\nand a `format` function which accepts a `Date` and returns a `string`."
|
|
472
489
|
}
|
|
473
490
|
},
|
|
491
|
+
"internalDateAdapter": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"mutable": false,
|
|
494
|
+
"complexType": {
|
|
495
|
+
"original": "\"iso\" | \"legacy\" | StzhLocaleAdapter",
|
|
496
|
+
"resolved": "\"iso\" | \"legacy\" | StzhLocaleAdapter",
|
|
497
|
+
"references": {
|
|
498
|
+
"StzhLocaleAdapter": {
|
|
499
|
+
"location": "import",
|
|
500
|
+
"path": "../../utils/date-adapter",
|
|
501
|
+
"id": "src/utils/date-adapter.ts::StzhLocaleAdapter"
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
"required": false,
|
|
506
|
+
"optional": false,
|
|
507
|
+
"docs": {
|
|
508
|
+
"tags": [],
|
|
509
|
+
"text": "Date adapter for internal date passed to backend, for custom parsing/formatting.\nCan be `\"iso\"` (default, date in ISO format) / `\"legacy\"` (date in `d.m.Y` format)\nor `StzhLocaleAdapter` (must be object with a `parse` function which accepts a `string` and returns a `Date`,\nand a `format` function which accepts a `Date` and returns a `string`.)"
|
|
510
|
+
},
|
|
511
|
+
"attribute": "internal-date-adapter",
|
|
512
|
+
"reflect": false,
|
|
513
|
+
"defaultValue": "\"iso\""
|
|
514
|
+
},
|
|
474
515
|
"localization": {
|
|
475
516
|
"type": "unknown",
|
|
476
517
|
"mutable": false,
|
|
@@ -580,6 +621,12 @@ export class StzhDatepicker {
|
|
|
580
621
|
}, {
|
|
581
622
|
"propName": "value",
|
|
582
623
|
"methodName": "valueWatcher"
|
|
624
|
+
}, {
|
|
625
|
+
"propName": "dateAdapter",
|
|
626
|
+
"methodName": "dateAdapterWatcher"
|
|
627
|
+
}, {
|
|
628
|
+
"propName": "internalDateAdapter",
|
|
629
|
+
"methodName": "internalDateAdapterWatcher"
|
|
583
630
|
}];
|
|
584
631
|
}
|
|
585
632
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-datepicker.js","sourceRoot":"","sources":["../../../../src/components/stzh-datepicker/stzh-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,CAAC,EACD,KAAK,EAEL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACN,MAAM,eAAe,CAAC;AASvB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAKnE;;GAEG;AAMH,MAAM,OAAO,cAAc;;IAkIjB,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;OACvB;IACH,CAAC,CAAA;IAEO,mBAAc,GAAG,GAAG,EAAE;MAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;MAEzE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,IAAI,UAAU,EAAE;QACzC,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;QAEzC,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE;UAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC;WAC/B;UAED,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;SACtB;aAAM;UACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;UACnB,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,IAAI,CAAC,KAAK;UACjB,WAAW,EAAE,UAAU;SACxB,CAAC,CAAA;OACH;IACH,CAAC,CAAA;IAEO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Host,\n Element,\n h,\n Event,\n EventEmitter,\n Method,\n Watch,\n Fragment,\n State\n} from \"@stencil/core\";\n\nimport {\n StzhCalendarChangeEvent,\n StzhDatepickerChangeEvent\n} from \"../../index\";\n\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nimport { printISODate, parseISODate } from \"../../utils/date-utils\"\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\"\n\nimport { StzhDatepickerLocalizedText } from \"./stzh-datepicker.localization\";\n\n/**\n * @slot action - Slot for action below calendar (stzh-link element)\n */\n@Component({\n tag: \"stzh-datepicker\",\n styleUrl: \"stzh-datepicker.scss\",\n scoped: true\n})\nexport class StzhDatepicker {\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() calendarMin: string = \"\"\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() calendarMax: string = \"\"\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @Prop() calendarIsDateDisabled: StzhCalendarDateDisabledPredicate = () => false\n\n /** Name of the hidden date picker input. */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of hidden date picker input (current selected date in ISO format). */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Label for input field and popover */\n @Prop() label: string = \"\";\n\n /** Whether label is visually hidden. */\n @Prop() labelHidden: boolean = false;\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 /** 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 /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Show calendar inline */\n @Prop() inline: boolean = false;\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhDatepickerLocalizedText;\n\n @State() buttonLabel: string;\n\n @Watch(\"localization\")\n createDateFormatters() {\n if (this.localization) {\n this.dateFormatLong = new Intl.DateTimeFormat(this.localization.$locale, {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n })\n }\n }\n\n /** Update calendar and input when value prop has changed */\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n const date = parseISODate(newValue);\n\n if (this.calendar) {\n this.calendar.value = newValue;\n }\n\n if (this.input) {\n this.input.value = this.dateAdapter.format(date, \"dateInput\");\n }\n\n this.updateButtonAccessibleLabel();\n }\n\n /** Set value by a JS Date object */\n @Method()\n async setDate(date: Date) {\n this.value = printISODate(date);\n }\n\n /** Return internal popover element */\n @Method()\n async getPopover(): Promise<HTMLStzhPopoverElement> {\n return this.popover;\n }\n\n /** Datepicker change event */\n @Event() stzhChange: EventEmitter<StzhDatepickerChangeEvent>;\n\n @Element() element: HTMLStzhDatepickerElement;\n\n /**\n * To format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatLong: Intl.DateTimeFormat\n\n private input: HTMLStzhInputElement;\n private popover: HTMLStzhPopoverElement;\n private calendar: HTMLStzhCalendarElement;\n\n private onRootFocus = () => {\n if (this.input) {\n this.input.setFocus();\n }\n }\n\n private onInputChanged = () => {\n const parsedDate = this.dateAdapter.parse(this.input.value, \"dateInput\");\n\n if (this.input.value === \"\" || parsedDate) {\n const isoDate = printISODate(parsedDate);\n\n if (this.value !== isoDate) {\n if (this.calendar) {\n this.calendar.value = isoDate;\n }\n\n this.value = isoDate;\n } else {\n this.valueWatcher(isoDate);\n }\n\n this.stzhChange.emit({\n component: \"stzh-datepicker\",\n value: this.value,\n valueAsDate: parsedDate,\n })\n }\n }\n\n private onCalendarChange = (event: CustomEvent<StzhCalendarChangeEvent>) => {\n this.value = event.detail.value;\n this.stzhChange.emit({\n component: \"stzh-datepicker\",\n value: this.value,\n valueAsDate: event.detail.valueAsDate,\n });\n\n if (this.input) {\n this.input.value = event.detail.valueAsDate\n && this.dateAdapter.format(event.detail.valueAsDate, \"dateInput\");\n }\n\n if (this.popover) {\n this.popover.hide();\n }\n }\n\n private updateButtonAccessibleLabel() {\n if (!this.localization) {\n return;\n }\n\n try {\n const valueAsDate = parseISODate(this.value);\n this.buttonLabel = `${this.label}, ${this.localization.buttonLabel}, ${this.localization.selectedDateMessage} ${this.dateFormatLong.format(valueAsDate)}`;\n } catch (err) {\n this.buttonLabel = `${this.label}, ${this.localization.buttonLabel}`;\n }\n }\n\n connectedCallback() {\n this.createDateFormatters();\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"datepicker\");\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n componentDidLoad() {\n this.valueWatcher(this.value);\n }\n\n render() {\n const classes = {\n \"stzh-datepicker\": true,\n \"stzh-datepicker--inline\": this.inline\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 {this.inline &&\n <Fragment>\n <stzh-calendar\n ref={(el) => (this.calendar = el as HTMLStzhCalendarElement)}\n isDateDisabled={this.calendarIsDateDisabled}\n min={this.calendarMin}\n max={this.calendarMax}\n onStzhChange={this.onCalendarChange}\n ></stzh-calendar>\n <div class=\"stzh-datepicker__actions\">\n <slot name=\"action\"></slot>\n </div>\n </Fragment>\n }\n\n {!this.inline &&\n <stzh-input\n label={this.label}\n labelHidden={this.labelHidden}\n ref={(el) => (this.input = el as HTMLStzhInputElement)}\n noAutocomplete\n onStzhChanged={this.onInputChanged}\n readonly={this.readonly}\n disabled={this.disabled}\n description={this.description}\n descriptionLong={this.descriptionLong}\n error={this.error}\n invalid={this.invalid}\n required={this.required}\n showMarker={this.showMarker}\n size={this.size}\n >\n <stzh-popover\n ref={(el) => (this.popover = el as HTMLStzhPopoverElement)}\n class=\"stzh-datepicker__popover\"\n slot=\"button-right\"\n placement=\"bottom-end\"\n label={this.label}\n >\n <stzh-button\n variant=\"input\"\n icon-only\n icon=\"calendar\"\n disabled={this.disabled}\n a11yLabel={this.buttonLabel}\n >\n </stzh-button>\n <div slot=\"content\">\n <stzh-calendar\n ref={(el) => (this.calendar = el as HTMLStzhCalendarElement)}\n isDateDisabled={this.calendarIsDateDisabled}\n min={this.calendarMin}\n max={this.calendarMax}\n onStzhChange={this.onCalendarChange}\n >\n </stzh-calendar>\n <div class=\"stzh-datepicker__actions\">\n <slot name=\"action\"></slot>\n </div>\n </div>\n </stzh-popover>\n </stzh-input>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-datepicker.js","sourceRoot":"","sources":["../../../../src/components/stzh-datepicker/stzh-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,CAAC,EACD,KAAK,EAEL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACN,MAAM,eAAe,CAAC;AASvB,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAKrD;;GAEG;AAMH,MAAM,OAAO,cAAc;;IAsKjB,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;OACvB;IACH,CAAC,CAAA;IAEO,mBAAc,GAAG,GAAG,EAAE;MAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;MAEzE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,IAAI,UAAU,EAAE;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAEhF,IAAI,IAAI,CAAC,KAAK,KAAK,aAAa,EAAE;UAChC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;WAChD;UAED,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC;SAC5B;aAAM;UACL,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Host,\n Element,\n h,\n Event,\n EventEmitter,\n Method,\n Watch,\n Fragment,\n State\n} from \"@stencil/core\";\n\nimport {\n StzhCalendarChangeEvent,\n StzhDatepickerChangeEvent\n} from \"../../index\";\n\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nimport { printISODate } from \"../../utils/date-utils\"\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\"\n\nimport { StzhDatepickerLocalizedText } from \"./stzh-datepicker.localization\";\n\n/**\n * @slot action - Slot for action below calendar (stzh-link element)\n */\n@Component({\n tag: \"stzh-datepicker\",\n styleUrl: \"stzh-datepicker.scss\",\n scoped: true\n})\nexport class StzhDatepicker {\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() calendarMin: string = \"\"\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() calendarMax: string = \"\"\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @Prop() calendarIsDateDisabled: StzhCalendarDateDisabledPredicate = () => false\n\n /** Name of the hidden date picker input. */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of hidden date picker input (current selected date in ISO format). */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Label for input field and popover */\n @Prop() label: string = \"\";\n\n /** Whether label is visually hidden. */\n @Prop() labelHidden: boolean = false;\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 /** 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 /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Show calendar inline */\n @Prop() inline: boolean = false;\n\n /**\n * Date adapter visible date shown to the user, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /**\n * Date adapter for internal date passed to backend, for custom parsing/formatting.\n * Can be `\"iso\"` (default, date in ISO format) / `\"legacy\"` (date in `d.m.Y` format)\n * or `StzhLocaleAdapter` (must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.)\n */\n @Prop() internalDateAdapter: \"iso\" | \"legacy\" | StzhLocaleAdapter = \"iso\";\n private _internalDateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhDatepickerLocalizedText;\n\n @State() buttonLabel: string;\n\n @Watch(\"localization\")\n createDateFormatters() {\n if (this.localization) {\n this.dateFormatLong = new Intl.DateTimeFormat(this.localization.$locale, {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n })\n }\n }\n\n /** Update calendar and input when value prop has changed */\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n const date = this._internalDateAdapter.parse(newValue, \"dateInput\");\n\n if (this.calendar) {\n this.calendar.value = printISODate(date);\n }\n\n if (this.input) {\n this.input.value = this.dateAdapter.format(date, \"dateInput\");\n }\n\n this.updateButtonAccessibleLabel();\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n @Watch(\"internalDateAdapter\")\n internalDateAdapterWatcher(newValue: \"iso\" | \"legacy\" | StzhLocaleAdapter) {\n if (newValue === \"iso\" || !newValue) {\n this._internalDateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formatsIso,\n this.localization.$globals\n );\n } else if (newValue === \"legacy\") {\n this._internalDateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formatsLegacy,\n this.localization.$globals\n );\n } else {\n this._internalDateAdapter = newValue;\n }\n }\n\n /** Set value by a JS Date object */\n @Method()\n async setDate(date: Date) {\n this.value = this._internalDateAdapter.format(date, \"dateInput\");\n }\n\n /** Return internal popover element */\n @Method()\n async getPopover(): Promise<HTMLStzhPopoverElement> {\n return this.popover;\n }\n\n /** Datepicker change event */\n @Event() stzhChange: EventEmitter<StzhDatepickerChangeEvent>;\n\n @Element() element: HTMLStzhDatepickerElement;\n\n /**\n * To format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatLong: Intl.DateTimeFormat\n\n private input: HTMLStzhInputElement;\n private popover: HTMLStzhPopoverElement;\n private calendar: HTMLStzhCalendarElement;\n\n private onRootFocus = () => {\n if (this.input) {\n this.input.setFocus();\n }\n }\n\n private onInputChanged = () => {\n const parsedDate = this.dateAdapter.parse(this.input.value, \"dateInput\");\n\n if (this.input.value === \"\" || parsedDate) {\n const formattedDate = this._internalDateAdapter.format(parsedDate, \"dateInput\");\n\n if (this.value !== formattedDate) {\n if (this.calendar) {\n this.calendar.value = printISODate(parsedDate);\n }\n\n this.value = formattedDate;\n } else {\n this.valueWatcher(formattedDate);\n }\n\n this.stzhChange.emit({\n component: \"stzh-datepicker\",\n value: this.value,\n valueAsDate: parsedDate,\n })\n }\n }\n\n private onCalendarChange = (event: CustomEvent<StzhCalendarChangeEvent>) => {\n this.value = event.detail.valueAsDate\n && this._internalDateAdapter.format(event.detail.valueAsDate, \"dateInput\");\n\n this.stzhChange.emit({\n component: \"stzh-datepicker\",\n value: this.value,\n valueAsDate: event.detail.valueAsDate,\n });\n\n if (this.input) {\n this.input.value = event.detail.valueAsDate\n && this.dateAdapter.format(event.detail.valueAsDate, \"dateInput\");\n }\n\n if (this.popover) {\n this.popover.hide();\n }\n }\n\n private updateButtonAccessibleLabel() {\n if (!this.localization) {\n return;\n }\n\n try {\n const valueAsDate = this._internalDateAdapter.parse(this.value, \"dateInput\");\n this.buttonLabel = `${this.label}, ${this.localization.buttonLabel}, ${this.localization.selectedDateMessage} ${this.dateFormatLong.format(valueAsDate)}`;\n } catch (err) {\n this.buttonLabel = `${this.label}, ${this.localization.buttonLabel}`;\n }\n }\n\n connectedCallback() {\n this.createDateFormatters();\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"datepicker\");\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n this.internalDateAdapterWatcher(this.internalDateAdapter);\n }\n\n componentDidLoad() {\n this.valueWatcher(this.value);\n }\n\n render() {\n const classes = {\n \"stzh-datepicker\": true,\n \"stzh-datepicker--inline\": this.inline\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 {this.inline &&\n <Fragment>\n <stzh-calendar\n ref={(el) => (this.calendar = el as HTMLStzhCalendarElement)}\n isDateDisabled={this.calendarIsDateDisabled}\n min={this.calendarMin}\n max={this.calendarMax}\n onStzhChange={this.onCalendarChange}\n ></stzh-calendar>\n <div class=\"stzh-datepicker__actions\">\n <slot name=\"action\"></slot>\n </div>\n </Fragment>\n }\n\n {!this.inline &&\n <stzh-input\n label={this.label}\n labelHidden={this.labelHidden}\n ref={(el) => (this.input = el as HTMLStzhInputElement)}\n noAutocomplete\n onStzhChanged={this.onInputChanged}\n readonly={this.readonly}\n disabled={this.disabled}\n description={this.description}\n descriptionLong={this.descriptionLong}\n error={this.error}\n invalid={this.invalid}\n required={this.required}\n showMarker={this.showMarker}\n size={this.size}\n >\n <stzh-popover\n ref={(el) => (this.popover = el as HTMLStzhPopoverElement)}\n class=\"stzh-datepicker__popover\"\n slot=\"button-right\"\n placement=\"bottom-end\"\n label={this.label}\n >\n <stzh-button\n variant=\"input\"\n icon-only\n icon=\"calendar\"\n disabled={this.disabled}\n a11yLabel={this.buttonLabel}\n >\n </stzh-button>\n <div slot=\"content\">\n <stzh-calendar\n ref={(el) => (this.calendar = el as HTMLStzhCalendarElement)}\n isDateDisabled={this.calendarIsDateDisabled}\n min={this.calendarMin}\n max={this.calendarMax}\n onStzhChange={this.onCalendarChange}\n >\n </stzh-calendar>\n <div class=\"stzh-datepicker__actions\">\n <slot name=\"action\"></slot>\n </div>\n </div>\n </stzh-popover>\n </stzh-input>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -645,10 +645,6 @@ stzh-gallery .stzh-fylingfocus-focused::-moz-focus-inner {
|
|
|
645
645
|
.stzh-gallery__pswp .pswp__top-bar {
|
|
646
646
|
align-items: flex-start;
|
|
647
647
|
}
|
|
648
|
-
.stzh-gallery__pswp .pswp__img-wrapper {
|
|
649
|
-
display: flex;
|
|
650
|
-
flex-direction: column;
|
|
651
|
-
}
|
|
652
648
|
.stzh-gallery__pswp .pswp__button {
|
|
653
649
|
opacity: 1;
|
|
654
650
|
width: 3rem;
|
|
@@ -213,7 +213,7 @@ export class StzhInput {
|
|
|
213
213
|
"mutable": false,
|
|
214
214
|
"complexType": {
|
|
215
215
|
"original": "StzhLocaleComponent",
|
|
216
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
216
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
217
217
|
"references": {
|
|
218
218
|
"StzhLocaleComponent": {
|
|
219
219
|
"location": "import",
|
|
@@ -138,7 +138,7 @@ export class StzhLink {
|
|
|
138
138
|
"mutable": false,
|
|
139
139
|
"complexType": {
|
|
140
140
|
"original": "StzhLocaleComponent",
|
|
141
|
-
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
141
|
+
"resolved": "{ $locale: \"de\" | \"en\"; $formats: StzhLocaleFormats; $formatsIso: StzhLocaleFormats; $formatsLegacy: StzhLocaleFormats; $globals: StzhLocaleGlobals; }",
|
|
142
142
|
"references": {
|
|
143
143
|
"StzhLocaleComponent": {
|
|
144
144
|
"location": "import",
|
|
@@ -33,6 +33,20 @@ export class StzhProgressbar {
|
|
|
33
33
|
this.stepsUltra = 0;
|
|
34
34
|
this.currentSteps = undefined;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Return infos about rendered progressbar items.
|
|
38
|
+
* Array of objects including: hide (whether step is hidden)
|
|
39
|
+
* / passed (whether step has been passed)
|
|
40
|
+
* / current (whether step is currently active)
|
|
41
|
+
* / dotted (whether step has dotted style active)
|
|
42
|
+
* / first|last (whether step is first or last)
|
|
43
|
+
* / label
|
|
44
|
+
*/
|
|
45
|
+
async getItemData() {
|
|
46
|
+
return this._data.map((step, index) => {
|
|
47
|
+
return Object.assign(Object.assign({}, step), this.getItemAttributes(index));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
36
50
|
dataWatcher(newValue) {
|
|
37
51
|
if (typeof newValue === "string") {
|
|
38
52
|
this._data = JSON.parse(newValue);
|
|
@@ -273,6 +287,27 @@ export class StzhProgressbar {
|
|
|
273
287
|
"currentSteps": {}
|
|
274
288
|
};
|
|
275
289
|
}
|
|
290
|
+
static get methods() {
|
|
291
|
+
return {
|
|
292
|
+
"getItemData": {
|
|
293
|
+
"complexType": {
|
|
294
|
+
"signature": "() => Promise<any[]>",
|
|
295
|
+
"parameters": [],
|
|
296
|
+
"references": {
|
|
297
|
+
"Promise": {
|
|
298
|
+
"location": "global",
|
|
299
|
+
"id": "global::Promise"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"return": "Promise<any[]>"
|
|
303
|
+
},
|
|
304
|
+
"docs": {
|
|
305
|
+
"text": "Return infos about rendered progressbar items.\nArray of objects including: hide (whether step is hidden)\n/ passed (whether step has been passed)\n/ current (whether step is currently active)\n/ dotted (whether step has dotted style active)\n/ first|last (whether step is first or last)\n/ label",
|
|
306
|
+
"tags": []
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
276
311
|
static get elementRef() { return "element"; }
|
|
277
312
|
static get watchers() {
|
|
278
313
|
return [{
|