@oiz/stzh-components 2.6.0-aalpha → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-2de776c8.js → app-globals-4dcdf160.js} +2 -2
- package/dist/cjs/{app-globals-2de776c8.js.map → app-globals-4dcdf160.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 +74 -20
- 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-datatable.cjs.entry.js +2 -2
- package/dist/cjs/stzh-datatable.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +4 -4
- 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-table.cjs.entry.js +2 -2
- package/dist/cjs/stzh-table.cjs.entry.js.map +1 -1
- 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/collection/assets/i18n/de.json +7 -0
- package/dist/collection/assets/i18n/en.json +7 -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 +127 -29
- package/dist/collection/components/stzh-amount/stzh-amount.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.localization.js +2 -0
- package/dist/collection/components/stzh-amount/stzh-amount.localization.js.map +1 -0
- package/dist/collection/components/stzh-amount/stzh-amount.stories.js +17 -2
- 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-chart/stzh-chart.stories.js +1 -3
- 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-datatable/stzh-datatable.css +18 -19
- package/dist/collection/components/stzh-datatable/stzh-datatable.js +2 -2
- package/dist/collection/components/stzh-datatable/stzh-datatable.js.map +1 -1
- package/dist/collection/components/stzh-datatable/stzh-datatable.stories.js +1 -0
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js.map +1 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +11 -0
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +3 -3
- 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-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-table/stzh-table.css +18 -19
- package/dist/collection/components/stzh-table/stzh-table.js +2 -1
- package/dist/collection/components/stzh-table/stzh-table.js.map +1 -1
- package/dist/collection/components/stzh-table/stzh-table.stories.js +1 -0
- package/dist/collection/components/stzh-textandimage/stzh-textandimage.stories.js +1 -1
- 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/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 +85 -30
- 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-checkbox.js.map +1 -1
- package/dist/components/stzh-checkboxgroup.js.map +1 -1
- package/dist/components/stzh-datatable.js +2 -2
- package/dist/components/stzh-datatable.js.map +1 -1
- package/dist/components/stzh-datepicker2.js.map +1 -1
- package/dist/components/stzh-dropdown2.js +4 -4
- 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-radio2.js.map +1 -1
- package/dist/components/stzh-radiogroup2.js.map +1 -1
- package/dist/components/stzh-table.js +2 -2
- package/dist/components/stzh-table.js.map +1 -1
- 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/esm/{app-globals-08f8b108.js → app-globals-91875913.js} +2 -2
- package/dist/esm/{app-globals-08f8b108.js.map → app-globals-91875913.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 +75 -21
- 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-datatable.entry.js +2 -2
- package/dist/esm/stzh-datatable.entry.js.map +1 -1
- package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm/stzh-dropdown.entry.js +4 -4
- 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-table.entry.js +2 -2
- package/dist/esm/stzh-table.entry.js.map +1 -1
- 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-es5/{app-globals-08f8b108.js → app-globals-91875913.js} +2 -2
- package/dist/esm-es5/{app-globals-08f8b108.js.map → app-globals-91875913.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-datatable.entry.js +1 -1
- package/dist/esm-es5/stzh-datatable.entry.js.map +1 -1
- package/dist/esm-es5/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm-es5/stzh-dropdown.entry.js +1 -1
- 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-table.entry.js +1 -1
- package/dist/esm-es5/stzh-table.entry.js.map +1 -1
- 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/stzh-components/assets/i18n/de.json +7 -0
- package/dist/stzh-components/assets/i18n/en.json +7 -0
- 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-772ca734.entry.js → p-1cc48f98.entry.js} +5 -5
- package/dist/stzh-components/{p-772ca734.entry.js.map → p-1cc48f98.entry.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-8cf10d79.js → p-362af013.js} +2 -2
- package/dist/stzh-components/{p-8cf10d79.js.map → p-362af013.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-3cb43903.entry.js.map +1 -1
- package/dist/stzh-components/p-3d056a49.entry.js +2 -0
- package/dist/stzh-components/{p-a8cd5621.entry.js.map → p-3d056a49.entry.js.map} +1 -1
- package/dist/stzh-components/p-3e10addb.system.js +2 -0
- package/dist/stzh-components/{p-4b07ade3.system.js.map → p-3e10addb.system.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-5d8ad1f4.system.entry.js.map +1 -1
- package/dist/stzh-components/{p-ea158f08.system.js → p-61b66e55.system.js} +2 -2
- package/dist/stzh-components/{p-ea158f08.system.js.map → p-61b66e55.system.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-67b11b03.system.entry.js +2 -0
- package/dist/stzh-components/p-67b11b03.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-f223ed11.system.entry.js → p-6bb83b30.system.entry.js} +4 -4
- package/dist/stzh-components/{p-f223ed11.system.entry.js.map → p-6bb83b30.system.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-88cd596e.system.entry.js → p-80d581ac.system.entry.js} +2 -2
- package/dist/stzh-components/p-80d581ac.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-a2bdc528.system.entry.js +2 -0
- package/dist/stzh-components/{p-7902eb77.system.entry.js.map → p-a2bdc528.system.entry.js.map} +1 -1
- package/dist/stzh-components/p-b05c240b.system.entry.js.map +1 -1
- package/dist/stzh-components/p-b8ad5f47.system.entry.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-c94f7331.entry.js +2 -0
- package/dist/stzh-components/p-c94f7331.entry.js.map +1 -0
- package/dist/stzh-components/p-cc35e963.entry.js.map +1 -1
- package/dist/stzh-components/{p-3c86c595.entry.js → p-d5b4d345.entry.js} +2 -2
- package/dist/stzh-components/p-d5b4d345.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.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 +8 -0
- package/dist/types/components.d.ts +38 -18
- package/dist/types/index.d.ts +5 -0
- package/dist/vscode-data.json +19 -7
- package/package.json +1 -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-3c86c595.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-4b07ade3.system.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-7902eb77.system.entry.js +0 -2
- package/dist/stzh-components/p-88cd596e.system.entry.js.map +0 -1
- package/dist/stzh-components/p-8bbb27f2.entry.js +0 -2
- package/dist/stzh-components/p-a8cd5621.entry.js +0 -2
- package/dist/stzh-components/p-d69b11ec.system.entry.js.map +0 -1
- package/dist/stzh-components/p-e683abe3.system.entry.js.map +0 -1
- package/dist/stzh-components/p-f533c689.system.entry.js +0 -2
- package/dist/stzh-components/p-f533c689.system.entry.js.map +0 -1
- package/dist/stzh-components/p-fc3e596a.entry.js +0 -2
- package/dist/stzh-components/p-fc3e596a.entry.js.map +0 -1
- package/dist/types/components/stzh-amount/stzh-amount.d.ts +0 -64
|
@@ -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,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAIjF;;GAEG;AAMH,MAAM,OAAO,cAAc;;IA+HjB,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;OACvB;IACH,CAAC,CAAA;IAEO,kBAAa,GAAG,GAAG,EAAE;MAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,C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,EAC3C,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAErB;gBAChB,WAAK,KAAK,EAAC,0BAA0B;kBACnC,YAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,CACO,CACJ,CAEX,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 { fetchTranslations } from \"../../utils/translation-utils\";\nimport { printISODate, parseISODate } from \"../../utils/date-utils\"\nimport { StzhLocaleAdapter, createGlobalAdapter } from \"../../utils/date-adapter\"\n\nimport { StzhDatepickerLocalizedText } from \"./stzh-datepicker.localization\";\n\n/**\n * @slot - Slot to place input, calendar and popover element inside\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 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 noting */\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, \"inputdate\");\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 onInputChange = () => {\n const parsedDate = this.dateAdapter.parse(this.input.value, \"inputdate\")\n\n if (this.input.value === \"\" || parsedDate) {\n const isoDate = printISODate(parsedDate);\n\n if (this.calendar) {\n this.calendar.value = isoDate;\n }\n\n this.value = isoDate;\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, \"inputdate\");\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.localization.buttonLabel}, ${this.localization.selectedDateMessage} ${this.dateFormatLong.format(valueAsDate)}`;\n } catch (err) {\n this.buttonLabel = this.localization.buttonLabel;\n }\n }\n\n connectedCallback() {\n this.createDateFormatters();\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"datepicker\");\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = createGlobalAdapter(\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 ref={(el) => (this.input = el as HTMLStzhInputElement)}\n noAutocomplete\n onStzhChange={this.onInputChange}\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,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAIjF;;GAEG;AAMH,MAAM,OAAO,cAAc;;IA+HjB,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;OACvB;IACH,CAAC,CAAA;IAEO,kBAAa,GAAG,GAAG,EAAE;MAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;MAExE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,IAAI,UAAU,EAAE;QACzC,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,C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AC,QAAQ,GAAQ,CACvB,CACF,CACO,CACJ,CAEX,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 { fetchTranslations } from \"../../utils/translation-utils\";\nimport { printISODate, parseISODate } from \"../../utils/date-utils\"\nimport { StzhLocaleAdapter, createGlobalAdapter } from \"../../utils/date-adapter\"\n\nimport { StzhDatepickerLocalizedText } from \"./stzh-datepicker.localization\";\n\n/**\n * @slot - Slot to place input, calendar and popover element inside\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 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, \"inputdate\");\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 onInputChange = () => {\n const parsedDate = this.dateAdapter.parse(this.input.value, \"inputdate\")\n\n if (this.input.value === \"\" || parsedDate) {\n const isoDate = printISODate(parsedDate);\n\n if (this.calendar) {\n this.calendar.value = isoDate;\n }\n\n this.value = isoDate;\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, \"inputdate\");\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.localization.buttonLabel}, ${this.localization.selectedDateMessage} ${this.dateFormatLong.format(valueAsDate)}`;\n } catch (err) {\n this.buttonLabel = this.localization.buttonLabel;\n }\n }\n\n connectedCallback() {\n this.createDateFormatters();\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"datepicker\");\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = createGlobalAdapter(\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 ref={(el) => (this.input = el as HTMLStzhInputElement)}\n noAutocomplete\n onStzhChange={this.onInputChange}\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"]}
|
|
@@ -346,6 +346,17 @@ stzh-dropdown[disabled]:not([disabled=false])[variant=plain] {
|
|
|
346
346
|
.stzh-dropdown .ts-control > input:placeholder-shown {
|
|
347
347
|
text-overflow: ellipsis;
|
|
348
348
|
}
|
|
349
|
+
.stzh-dropdown__vhidden {
|
|
350
|
+
border: 0;
|
|
351
|
+
clip: rect(0 0 0 0);
|
|
352
|
+
-webkit-clip-path: inset(100%);
|
|
353
|
+
clip-path: inset(100%);
|
|
354
|
+
width: 0.0625rem;
|
|
355
|
+
height: 0.0625rem;
|
|
356
|
+
overflow: hidden;
|
|
357
|
+
padding: 0;
|
|
358
|
+
position: absolute;
|
|
359
|
+
}
|
|
349
360
|
.stzh-dropdown__field-wrapper, .stzh-dropdown__select {
|
|
350
361
|
position: relative;
|
|
351
362
|
}
|
|
@@ -470,15 +470,15 @@ export class StzhDropdown {
|
|
|
470
470
|
[`stzh-dropdown--size-${this.size}`]: !!this.size,
|
|
471
471
|
[`stzh-dropdown--${this.variant}`]: !!this.variant
|
|
472
472
|
};
|
|
473
|
-
return (h(Host, { tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { class: classes, ref: (el) => (this.rootElement = el) }, h("div", { class: "stzh-dropdown__field-wrapper" }, h("select", { id: this.dropdownId, class: "stzh-dropdown__select", ref: (el) => (this.select = el), multiple: this.multiple, name: this.name, disabled: this.disabled
|
|
473
|
+
return (h(Host, { tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { class: classes, ref: (el) => (this.rootElement = el) }, h("div", { class: "stzh-dropdown__field-wrapper" }, h("select", { id: this.dropdownId, class: "stzh-dropdown__select", ref: (el) => (this.select = el), multiple: this.multiple, name: this.name, disabled: this.disabled }, h("slot", null)), h("stzh-icon", { name: "angle-down", class: "stzh-dropdown__angle-icon" }), h("div", { class: "stzh-dropdown__icon-wrapper" }, this.icon ?
|
|
474
474
|
h("stzh-icon", { class: "stzh-dropdown__icon", name: this.icon })
|
|
475
475
|
:
|
|
476
|
-
h("slot", { name: "icon" })), h("label", { class: "stzh-dropdown__label", htmlFor: this.dropdownId }, this.label ? this.label : h("slot", { name: "label" }), this.showMarker &&
|
|
476
|
+
h("slot", { name: "icon" })), h("label", { class: "stzh-dropdown__label", htmlFor: this.dropdownId, "aria-labelledby": `${this.dropdownId}-label-inner ${this.dropdownId}-description ${this.a11yDescribedby}`, "aria-describedby": `${this.dropdownId}-description ${this.a11yDescribedby}` }, h("span", { id: `${this.dropdownId}-label-inner` }, this.label ? this.label : h("slot", { name: "label" }), this.showMarker &&
|
|
477
477
|
h("span", { class: "stzh-dropdown__marker" }, h("span", { class: "stzh-dropdown__marker-symbol", "aria-hidden": "true" }, this.required
|
|
478
478
|
? this.localization.$globals.requiredFieldMarker
|
|
479
479
|
: this.localization.$globals.optionalFieldMarker), h("span", { class: "stzh-dropdown__marker-text" }, this.required
|
|
480
480
|
? this.localization.$globals.requiredFieldText
|
|
481
|
-
: this.localization.$globals.optionalFieldText)))), h(StzhInputDescription, { classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel }))));
|
|
481
|
+
: this.localization.$globals.optionalFieldText)), h("span", { class: "stzh-dropdown__vhidden" }, ".")))), h(StzhInputDescription, { classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel }))));
|
|
482
482
|
}
|
|
483
483
|
static get is() { return "stzh-dropdown"; }
|
|
484
484
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-dropdown.js","sourceRoot":"","sources":["../../../src/components/stzh-dropdown/stzh-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EAEN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAe5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,SAAS,MAAM,8CAA8C,CAAC;AACrE,OAAO,qBAAqB,MAAM,gEAAgE,CAAC;AACnG,OAAO,wBAAwB,MAAM,mEAAmE,CAAC;AACzG,OAAO,sBAAsB,MAAM,iEAAiE,CAAC;AACrG,OAAO,0BAA0B,MAAM,sEAAsE,CAAC;AAE9G,MAAM,sBAAsB,GAAG,UAAU,eAAe;EACtD,MAAM,IAAI,GAAG,IAAI,CAAC;EAElB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACzB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAiC,CAAC;IACrD,IAAI,KAAK;MAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;EACnC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AACzD,SAAS,CAAC,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAAC;AAC/D,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;AAC3D,SAAS,CAAC,MAAM,CAAC,qBAAqB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Method,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport {\n StzhDropdownChangeEvent,\n StzhDropdownItemAddEvent,\n StzhDropdownItemRemoveEvent,\n StzhDropdownOptionAddEvent,\n StzhDropdownOptionRemoveEvent,\n StzhDropdownOpenEvent,\n StzhDropdowCloseEvent,\n StzhDropdownFocusEvent,\n StzhDropdownBlurEvent,\n StzhDropdowInitEvent\n} from \"../../index\";\n\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhDropdownLocalizedText } from './stzh-dropdown.localization';\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport TomSelect from \"../../libraries/tom-select/esm/tom-select.js\";\nimport TomSelectRemoveButton from \"../../libraries/tom-select/esm/plugins/remove_button/plugin.js\";\nimport TomSelectCheckboxOptions from \"../../libraries/tom-select/esm/plugins/checkbox_options/plugin.js\";\nimport TomSelectInputAutogrow from \"../../libraries/tom-select/esm/plugins/input_autogrow/plugin.js\";\nimport TomSelectNoBackspaceDelete from \"../../libraries/tom-select/esm/plugins/no_backspace_delete/plugin.js\";\n\nconst TomSelectInputReadonly = function (_plugin_options) {\n const self = this;\n\n self.on(\"initialize\", () => {\n const input = self.control_input as HTMLInputElement;\n if (input) input.readOnly = true;\n })\n};\n\nconst CLASS_FILLED = \"stzh-dropdown--is-filled\";\nconst CLASS_FOCUS = \"stzh-dropdown--has-focus\";\n\nTomSelect.define(\"remove_button\", TomSelectRemoveButton);\nTomSelect.define(\"checkbox_options\", TomSelectCheckboxOptions);\nTomSelect.define(\"input_autogrow\", TomSelectInputAutogrow);\nTomSelect.define(\"no_backspace_delete\", TomSelectNoBackspaceDelete);\nTomSelect.define(\"input_readonly\", TomSelectInputReadonly);\n\nlet dropdownCounter = 0;\n\n/**\n * @slot label - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-dropdown\",\n styleUrl: \"stzh-dropdown.scss\"\n})\nexport class StzhDropdown {\n /** Available options */\n @Prop() options: any[] | string;\n private _options: any[];\n\n /**\n * Option groups that options will be bucketed into.\n * Make sure each object in the array has a property named whatever `optgroupValueField` is set to.\n */\n @Prop() optgroups: any[] | string;\n private _optgroups: any[];\n\n /**\n * Set selected options. Can be array set with JS or as JSON string.\n * To get the current (user) selected options, use `getItems` method.\n */\n @Prop() items: string[] | string;\n private _items: string[];\n\n /**\n * An array of property names to analyze when filtering options.\n * Weights can be given to each field to improve search result:\n * `[{\"field\":\"text\",\"weight\":2},{\"field\":\"text2\",\"weight\":0.5}]`\n */\n @Prop() searchField: string[] | string = [\"text\"];\n private _searchField: string[];\n\n /** Whether multiple items option can be selected */\n @Prop({ reflect: true }) multiple: boolean = false;\n\n /** Show inline (auto width) */\n @Prop({ reflect: true }) inline: boolean = false;\n\n /** The max number of options to display in the dropdown. Set to `null` for an unlimited number of options. */\n @Prop() maxOptions: number | null = null;\n\n /** When searching for multiple terms (separated by space), this is the operator used. Can be 'and' or 'or' */\n @Prop() searchConjunction: \"and\" | \"or\" = \"and\";\n\n /** If true, any options with a \"\" value will be treated like a normal option. This defaults to false to accommodate the common <select> practice of having the first empty option to act as a placeholder. */\n @Prop() allowEmptyOption: boolean = false;\n\n /** Show the dropdown immediately when the control receives focus. */\n @Prop() openOnFocus: boolean = true;\n\n /** After a selection is made, the dropdown will remain open if in a multi-selection control or will close in a single-selection control. Setting closeAfterSelect to true will force the dropdown to close after selections are made. Setting closeAfterSelect to false will keep the dropdown open after selections are made. */\n @Prop() closeAfterSelect: boolean | null = null;\n\n /** Invoked when new options should be loaded from the server. Called with the current query string and a callback function to call with the results when they are loaded (or nothing when an error arises). */\n @Prop() load: (query: string, callback: Function) => any[] | null = null;\n\n /** Minimum of characters required to execute the `load` function */\n @Prop() minCharacters: number = 3;\n\n /** The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled. Useful when loading options dynamically while the user types a search / filter expression. */\n @Prop() loadThrottle: number = 300;\n\n /** If true, the load function will be called upon control initialization (with an empty search). Alternatively it can be set to 'focus' to call the load function when control receives focus. */\n @Prop() preload: boolean | \"focus\" = false;\n\n /** The name of the property to render as an option / item label (not needed when custom rendering functions are defined). */\n @Prop() labelField: string = \"text\";\n\n /** The name of the property to use as the value when an item is selected. */\n @Prop() valueField: string = \"value\";\n\n /** The name of the property to group items by. */\n @Prop() optgroupField: string = \"optgroup\";\n\n /** The name of the property to render as an option group label (not needed when custom rendering functions are defined). */\n @Prop() optgroupLabelField: string = \"label\";\n\n /** The name of the option group property that serves as its unique identifier. */\n @Prop() optgroupValueField: string = \"value\";\n\n /** If truthy, all optgroups will be displayed in the same order as they were added (by the `$order` property). Otherwise, it will order based on the score of the results in each. */\n @Prop() lockOptgroupOrder: true;\n\n /** Name of hidden select element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Initial open state */\n @Prop() open: boolean = false;\n\n /** Current open state (readonly) */\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n /** Variant */\n @Prop({ reflect: true }) variant: \"default\" | \"plain\" = \"default\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Whether the dropdown is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Popover placement */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Icon (use instead of icon slot) */\n @Prop() icon: string = \"\";\n\n /** Prevent option search */\n @Prop() noSearch: boolean = false;\n\n /** Prevent backspace delete */\n @Prop() noBackspaceDelete: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Show text in label depending if field is optional/required */\n @Prop({ reflect: true }) showMarker: 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 private _error: string[];\n\n /** Translation strings */\n @Prop() localization: StzhDropdownLocalizedText;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @Watch(\"options\")\n optionsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._options = JSON.parse(newValue);\n }\n else {\n this._options = newValue;\n }\n }\n\n @Watch(\"items\")\n itemsWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._items = JSON.parse(newValue);\n }\n else {\n this._items = newValue;\n }\n }\n\n @Watch(\"searchField\")\n searchFieldWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._searchField = JSON.parse(newValue);\n }\n else {\n this._searchField = newValue;\n }\n }\n\n @Watch(\"optgroups\")\n optgroupsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._optgroups = JSON.parse(newValue);\n }\n else {\n this._optgroups = newValue;\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Element() element: HTMLStzhDropdownElement;\n\n /**\n * Returns the value of the control.\n * If multiple items can be selected,\n * this returns an array, otherwise a string.\n */\n @Method()\n async getValue(): Promise<string | string[]> {\n return this.tomSelect.getValue();\n }\n\n /** Set new value */\n @Method()\n async setValue(newValue: string | string[], silent: boolean = false) {\n this.tomSelect.setValue(newValue, silent);\n }\n\n /** Focus select */\n @Method()\n async setFocus() {\n this.tomSelect.focus();\n }\n\n /** Reset loaded/cached search queries (calls from load property function) */\n @Method()\n async resetLoadedSearches() {\n this.tomSelect.loadedSearches = {};\n }\n\n /** Return loaded/cached search queries (calls from load property function) */\n @Method()\n async getLoadedSearches() {\n return this.tomSelect.loadedSearches;\n }\n\n /** Return current selected items */\n @Method()\n async getItems() {\n return this.tomSelect.items;\n }\n\n /** Load items by calling load property/function */\n @Method()\n async loadItems(query: string) {\n return this.tomSelect.load(query);\n }\n\n /** Show dropdown popover */\n @Method()\n async show() {\n return this.tomSelect.open();\n }\n\n /** Hide dropdown popover */\n @Method()\n async hide() {\n return this.tomSelect.close();\n }\n\n /** Dropdown change event */\n @Event() stzhChange: EventEmitter<StzhDropdownChangeEvent>;\n\n /** Dropdown item added event */\n @Event() stzhItemAdd: EventEmitter<StzhDropdownItemAddEvent>;\n\n /** Dropdown item removed event */\n @Event() stzhItemRemove: EventEmitter<StzhDropdownItemRemoveEvent>;\n\n /** Dropdown option added event */\n @Event() stzhOptionAdd: EventEmitter<StzhDropdownOptionAddEvent>;\n\n /** Dropdown option removed event */\n @Event() stzhOptionRemove: EventEmitter<StzhDropdownOptionRemoveEvent>;\n\n /** Dropdown open event */\n @Event() stzhOpen: EventEmitter<StzhDropdownOpenEvent>;\n\n /** Dropdown close event */\n @Event() stzhClose: EventEmitter<StzhDropdowCloseEvent>;\n\n /** Dropdown focus event */\n @Event() stzhFocus: EventEmitter<StzhDropdownFocusEvent>;\n\n /** Dropdown blur event */\n @Event() stzhBlur: EventEmitter<StzhDropdownBlurEvent>;\n\n /** Dropdown focus event */\n @Event() stzhInit: EventEmitter<StzhDropdowInitEvent>;\n\n private tomSelect: TomSelect;\n private select: HTMLSelectElement;\n private rootElement: HTMLElement;\n private dropdownId: string;\n private focusedByInput: boolean = false;\n\n private updateFilled() {\n if (this._items.length > 0) {\n this.rootElement.classList.add(CLASS_FILLED);\n } else {\n this.rootElement.classList.remove(CLASS_FILLED);\n }\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n async componentWillLoad() {\n this.dropdownId = `stzh-dropdown-${dropdownCounter++}`;\n\n this.optionsWatcher(this.options);\n this.optgroupsWatcher(this.optgroups);\n this.itemsWatcher(this.items);\n this.searchFieldWatcher(this.searchField);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"dropdown\");\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return [\"isOpen\"].includes(prop) === false;\n }\n\n async componentWillUpdate() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n async componentDidRender() {\n if (this.tomSelect) {\n return;\n }\n\n const plugins = {};\n\n if (this.noSearch) {\n plugins[\"input_readonly\"] = {};\n } else {\n plugins[\"input_autogrow\"] = {};\n }\n\n if (this.noBackspaceDelete) {\n plugins[\"no_backspace_delete\"] = {};\n }\n\n if (this.multiple) {\n plugins[\"checkbox_options\"] = {};\n plugins[\"remove_button\"] = {\n title: this.localization.removeButtonTitle,\n label: '<stzh-icon name=\"close\" class=\"stzh-dropdown__remove-icon\"></stzh-icon>'\n };\n }\n\n const tomSelectOptions: any = {\n plugins,\n maxItems: this.multiple ? null : 1,\n maxOptions: this.maxOptions,\n items: this._items,\n optgroups: this._optgroups,\n searchField: this._searchField,\n searchConjunction: this.searchConjunction,\n allowEmptyOption: this.allowEmptyOption,\n closeAfterSelect: this.closeAfterSelect !== null\n ? this.closeAfterSelect\n : !this.multiple,\n labelField: this.labelField,\n valueField: this.valueField,\n optgroupField: this.optgroupField,\n optgroupLabelField: this.optgroupLabelField,\n optgroupValueField: this.optgroupValueField,\n lockOptgroupOrder: this.lockOptgroupOrder,\n load: this.load,\n shouldLoad: (query: string) => {\n return query.length >= this.minCharacters;\n },\n loadThrottle: this.loadThrottle,\n preload: this.preload,\n openOnFocus: this.openOnFocus,\n loadingClass: \"is-loading\",\n hideSelected: false,\n duplicates: false,\n delimiter: \",\",\n copyClassesToDropdown: false,\n hidePlaceholder: null,\n // if you want the user to be able to add own items enable this option\n // (but checkbox_options plugin throws an error and would need a fix first)\n // create: function(input, callback) {\n // callback({ value: input, text: input });\n // },\n // createOnBlur: false,\n // createFilter: null,\n // persist: false,\n render: {\n option: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__option\" title=\"${escape(data[this.labelField])}\">\n <stzh-icon name=\"checkmark\" class=\"stzh-dropdown__option-check\"></stzh-icon>\n <span class=\"stzh-dropdown__option-title\">\n ${escape(data[this.labelField])}\n </span>\n </div>\n `;\n },\n item: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__item\">\n ${escape(data[this.labelField])}\n </div>\n `;\n },\n option_create: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__create\">\n ${this.localization.create.replace(/{x}/gi, escape(data.input))}…\n </div>\n `;\n },\n no_results: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__no-results\">\n ${this.localization.noResults.replace(/{x}/gi, escape(data.input))}\n </div>`;\n },\n not_loading: this.load === null ? null : (_data, escape) => {\n return `\n <div class=\"stzh-dropdown__not-loading\">\n ${this.localization.notLoading.replace(/{x}/gi, escape(this.minCharacters.toString()))}\n </div>\n `;\n },\n optgroup: (data) => {\n let optgroup = document.createElement(\"div\");\n optgroup.className = \"stzh-dropdown__optgroup\";\n optgroup.appendChild(data.options);\n return optgroup;\n },\n optgroup_header: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__optgroup-header\">\n ${escape(data.label)}\n </div>\n `;\n },\n loading: () => {\n return `\n <div class=\"stzh-dropdown__loader\">\n <stzh-loader></stzh-loader>\n </div>\n `;\n },\n dropdown: () => {\n return `<div class=\"stzh-dropdown__dropdown\"></div>`;\n }\n },\n onChange: (value) => {\n this._items = this.tomSelect.items;\n this.updateFilled();\n\n this.stzhChange.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onItemAdd: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemAdd.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onItemRemove: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemRemove.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onOptionAdd: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionAdd.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onOptionRemove: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionRemove.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onDropdownOpen: () => {\n this.isOpen = true;\n this.stzhOpen.emit({\n component: \"stzh-dropdown\"\n });\n },\n onDropdownClose: () => {\n this.isOpen = false;\n this.stzhClose.emit({\n component: \"stzh-dropdown\"\n });\n },\n onFocus: () => {\n this.focusedByInput = true;\n\n if (this.tomSelect.load && this.preload === \"focus\") {\n // to be able to execute load function again, we reset loaded searches\n this.resetLoadedSearches();\n\n // if results have been preloaded before, load them now directly with load function\n if (this.tomSelect.wrapper.classList.contains('preloaded')) {\n // since tomSelect.preload() doesn't call tomSelect.shouldCall() method internally (to check for minCharacters),\n // we will also not call it (this.tomSelect.settings.shouldLoad.call(this.tomSelect, ''))\n this.tomSelect.load('');\n }\n }\n\n this.rootElement.classList.add(CLASS_FOCUS);\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-dropdown\",\n originalEvent: {\n target: this.tomSelect.control\n }\n });\n },\n onBlur: () => {\n this.rootElement.classList.remove(CLASS_FOCUS);\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-dropdown\"\n });\n },\n onInitialize: () => {\n this.stzhInit.emit({\n component: \"stzh-dropdown\"\n });\n },\n onLoad: () => {\n this._options = this.tomSelect.options;\n }\n };\n\n if (this._options) {\n tomSelectOptions.options = this._options;\n }\n\n if (this._optgroups) {\n tomSelectOptions.optgroups = this._optgroups;\n }\n\n if (this._items) {\n tomSelectOptions.items = this._items;\n }\n\n this.tomSelect = new TomSelect(this.select, tomSelectOptions);\n\n if (!this.openOnFocus) {\n // we still want to enable opening the dropdown by click\n this.tomSelect.control.addEventListener(\"click\", () => {\n this.tomSelect.open();\n });\n }\n\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n render() {\n const iconUsed = hasSlot(this.element, 'icon') || !!this.icon;\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-dropdown\": true,\n \"stzh-dropdown--is-inline\": this.inline,\n \"stzh-dropdown--is-multiple\": this.multiple,\n \"stzh-dropdown--is-disabled\": this.disabled,\n \"stzh-dropdown--is-required\": this.required,\n \"stzh-dropdown--is-invalid\": this.invalid,\n [CLASS_FILLED]: this._items && this._items.length > 0,\n \"stzh-dropdown--has-icon\": iconUsed,\n \"stzh-dropdown--has-description\": descriptionUsed,\n \"stzh-dropdown--has-description-long\": descriptionLongUsed,\n \"stzh-dropdown--has-error\": errorUsed,\n \"stzh-dropdown--has-no-search\": this.noSearch,\n \"stzh-dropdown--has-fixed-label\": window?.stzhComponents?.labels === \"fixed\",\n [`stzh-dropdown--popover-placement-${this.popoverPlacement}`]: !!this.popoverPlacement,\n [`stzh-dropdown--size-${this.size}`]: !!this.size,\n [`stzh-dropdown--${this.variant}`]: !!this.variant\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div\n class={classes}\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-dropdown__field-wrapper\">\n <select\n id={this.dropdownId}\n class=\"stzh-dropdown__select\"\n ref={(el) => (this.select = el as HTMLSelectElement)}\n multiple={this.multiple}\n name={this.name}\n disabled={this.disabled}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n aria-describedby={`${this.dropdownId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n >\n <slot></slot>\n </select>\n\n {/* <div class=\"stzh-dropdown__sizer\">\n {this.placeholder}\n </div> */}\n\n <stzh-icon name=\"angle-down\" class=\"stzh-dropdown__angle-icon\"></stzh-icon>\n\n <div class=\"stzh-dropdown__icon-wrapper\">\n {this.icon ?\n <stzh-icon class=\"stzh-dropdown__icon\" name={this.icon}></stzh-icon>\n :\n <slot name=\"icon\"></slot>\n }\n </div>\n\n <label class=\"stzh-dropdown__label\" htmlFor={this.dropdownId}>\n {this.label ? this.label : <slot name=\"label\"></slot>}\n {this.showMarker &&\n <span class=\"stzh-dropdown__marker\">\n <span class=\"stzh-dropdown__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-dropdown__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </label>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-dropdown\"\n id={`${this.dropdownId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-dropdown.js","sourceRoot":"","sources":["../../../src/components/stzh-dropdown/stzh-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EAEN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAe5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,SAAS,MAAM,8CAA8C,CAAC;AACrE,OAAO,qBAAqB,MAAM,gEAAgE,CAAC;AACnG,OAAO,wBAAwB,MAAM,mEAAmE,CAAC;AACzG,OAAO,sBAAsB,MAAM,iEAAiE,CAAC;AACrG,OAAO,0BAA0B,MAAM,sEAAsE,CAAC;AAE9G,MAAM,sBAAsB,GAAG,UAAU,eAAe;EACtD,MAAM,IAAI,GAAG,IAAI,CAAC;EAElB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACzB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAiC,CAAC;IACrD,IAAI,KAAK;MAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;EACnC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AACzD,SAAS,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Method,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport {\n StzhDropdownChangeEvent,\n StzhDropdownItemAddEvent,\n StzhDropdownItemRemoveEvent,\n StzhDropdownOptionAddEvent,\n StzhDropdownOptionRemoveEvent,\n StzhDropdownOpenEvent,\n StzhDropdowCloseEvent,\n StzhDropdownFocusEvent,\n StzhDropdownBlurEvent,\n StzhDropdowInitEvent\n} from \"../../index\";\n\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhDropdownLocalizedText } from './stzh-dropdown.localization';\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport TomSelect from \"../../libraries/tom-select/esm/tom-select.js\";\nimport TomSelectRemoveButton from \"../../libraries/tom-select/esm/plugins/remove_button/plugin.js\";\nimport TomSelectCheckboxOptions from \"../../libraries/tom-select/esm/plugins/checkbox_options/plugin.js\";\nimport TomSelectInputAutogrow from \"../../libraries/tom-select/esm/plugins/input_autogrow/plugin.js\";\nimport TomSelectNoBackspaceDelete from \"../../libraries/tom-select/esm/plugins/no_backspace_delete/plugin.js\";\n\nconst TomSelectInputReadonly = function (_plugin_options) {\n const self = this;\n\n self.on(\"initialize\", () => {\n const input = self.control_input as HTMLInputElement;\n if (input) input.readOnly = true;\n })\n};\n\nconst CLASS_FILLED = \"stzh-dropdown--is-filled\";\nconst CLASS_FOCUS = \"stzh-dropdown--has-focus\";\n\nTomSelect.define(\"remove_button\", TomSelectRemoveButton);\nTomSelect.define(\"checkbox_options\", TomSelectCheckboxOptions);\nTomSelect.define(\"input_autogrow\", TomSelectInputAutogrow);\nTomSelect.define(\"no_backspace_delete\", TomSelectNoBackspaceDelete);\nTomSelect.define(\"input_readonly\", TomSelectInputReadonly);\n\nlet dropdownCounter = 0;\n\n/**\n * @slot label - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-dropdown\",\n styleUrl: \"stzh-dropdown.scss\"\n})\nexport class StzhDropdown {\n /** Available options */\n @Prop() options: any[] | string;\n private _options: any[];\n\n /**\n * Option groups that options will be bucketed into.\n * Make sure each object in the array has a property named whatever `optgroupValueField` is set to.\n */\n @Prop() optgroups: any[] | string;\n private _optgroups: any[];\n\n /**\n * Set selected options. Can be array set with JS or as JSON string.\n * To get the current (user) selected options, use `getItems` method.\n */\n @Prop() items: string[] | string;\n private _items: string[];\n\n /**\n * An array of property names to analyze when filtering options.\n * Weights can be given to each field to improve search result:\n * `[{\"field\":\"text\",\"weight\":2},{\"field\":\"text2\",\"weight\":0.5}]`\n */\n @Prop() searchField: string[] | string = [\"text\"];\n private _searchField: string[];\n\n /** Whether multiple items option can be selected */\n @Prop({ reflect: true }) multiple: boolean = false;\n\n /** Show inline (auto width) */\n @Prop({ reflect: true }) inline: boolean = false;\n\n /** The max number of options to display in the dropdown. Set to `null` for an unlimited number of options. */\n @Prop() maxOptions: number | null = null;\n\n /** When searching for multiple terms (separated by space), this is the operator used. Can be 'and' or 'or' */\n @Prop() searchConjunction: \"and\" | \"or\" = \"and\";\n\n /** If true, any options with a \"\" value will be treated like a normal option. This defaults to false to accommodate the common <select> practice of having the first empty option to act as a placeholder. */\n @Prop() allowEmptyOption: boolean = false;\n\n /** Show the dropdown immediately when the control receives focus. */\n @Prop() openOnFocus: boolean = true;\n\n /** After a selection is made, the dropdown will remain open if in a multi-selection control or will close in a single-selection control. Setting closeAfterSelect to true will force the dropdown to close after selections are made. Setting closeAfterSelect to false will keep the dropdown open after selections are made. */\n @Prop() closeAfterSelect: boolean | null = null;\n\n /** Invoked when new options should be loaded from the server. Called with the current query string and a callback function to call with the results when they are loaded (or nothing when an error arises). */\n @Prop() load: (query: string, callback: Function) => any[] | null = null;\n\n /** Minimum of characters required to execute the `load` function */\n @Prop() minCharacters: number = 3;\n\n /** The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled. Useful when loading options dynamically while the user types a search / filter expression. */\n @Prop() loadThrottle: number = 300;\n\n /** If true, the load function will be called upon control initialization (with an empty search). Alternatively it can be set to 'focus' to call the load function when control receives focus. */\n @Prop() preload: boolean | \"focus\" = false;\n\n /** The name of the property to render as an option / item label (not needed when custom rendering functions are defined). */\n @Prop() labelField: string = \"text\";\n\n /** The name of the property to use as the value when an item is selected. */\n @Prop() valueField: string = \"value\";\n\n /** The name of the property to group items by. */\n @Prop() optgroupField: string = \"optgroup\";\n\n /** The name of the property to render as an option group label (not needed when custom rendering functions are defined). */\n @Prop() optgroupLabelField: string = \"label\";\n\n /** The name of the option group property that serves as its unique identifier. */\n @Prop() optgroupValueField: string = \"value\";\n\n /** If truthy, all optgroups will be displayed in the same order as they were added (by the `$order` property). Otherwise, it will order based on the score of the results in each. */\n @Prop() lockOptgroupOrder: true;\n\n /** Name of hidden select element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Initial open state */\n @Prop() open: boolean = false;\n\n /** Current open state (readonly) */\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n /** Variant */\n @Prop({ reflect: true }) variant: \"default\" | \"plain\" = \"default\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Whether the dropdown is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Popover placement */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Icon (use instead of icon slot) */\n @Prop() icon: string = \"\";\n\n /** Prevent option search */\n @Prop() noSearch: boolean = false;\n\n /** Prevent backspace delete */\n @Prop() noBackspaceDelete: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Show text in label depending if field is optional/required */\n @Prop({ reflect: true }) showMarker: 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 private _error: string[];\n\n /** Translation strings */\n @Prop() localization: StzhDropdownLocalizedText;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @Watch(\"options\")\n optionsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._options = JSON.parse(newValue);\n }\n else {\n this._options = newValue;\n }\n }\n\n @Watch(\"items\")\n itemsWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._items = JSON.parse(newValue);\n }\n else {\n this._items = newValue;\n }\n }\n\n @Watch(\"searchField\")\n searchFieldWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._searchField = JSON.parse(newValue);\n }\n else {\n this._searchField = newValue;\n }\n }\n\n @Watch(\"optgroups\")\n optgroupsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._optgroups = JSON.parse(newValue);\n }\n else {\n this._optgroups = newValue;\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Element() element: HTMLStzhDropdownElement;\n\n /**\n * Returns the value of the control.\n * If multiple items can be selected,\n * this returns an array, otherwise a string.\n */\n @Method()\n async getValue(): Promise<string | string[]> {\n return this.tomSelect.getValue();\n }\n\n /** Set new value */\n @Method()\n async setValue(newValue: string | string[], silent: boolean = false) {\n this.tomSelect.setValue(newValue, silent);\n }\n\n /** Focus select */\n @Method()\n async setFocus() {\n this.tomSelect.focus();\n }\n\n /** Reset loaded/cached search queries (calls from load property function) */\n @Method()\n async resetLoadedSearches() {\n this.tomSelect.loadedSearches = {};\n }\n\n /** Return loaded/cached search queries (calls from load property function) */\n @Method()\n async getLoadedSearches() {\n return this.tomSelect.loadedSearches;\n }\n\n /** Return current selected items */\n @Method()\n async getItems() {\n return this.tomSelect.items;\n }\n\n /** Load items by calling load property/function */\n @Method()\n async loadItems(query: string) {\n return this.tomSelect.load(query);\n }\n\n /** Show dropdown popover */\n @Method()\n async show() {\n return this.tomSelect.open();\n }\n\n /** Hide dropdown popover */\n @Method()\n async hide() {\n return this.tomSelect.close();\n }\n\n /** Dropdown change event */\n @Event() stzhChange: EventEmitter<StzhDropdownChangeEvent>;\n\n /** Dropdown item added event */\n @Event() stzhItemAdd: EventEmitter<StzhDropdownItemAddEvent>;\n\n /** Dropdown item removed event */\n @Event() stzhItemRemove: EventEmitter<StzhDropdownItemRemoveEvent>;\n\n /** Dropdown option added event */\n @Event() stzhOptionAdd: EventEmitter<StzhDropdownOptionAddEvent>;\n\n /** Dropdown option removed event */\n @Event() stzhOptionRemove: EventEmitter<StzhDropdownOptionRemoveEvent>;\n\n /** Dropdown open event */\n @Event() stzhOpen: EventEmitter<StzhDropdownOpenEvent>;\n\n /** Dropdown close event */\n @Event() stzhClose: EventEmitter<StzhDropdowCloseEvent>;\n\n /** Dropdown focus event */\n @Event() stzhFocus: EventEmitter<StzhDropdownFocusEvent>;\n\n /** Dropdown blur event */\n @Event() stzhBlur: EventEmitter<StzhDropdownBlurEvent>;\n\n /** Dropdown focus event */\n @Event() stzhInit: EventEmitter<StzhDropdowInitEvent>;\n\n private tomSelect: TomSelect;\n private select: HTMLSelectElement;\n private rootElement: HTMLElement;\n private dropdownId: string;\n private focusedByInput: boolean = false;\n\n private updateFilled() {\n if (this._items.length > 0) {\n this.rootElement.classList.add(CLASS_FILLED);\n } else {\n this.rootElement.classList.remove(CLASS_FILLED);\n }\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n async componentWillLoad() {\n this.dropdownId = `stzh-dropdown-${dropdownCounter++}`;\n\n this.optionsWatcher(this.options);\n this.optgroupsWatcher(this.optgroups);\n this.itemsWatcher(this.items);\n this.searchFieldWatcher(this.searchField);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"dropdown\");\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return [\"isOpen\"].includes(prop) === false;\n }\n\n async componentWillUpdate() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n async componentDidRender() {\n if (this.tomSelect) {\n return;\n }\n\n const plugins = {};\n\n if (this.noSearch) {\n plugins[\"input_readonly\"] = {};\n } else {\n plugins[\"input_autogrow\"] = {};\n }\n\n if (this.noBackspaceDelete) {\n plugins[\"no_backspace_delete\"] = {};\n }\n\n if (this.multiple) {\n plugins[\"checkbox_options\"] = {};\n plugins[\"remove_button\"] = {\n title: this.localization.removeButtonTitle,\n label: '<stzh-icon name=\"close\" class=\"stzh-dropdown__remove-icon\"></stzh-icon>'\n };\n }\n\n const tomSelectOptions: any = {\n plugins,\n maxItems: this.multiple ? null : 1,\n maxOptions: this.maxOptions,\n items: this._items,\n optgroups: this._optgroups,\n searchField: this._searchField,\n searchConjunction: this.searchConjunction,\n allowEmptyOption: this.allowEmptyOption,\n closeAfterSelect: this.closeAfterSelect !== null\n ? this.closeAfterSelect\n : !this.multiple,\n labelField: this.labelField,\n valueField: this.valueField,\n optgroupField: this.optgroupField,\n optgroupLabelField: this.optgroupLabelField,\n optgroupValueField: this.optgroupValueField,\n lockOptgroupOrder: this.lockOptgroupOrder,\n load: this.load,\n shouldLoad: (query: string) => {\n return query.length >= this.minCharacters;\n },\n loadThrottle: this.loadThrottle,\n preload: this.preload,\n openOnFocus: this.openOnFocus,\n loadingClass: \"is-loading\",\n hideSelected: false,\n duplicates: false,\n delimiter: \",\",\n copyClassesToDropdown: false,\n hidePlaceholder: null,\n // if you want the user to be able to add own items enable this option\n // (but checkbox_options plugin throws an error and would need a fix first)\n // create: function(input, callback) {\n // callback({ value: input, text: input });\n // },\n // createOnBlur: false,\n // createFilter: null,\n // persist: false,\n render: {\n option: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__option\" title=\"${escape(data[this.labelField])}\">\n <stzh-icon name=\"checkmark\" class=\"stzh-dropdown__option-check\"></stzh-icon>\n <span class=\"stzh-dropdown__option-title\">\n ${escape(data[this.labelField])}\n </span>\n </div>\n `;\n },\n item: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__item\">\n ${escape(data[this.labelField])}\n </div>\n `;\n },\n option_create: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__create\">\n ${this.localization.create.replace(/{x}/gi, escape(data.input))}…\n </div>\n `;\n },\n no_results: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__no-results\">\n ${this.localization.noResults.replace(/{x}/gi, escape(data.input))}\n </div>`;\n },\n not_loading: this.load === null ? null : (_data, escape) => {\n return `\n <div class=\"stzh-dropdown__not-loading\">\n ${this.localization.notLoading.replace(/{x}/gi, escape(this.minCharacters.toString()))}\n </div>\n `;\n },\n optgroup: (data) => {\n let optgroup = document.createElement(\"div\");\n optgroup.className = \"stzh-dropdown__optgroup\";\n optgroup.appendChild(data.options);\n return optgroup;\n },\n optgroup_header: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__optgroup-header\">\n ${escape(data.label)}\n </div>\n `;\n },\n loading: () => {\n return `\n <div class=\"stzh-dropdown__loader\">\n <stzh-loader></stzh-loader>\n </div>\n `;\n },\n dropdown: () => {\n return `<div class=\"stzh-dropdown__dropdown\"></div>`;\n }\n },\n onChange: (value) => {\n this._items = this.tomSelect.items;\n this.updateFilled();\n\n this.stzhChange.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onItemAdd: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemAdd.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onItemRemove: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemRemove.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onOptionAdd: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionAdd.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onOptionRemove: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionRemove.emit({\n component: \"stzh-dropdown\",\n value\n });\n },\n onDropdownOpen: () => {\n this.isOpen = true;\n this.stzhOpen.emit({\n component: \"stzh-dropdown\"\n });\n },\n onDropdownClose: () => {\n this.isOpen = false;\n this.stzhClose.emit({\n component: \"stzh-dropdown\"\n });\n },\n onFocus: () => {\n this.focusedByInput = true;\n\n if (this.tomSelect.load && this.preload === \"focus\") {\n // to be able to execute load function again, we reset loaded searches\n this.resetLoadedSearches();\n\n // if results have been preloaded before, load them now directly with load function\n if (this.tomSelect.wrapper.classList.contains('preloaded')) {\n // since tomSelect.preload() doesn't call tomSelect.shouldCall() method internally (to check for minCharacters),\n // we will also not call it (this.tomSelect.settings.shouldLoad.call(this.tomSelect, ''))\n this.tomSelect.load('');\n }\n }\n\n this.rootElement.classList.add(CLASS_FOCUS);\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-dropdown\",\n originalEvent: {\n target: this.tomSelect.control\n }\n });\n },\n onBlur: () => {\n this.rootElement.classList.remove(CLASS_FOCUS);\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-dropdown\"\n });\n },\n onInitialize: () => {\n this.stzhInit.emit({\n component: \"stzh-dropdown\"\n });\n },\n onLoad: () => {\n this._options = this.tomSelect.options;\n }\n };\n\n if (this._options) {\n tomSelectOptions.options = this._options;\n }\n\n if (this._optgroups) {\n tomSelectOptions.optgroups = this._optgroups;\n }\n\n if (this._items) {\n tomSelectOptions.items = this._items;\n }\n\n this.tomSelect = new TomSelect(this.select, tomSelectOptions);\n\n if (!this.openOnFocus) {\n // we still want to enable opening the dropdown by click\n this.tomSelect.control.addEventListener(\"click\", () => {\n this.tomSelect.open();\n });\n }\n\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n render() {\n const iconUsed = hasSlot(this.element, 'icon') || !!this.icon;\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-dropdown\": true,\n \"stzh-dropdown--is-inline\": this.inline,\n \"stzh-dropdown--is-multiple\": this.multiple,\n \"stzh-dropdown--is-disabled\": this.disabled,\n \"stzh-dropdown--is-required\": this.required,\n \"stzh-dropdown--is-invalid\": this.invalid,\n [CLASS_FILLED]: this._items && this._items.length > 0,\n \"stzh-dropdown--has-icon\": iconUsed,\n \"stzh-dropdown--has-description\": descriptionUsed,\n \"stzh-dropdown--has-description-long\": descriptionLongUsed,\n \"stzh-dropdown--has-error\": errorUsed,\n \"stzh-dropdown--has-no-search\": this.noSearch,\n \"stzh-dropdown--has-fixed-label\": window?.stzhComponents?.labels === \"fixed\",\n [`stzh-dropdown--popover-placement-${this.popoverPlacement}`]: !!this.popoverPlacement,\n [`stzh-dropdown--size-${this.size}`]: !!this.size,\n [`stzh-dropdown--${this.variant}`]: !!this.variant\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div\n class={classes}\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-dropdown__field-wrapper\">\n {/* tom-select sets aria-labelledby automatically referencing the stzh-dropdown__label element */}\n <select\n id={this.dropdownId}\n class=\"stzh-dropdown__select\"\n ref={(el) => (this.select = el as HTMLSelectElement)}\n multiple={this.multiple}\n name={this.name}\n disabled={this.disabled}\n >\n <slot></slot>\n </select>\n\n {/* <div class=\"stzh-dropdown__sizer\">\n {this.placeholder}\n </div> */}\n\n <stzh-icon name=\"angle-down\" class=\"stzh-dropdown__angle-icon\"></stzh-icon>\n\n <div class=\"stzh-dropdown__icon-wrapper\">\n {this.icon ?\n <stzh-icon class=\"stzh-dropdown__icon\" name={this.icon}></stzh-icon>\n :\n <slot name=\"icon\"></slot>\n }\n </div>\n\n <label\n class=\"stzh-dropdown__label\"\n htmlFor={this.dropdownId}\n aria-labelledby={`${this.dropdownId}-label-inner ${this.dropdownId}-description ${this.a11yDescribedby}`}\n aria-describedby={`${this.dropdownId}-description ${this.a11yDescribedby}`}\n >\n <span id={`${this.dropdownId}-label-inner`}>\n {this.label ? this.label : <slot name=\"label\"></slot>}\n {this.showMarker &&\n <span class=\"stzh-dropdown__marker\">\n <span class=\"stzh-dropdown__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-dropdown__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n <span class=\"stzh-dropdown__vhidden\">.</span>\n </span>\n </label>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-dropdown\"\n id={`${this.dropdownId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -152,13 +152,13 @@
|
|
|
152
152
|
--hover-background-color: var(--stzh-base-invert-color72);
|
|
153
153
|
--hover-border-color: transparent;
|
|
154
154
|
}
|
|
155
|
-
:host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false]) {
|
|
155
|
+
:host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false]), :host ::slotted(stzh-button[slot=button])[a11y-disabled]:not([a11y-disabled=false]) {
|
|
156
156
|
--border-color: transparent;
|
|
157
157
|
--background-color: var(--stzh-base-invert-color32);
|
|
158
158
|
--hover-border-color: transparent;
|
|
159
159
|
--hover-background-color: var(--stzh-base-invert-color32);
|
|
160
160
|
}
|
|
161
|
-
:host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=secondary], :host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=input], :host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=tertiary] {
|
|
161
|
+
:host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=secondary], :host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=input], :host ::slotted(stzh-button[slot=button])[disabled]:not([disabled=false])[variant=tertiary], :host ::slotted(stzh-button[slot=button])[a11y-disabled]:not([a11y-disabled=false])[variant=secondary], :host ::slotted(stzh-button[slot=button])[a11y-disabled]:not([a11y-disabled=false])[variant=input], :host ::slotted(stzh-button[slot=button])[a11y-disabled]:not([a11y-disabled=false])[variant=tertiary] {
|
|
162
162
|
--color: var(--stzh-base-invert-color32);
|
|
163
163
|
--border-color: var(--stzh-base-invert-color32);
|
|
164
164
|
--background-color: transparent;
|
|
@@ -351,13 +351,13 @@
|
|
|
351
351
|
--hover-background-color: var(--stzh-base-invert-color72);
|
|
352
352
|
--hover-border-color: transparent;
|
|
353
353
|
}
|
|
354
|
-
.stzh-ghettobox__close[disabled]:not([disabled=false]) {
|
|
354
|
+
.stzh-ghettobox__close[disabled]:not([disabled=false]), .stzh-ghettobox__close[a11y-disabled]:not([a11y-disabled=false]) {
|
|
355
355
|
--border-color: transparent;
|
|
356
356
|
--background-color: var(--stzh-base-invert-color32);
|
|
357
357
|
--hover-border-color: transparent;
|
|
358
358
|
--hover-background-color: var(--stzh-base-invert-color32);
|
|
359
359
|
}
|
|
360
|
-
.stzh-ghettobox__close[disabled]:not([disabled=false])[variant=secondary], .stzh-ghettobox__close[disabled]:not([disabled=false])[variant=input], .stzh-ghettobox__close[disabled]:not([disabled=false])[variant=tertiary] {
|
|
360
|
+
.stzh-ghettobox__close[disabled]:not([disabled=false])[variant=secondary], .stzh-ghettobox__close[disabled]:not([disabled=false])[variant=input], .stzh-ghettobox__close[disabled]:not([disabled=false])[variant=tertiary], .stzh-ghettobox__close[a11y-disabled]:not([a11y-disabled=false])[variant=secondary], .stzh-ghettobox__close[a11y-disabled]:not([a11y-disabled=false])[variant=input], .stzh-ghettobox__close[a11y-disabled]:not([a11y-disabled=false])[variant=tertiary] {
|
|
361
361
|
--color: var(--stzh-base-invert-color32);
|
|
362
362
|
--border-color: var(--stzh-base-invert-color32);
|
|
363
363
|
--background-color: transparent;
|
|
@@ -403,7 +403,7 @@ export class StzhInput {
|
|
|
403
403
|
"optional": false,
|
|
404
404
|
"docs": {
|
|
405
405
|
"tags": [],
|
|
406
|
-
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show
|
|
406
|
+
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing"
|
|
407
407
|
},
|
|
408
408
|
"attribute": "show-marker",
|
|
409
409
|
"reflect": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-input.js","sourceRoot":"","sources":["../../../src/components/stzh-input/stzh-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EAEL,KAAK,EACL,MAAM,EACN,OAAO,EACP,CAAC,EACD,KAAK,EACN,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;GAMG;AAMH,MAAM,OAAO,SAAS;;IAoJZ,mBAAc,GAAY,KAAK,CAAC;IAEhC,iBAAY,GAAG,CAAC,KAAiB,EAAE,EAAE;MAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;MAChB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;MAEnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,YAAY;QACvB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;OAClB,CAAC,CAAC;IACL,CAAC,CAAA;IAEO,YAAO,GAAG,CAAC,KAAiB,EAAE,EAAE;MACtC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;MAE9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB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;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Host,\n Event,\n EventEmitter,\n State,\n Method,\n Element,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhInputChangeEvent,\n StzhInputFocusEvent,\n StzhInputBlurEvent\n} from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"./stzh-input-description\";\n\nlet inputCounter = 0;\n\n/**\n * @slot - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n * @slot button-right - Slot for right button\n */\n@Component({\n tag: \"stzh-input\",\n styleUrl: \"stzh-input.scss\",\n scoped: true\n})\nexport class StzhInput {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the input is a textarea or an input field */\n @Prop() multiline: boolean = false;\n\n /** Rows attribute if input element is textarea */\n @Prop() rows: number;\n\n /** If input field, this defines the type (if `search`, a search icon will be displayed) */\n @Prop() type: \"text\" | \"search\" | \"password\" | \"email\" | \"url\" | \"tel\" | \"number\" = \"text\";\n\n /** If input type is number, this will be the step size */\n @Prop() step: number = 1;\n\n /** If input type is number, this will be the minimum step number */\n @Prop() min: number;\n\n /** If input type is number, this will be the maximum step number */\n @Prop() max: number;\n\n /** If input type is number and this property is true, this will show the spin buttons on hover/focus */\n @Prop({ reflect: true }) showSpin: 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 /** Whether clearable button is showing when input field has value and is enabled (button-right slot not usable anymore when true) */\n @Prop({ reflect: true }) clearable: boolean = false;\n\n /** Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show noting */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Minimum of characters */\n @Prop() minlength: number;\n\n /** Maxlength of characters */\n @Prop() maxlength: number;\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string;\n\n /** The value of the input element */\n @Prop({ mutable: true }) value: string = \"\";\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 private _error: 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 /**\n * Specify inputmode.\n * See [MDN](https://developer.mozilla.org/de/docs/Web/HTML/Global_attributes/inputmode) for possible values\n */\n @Prop() inputmode: string;\n\n /**\n * Specify what the user agent has to provide as automated assistance.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for possible values\n */\n @Prop() autocomplete: string = \"on\";\n\n /** Whether autocomplete should be turned off */\n @Prop() noAutocomplete: boolean = false;\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Whether the input is filled or not */\n @State() filled: boolean;\n\n @Element() element: HTMLStzhInputElement;\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Input change event */\n @Event() stzhChange: EventEmitter<StzhInputChangeEvent>;\n\n /** Input focus event */\n @Event() stzhFocus: EventEmitter<StzhInputFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhInputBlurEvent>;\n\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n this.filled = newValue !== \"\";\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Watch(\"type\")\n typeWatcher(newValue: string) {\n const types = [\n \"text\", \"search\", \"password\", \"email\", \"url\", \"tel\", \"number\"\n ];\n\n if (!this.multiline && !types.includes(newValue)) {\n throw new Error(`Type ${newValue} not supported`);\n }\n }\n\n private input: HTMLInputElement | HTMLTextAreaElement;\n private inputId: string;\n private focusedByInput: boolean = false;\n\n private onClearClick = (event: MouseEvent) => {\n this.value = \"\";\n this.input.focus();\n\n this.stzhChange.emit({\n component: \"stzh-input\",\n originalEvent: event,\n value: this.value\n });\n }\n\n private onInput = (event: InputEvent) => {\n this.value = this.input.value;\n\n this.stzhChange.emit({\n component: \"stzh-input\",\n originalEvent: event,\n value: this.value\n });\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-input\",\n originalEvent: event\n });\n }\n\n private onBlur = (event: FocusEvent) => {\n // fixes weird bug where autofill selection doesn't get removed\n this.input.value = this.input.value;\n\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-input\",\n originalEvent: event\n });\n }\n\n private renderTextarea(): HTMLTextAreaElement {\n return (\n <textarea\n class=\"stzh-input__input stzh-input__input--textarea\"\n ref={(el) => (this.input = el as HTMLTextAreaElement)}\n id={this.inputId}\n name={this.name}\n value={this.value}\n rows={this.rows}\n disabled={this.disabled}\n readonly={this.readonly}\n minlength={this.minlength}\n maxlength={this.maxlength}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ></textarea>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n class=\"stzh-input__input stzh-input__input--input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n id={this.inputId}\n type={this.type}\n name={this.name}\n value={this.value}\n min={this.min}\n max={this.max}\n step={this.step}\n inputmode={this.inputmode}\n disabled={this.disabled}\n readonly={this.readonly}\n minlength={this.minlength}\n maxlength={this.maxlength}\n autocomplete={this.noAutocomplete ? \"off\" : this.autocomplete}\n aria-autocomplete={this.noAutocomplete ? \"none\" : undefined}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n );\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-input-${inputCounter++}`;\n this.typeWatcher(this.type);\n this.valueWatcher(this.value);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"input\");\n }\n }\n\n render() {\n const buttonRightSlotUsed = hasSlot(this.element, 'button-right');\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n const classes = {\n \"stzh-input\": true,\n \"stzh-input--has-button-right\": buttonRightSlotUsed\n || this.type === \"search\"\n || (this.clearable && this.filled && !this.readonly && !this.disabled),\n \"stzh-input--has-description\": descriptionUsed,\n \"stzh-input--has-description-long\": descriptionLongUsed,\n \"stzh-input--has-error\": errorUsed,\n \"stzh-input--has-spin\": this.showSpin,\n \"stzh-input--is-invalid\": this.invalid,\n \"stzh-input--is-disabled\": this.disabled,\n \"stzh-input--is-readonly\": this.readonly,\n \"stzh-input--is-required\": this.required,\n \"stzh-input--is-filled\": this.filled,\n \"stzh-input--is-clearable\": this.clearable,\n \"stzh-input--has-fixed-label\": window?.stzhComponents?.labels === \"fixed\",\n [`stzh-input--size-${this.size}`]: !!this.size,\n [`stzh-input--type-${this.type}`]: !!this.type,\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <div class=\"stzh-input__field-wrapper\">\n {this.multiline ? this.renderTextarea() : this.renderInput()}\n <label class=\"stzh-input__label\" htmlFor={this.inputId}>\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-input__marker\">\n <span class=\"stzh-input__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-input__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </label>\n {this.clearable || this.type === \"search\"\n ?\n <stzh-button\n class=\"stzh-input__button-right\"\n icon={this.disabled || this.readonly || !this.filled ? \"search\" : \"close-circle\"}\n icon-only\n variant=\"input\"\n onClick={this.onClearClick}\n disabled={this.disabled || this.readonly || !this.filled}\n a11yLabel={this.localization.$globals.clearButtonLabel}\n aria-controls={this.inputId}\n ></stzh-button>\n :\n <slot name=\"button-right\"></slot>\n }\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-input\"\n id={`${this.inputId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-input.js","sourceRoot":"","sources":["../../../src/components/stzh-input/stzh-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,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,IAAI,CAAC,eAAe,EACrC,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n Host,\n Event,\n EventEmitter,\n State,\n Method,\n Element,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhInputChangeEvent,\n StzhInputFocusEvent,\n StzhInputBlurEvent\n} from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"./stzh-input-description\";\n\nlet inputCounter = 0;\n\n/**\n * @slot - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n * @slot button-right - Slot for right button\n */\n@Component({\n tag: \"stzh-input\",\n styleUrl: \"stzh-input.scss\",\n scoped: true\n})\nexport class StzhInput {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the input is a textarea or an input field */\n @Prop() multiline: boolean = false;\n\n /** Rows attribute if input element is textarea */\n @Prop() rows: number;\n\n /** If input field, this defines the type (if `search`, a search icon will be displayed) */\n @Prop() type: \"text\" | \"search\" | \"password\" | \"email\" | \"url\" | \"tel\" | \"number\" = \"text\";\n\n /** If input type is number, this will be the step size */\n @Prop() step: number = 1;\n\n /** If input type is number, this will be the minimum step number */\n @Prop() min: number;\n\n /** If input type is number, this will be the maximum step number */\n @Prop() max: number;\n\n /** If input type is number and this property is true, this will show the spin buttons on hover/focus */\n @Prop({ reflect: true }) showSpin: 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 /** Whether clearable button is showing when input field has value and is enabled (button-right slot not usable anymore when true) */\n @Prop({ reflect: true }) clearable: 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 /** Minimum of characters */\n @Prop() minlength: number;\n\n /** Maxlength of characters */\n @Prop() maxlength: number;\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string;\n\n /** The value of the input element */\n @Prop({ mutable: true }) value: string = \"\";\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 private _error: 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 /**\n * Specify inputmode.\n * See [MDN](https://developer.mozilla.org/de/docs/Web/HTML/Global_attributes/inputmode) for possible values\n */\n @Prop() inputmode: string;\n\n /**\n * Specify what the user agent has to provide as automated assistance.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for possible values\n */\n @Prop() autocomplete: string = \"on\";\n\n /** Whether autocomplete should be turned off */\n @Prop() noAutocomplete: boolean = false;\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Whether the input is filled or not */\n @State() filled: boolean;\n\n @Element() element: HTMLStzhInputElement;\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Input change event */\n @Event() stzhChange: EventEmitter<StzhInputChangeEvent>;\n\n /** Input focus event */\n @Event() stzhFocus: EventEmitter<StzhInputFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhInputBlurEvent>;\n\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n this.filled = newValue !== \"\";\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Watch(\"type\")\n typeWatcher(newValue: string) {\n const types = [\n \"text\", \"search\", \"password\", \"email\", \"url\", \"tel\", \"number\"\n ];\n\n if (!this.multiline && !types.includes(newValue)) {\n throw new Error(`Type ${newValue} not supported`);\n }\n }\n\n private input: HTMLInputElement | HTMLTextAreaElement;\n private inputId: string;\n private focusedByInput: boolean = false;\n\n private onClearClick = (event: MouseEvent) => {\n this.value = \"\";\n this.input.focus();\n\n this.stzhChange.emit({\n component: \"stzh-input\",\n originalEvent: event,\n value: this.value\n });\n }\n\n private onInput = (event: InputEvent) => {\n this.value = this.input.value;\n\n this.stzhChange.emit({\n component: \"stzh-input\",\n originalEvent: event,\n value: this.value\n });\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-input\",\n originalEvent: event\n });\n }\n\n private onBlur = (event: FocusEvent) => {\n // fixes weird bug where autofill selection doesn't get removed\n this.input.value = this.input.value;\n\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-input\",\n originalEvent: event\n });\n }\n\n private renderTextarea(): HTMLTextAreaElement {\n return (\n <textarea\n class=\"stzh-input__input stzh-input__input--textarea\"\n ref={(el) => (this.input = el as HTMLTextAreaElement)}\n id={this.inputId}\n name={this.name}\n value={this.value}\n rows={this.rows}\n disabled={this.disabled}\n readonly={this.readonly}\n minlength={this.minlength}\n maxlength={this.maxlength}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ></textarea>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n class=\"stzh-input__input stzh-input__input--input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n id={this.inputId}\n type={this.type}\n name={this.name}\n value={this.value}\n min={this.min}\n max={this.max}\n step={this.step}\n inputmode={this.inputmode}\n disabled={this.disabled}\n readonly={this.readonly}\n minlength={this.minlength}\n maxlength={this.maxlength}\n autocomplete={this.noAutocomplete ? \"off\" : this.autocomplete}\n aria-autocomplete={this.noAutocomplete ? \"none\" : undefined}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n );\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-input-${inputCounter++}`;\n this.typeWatcher(this.type);\n this.valueWatcher(this.value);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"input\");\n }\n }\n\n render() {\n const buttonRightSlotUsed = hasSlot(this.element, 'button-right');\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n const classes = {\n \"stzh-input\": true,\n \"stzh-input--has-button-right\": buttonRightSlotUsed\n || this.type === \"search\"\n || (this.clearable && this.filled && !this.readonly && !this.disabled),\n \"stzh-input--has-description\": descriptionUsed,\n \"stzh-input--has-description-long\": descriptionLongUsed,\n \"stzh-input--has-error\": errorUsed,\n \"stzh-input--has-spin\": this.showSpin,\n \"stzh-input--is-invalid\": this.invalid,\n \"stzh-input--is-disabled\": this.disabled,\n \"stzh-input--is-readonly\": this.readonly,\n \"stzh-input--is-required\": this.required,\n \"stzh-input--is-filled\": this.filled,\n \"stzh-input--is-clearable\": this.clearable,\n \"stzh-input--has-fixed-label\": window?.stzhComponents?.labels === \"fixed\",\n [`stzh-input--size-${this.size}`]: !!this.size,\n [`stzh-input--type-${this.type}`]: !!this.type,\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <div class=\"stzh-input__field-wrapper\">\n {this.multiline ? this.renderTextarea() : this.renderInput()}\n <label class=\"stzh-input__label\" htmlFor={this.inputId}>\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-input__marker\">\n <span class=\"stzh-input__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-input__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </label>\n {this.clearable || this.type === \"search\"\n ?\n <stzh-button\n class=\"stzh-input__button-right\"\n icon={this.disabled || this.readonly || !this.filled ? \"search\" : \"close-circle\"}\n icon-only\n variant=\"input\"\n onClick={this.onClearClick}\n disabled={this.disabled || this.readonly || !this.filled}\n a11yLabel={this.localization.$globals.clearButtonLabel}\n aria-controls={this.inputId}\n ></stzh-button>\n :\n <slot name=\"button-right\"></slot>\n }\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-input\"\n id={`${this.inputId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -146,13 +146,13 @@
|
|
|
146
146
|
--hover-background-color: var(--stzh-base-invert-color72);
|
|
147
147
|
--hover-border-color: transparent;
|
|
148
148
|
}
|
|
149
|
-
:host ::slotted(*) stzh-button[disabled]:not([disabled=false]) {
|
|
149
|
+
:host ::slotted(*) stzh-button[disabled]:not([disabled=false]), :host ::slotted(*) stzh-button[a11y-disabled]:not([a11y-disabled=false]) {
|
|
150
150
|
--border-color: transparent;
|
|
151
151
|
--background-color: var(--stzh-base-invert-color32);
|
|
152
152
|
--hover-border-color: transparent;
|
|
153
153
|
--hover-background-color: var(--stzh-base-invert-color32);
|
|
154
154
|
}
|
|
155
|
-
:host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=secondary], :host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=input], :host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=tertiary] {
|
|
155
|
+
:host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=secondary], :host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=input], :host ::slotted(*) stzh-button[disabled]:not([disabled=false])[variant=tertiary], :host ::slotted(*) stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=secondary], :host ::slotted(*) stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=input], :host ::slotted(*) stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=tertiary] {
|
|
156
156
|
--color: var(--stzh-base-invert-color32);
|
|
157
157
|
--border-color: var(--stzh-base-invert-color32);
|
|
158
158
|
--background-color: transparent;
|
|
@@ -255,7 +255,7 @@ export class StzhRadio {
|
|
|
255
255
|
"optional": false,
|
|
256
256
|
"docs": {
|
|
257
257
|
"tags": [],
|
|
258
|
-
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show
|
|
258
|
+
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing"
|
|
259
259
|
},
|
|
260
260
|
"attribute": "show-marker",
|
|
261
261
|
"reflect": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-radio.js","sourceRoot":"","sources":["../../../src/components/stzh-radio/stzh-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EAEP,MAAM,EACN,CAAC,EACD,KAAK,EACN,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;GAKG;AAMH,MAAM,OAAO,SAAS;;IAiFZ,mBAAc,GAAY,KAAK,CAAC;IAEhC,YAAO,GAAG,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Host,\n Component,\n Prop,\n Event,\n Element,\n EventEmitter,\n Method,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhRadioChangeEvent,\n StzhRadioFocusEvent,\n StzhRadioBlurEvent\n} from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nlet radioCounter = 0;\n\n/**\n * @slot - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-radio\",\n styleUrl: \"stzh-radio.scss\",\n scoped: true\n})\nexport class StzhRadio {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** The value of the input element */\n @Prop({ mutable: true }) value: 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 noting */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Checked status */\n @Prop({ mutable: true, reflect: true }) checked: boolean = false;\n\n /** Label */\n @Prop() label: string = \"\";\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 private _error: string[];\n\n /** Id for element which describes the radio button (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Input change event */\n @Event() stzhChange: EventEmitter<StzhRadioChangeEvent>;\n\n /** Input focus event */\n @Event() stzhFocus: EventEmitter<StzhRadioFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhRadioBlurEvent>;\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Element() element: HTMLStzhRadioElement;\n\n private input: HTMLInputElement;\n private inputId: string;\n private focusedByInput: boolean = false;\n\n private onInput = (event: InputEvent) => {\n this.checked = this.input.checked;\n this.stzhChange.emit({\n component: \"stzh-radio\",\n originalEvent: event,\n value: this.value,\n checked: this.checked\n });\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-radio\",\n originalEvent: event\n });\n }\n\n private onBlur = (event: FocusEvent) => {\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-radio\",\n originalEvent: event\n });\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-radio-${radioCounter++}`;\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, 'radio');\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-radio\": true,\n \"stzh-radio--has-description\": descriptionUsed,\n \"stzh-radio--has-description-long\": descriptionLongUsed,\n \"stzh-radio--has-error\": errorUsed,\n \"stzh-radio--is-required\": this.required,\n \"stzh-radio--is-invalid\": this.invalid,\n \"stzh-radio--is-disabled\": this.disabled\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <label class=\"stzh-radio__field-wrapper\">\n <input\n class=\"stzh-radio__input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n type=\"radio\"\n id={this.inputId}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n checked={this.checked}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <div class=\"stzh-radio__mark\">\n <div class=\"stzh-radio__check\"></div>\n </div>\n <div class=\"stzh-radio__label\">\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-radio__marker\">\n <span class=\"stzh-radio__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-radio__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </div>\n </label>\n <StzhInputDescription\n classPrefix=\"stzh-radio\"\n id={`${this.inputId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-radio.js","sourceRoot":"","sources":["../../../src/components/stzh-radio/stzh-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EAEP,MAAM,EACN,CAAC,EACD,KAAK,EACN,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;GAKG;AAMH,MAAM,OAAO,SAAS;;IAiFZ,mBAAc,GAAY,KAAK,CAAC;IAEhC,YAAO,GAAG,CAAC,KAAiB,EAAE,EAAE;MACtC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;MAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,YAAY;QACvB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;OACtB,CAAC,CAAC;IACL,CAAC,CAAA;IAEO,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;OACjB;MAED,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC,CAAA;IAEO,YAAO,GAAG,CAAC,KAAiB,EAAE,EAAE;MACtC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;MAE3B,MAAM,UAAU,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,mBAAmB,CAE7C;gBACP,YAAM,KAAK,EAAC,yBAAyB,IAClC,IAAI,CAAC,QAAQ;kBACZ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB;kBAC9C,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAE3C,CACF,CAEL,CACA;QACR,EAAC,oBAAoB,IACnB,WAAW,EAAC,YAAY,EACxB,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,cAAc,EACjC,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Host,\n Component,\n Prop,\n Event,\n Element,\n EventEmitter,\n Method,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhRadioChangeEvent,\n StzhRadioFocusEvent,\n StzhRadioBlurEvent\n} from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nlet radioCounter = 0;\n\n/**\n * @slot - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-radio\",\n styleUrl: \"stzh-radio.scss\",\n scoped: true\n})\nexport class StzhRadio {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** The value of the input element */\n @Prop({ mutable: true }) value: 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 /** Checked status */\n @Prop({ mutable: true, reflect: true }) checked: boolean = false;\n\n /** Label */\n @Prop() label: string = \"\";\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 private _error: string[];\n\n /** Id for element which describes the radio button (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Input change event */\n @Event() stzhChange: EventEmitter<StzhRadioChangeEvent>;\n\n /** Input focus event */\n @Event() stzhFocus: EventEmitter<StzhRadioFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhRadioBlurEvent>;\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n @Element() element: HTMLStzhRadioElement;\n\n private input: HTMLInputElement;\n private inputId: string;\n private focusedByInput: boolean = false;\n\n private onInput = (event: InputEvent) => {\n this.checked = this.input.checked;\n this.stzhChange.emit({\n component: \"stzh-radio\",\n originalEvent: event,\n value: this.value,\n checked: this.checked\n });\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.setFocus();\n }\n\n this.focusedByInput = false;\n }\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-radio\",\n originalEvent: event\n });\n }\n\n private onBlur = (event: FocusEvent) => {\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-radio\",\n originalEvent: event\n });\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-radio-${radioCounter++}`;\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, 'radio');\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-radio\": true,\n \"stzh-radio--has-description\": descriptionUsed,\n \"stzh-radio--has-description-long\": descriptionLongUsed,\n \"stzh-radio--has-error\": errorUsed,\n \"stzh-radio--is-required\": this.required,\n \"stzh-radio--is-invalid\": this.invalid,\n \"stzh-radio--is-disabled\": this.disabled\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <label class=\"stzh-radio__field-wrapper\">\n <input\n class=\"stzh-radio__input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n type=\"radio\"\n id={this.inputId}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n checked={this.checked}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <div class=\"stzh-radio__mark\">\n <div class=\"stzh-radio__check\"></div>\n </div>\n <div class=\"stzh-radio__label\">\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-radio__marker\">\n <span class=\"stzh-radio__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-radio__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </div>\n </label>\n <StzhInputDescription\n classPrefix=\"stzh-radio\"\n id={`${this.inputId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -320,7 +320,7 @@ export class StzhRadiogroup {
|
|
|
320
320
|
"optional": false,
|
|
321
321
|
"docs": {
|
|
322
322
|
"tags": [],
|
|
323
|
-
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show
|
|
323
|
+
"text": "Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing"
|
|
324
324
|
},
|
|
325
325
|
"attribute": "show-marker",
|
|
326
326
|
"reflect": true,
|