@oiz/stzh-components 2.6.0-beta → 2.7.0-alpha
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-b9f31c77.js → app-globals-5dfa53d1.js} +2 -2
- package/dist/cjs/{app-globals-b9f31c77.js.map → app-globals-5dfa53d1.js.map} +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-actions.cjs.entry.js +1 -5
- package/dist/cjs/stzh-actions.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-actionset.cjs.entry.js +2 -2
- package/dist/cjs/stzh-actionset.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-amount.cjs.entry.js +50 -69
- package/dist/cjs/stzh-amount.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-badge_3.cjs.entry.js +2 -2
- package/dist/cjs/stzh-badge_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +60 -25
- package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ghettobox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-input.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-invert.cjs.entry.js +1 -1
- package/dist/cjs/stzh-invert.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js +191 -0
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-timepicker.cjs.entry.js +82 -0
- package/dist/cjs/stzh-timepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +19 -7
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/translation-utils-73073e44.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +10 -7
- package/dist/collection/assets/i18n/en.json +8 -5
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/stzh-actions/stzh-actions.js +1 -5
- package/dist/collection/components/stzh-actions/stzh-actions.js.map +1 -1
- package/dist/collection/components/stzh-actionset/stzh-actionset.js +2 -2
- package/dist/collection/components/stzh-actionset/stzh-actionset.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.css +1 -0
- package/dist/collection/components/stzh-amount/stzh-amount.js +84 -85
- package/dist/collection/components/stzh-amount/stzh-amount.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.localization.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.stories.js +14 -0
- package/dist/collection/components/stzh-button/stzh-button.css +2 -2
- package/dist/collection/components/stzh-button/stzh-button.js +1 -1
- package/dist/collection/components/stzh-button/stzh-button.js.map +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js.map +1 -1
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +1 -1
- package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js.map +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +2 -2
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js.map +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.stories.js +3 -0
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +32 -20
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +40 -9
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js.map +1 -1
- package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +4 -4
- package/dist/collection/components/stzh-input/stzh-input.js +1 -1
- package/dist/collection/components/stzh-input/stzh-input.js.map +1 -1
- package/dist/collection/components/stzh-invert/stzh-invert.css +2 -2
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.css +123 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js +724 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js.map +1 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.js +2 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.js.map +1 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.stories.js +61 -0
- package/dist/collection/components/stzh-radio/stzh-radio.js +1 -1
- package/dist/collection/components/stzh-radio/stzh-radio.js.map +1 -1
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +1 -1
- package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js.map +1 -1
- package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.css +1 -1
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.css +109 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js +438 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js.map +1 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.localization.js +2 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.localization.js.map +1 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.stories.js +45 -0
- package/dist/collection/components/stzh-toggle/stzh-toggle.js +1 -1
- package/dist/collection/components/stzh-toggle/stzh-toggle.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +53 -3
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/libraries/dropzone/dropzone-amd-module.js +11 -5
- package/dist/collection/libraries/dropzone/dropzone.js +11 -5
- package/dist/collection/libraries/dropzone/min/dropzone-amd-module.min.js +1 -1
- package/dist/collection/libraries/dropzone/min/dropzone.min.js +1 -1
- package/dist/collection/libraries/tom-select/cjs/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/cjs/tom-select.js +47 -18
- package/dist/collection/libraries/tom-select/cjs/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.base.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.base.min.js +16 -17
- package/dist/collection/libraries/tom-select/js/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.complete.min.js +12 -13
- package/dist/collection/libraries/tom-select/js/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.popular.min.js +21 -22
- package/dist/collection/utils/translation-utils.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-actions.js +1 -5
- package/dist/components/stzh-actions.js.map +1 -1
- package/dist/components/stzh-actionset2.js +2 -2
- package/dist/components/stzh-actionset2.js.map +1 -1
- package/dist/components/stzh-amount.js +69 -82
- package/dist/components/stzh-amount.js.map +1 -1
- package/dist/components/stzh-button2.js +2 -2
- package/dist/components/stzh-button2.js.map +1 -1
- package/dist/components/stzh-buttongroup.js +1 -31
- package/dist/components/stzh-buttongroup.js.map +1 -1
- package/dist/components/stzh-buttongroup2.js +35 -0
- package/dist/components/stzh-buttongroup2.js.map +1 -0
- package/dist/components/stzh-checkbox.js.map +1 -1
- package/dist/components/stzh-checkboxgroup.js.map +1 -1
- package/dist/components/stzh-datepicker2.js.map +1 -1
- package/dist/components/stzh-dropdown2.js +61 -25
- package/dist/components/stzh-dropdown2.js.map +1 -1
- package/dist/components/stzh-ghettobox2.js +1 -1
- package/dist/components/stzh-ghettobox2.js.map +1 -1
- package/dist/components/stzh-input2.js.map +1 -1
- package/dist/components/stzh-invert.js +1 -1
- package/dist/components/stzh-invert.js.map +1 -1
- package/dist/components/stzh-monthyearpicker.d.ts +11 -0
- package/dist/components/stzh-monthyearpicker.js +251 -0
- package/dist/components/stzh-monthyearpicker.js.map +1 -0
- package/dist/components/stzh-radio2.js.map +1 -1
- package/dist/components/stzh-radiogroup2.js.map +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js.map +1 -1
- package/dist/components/stzh-timepicker.d.ts +11 -0
- package/dist/components/stzh-timepicker.js +132 -0
- package/dist/components/stzh-timepicker.js.map +1 -0
- package/dist/components/stzh-toggle.js.map +1 -1
- package/dist/components/stzh-upload.js +22 -8
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/components/translation-utils.js.map +1 -1
- package/dist/esm/{app-globals-0c7feedc.js → app-globals-862dc6d0.js} +2 -2
- package/dist/esm/{app-globals-0c7feedc.js.map → app-globals-862dc6d0.js.map} +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-actions.entry.js +1 -5
- package/dist/esm/stzh-actions.entry.js.map +1 -1
- package/dist/esm/stzh-actionset.entry.js +2 -2
- package/dist/esm/stzh-actionset.entry.js.map +1 -1
- package/dist/esm/stzh-amount.entry.js +51 -70
- package/dist/esm/stzh-amount.entry.js.map +1 -1
- package/dist/esm/stzh-badge_3.entry.js +2 -2
- package/dist/esm/stzh-badge_3.entry.js.map +1 -1
- package/dist/esm/stzh-checkbox.entry.js.map +1 -1
- package/dist/esm/stzh-checkboxgroup.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm/stzh-dropdown.entry.js +60 -25
- package/dist/esm/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm/stzh-ghettobox_2.entry.js +1 -1
- package/dist/esm/stzh-ghettobox_2.entry.js.map +1 -1
- package/dist/esm/stzh-input.entry.js.map +1 -1
- package/dist/esm/stzh-invert.entry.js +1 -1
- package/dist/esm/stzh-invert.entry.js.map +1 -1
- package/dist/esm/stzh-monthyearpicker.entry.js +187 -0
- package/dist/esm/stzh-monthyearpicker.entry.js.map +1 -0
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js.map +1 -1
- package/dist/esm/stzh-timepicker.entry.js +78 -0
- package/dist/esm/stzh-timepicker.entry.js.map +1 -0
- package/dist/esm/stzh-toggle.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +19 -7
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/esm/translation-utils-2623783f.js.map +1 -1
- package/dist/esm-es5/{app-globals-0c7feedc.js → app-globals-862dc6d0.js} +2 -2
- package/dist/esm-es5/{app-globals-0c7feedc.js.map → app-globals-862dc6d0.js.map} +1 -1
- 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-actions.entry.js +1 -1
- package/dist/esm-es5/stzh-actions.entry.js.map +1 -1
- package/dist/esm-es5/stzh-actionset.entry.js +1 -1
- package/dist/esm-es5/stzh-actionset.entry.js.map +1 -1
- package/dist/esm-es5/stzh-amount.entry.js +1 -1
- package/dist/esm-es5/stzh-amount.entry.js.map +1 -1
- package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
- package/dist/esm-es5/stzh-badge_3.entry.js.map +1 -1
- package/dist/esm-es5/stzh-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/stzh-checkboxgroup.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-datepicker_3.entry.js.map +1 -1
- package/dist/esm-es5/stzh-dropdown.entry.js +2 -2
- package/dist/esm-es5/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
- package/dist/esm-es5/stzh-ghettobox_2.entry.js.map +1 -1
- package/dist/esm-es5/stzh-input.entry.js.map +1 -1
- package/dist/esm-es5/stzh-invert.entry.js +1 -1
- package/dist/esm-es5/stzh-invert.entry.js.map +1 -1
- package/dist/esm-es5/stzh-monthyearpicker.entry.js +2 -0
- package/dist/esm-es5/stzh-monthyearpicker.entry.js.map +1 -0
- package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js.map +1 -1
- package/dist/esm-es5/stzh-timepicker.entry.js +2 -0
- package/dist/esm-es5/stzh-timepicker.entry.js.map +1 -0
- package/dist/esm-es5/stzh-toggle.entry.js.map +1 -1
- package/dist/esm-es5/stzh-upload.entry.js +1 -1
- package/dist/esm-es5/stzh-upload.entry.js.map +1 -1
- package/dist/esm-es5/translation-utils-2623783f.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +10 -7
- package/dist/stzh-components/assets/i18n/en.json +8 -5
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/{p-8228cd4c.system.entry.js → p-09191103.system.entry.js} +2 -2
- package/dist/stzh-components/{p-8228cd4c.system.entry.js.map → p-09191103.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-0f328a2d.system.entry.js +2 -0
- package/dist/stzh-components/{p-12964da2.system.entry.js.map → p-0f328a2d.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-14e782cb.entry.js +2 -0
- package/dist/stzh-components/{p-85504842.entry.js.map → p-14e782cb.entry.js.map} +1 -1
- package/dist/stzh-components/p-1678e09c.system.js +2 -0
- package/dist/stzh-components/{p-8ebb6058.system.js.map → p-1678e09c.system.js.map} +1 -1
- package/dist/stzh-components/p-25a09313.js.map +1 -1
- package/dist/stzh-components/p-2615433f.system.entry.js +2 -0
- package/dist/stzh-components/p-2615433f.system.entry.js.map +1 -0
- package/dist/stzh-components/p-2907f1b5.entry.js +2 -0
- package/dist/stzh-components/{p-72da8eba.entry.js.map → p-2907f1b5.entry.js.map} +1 -1
- package/dist/stzh-components/{p-728cc738.entry.js → p-2d25bcc8.entry.js} +2 -2
- package/dist/stzh-components/p-2d25bcc8.entry.js.map +1 -0
- package/dist/stzh-components/p-2f3add2f.system.entry.js +2 -0
- package/dist/stzh-components/{p-0fa1dc9b.system.entry.js.map → p-2f3add2f.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-39a4904e.system.entry.js.map +1 -1
- package/dist/stzh-components/p-3aa5623c.entry.js.map +1 -1
- package/dist/stzh-components/{p-37cfb2b2.system.js → p-3b4833a0.system.js} +2 -2
- package/dist/stzh-components/{p-37cfb2b2.system.js.map → p-3b4833a0.system.js.map} +1 -1
- package/dist/stzh-components/p-3cb43903.entry.js.map +1 -1
- package/dist/stzh-components/p-49a0420a.entry.js +2 -0
- package/dist/stzh-components/{p-8bbb27f2.entry.js.map → p-49a0420a.entry.js.map} +1 -1
- package/dist/stzh-components/p-51f1714c.system.entry.js +2 -0
- package/dist/stzh-components/p-51f1714c.system.entry.js.map +1 -0
- package/dist/stzh-components/p-5aa96b49.system.entry.js +2 -0
- package/dist/stzh-components/p-5aa96b49.system.entry.js.map +1 -0
- package/dist/stzh-components/p-5d8ad1f4.system.entry.js.map +1 -1
- package/dist/stzh-components/{p-6ee544b4.entry.js → p-62188444.entry.js} +2 -2
- package/dist/stzh-components/{p-6ee544b4.entry.js.map → p-62188444.entry.js.map} +1 -1
- package/dist/stzh-components/{p-e683abe3.system.entry.js → p-6d097e82.system.entry.js} +2 -2
- package/dist/stzh-components/p-6d097e82.system.entry.js.map +1 -0
- package/dist/stzh-components/p-82e886d4.entry.js.map +1 -1
- package/dist/stzh-components/{p-d69b11ec.system.entry.js → p-94a5e295.system.entry.js} +2 -2
- package/dist/stzh-components/p-94a5e295.system.entry.js.map +1 -0
- package/dist/stzh-components/p-9b7d4e8d.entry.js.map +1 -1
- package/dist/stzh-components/p-9d46101e.entry.js +2 -0
- package/dist/stzh-components/p-9d46101e.entry.js.map +1 -0
- package/dist/stzh-components/p-9f31cf7d.entry.js +2 -0
- package/dist/stzh-components/p-9f31cf7d.entry.js.map +1 -0
- package/dist/stzh-components/p-9fe69be8.system.entry.js +2 -0
- package/dist/stzh-components/{p-479a02fb.system.entry.js.map → p-9fe69be8.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-a408bfba.system.js.map +1 -1
- package/dist/stzh-components/p-ad33db31.entry.js +2 -0
- package/dist/stzh-components/p-ad33db31.entry.js.map +1 -0
- package/dist/stzh-components/p-b05c240b.system.entry.js.map +1 -1
- package/dist/stzh-components/p-b5cda655.entry.js +2 -0
- package/dist/stzh-components/p-b5cda655.entry.js.map +1 -0
- package/dist/stzh-components/p-b8ad5f47.system.entry.js.map +1 -1
- package/dist/stzh-components/{p-a226d634.js → p-bc82ed48.js} +2 -2
- package/dist/stzh-components/{p-a226d634.js.map → p-bc82ed48.js.map} +1 -1
- package/dist/stzh-components/{p-5e09547b.entry.js → p-bcd5b20e.entry.js} +2 -2
- package/dist/stzh-components/p-bcd5b20e.entry.js.map +1 -0
- package/dist/stzh-components/p-c0f971f2.entry.js +9 -0
- package/dist/stzh-components/p-c0f971f2.entry.js.map +1 -0
- package/dist/stzh-components/p-c901fe72.system.entry.js +9 -0
- package/dist/stzh-components/p-c901fe72.system.entry.js.map +1 -0
- package/dist/stzh-components/p-cc35e963.entry.js.map +1 -1
- package/dist/stzh-components/p-e8545386.system.entry.js +2 -0
- package/dist/stzh-components/p-e8545386.system.entry.js.map +1 -0
- package/dist/stzh-components/p-eaa65f52.system.js.map +1 -1
- package/dist/stzh-components/p-f2d74491.system.entry.js.map +1 -1
- package/dist/stzh-components/stzh-components.css +1 -1
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/stzh-components/stzh-components.js +1 -1
- package/dist/types/components/stzh-amount/stzh-amount.localization.d.ts +0 -2
- package/dist/types/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.d.ts +5 -0
- package/dist/types/components/stzh-timepicker/stzh-timepicker.localization.d.ts +2 -0
- package/dist/types/components.d.ts +454 -22
- package/dist/types/index.d.ts +19 -0
- package/dist/types/utils/translation-utils.d.ts +1 -0
- package/dist/vscode-data.json +282 -8
- package/package.json +1 -1
- package/dist/stzh-components/p-09a8bcde.system.entry.js +0 -9
- package/dist/stzh-components/p-09a8bcde.system.entry.js.map +0 -1
- package/dist/stzh-components/p-0fa1dc9b.system.entry.js +0 -2
- package/dist/stzh-components/p-12964da2.system.entry.js +0 -2
- package/dist/stzh-components/p-2ee0d173.system.entry.js +0 -2
- package/dist/stzh-components/p-2ee0d173.system.entry.js.map +0 -1
- package/dist/stzh-components/p-30e04d53.entry.js +0 -2
- package/dist/stzh-components/p-30e04d53.entry.js.map +0 -1
- package/dist/stzh-components/p-427461c5.system.entry.js +0 -2
- package/dist/stzh-components/p-427461c5.system.entry.js.map +0 -1
- package/dist/stzh-components/p-479a02fb.system.entry.js +0 -2
- package/dist/stzh-components/p-5e09547b.entry.js.map +0 -1
- package/dist/stzh-components/p-66c1942a.entry.js +0 -2
- package/dist/stzh-components/p-66c1942a.entry.js.map +0 -1
- package/dist/stzh-components/p-728cc738.entry.js.map +0 -1
- package/dist/stzh-components/p-72da8eba.entry.js +0 -2
- package/dist/stzh-components/p-85504842.entry.js +0 -2
- package/dist/stzh-components/p-8bbb27f2.entry.js +0 -2
- package/dist/stzh-components/p-8ebb6058.system.js +0 -2
- package/dist/stzh-components/p-c4503250.entry.js +0 -9
- package/dist/stzh-components/p-c4503250.entry.js.map +0 -1
- package/dist/stzh-components/p-d69b11ec.system.entry.js.map +0 -1
- package/dist/stzh-components/p-e683abe3.system.entry.js.map +0 -1
|
@@ -1 +1 @@
|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AAmB,MAAM,CAAC,cAAc,CAAC,OAAO,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;MAChH,uCACK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACvB;KACH;GAEF;EAAC,OAAO,SAAS,EAAE;IAClB,OAAO,CAAC,KAAK,CAAC,yBAAyB,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;GAC7D;AACH;;;;;","names":[],"sources":["./src/utils/translation-utils.ts"],"sourcesContent":["import {\n StzhDateFormat,\n StzhDateParse\n} from \"./date-adapter\";\n\nconst LANG_DE = \"de\";\nconst LANG_EN = \"en\";\nconst LANG_DEFAULT = LANG_DE;\n\nexport const SUPPORTED_LANGUAGES = [\n LANG_DE,\n LANG_EN\n];\n\nexport type StzhLocaleFormats = {\n inputdate: {\n format: string | StzhDateFormat,\n parse: string | StzhDateParse\n },\n date: {\n format: string | StzhDateFormat\n },\n dateRange: string,\n timeRange: string,\n timePostfix: string,\n time: {\n format: string | StzhDateFormat\n }\n}\n\ntype MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string]\ntype DayNames = [string, string, string, string, string, string, string]\n\nexport type StzhLocaleGlobals = {\n externalLinkLabel: string\n downloadLinkLabel: string\n requiredFieldMarker: string\n requiredFieldText: string\n optionalFieldMarker: string\n optionalFieldText: string\n invalidFieldText: string\n clearButtonLabel: string\n moreInfoButtonLabel: string\n dayNames: DayNames\n monthNames: MonthsNames\n monthNamesShort: MonthsNames\n}\n\nexport type StzhLocaleComponent = {\n $locale: typeof LANG_DE | typeof LANG_EN,\n $formats: StzhLocaleFormats,\n $globals: StzhLocaleGlobals\n}\n\nfunction getLocale(element: HTMLElement) {\n const closestElement = element.closest(\"[lang]\") as HTMLElement;\n const locale = closestElement && closestElement.lang.split(\"-\")[0];\n\n if (SUPPORTED_LANGUAGES.indexOf(locale) === -1 || !locale) {\n return LANG_DEFAULT;\n } else {\n return locale;\n }\n}\n\nexport function tc(translation: string, count: number): string {\n if (!translation) {\n return \"\";\n }\n\n const parts = translation.split('|');\n let part = parts[0].trim();\n\n if (parts.length === 3 && count === 1) {\n part = parts[1].trim();\n } else if (parts.length === 3 && count > 1) {\n part = parts[2].trim();\n }\n\n if (parts.length === 2 && count !== 1) {\n part = parts[1].trim();\n }\n\n return part.replace(/\\{n\\}/ig, count.toString());\n}\n\nexport async function fetchTranslations(host: HTMLElement, component: string) {\n const locale = getLocale(host);\n const existingTranslations = JSON.parse(sessionStorage.getItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`));\n\n if (\n window.stzhComponents.cacheTranslations\n && window.stzhComponents.version.match(/-dev-snapshot/i) === null\n && existingTranslations\n && Object.keys(existingTranslations).length > 0\n ) {\n return {\n ...existingTranslations[component] || {},\n $globals: existingTranslations.$globals,\n $locale: existingTranslations.$code,\n $formats: existingTranslations.$formats\n };\n }\n\n try {\n const result = await fetch(\n `${window.stzhComponents.pathTranslations}/${locale}.json`\n );\n\n if (result.ok) {\n const data = await result.json();\n sessionStorage.setItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`, JSON.stringify(data));\n return {\n ...data[component] || {},\n $globals: data.$globals,\n $locale: data.$code,\n $formats: data.$formats\n };\n }\n\n } catch (exception) {\n console.error(`Error loading locale: ${locale}`, exception);\n }\n}\n"],"version":3}
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
"externalLinkLabel": "Externer Link:",
|
|
20
20
|
"downloadLinkLabel": "Download von:",
|
|
21
21
|
"requiredFieldMarker": "",
|
|
22
|
-
"requiredFieldText": " (Pflichtfeld)",
|
|
23
22
|
"optionalFieldMarker": " (optional)",
|
|
24
|
-
"
|
|
23
|
+
"requiredFieldText": " (Pflichtfeld).",
|
|
24
|
+
"optionalFieldText": " (optional).",
|
|
25
|
+
"invalidFieldText": "(ungültig).",
|
|
25
26
|
"clearButtonLabel": "Feld leeren",
|
|
26
27
|
"moreInfoButtonLabel": "Mehr Info",
|
|
27
28
|
"dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
|
|
@@ -42,16 +43,18 @@
|
|
|
42
43
|
"monthNamesShort": ["Jan.", "Febr.", "März", "April", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."]
|
|
43
44
|
},
|
|
44
45
|
"amount": {
|
|
45
|
-
"stepperMinusLabel": "
|
|
46
|
-
"stepperPlusLabel": "
|
|
47
|
-
"selectedAmountMessage": "Ausgewählte
|
|
48
|
-
"amountTooSmallError": "Der Betrag darf nicht kleiner sein als {minValue}",
|
|
49
|
-
"amountTooGreatError": "Der Betrag darf nicht grösser sein als {maxValue}"
|
|
46
|
+
"stepperMinusLabel": "Menge verkleinern",
|
|
47
|
+
"stepperPlusLabel": "Menge vergrössern",
|
|
48
|
+
"selectedAmountMessage": "Ausgewählte Menge ist"
|
|
50
49
|
},
|
|
51
50
|
"datepicker": {
|
|
52
51
|
"buttonLabel": "Datum wählen",
|
|
53
52
|
"selectedDateMessage": "Ausgewähltes Datum ist"
|
|
54
53
|
},
|
|
54
|
+
"monthyearpicker": {
|
|
55
|
+
"monthLabel": "Monat wählen",
|
|
56
|
+
"yearLabel": "Jahr wählen"
|
|
57
|
+
},
|
|
55
58
|
"popover": {
|
|
56
59
|
"open": "Menü öffnen",
|
|
57
60
|
"close": "Menü schliessen"
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
"externalLinkLabel": "External link:",
|
|
20
20
|
"downloadLinkLabel": "Download of:",
|
|
21
21
|
"requiredFieldMarker": "",
|
|
22
|
-
"requiredFieldText": " (required)",
|
|
23
22
|
"optionalFieldMarker": " (optional)",
|
|
24
|
-
"
|
|
23
|
+
"requiredFieldText": " (required).",
|
|
24
|
+
"optionalFieldText": " (optional).",
|
|
25
|
+
"invalidFieldText": " (invalid).",
|
|
25
26
|
"clearButtonLabel": "Clear input",
|
|
26
27
|
"moreInfoButtonLabel": "More Info",
|
|
27
28
|
"dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
@@ -44,14 +45,16 @@
|
|
|
44
45
|
"amount": {
|
|
45
46
|
"stepperMinusLabel": "Decrease amount",
|
|
46
47
|
"stepperPlusLabel": "Increase amount",
|
|
47
|
-
"selectedAmountMessage": "Selected amount is"
|
|
48
|
-
"amountTooSmallError": "The amount must not be less than {minValue}",
|
|
49
|
-
"amountTooGreatError": "The amount must not be greater than {maxValue}"
|
|
48
|
+
"selectedAmountMessage": "Selected amount is"
|
|
50
49
|
},
|
|
51
50
|
"datepicker": {
|
|
52
51
|
"buttonLabel": "Choose date",
|
|
53
52
|
"selectedDateMessage": "Selected date is"
|
|
54
53
|
},
|
|
54
|
+
"monthyearpicker": {
|
|
55
|
+
"monthLabel": "Choose month",
|
|
56
|
+
"yearLabel": "Choose year"
|
|
57
|
+
},
|
|
55
58
|
"popover": {
|
|
56
59
|
"open": "Open menu",
|
|
57
60
|
"close": "Close menu"
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"./components/stzh-message/stzh-message.js",
|
|
60
60
|
"./components/stzh-metanav/stzh-metanav.js",
|
|
61
61
|
"./components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js",
|
|
62
|
+
"./components/stzh-monthyearpicker/stzh-monthyearpicker.js",
|
|
62
63
|
"./components/stzh-olmap/stzh-olmap.js",
|
|
63
64
|
"./components/stzh-overlay/stzh-overlay.js",
|
|
64
65
|
"./components/stzh-page-skiplinks/stzh-page-skiplinks.js",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"./components/stzh-table/stzh-table.js",
|
|
90
91
|
"./components/stzh-text/stzh-text.js",
|
|
91
92
|
"./components/stzh-textandimage/stzh-textandimage.js",
|
|
93
|
+
"./components/stzh-timepicker/stzh-timepicker.js",
|
|
92
94
|
"./components/stzh-toggle/stzh-toggle.js",
|
|
93
95
|
"./components/stzh-tooltip/stzh-tooltip.js",
|
|
94
96
|
"./components/stzh-upload/stzh-upload.js",
|
|
@@ -8,15 +8,11 @@ export class StzhActions {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.init = () => {
|
|
10
10
|
const secondaryButtons = this.element.querySelectorAll('stzh-button[slot="secondary"], [slot="secondary"] stzh-button');
|
|
11
|
-
const buttons = this.element.querySelectorAll('stzh-button');
|
|
12
11
|
secondaryButtons.forEach((button) => {
|
|
13
12
|
setPropsIfNull(button, {
|
|
14
13
|
variant: "secondary"
|
|
15
14
|
});
|
|
16
15
|
});
|
|
17
|
-
buttons.forEach((button) => {
|
|
18
|
-
button.setAttribute("role", "listitem");
|
|
19
|
-
});
|
|
20
16
|
};
|
|
21
17
|
this.variant = "form";
|
|
22
18
|
this.withBorder = false;
|
|
@@ -40,7 +36,7 @@ export class StzhActions {
|
|
|
40
36
|
"stzh-actions--has-border": this.withBorder,
|
|
41
37
|
[`stzh-actions--${this.variant}`]: !!this.variant
|
|
42
38
|
};
|
|
43
|
-
return (h(Host, null, h("div", { class: classes }, h("div", { class: "stzh-actions__actions", role: "
|
|
39
|
+
return (h(Host, null, h("div", { class: classes }, h("div", { class: "stzh-actions__actions", role: "group" }, h("div", { class: "stzh-actions__secondary-actions" }, h("slot", { name: "secondary" })), h("div", { class: "stzh-actions__primary-actions" }, h("slot", { name: "primary" }))))));
|
|
44
40
|
}
|
|
45
41
|
static get is() { return "stzh-actions"; }
|
|
46
42
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-actions.js","sourceRoot":"","sources":["../../../src/components/stzh-actions/stzh-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc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IAAI;MACpB,0BAA0B,EAAE,IAAI,CAAC,UAAU;MAC3C,CAAC,iBAAiB,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO;KAClD,CAAC;IAEF,OAAO,CACL,EAAC,IAAI;MACH,WAAK,KAAK,EAAE,OAAO;QACjB,WAAK,KAAK,EAAC,uBAAuB,EAAC,IAAI,EAAC,OAAO;UAC7C,WAAK,KAAK,EAAC,iCAAiC;YAC1C,YAAM,IAAI,EAAC,WAAW,GAAQ,CAC1B;UACN,WAAK,KAAK,EAAC,+BAA+B;YACxC,YAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element\n} from \"@stencil/core\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\n\n/**\n * @slot primary - Slot for primary button\n * @slot secondary - Slot for secondary button\n */\n@Component({\n tag: \"stzh-actions\",\n styleUrl: \"stzh-actions.scss\",\n scoped: true\n})\nexport class StzhActions {\n /** Variant determining what position the action buttons are */\n @Prop({ reflect: true }) variant: \"form\" | \"dialog\" | \"process\" | \"cta\" = \"form\";\n\n /** With border separator */\n @Prop({ reflect: true }) withBorder: boolean = false;\n\n @Element() element: HTMLStzhActionsElement;\n\n private observer: MutationObserver;\n\n private init = () => {\n const secondaryButtons = this.element.querySelectorAll(\n 'stzh-button[slot=\"secondary\"], [slot=\"secondary\"] stzh-button'\n );\n\n secondaryButtons.forEach((button) => {\n setPropsIfNull(button, {\n variant: \"secondary\"\n } as HTMLStzhButtonElement)\n });\n\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-actions\": true,\n \"stzh-actions--has-border\": this.withBorder,\n [`stzh-actions--${this.variant}`]: !!this.variant\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-actions__actions\" role=\"group\">\n <div class=\"stzh-actions__secondary-actions\">\n <slot name=\"secondary\"></slot>\n </div>\n <div class=\"stzh-actions__primary-actions\">\n <slot name=\"primary\"></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -125,7 +125,7 @@ export class StzhActionset {
|
|
|
125
125
|
// "show-medium": !action.onlyCollapseText,
|
|
126
126
|
// "hide-when-collapsed": !action.onlyCollapseText,
|
|
127
127
|
// "hide-text-when-collapsed": action.onlyCollapseText
|
|
128
|
-
},
|
|
128
|
+
}, icon: action.icon, iconPosition: action.iconPosition, iconOnly: action.iconOnly, badge: action.badge, variant: action.variant
|
|
129
129
|
? action.variant
|
|
130
130
|
: (this.variant === "stack" ? "secondary" : "tertiary"), size: action.size
|
|
131
131
|
? action.size
|
|
@@ -133,7 +133,7 @@ export class StzhActionset {
|
|
|
133
133
|
// "show-medium": action.onlyCollapseText,
|
|
134
134
|
// "hide-when-collapsed": action.onlyCollapseText
|
|
135
135
|
} }, action.label)));
|
|
136
|
-
return (h(Host, { "has-collapsed-items": this.actionsCollapsed.length > 0 }, h("div", { class: classes }, h("div", { class: "stzh-actionset__actions", role: "
|
|
136
|
+
return (h(Host, { "has-collapsed-items": this.actionsCollapsed.length > 0 }, h("div", { class: classes }, h("div", { class: "stzh-actionset__actions", role: "group" }, h("div", { ref: (el) => (this.actionsElement = el), class: "stzh-actionset__actions-wrapper" }, this._actions.map(action => ((this.dynamicActions
|
|
137
137
|
|| (!this.dynamicActions &&
|
|
138
138
|
this.actionsCollapsed.indexOf(action) === -1))
|
|
139
139
|
&&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-actionset.js","sourceRoot":"","sources":["../../../src/components/stzh-actionset/stzh-actionset.tsx"],"names":[],"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AAK,EACnB,UAAU,EAAE,MAAM,CAAC,UAAU,EAC7B,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA,CAAC,CAAC,IAE9C,MAAM,CAAC,KAAK,CACE,CAClB,CAAC,CACQ,CACC,CACX,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n\nimport {\n StzhActionsetItem,\n StzhActionsetItemClickEvent\n} from \"../../index\";\n\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhActionsetLocalizedText } from './stzh-actionset.localization';\n\nimport {\n media,\n addMediaChangeListener,\n removeMediaChangeListener\n} from '../../utils/media-utils';\n\nimport {\n Placement,\n} from \"@floating-ui/dom\";\n\n/**\n */\n@Component({\n tag: \"stzh-actionset\",\n styleUrl: \"stzh-actionset.scss\",\n scoped: true\n})\nexport class StzhActionset {\n /** Translation strings */\n @Prop() localization: StzhActionsetLocalizedText;\n\n /** Variant determining what position the action buttons are */\n @Prop({ reflect: true }) variant: \"stack\" | \"overflow\" = \"stack\";\n\n /** Button variant of popover button (button thats holds collapsed actions) */\n @Prop({ reflect: true }) popoverButtonVariant: \"\" | \"default\" | \"secondary\" | \"input\" | \"tertiary\" = \"\";\n\n /** Button size of popover button (button that holds collapsed actions) */\n @Prop({ reflect: true }) popoverButtonSize: \"\" | \"default\" | \"small\" | \"tiny\" = \"\";\n\n /** Popover placement of button that holds collapsed actions */\n @Prop({ reflect: true }) popoverPlacement: Placement = \"bottom-end\";\n\n /**\n * Card header actions.\n * Array of objects that can include the button attributes `id`, `variant`, `icon`, `size`, `iconPosition`, `iconOnly`, `label` or `badge`:\n * `[{\"id\":\"action-1\", \"icon\": \"alarm-bell\", \"label\": \"Lorem\"}, {\"id\":\"action-2\", \"icon\": \"mail\", \"label\": \"Lorem\"}]`\n */\n @Prop() actions: StzhActionsetItem[] | string = [];\n private _actions: StzhActionsetItem[] = [];\n\n /** Header action click event */\n @Event() stzhActionClick: EventEmitter<StzhActionsetItemClickEvent>;\n\n @Element() element: HTMLStzhActionsetElement;\n\n @Watch(\"actions\")\n actionsWatcher(newValue: StzhActionsetItem[] | string) {\n if (typeof newValue === \"string\") {\n this._actions = JSON.parse(newValue);\n } else {\n this._actions = newValue;\n }\n }\n\n @State() actionsCollapsed: StzhActionsetItem[] = [];\n @State() dynamicActions: boolean;\n @State() isSmall: boolean;\n @State() isMedium: boolean;\n\n private actionsElement: HTMLElement;\n private debounceResize: number;\n private resizeObserver: ResizeObserver;\n\n private actionClick = (action: StzhActionsetItem, originalEvent: MouseEvent) => {\n this.stzhActionClick.emit({\n component: \"stzh-actionset\",\n action,\n originalEvent\n });\n }\n\n private update = () => {\n this.isSmall = media(\"small\").matches;\n this.isMedium = media(\"medium\").matches;\n\n if (!this.actionsElement) {\n return;\n }\n\n Object.assign(this.actionsElement.style, {\n width: null,\n height: null\n });\n\n let newActionsVisible = 0;\n\n if (\n this.variant === \"overflow\" && this.isMedium\n || this.variant === \"stack\" && this.isSmall\n ) {\n this.dynamicActions = true;\n\n let newActionsHeight = 0;\n let newActionsWidth = 0;\n\n // update height and width\n Array.from(this.actionsElement.children).forEach((child: HTMLElement) => {\n // check which item is visible and\n if (child.offsetTop === 0) {\n newActionsVisible++;\n\n const style = getComputedStyle(child);\n const marginLeft = parseInt(style.marginLeft);\n const marginRight = parseInt(style.marginRight);\n const marginTop = parseInt(style.marginTop);\n const marginBottom = parseInt(style.marginBottom);\n\n const childWidth = child.offsetWidth + marginLeft + marginRight;\n const childHeight = child.offsetHeight + marginTop + marginBottom;\n\n if (newActionsHeight < childHeight) {\n newActionsHeight = childHeight;\n }\n\n newActionsWidth = newActionsWidth + childWidth + 1;\n }\n });\n\n Object.assign(this.actionsElement.style, {\n width: `${newActionsWidth}px`,\n height: `${newActionsHeight}px`\n });\n } else {\n this.dynamicActions = false;\n\n if (this.variant === \"overflow\") {\n newActionsVisible = 0;\n } else if (this.variant === \"stack\") {\n newActionsVisible = this._actions.length <= 3 ? this._actions.length : 2;\n }\n }\n\n this.actionsCollapsed = this._actions.slice(newActionsVisible);\n }\n\n private handleResize = () => {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.update);\n }\n\n private mediaChangeHandler = () => {\n this.actionsCollapsed = [];\n requestAnimationFrame(this.update);\n }\n\n async componentWillLoad() {\n this.actionsWatcher(this.actions);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"actionset\");\n }\n }\n\n connectedCallback() {\n addMediaChangeListener(this.mediaChangeHandler);\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this.element);\n }\n\n disconnectedCallback() {\n removeMediaChangeListener(this.mediaChangeHandler);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentDidLoad() {\n this.update();\n }\n\n render() {\n const classes = {\n \"stzh-actionset\": true,\n // \"stzh-actionset--has-dynamic-actions\": this.dynamicActions,\n \"stzh-actionset--has-collapsed-items\": this.actionsCollapsed.length > 0,\n [`stzh-actionset--${this.variant}`]: !!this.variant\n };\n\n const Action = (action: StzhActionsetItem) => (\n <stzh-button\n class={{\n \"stzh-actionset__action\": true,\n \"is-button\": true,\n // \"show-medium\": !action.onlyCollapseText,\n // \"hide-when-collapsed\": !action.onlyCollapseText,\n // \"hide-text-when-collapsed\": action.onlyCollapseText\n }}\n role=\"listitem\"\n icon={action.icon}\n iconPosition={action.iconPosition}\n iconOnly={action.iconOnly}\n badge={action.badge}\n variant={action.variant\n ? action.variant\n : (this.variant === \"stack\" ? \"secondary\" : \"tertiary\")}\n size={action.size\n ? action.size\n : (this.variant === \"stack\" ? \"default\" : \"tiny\")}\n badgePosition=\"icon\"\n onClick={(e) => { this.actionClick(action, e) }}\n >\n <span\n class={{\n // \"show-medium\": action.onlyCollapseText,\n // \"hide-when-collapsed\": action.onlyCollapseText\n }}\n >\n {action.label}\n </span>\n </stzh-button>\n );\n\n return (\n <Host has-collapsed-items={this.actionsCollapsed.length > 0}>\n <div class={classes}>\n <div class=\"stzh-actionset__actions\" role=\"list\">\n <div\n ref={(el) => (this.actionsElement = el as HTMLElement)}\n class=\"stzh-actionset__actions-wrapper\"\n >\n {this._actions.map(action => (\n (this.dynamicActions\n || (!this.dynamicActions &&\n this.actionsCollapsed.indexOf(action) === -1))\n &&\n (action.tooltipContent\n ?\n <stzh-tooltip\n strategy=\"fixed\"\n content={action.tooltipContent}\n >\n {Action(action)}\n </stzh-tooltip>\n :\n Action(action))\n ))}\n </div>\n\n <stzh-popover\n label={this.variant === \"stack\"\n ? this.localization.furtherActions\n : (!this.isMedium ? this.localization.actions : \"\")}\n strategy=\"fixed\"\n placement={this.popoverPlacement}\n class=\"stzh-actionset__action-popover\"\n >\n <stzh-button\n fullwidth\n disabled={this.actionsCollapsed.length === 0}\n class=\"stzh-actionset__action is-further\"\n variant={this.popoverButtonVariant !== \"\"\n ? this.popoverButtonVariant\n : (this.variant === \"stack\" ? \"secondary\" : \"tertiary\")}\n size={this.popoverButtonSize !== \"\"\n ? this.popoverButtonSize\n : (this.variant === \"stack\" ? \"default\" : \"tiny\")}\n icon={this.variant === \"stack\" ? \"angle-down\" : \"more-vertical\"}\n iconOnly={this.variant === \"overflow\" && this.isMedium}\n iconPosition=\"right\"\n label={this.variant === \"stack\"\n ? this.localization.furtherActions\n : (!this.isMedium ? this.localization.actions : \"\")}\n ></stzh-button>\n <stzh-menu slot=\"content\">\n {this.actionsCollapsed.map(action => (\n <stzh-menu-item\n // class=\"hide-medium show-when-collapsed\"\n icon={action.icon}\n badge={action.badge}\n badgeEmpty={action.badgeEmpty}\n badgeType={action.badgeType}\n onClick={(e) => { this.actionClick(action, e) }}\n >\n {action.label}\n </stzh-menu-item>\n ))}\n </stzh-menu>\n </stzh-popover>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-actionset.js","sourceRoot":"","sources":["../../../src/components/stzh-actionset/stzh-actionset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,KAAK,EACL,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EACL,KAAK,EACL,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AAMjC;GACG;AAMH,MAAM,OAAO,aAAa;;IAsBhB,aAAQ,GAAwB,EAAE,CAAC;IAyBnC,gBAAW,GAAG,CAAC,MAAyB,EAAE,aAAyB,EAAE,EAAE;MAC7E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;QACxB,SAAS,EAAE,gBAAgB;QAC3B,MAAM;QACN,aAAa;OACd,CAAC,CAAC;IACL,CAAC,CAAA;IAEO,WAAM,GAAG,GAAG,EAAE;MACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;MACtC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;MAExC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;QACxB,OAAO;OACR;MAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;QACvC,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;OACb,CA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C,cAAc;gBAClC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,GACxC;YACf,iBAAW,IAAI,EAAC,SAAS,IACtB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACnC;cACE,0CAA0C;cAC1C,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,UAAU,EAAE,MAAM,CAAC,UAAU,EAC7B,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA,CAAC,CAAC,IAE9C,MAAM,CAAC,KAAK,CACE,CAClB,CAAC,CACQ,CACC,CACX,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n\nimport {\n StzhActionsetItem,\n StzhActionsetItemClickEvent\n} from \"../../index\";\n\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhActionsetLocalizedText } from './stzh-actionset.localization';\n\nimport {\n media,\n addMediaChangeListener,\n removeMediaChangeListener\n} from '../../utils/media-utils';\n\nimport {\n Placement,\n} from \"@floating-ui/dom\";\n\n/**\n */\n@Component({\n tag: \"stzh-actionset\",\n styleUrl: \"stzh-actionset.scss\",\n scoped: true\n})\nexport class StzhActionset {\n /** Translation strings */\n @Prop() localization: StzhActionsetLocalizedText;\n\n /** Variant determining what position the action buttons are */\n @Prop({ reflect: true }) variant: \"stack\" | \"overflow\" = \"stack\";\n\n /** Button variant of popover button (button thats holds collapsed actions) */\n @Prop({ reflect: true }) popoverButtonVariant: \"\" | \"default\" | \"secondary\" | \"input\" | \"tertiary\" = \"\";\n\n /** Button size of popover button (button that holds collapsed actions) */\n @Prop({ reflect: true }) popoverButtonSize: \"\" | \"default\" | \"small\" | \"tiny\" = \"\";\n\n /** Popover placement of button that holds collapsed actions */\n @Prop({ reflect: true }) popoverPlacement: Placement = \"bottom-end\";\n\n /**\n * Card header actions.\n * Array of objects that can include the button attributes `id`, `variant`, `icon`, `size`, `iconPosition`, `iconOnly`, `label` or `badge`:\n * `[{\"id\":\"action-1\", \"icon\": \"alarm-bell\", \"label\": \"Lorem\"}, {\"id\":\"action-2\", \"icon\": \"mail\", \"label\": \"Lorem\"}]`\n */\n @Prop() actions: StzhActionsetItem[] | string = [];\n private _actions: StzhActionsetItem[] = [];\n\n /** Header action click event */\n @Event() stzhActionClick: EventEmitter<StzhActionsetItemClickEvent>;\n\n @Element() element: HTMLStzhActionsetElement;\n\n @Watch(\"actions\")\n actionsWatcher(newValue: StzhActionsetItem[] | string) {\n if (typeof newValue === \"string\") {\n this._actions = JSON.parse(newValue);\n } else {\n this._actions = newValue;\n }\n }\n\n @State() actionsCollapsed: StzhActionsetItem[] = [];\n @State() dynamicActions: boolean;\n @State() isSmall: boolean;\n @State() isMedium: boolean;\n\n private actionsElement: HTMLElement;\n private debounceResize: number;\n private resizeObserver: ResizeObserver;\n\n private actionClick = (action: StzhActionsetItem, originalEvent: MouseEvent) => {\n this.stzhActionClick.emit({\n component: \"stzh-actionset\",\n action,\n originalEvent\n });\n }\n\n private update = () => {\n this.isSmall = media(\"small\").matches;\n this.isMedium = media(\"medium\").matches;\n\n if (!this.actionsElement) {\n return;\n }\n\n Object.assign(this.actionsElement.style, {\n width: null,\n height: null\n });\n\n let newActionsVisible = 0;\n\n if (\n this.variant === \"overflow\" && this.isMedium\n || this.variant === \"stack\" && this.isSmall\n ) {\n this.dynamicActions = true;\n\n let newActionsHeight = 0;\n let newActionsWidth = 0;\n\n // update height and width\n Array.from(this.actionsElement.children).forEach((child: HTMLElement) => {\n // check which item is visible and\n if (child.offsetTop === 0) {\n newActionsVisible++;\n\n const style = getComputedStyle(child);\n const marginLeft = parseInt(style.marginLeft);\n const marginRight = parseInt(style.marginRight);\n const marginTop = parseInt(style.marginTop);\n const marginBottom = parseInt(style.marginBottom);\n\n const childWidth = child.offsetWidth + marginLeft + marginRight;\n const childHeight = child.offsetHeight + marginTop + marginBottom;\n\n if (newActionsHeight < childHeight) {\n newActionsHeight = childHeight;\n }\n\n newActionsWidth = newActionsWidth + childWidth + 1;\n }\n });\n\n Object.assign(this.actionsElement.style, {\n width: `${newActionsWidth}px`,\n height: `${newActionsHeight}px`\n });\n } else {\n this.dynamicActions = false;\n\n if (this.variant === \"overflow\") {\n newActionsVisible = 0;\n } else if (this.variant === \"stack\") {\n newActionsVisible = this._actions.length <= 3 ? this._actions.length : 2;\n }\n }\n\n this.actionsCollapsed = this._actions.slice(newActionsVisible);\n }\n\n private handleResize = () => {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.update);\n }\n\n private mediaChangeHandler = () => {\n this.actionsCollapsed = [];\n requestAnimationFrame(this.update);\n }\n\n async componentWillLoad() {\n this.actionsWatcher(this.actions);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"actionset\");\n }\n }\n\n connectedCallback() {\n addMediaChangeListener(this.mediaChangeHandler);\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this.element);\n }\n\n disconnectedCallback() {\n removeMediaChangeListener(this.mediaChangeHandler);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentDidLoad() {\n this.update();\n }\n\n render() {\n const classes = {\n \"stzh-actionset\": true,\n // \"stzh-actionset--has-dynamic-actions\": this.dynamicActions,\n \"stzh-actionset--has-collapsed-items\": this.actionsCollapsed.length > 0,\n [`stzh-actionset--${this.variant}`]: !!this.variant\n };\n\n const Action = (action: StzhActionsetItem) => (\n <stzh-button\n class={{\n \"stzh-actionset__action\": true,\n \"is-button\": true,\n // \"show-medium\": !action.onlyCollapseText,\n // \"hide-when-collapsed\": !action.onlyCollapseText,\n // \"hide-text-when-collapsed\": action.onlyCollapseText\n }}\n icon={action.icon}\n iconPosition={action.iconPosition}\n iconOnly={action.iconOnly}\n badge={action.badge}\n variant={action.variant\n ? action.variant\n : (this.variant === \"stack\" ? \"secondary\" : \"tertiary\")}\n size={action.size\n ? action.size\n : (this.variant === \"stack\" ? \"default\" : \"tiny\")}\n badgePosition=\"icon\"\n onClick={(e) => { this.actionClick(action, e) }}\n >\n <span\n class={{\n // \"show-medium\": action.onlyCollapseText,\n // \"hide-when-collapsed\": action.onlyCollapseText\n }}\n >\n {action.label}\n </span>\n </stzh-button>\n );\n\n return (\n <Host has-collapsed-items={this.actionsCollapsed.length > 0}>\n <div class={classes}>\n <div class=\"stzh-actionset__actions\" role=\"group\">\n <div\n ref={(el) => (this.actionsElement = el as HTMLElement)}\n class=\"stzh-actionset__actions-wrapper\"\n >\n {this._actions.map(action => (\n (this.dynamicActions\n || (!this.dynamicActions &&\n this.actionsCollapsed.indexOf(action) === -1))\n &&\n (action.tooltipContent\n ?\n <stzh-tooltip\n strategy=\"fixed\"\n content={action.tooltipContent}\n >\n {Action(action)}\n </stzh-tooltip>\n :\n Action(action))\n ))}\n </div>\n\n <stzh-popover\n label={this.variant === \"stack\"\n ? this.localization.furtherActions\n : (!this.isMedium ? this.localization.actions : \"\")}\n strategy=\"fixed\"\n placement={this.popoverPlacement}\n class=\"stzh-actionset__action-popover\"\n >\n <stzh-button\n fullwidth\n disabled={this.actionsCollapsed.length === 0}\n class=\"stzh-actionset__action is-further\"\n variant={this.popoverButtonVariant !== \"\"\n ? this.popoverButtonVariant\n : (this.variant === \"stack\" ? \"secondary\" : \"tertiary\")}\n size={this.popoverButtonSize !== \"\"\n ? this.popoverButtonSize\n : (this.variant === \"stack\" ? \"default\" : \"tiny\")}\n icon={this.variant === \"stack\" ? \"angle-down\" : \"more-vertical\"}\n iconOnly={this.variant === \"overflow\" && this.isMedium}\n iconPosition=\"right\"\n label={this.variant === \"stack\"\n ? this.localization.furtherActions\n : (!this.isMedium ? this.localization.actions : \"\")}\n ></stzh-button>\n <stzh-menu slot=\"content\">\n {this.actionsCollapsed.map(action => (\n <stzh-menu-item\n // class=\"hide-medium show-when-collapsed\"\n icon={action.icon}\n badge={action.badge}\n badgeEmpty={action.badgeEmpty}\n badgeType={action.badgeType}\n onClick={(e) => { this.actionClick(action, e) }}\n >\n {action.label}\n </stzh-menu-item>\n ))}\n </stzh-menu>\n </stzh-popover>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Host, h
|
|
2
|
-
import { StzhInputDescription } from '../stzh-input/stzh-input-description';
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
3
2
|
import { fetchTranslations } from '../../utils/translation-utils';
|
|
4
3
|
const DROPDOWN_ITEM_PLUS_OPTION_VALUE = "stzh-amount__dropdown-plus-option";
|
|
5
4
|
let amountCounter = 0;
|
|
@@ -7,6 +6,11 @@ export class StzhAmount {
|
|
|
7
6
|
constructor() {
|
|
8
7
|
this._showDropdown = !Number.isNaN(this.minValueDropdown) && !Number.isNaN(this.maxValueDropdown)
|
|
9
8
|
&& this.minValueDropdown < this.maxValueDropdown;
|
|
9
|
+
this.onRootFocus = () => {
|
|
10
|
+
if (this.input) {
|
|
11
|
+
this.input.setFocus();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
10
14
|
/** Handling dropdown changes (switch to input stepper if the plus option is selected in the dropdown). */
|
|
11
15
|
this.onDropdownChange = (event) => {
|
|
12
16
|
if (event.detail.value === DROPDOWN_ITEM_PLUS_OPTION_VALUE) {
|
|
@@ -14,22 +18,44 @@ export class StzhAmount {
|
|
|
14
18
|
this.value = (this.maxValueDropdown + this.step).toString();
|
|
15
19
|
}
|
|
16
20
|
else {
|
|
17
|
-
this.value =
|
|
21
|
+
this.value = event.detail.value;
|
|
18
22
|
}
|
|
23
|
+
this.stzhChange.emit({
|
|
24
|
+
component: "stzh-amount",
|
|
25
|
+
value: this.value
|
|
26
|
+
});
|
|
19
27
|
};
|
|
20
28
|
/** Handling the minus button. */
|
|
21
29
|
this.onInputMinusStepClick = () => {
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
if (Number(this.value) <= this.minValue) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.value = (Number(this.value) - this.step).toString();
|
|
34
|
+
this.value = this.roundToStep(Number(this.value)).toString();
|
|
35
|
+
this.stzhChange.emit({
|
|
36
|
+
component: "stzh-amount",
|
|
37
|
+
value: this.value
|
|
38
|
+
});
|
|
24
39
|
};
|
|
25
40
|
/** Handling the plus button. */
|
|
26
41
|
this.onInputPlusStepClick = () => {
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
if (Number(this.value) >= this.maxValue) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.value = (Number(this.value) + this.step).toString();
|
|
46
|
+
this.value = this.roundToStep(Number(this.value)).toString();
|
|
47
|
+
this.stzhChange.emit({
|
|
48
|
+
component: "stzh-amount",
|
|
49
|
+
value: this.value
|
|
50
|
+
});
|
|
29
51
|
};
|
|
30
52
|
/** Handling manual value change of the stepper input. */
|
|
31
53
|
this.onStepperInputChange = (event) => {
|
|
32
54
|
this.value = event.detail.value;
|
|
55
|
+
this.stzhChange.emit({
|
|
56
|
+
component: "stzh-amount",
|
|
57
|
+
value: this.value
|
|
58
|
+
});
|
|
33
59
|
};
|
|
34
60
|
this.minValue = -9007199254740991;
|
|
35
61
|
this.maxValue = 9007199254740991;
|
|
@@ -52,65 +78,22 @@ export class StzhAmount {
|
|
|
52
78
|
this.a11yDescribedby = '';
|
|
53
79
|
this.localization = undefined;
|
|
54
80
|
}
|
|
55
|
-
|
|
81
|
+
minMaxValueDropdownWatcher() {
|
|
56
82
|
this.setDropdownOptions();
|
|
57
83
|
}
|
|
58
|
-
maxValueDropdownWatcher() {
|
|
59
|
-
this.setDropdownOptions();
|
|
60
|
-
}
|
|
61
|
-
errorWatcher(newValue) {
|
|
62
|
-
if (typeof newValue === "string") {
|
|
63
|
-
try {
|
|
64
|
-
this._error = JSON.parse(newValue);
|
|
65
|
-
}
|
|
66
|
-
catch (e) {
|
|
67
|
-
if (newValue) {
|
|
68
|
-
this._error = [newValue];
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this._error = [];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else if (newValue) {
|
|
76
|
-
this._error = newValue;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this._error = [];
|
|
80
|
-
}
|
|
81
|
-
this.invalid = this._error.length > 0;
|
|
82
|
-
}
|
|
83
|
-
/** Update stepper button a11y-labels when value has changed */
|
|
84
|
-
valueWatcher(newValue) {
|
|
85
|
-
if (!this._showDropdown) {
|
|
86
|
-
this.handleOutOfRangeValue(newValue);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
84
|
/** Fill the dropdown with options according to maxValueDropdown & minValueDropdown. */
|
|
90
85
|
setDropdownOptions() {
|
|
91
|
-
if (this._showDropdown) {
|
|
92
|
-
|
|
93
|
-
for (let i = this.minValueDropdown; i <= this.maxValueDropdown; i++) {
|
|
94
|
-
options.push({ text: i.toString(), value: i.toString() });
|
|
95
|
-
}
|
|
96
|
-
if (this.maxValue != undefined && this.maxValue > this.maxValueDropdown) {
|
|
97
|
-
options.push({ text: `${this.maxValueDropdown.toString()}+`, value: DROPDOWN_ITEM_PLUS_OPTION_VALUE });
|
|
98
|
-
}
|
|
99
|
-
this._dropdownOptions = JSON.stringify(options);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/** Handling manual value change of the stepper input. */
|
|
103
|
-
handleOutOfRangeValue(newValue) {
|
|
104
|
-
this.invalid = (+newValue > this.maxValue || +newValue < this.minValue);
|
|
105
|
-
if (+newValue > this.maxValue) {
|
|
106
|
-
this.error = this.localization.amountTooGreatError.replace(/{maxValue}/gi, this.maxValue.toString());
|
|
86
|
+
if (!this._showDropdown) {
|
|
87
|
+
return;
|
|
107
88
|
}
|
|
108
|
-
|
|
109
|
-
|
|
89
|
+
const options = [];
|
|
90
|
+
for (let i = this.minValueDropdown; i <= this.maxValueDropdown; i++) {
|
|
91
|
+
options.push({ text: i.toString(), value: i.toString() });
|
|
110
92
|
}
|
|
111
|
-
|
|
112
|
-
this.
|
|
93
|
+
if (this.maxValue != undefined && this.maxValue > this.maxValueDropdown) {
|
|
94
|
+
options.push({ text: `${this.maxValueDropdown.toString()}+`, value: DROPDOWN_ITEM_PLUS_OPTION_VALUE });
|
|
113
95
|
}
|
|
96
|
+
this._dropdownOptions = options;
|
|
114
97
|
}
|
|
115
98
|
/** Making sure, that the value is rounded correctly according to the step */
|
|
116
99
|
roundToStep(input) {
|
|
@@ -120,13 +103,10 @@ export class StzhAmount {
|
|
|
120
103
|
return Number((rounded * factor / factor).toFixed(decimals));
|
|
121
104
|
}
|
|
122
105
|
async componentWillLoad() {
|
|
123
|
-
this.errorWatcher(this.error);
|
|
124
|
-
this.valueWatcher(this.value);
|
|
125
106
|
if (!this.localization) {
|
|
126
107
|
this.localization = await fetchTranslations(this.element, "amount");
|
|
127
108
|
}
|
|
128
109
|
this.amountId = `stzh-amount-${amountCounter++}`;
|
|
129
|
-
this.descriptionId = `${this.amountId}-description`;
|
|
130
110
|
if (this._showDropdown) {
|
|
131
111
|
this.setDropdownOptions();
|
|
132
112
|
}
|
|
@@ -139,10 +119,10 @@ export class StzhAmount {
|
|
|
139
119
|
"stzh-amount__dropdown": true,
|
|
140
120
|
[`stzh-amount--popover-placement-${this.popoverPlacement}`]: !!this.popoverPlacement,
|
|
141
121
|
};
|
|
142
|
-
return (h("div", { class: classes }, h("stzh-dropdown", { options: this._dropdownOptions, items: [this.value], label: this.label, required: this.required, disabled: this.disabled, description: this.description, descriptionLong: this.descriptionLong, error: this.error,
|
|
122
|
+
return (h("div", { class: classes }, h("stzh-dropdown", { ref: (el) => (this.input = el), options: this._dropdownOptions, items: [this.value], label: this.label, required: this.required, disabled: this.disabled, description: this.description, descriptionLong: this.descriptionLong, error: this.error, invalid: this.invalid, popoverPlacement: this.popoverPlacement, a11yDescribedby: this.a11yDescribedby, name: this.name, size: this.size, showMarker: this.showMarker, onStzhChange: this.onDropdownChange })));
|
|
143
123
|
}
|
|
144
124
|
renderInputStepper() {
|
|
145
|
-
return (h("div", { class: "stzh-amount__stepper" }, h("div", { class: "stzh-amount__stepper-wrapper" }, h("stzh-
|
|
125
|
+
return (h("div", { class: "stzh-amount__stepper" }, h("div", { class: "stzh-amount__stepper-wrapper" }, h("stzh-input", { ref: (el) => (this.input = el), class: "stzh-amount__stepper-input", value: this.value, type: "number", label: this.label, min: this.minValue, max: this.maxValue, error: this.error, invalid: this.invalid, required: this.required, name: this.name, id: this.stepperInputId, size: this.size, step: this.step, showMarker: this.showMarker, description: this.description, descriptionLong: this.descriptionLong, clearable: this.clearable, disabled: this.disabled, a11yDescribedby: this.a11yDescribedby, onStzhChange: this.onStepperInputChange }), h("stzh-buttongroup", null, h("stzh-button", { class: "stzh-amount__stepper-minus", onClick: this.onInputMinusStepClick, variant: "secondary", icon: "minus", iconOnly: true, a11yControls: this.stepperInputId, a11yDescribedby: this.a11yDescribedby, a11yLabel: `${this.label} ${this.localization.stepperMinusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`, size: this.size, a11yDisabled: Number(this.value) <= this.minValue || this.disabled, disabled: this.disabled }), h("stzh-button", { class: "stzh-amount__stepper-plus", onClick: this.onInputPlusStepClick, variant: "secondary", icon: "plus", iconOnly: true, a11yControls: this.stepperInputId, a11yDescribedby: this.a11yDescribedby, a11yLabel: `${this.label} ${this.localization.stepperPlusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`, size: this.size, a11yDisabled: Number(this.value) >= this.maxValue || this.disabled, disabled: this.disabled })))));
|
|
146
126
|
}
|
|
147
127
|
render() {
|
|
148
128
|
const classes = {
|
|
@@ -150,8 +130,10 @@ export class StzhAmount {
|
|
|
150
130
|
"stzh-amount--has-description": !!this.description,
|
|
151
131
|
"stzh-amount--has-description-long": !!this.descriptionLong,
|
|
152
132
|
"stzh-amount--has-error": !!this.error,
|
|
133
|
+
"stzh-amount--is-required": !!this.required,
|
|
134
|
+
"stzh-amount--is-disabled": !!this.disabled
|
|
153
135
|
};
|
|
154
|
-
return (h(Host, null, h("div", { class: classes, id: this.amountId }, this._showDropdown ?
|
|
136
|
+
return (h(Host, { tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { class: classes, id: this.amountId }, this._showDropdown ?
|
|
155
137
|
this.renderDropdown()
|
|
156
138
|
:
|
|
157
139
|
this.renderInputStepper())));
|
|
@@ -184,7 +166,7 @@ export class StzhAmount {
|
|
|
184
166
|
"text": "The lowest allowed amount (can be negative)."
|
|
185
167
|
},
|
|
186
168
|
"attribute": "min-value",
|
|
187
|
-
"reflect":
|
|
169
|
+
"reflect": false,
|
|
188
170
|
"defaultValue": "-9007199254740991"
|
|
189
171
|
},
|
|
190
172
|
"maxValue": {
|
|
@@ -202,7 +184,7 @@ export class StzhAmount {
|
|
|
202
184
|
"text": "The highest allowed amount."
|
|
203
185
|
},
|
|
204
186
|
"attribute": "max-value",
|
|
205
|
-
"reflect":
|
|
187
|
+
"reflect": false,
|
|
206
188
|
"defaultValue": "9007199254740991"
|
|
207
189
|
},
|
|
208
190
|
"minValueDropdown": {
|
|
@@ -220,7 +202,7 @@ export class StzhAmount {
|
|
|
220
202
|
"text": "The lowest amount as option in the dropdown. Needs to be set to initially display a dropdown."
|
|
221
203
|
},
|
|
222
204
|
"attribute": "min-value-dropdown",
|
|
223
|
-
"reflect":
|
|
205
|
+
"reflect": false,
|
|
224
206
|
"defaultValue": "null"
|
|
225
207
|
},
|
|
226
208
|
"maxValueDropdown": {
|
|
@@ -238,12 +220,12 @@ export class StzhAmount {
|
|
|
238
220
|
"text": "The highest amount as option in the dropdown. Needs to be set to initially display a dropdown."
|
|
239
221
|
},
|
|
240
222
|
"attribute": "max-value-dropdown",
|
|
241
|
-
"reflect":
|
|
223
|
+
"reflect": false,
|
|
242
224
|
"defaultValue": "null"
|
|
243
225
|
},
|
|
244
226
|
"value": {
|
|
245
227
|
"type": "string",
|
|
246
|
-
"mutable":
|
|
228
|
+
"mutable": true,
|
|
247
229
|
"complexType": {
|
|
248
230
|
"original": "string",
|
|
249
231
|
"resolved": "string",
|
|
@@ -256,7 +238,7 @@ export class StzhAmount {
|
|
|
256
238
|
"text": "The initial value of the amount element"
|
|
257
239
|
},
|
|
258
240
|
"attribute": "value",
|
|
259
|
-
"reflect":
|
|
241
|
+
"reflect": false,
|
|
260
242
|
"defaultValue": "\"\""
|
|
261
243
|
},
|
|
262
244
|
"step": {
|
|
@@ -274,7 +256,7 @@ export class StzhAmount {
|
|
|
274
256
|
"text": "The step the amount can be increased or decreased"
|
|
275
257
|
},
|
|
276
258
|
"attribute": "step",
|
|
277
|
-
"reflect":
|
|
259
|
+
"reflect": false,
|
|
278
260
|
"defaultValue": "1"
|
|
279
261
|
},
|
|
280
262
|
"name": {
|
|
@@ -335,8 +317,8 @@ export class StzhAmount {
|
|
|
335
317
|
"type": "string",
|
|
336
318
|
"mutable": false,
|
|
337
319
|
"complexType": {
|
|
338
|
-
"original": "\"bottom\" | \"top\"",
|
|
339
|
-
"resolved": "\"bottom\" | \"top\"",
|
|
320
|
+
"original": "\"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\"",
|
|
321
|
+
"resolved": "\"bottom\" | \"bottom-center\" | \"bottom-end\" | \"top\" | \"top-center\" | \"top-end\"",
|
|
340
322
|
"references": {}
|
|
341
323
|
},
|
|
342
324
|
"required": false,
|
|
@@ -475,7 +457,7 @@ export class StzhAmount {
|
|
|
475
457
|
},
|
|
476
458
|
"error": {
|
|
477
459
|
"type": "string",
|
|
478
|
-
"mutable":
|
|
460
|
+
"mutable": true,
|
|
479
461
|
"complexType": {
|
|
480
462
|
"original": "string | string[]",
|
|
481
463
|
"resolved": "string | string[]",
|
|
@@ -502,7 +484,7 @@ export class StzhAmount {
|
|
|
502
484
|
"optional": false,
|
|
503
485
|
"docs": {
|
|
504
486
|
"tags": [],
|
|
505
|
-
"text": "Id of the element which describes the input
|
|
487
|
+
"text": "Id of the element which describes the input"
|
|
506
488
|
},
|
|
507
489
|
"attribute": "a11y-describedby",
|
|
508
490
|
"reflect": false,
|
|
@@ -513,7 +495,7 @@ export class StzhAmount {
|
|
|
513
495
|
"mutable": false,
|
|
514
496
|
"complexType": {
|
|
515
497
|
"original": "StzhAmountLocalizedText",
|
|
516
|
-
"resolved": "StzhLocaleComponent & { stepperMinusLabel: string; stepperPlusLabel: string; selectedAmountMessage: string;
|
|
498
|
+
"resolved": "StzhLocaleComponent & { stepperMinusLabel: string; stepperPlusLabel: string; selectedAmountMessage: string; }",
|
|
517
499
|
"references": {
|
|
518
500
|
"StzhAmountLocalizedText": {
|
|
519
501
|
"location": "import",
|
|
@@ -530,20 +512,37 @@ export class StzhAmount {
|
|
|
530
512
|
}
|
|
531
513
|
};
|
|
532
514
|
}
|
|
515
|
+
static get events() {
|
|
516
|
+
return [{
|
|
517
|
+
"method": "stzhChange",
|
|
518
|
+
"name": "stzhChange",
|
|
519
|
+
"bubbles": true,
|
|
520
|
+
"cancelable": true,
|
|
521
|
+
"composed": true,
|
|
522
|
+
"docs": {
|
|
523
|
+
"tags": [],
|
|
524
|
+
"text": "Amount change event"
|
|
525
|
+
},
|
|
526
|
+
"complexType": {
|
|
527
|
+
"original": "StzhAmountChangeEvent",
|
|
528
|
+
"resolved": "{ component: \"stzh-amount\"; value: string; }",
|
|
529
|
+
"references": {
|
|
530
|
+
"StzhAmountChangeEvent": {
|
|
531
|
+
"location": "import",
|
|
532
|
+
"path": "../../index"
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}];
|
|
537
|
+
}
|
|
533
538
|
static get elementRef() { return "element"; }
|
|
534
539
|
static get watchers() {
|
|
535
540
|
return [{
|
|
536
541
|
"propName": "minValueDropdown",
|
|
537
|
-
"methodName": "
|
|
542
|
+
"methodName": "minMaxValueDropdownWatcher"
|
|
538
543
|
}, {
|
|
539
544
|
"propName": "maxValueDropdown",
|
|
540
|
-
"methodName": "
|
|
541
|
-
}, {
|
|
542
|
-
"propName": "error",
|
|
543
|
-
"methodName": "errorWatcher"
|
|
544
|
-
}, {
|
|
545
|
-
"propName": "value",
|
|
546
|
-
"methodName": "valueWatcher"
|
|
545
|
+
"methodName": "minMaxValueDropdownWatcher"
|
|
547
546
|
}];
|
|
548
547
|
}
|
|
549
548
|
}
|