@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
|
@@ -8,7 +8,7 @@ const utils = require('./utils-a2ff9f84.js');
|
|
|
8
8
|
const translationUtils = require('./translation-utils-73073e44.js');
|
|
9
9
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
10
10
|
|
|
11
|
-
const stzhGhettoboxCss = ".sc-stzh-ghettobox-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-ghettobox-h{display:none}.sc-stzh-ghettobox-h *.sc-stzh-ghettobox,.sc-stzh-ghettobox-h *.sc-stzh-ghettobox::before,.sc-stzh-ghettobox-h *.sc-stzh-ghettobox::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-ghettobox-h{--stzh-flyingfocus-color:var(--stzh-base-invert-color);--stzh-base-color:var(--stzh-base-invert-color);--stzh-base-lead-color:var(--stzh-base-invert-color);--stzh-base-border-color:var(--stzh-base-invert-color);--stzh-heading-color:var(--stzh-base-invert-color);--stzh-link-color:var(--stzh-base-invert-color);--stzh-link-hover-color:var(--stzh-base-invert-color);--background-color:var(--stzh-color-error);--color:var(--stzh-base-invert-color);--richtext-color:var(--color);--close-color:var(--stzh-base-invert-color);--button-color:var(--color);--hover-button-color:var(--background-color);--hover-close-color:var(--background-color)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-richtext{--stzh-base-color:var(--richtext-color)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=default]{--color:var(--hover-button-color);--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=secondary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=tertiary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][active]:not([active=false]){--color:var(--hover-button-color);--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=secondary],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=input],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxlarge);padding-bottom:var(--stzh-space-xxlarge);padding-left:var(--stzh-space-xxxlarge);padding-right:var(--stzh-space-xxxlarge);position:relative;display:-ms-flexbox;display:flex;background-color:var(--background-color);color:var(--color);-webkit-box-shadow:var(--stzh-box-shadow-message);box-shadow:var(--stzh-box-shadow-message);border-radius:var(--stzh-button-border-radius)}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-bottom:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 600px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-big)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-xbig)}}@media screen and (min-width: 600px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-big)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-xbig)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{border-radius:0.1875rem}}.stzh-ghettobox__hidden-title.sc-stzh-ghettobox{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-ghettobox__message.sc-stzh-ghettobox{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-positive:1;flex-grow:1}.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-family:var(--stzh-font-family-title);font-weight:var(--stzh-font-weight-title);font-size:var(--stzh-font-curve-h1-default-font-size, var(--stzh-font-deca-font-size));line-height:var(--stzh-font-curve-h1-default-heading-line-height, var(--stzh-font-deca-text-line-height));letter-spacing:var(--stzh-font-curve-h1-default-heading-letter-spacing, var(--stzh-font-deca-text-letter-spacing));margin:0;color:inherit}@media screen and (min-width: 600px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-small-font-size, var(--stzh-font-kilo-font-size));line-height:var(--stzh-font-curve-h1-small-heading-line-height, var(--stzh-font-kilo-text-line-height));letter-spacing:var(--stzh-font-curve-h1-small-heading-letter-spacing, var(--stzh-font-kilo-text-letter-spacing))}}@media screen and (min-width: 1024px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-medium-font-size, var(--stzh-font-mega-font-size));line-height:var(--stzh-font-curve-h1-medium-heading-line-height, var(--stzh-font-mega-text-line-height));letter-spacing:var(--stzh-font-curve-h1-medium-heading-letter-spacing, var(--stzh-font-mega-text-letter-spacing))}}@media screen and (min-width: 1440px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-ultra-font-size, var(--stzh-font-giga-font-size));line-height:var(--stzh-font-curve-h1-ultra-heading-line-height, var(--stzh-font-giga-text-line-height));letter-spacing:var(--stzh-font-curve-h1-ultra-heading-letter-spacing, var(--stzh-font-giga-text-letter-spacing))}}.stzh-ghettobox__description.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing)}@media screen and (min-width: 1024px){.stzh-ghettobox__description.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-small)}@media screen and (min-width: 1024px){.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-large)}}.stzh-ghettobox__close.sc-stzh-ghettobox{-ms-flex-negative:0;flex-shrink:0}@media screen and (min-width: 600px){.stzh-ghettobox__close.sc-stzh-ghettobox{margin-left:var(--stzh-space-small)}}.stzh-ghettobox__close.sc-stzh-ghettobox{position:absolute;top:0;right:0}.stzh-ghettobox__close[variant=default].sc-stzh-ghettobox{--color:var(--hover-close-color);--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[variant=secondary].sc-stzh-ghettobox{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[variant=tertiary].sc-stzh-ghettobox{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.stzh-ghettobox__close[active].sc-stzh-ghettobox:not([active=false]){--color:var(--hover-close-color);--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=secondary],.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=input],.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-xxxlarge)}@media screen and (min-width: 600px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-medium)}}@media screen and (min-width: 600px) and (min-width: 1024px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 600px) and (min-width: 1260px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-xlarge)}}";
|
|
11
|
+
const stzhGhettoboxCss = ".sc-stzh-ghettobox-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-ghettobox-h{display:none}.sc-stzh-ghettobox-h *.sc-stzh-ghettobox,.sc-stzh-ghettobox-h *.sc-stzh-ghettobox::before,.sc-stzh-ghettobox-h *.sc-stzh-ghettobox::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-ghettobox-h{--stzh-flyingfocus-color:var(--stzh-base-invert-color);--stzh-base-color:var(--stzh-base-invert-color);--stzh-base-lead-color:var(--stzh-base-invert-color);--stzh-base-border-color:var(--stzh-base-invert-color);--stzh-heading-color:var(--stzh-base-invert-color);--stzh-link-color:var(--stzh-base-invert-color);--stzh-link-hover-color:var(--stzh-base-invert-color);--background-color:var(--stzh-color-error);--color:var(--stzh-base-invert-color);--richtext-color:var(--color);--close-color:var(--stzh-base-invert-color);--button-color:var(--color);--hover-button-color:var(--background-color);--hover-close-color:var(--background-color)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-richtext{--stzh-base-color:var(--richtext-color)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=default]{--color:var(--hover-button-color);--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=secondary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][variant=tertiary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][active]:not([active=false]){--color:var(--hover-button-color);--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--hover-button-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false]),.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][a11y-disabled]:not([a11y-disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=secondary],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=input],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][disabled]:not([disabled=false])[variant=tertiary],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][a11y-disabled]:not([a11y-disabled=false])[variant=secondary],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][a11y-disabled]:not([a11y-disabled=false])[variant=input],.sc-stzh-ghettobox-h .sc-stzh-ghettobox-s>stzh-button[slot=button][a11y-disabled]:not([a11y-disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxlarge);padding-bottom:var(--stzh-space-xxlarge);padding-left:var(--stzh-space-xxxlarge);padding-right:var(--stzh-space-xxxlarge);position:relative;display:-ms-flexbox;display:flex;background-color:var(--background-color);color:var(--color);-webkit-box-shadow:var(--stzh-box-shadow-message);box-shadow:var(--stzh-box-shadow-message);border-radius:var(--stzh-button-border-radius)}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-top:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-bottom:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 600px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-big)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-left:var(--stzh-space-xbig)}}@media screen and (min-width: 600px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-xxxxlarge)}}@media screen and (min-width: 1024px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-big)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{padding-right:var(--stzh-space-xbig)}}@media screen and (min-width: 1260px){.stzh-ghettobox.sc-stzh-ghettobox{border-radius:0.1875rem}}.stzh-ghettobox__hidden-title.sc-stzh-ghettobox{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-ghettobox__message.sc-stzh-ghettobox{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-positive:1;flex-grow:1}.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-family:var(--stzh-font-family-title);font-weight:var(--stzh-font-weight-title);font-size:var(--stzh-font-curve-h1-default-font-size, var(--stzh-font-deca-font-size));line-height:var(--stzh-font-curve-h1-default-heading-line-height, var(--stzh-font-deca-text-line-height));letter-spacing:var(--stzh-font-curve-h1-default-heading-letter-spacing, var(--stzh-font-deca-text-letter-spacing));margin:0;color:inherit}@media screen and (min-width: 600px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-small-font-size, var(--stzh-font-kilo-font-size));line-height:var(--stzh-font-curve-h1-small-heading-line-height, var(--stzh-font-kilo-text-line-height));letter-spacing:var(--stzh-font-curve-h1-small-heading-letter-spacing, var(--stzh-font-kilo-text-letter-spacing))}}@media screen and (min-width: 1024px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-medium-font-size, var(--stzh-font-mega-font-size));line-height:var(--stzh-font-curve-h1-medium-heading-line-height, var(--stzh-font-mega-text-line-height));letter-spacing:var(--stzh-font-curve-h1-medium-heading-letter-spacing, var(--stzh-font-mega-text-letter-spacing))}}@media screen and (min-width: 1440px){.stzh-ghettobox__main-title.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-h1-ultra-font-size, var(--stzh-font-giga-font-size));line-height:var(--stzh-font-curve-h1-ultra-heading-line-height, var(--stzh-font-giga-text-line-height));letter-spacing:var(--stzh-font-curve-h1-ultra-heading-letter-spacing, var(--stzh-font-giga-text-letter-spacing))}}.stzh-ghettobox__description.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing)}@media screen and (min-width: 1024px){.stzh-ghettobox__description.sc-stzh-ghettobox{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-small)}@media screen and (min-width: 1024px){.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-ghettobox__description.sc-stzh-ghettobox:not(:empty),.stzh-ghettobox__button.sc-stzh-ghettobox:not(:empty){margin-top:var(--stzh-space-large)}}.stzh-ghettobox__close.sc-stzh-ghettobox{-ms-flex-negative:0;flex-shrink:0}@media screen and (min-width: 600px){.stzh-ghettobox__close.sc-stzh-ghettobox{margin-left:var(--stzh-space-small)}}.stzh-ghettobox__close.sc-stzh-ghettobox{position:absolute;top:0;right:0}.stzh-ghettobox__close[variant=default].sc-stzh-ghettobox{--color:var(--hover-close-color);--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[variant=secondary].sc-stzh-ghettobox{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[variant=tertiary].sc-stzh-ghettobox{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.stzh-ghettobox__close[active].sc-stzh-ghettobox:not([active=false]){--color:var(--hover-close-color);--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--hover-close-color);--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false]),.stzh-ghettobox__close[a11y-disabled].sc-stzh-ghettobox:not([a11y-disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=secondary],.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=input],.stzh-ghettobox__close[disabled].sc-stzh-ghettobox:not([disabled=false])[variant=tertiary],.stzh-ghettobox__close[a11y-disabled].sc-stzh-ghettobox:not([a11y-disabled=false])[variant=secondary],.stzh-ghettobox__close[a11y-disabled].sc-stzh-ghettobox:not([a11y-disabled=false])[variant=input],.stzh-ghettobox__close[a11y-disabled].sc-stzh-ghettobox:not([a11y-disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-xxxlarge)}@media screen and (min-width: 600px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-medium)}}@media screen and (min-width: 600px) and (min-width: 1024px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 600px) and (min-width: 1260px){.stzh-ghettobox--has-close-button.sc-stzh-ghettobox{padding-right:var(--stzh-space-xlarge)}}";
|
|
12
12
|
|
|
13
13
|
const KEY_PREFIX_CLOSE_TIME = "stzh-components-ghettobox-close-time";
|
|
14
14
|
const StzhGhettobox = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-ghettobox.stzh-richtext.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,4vVAA4vV;;ACqBrxV,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;MAWxD,aAAa;;;;;IAkFhB,uBAAkB,GAAG;MAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAA;IAEO,SAAI,GAAG;MACb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;MAExE,IAAI,MAAM,EAAE;QACVA,oBAAc,CAAC,MAAM,EAAE;UACrB,IAAI,EAAE,OAAO;UACb,OAAO,EAAE,WAAW;UACpB,MAAM,EAAE,KAAK;UACb,IAAI,EAAE,kBAAkB;UACxB,YAAY,EAAE,OAAO;SACG,CAAC,CAAA;OAC5B;KACF,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AAW,CAAC,CAAC;KACvC,CAAC,CAAC;GACJ;EAED,MAAM,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;MACtB,IAAI,CAAC,YAAY,GAAG,MAAMD,kCAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;KACvE;GACF;EAED,kBAAkB;IAChB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC1F,IAAI,CAAC,oBAAoB,EAAE,CAAC;GAC7B;EAED,MAAM;IACJ,MAAM,OAAO,GAAG;MACd,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,QACEC,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IACjBA,qBAAa,CACT,CACD,EACP;GACH;;;;;;;;","names":["setPropsIfNull","Cookie","fetchTranslations","h","Host"],"sources":["./src/components/stzh-ghettobox/stzh-ghettobox.scss?tag=stzh-ghettobox&encapsulation=scoped","./src/components/stzh-ghettobox/stzh-ghettobox.tsx","./src/components/stzh-richtext/stzh-richtext.scss?tag=stzh-richtext&encapsulation=scoped","./src/components/stzh-richtext/stzh-richtext.tsx"],"sourcesContent":[":host {\n @include base-invert;\n\n --background-color: #{$colorError};\n --color: #{$baseInvertColor};\n --richtext-color: var(--color);\n --close-color: #{$baseInvertColor};\n --button-color: var(--color);\n\n --hover-button-color: var(--background-color);\n --hover-close-color: var(--background-color);\n\n ::slotted(stzh-richtext) {\n --stzh-base-color: var(--richtext-color);\n }\n\n ::slotted(stzh-button[slot=\"button\"]) {\n @include button-invert(var(--hover-button-color));\n }\n}\n\n.stzh-ghettobox {\n @include spaceCurve('padding-top', 'large');\n @include spaceCurve('padding-bottom', 'large');\n @include spaceCurve('padding-left', 'big');\n @include spaceCurve('padding-right', 'big');\n position: relative;\n display: flex;\n background-color: var(--background-color);\n color: var(--color);\n box-shadow: $boxShadowMessage;\n border-radius: $buttonBorderRadius;\n\n @include mq($from: large) {\n border-radius: 3px;\n }\n\n &__hidden-title {\n @include visuallyhidden;\n }\n\n &__message {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n\n &__main-title {\n @include font('title');\n @include fontCurve('h1', 'heading');\n margin: 0;\n color: inherit;\n }\n\n &__description {\n @include fontCurve('p1');\n }\n\n &__description,\n &__button {\n &:not(:empty) {\n @include spaceCurve('margin-top', 'small');\n }\n }\n\n &__close {\n flex-shrink: 0;\n\n @include mq($from: small) {\n margin-left: space('small');\n }\n }\n\n &__close {\n @include button-invert(var(--hover-close-color));\n\n position: absolute;\n top: 0;\n right: 0;\n }\n\n /* Has close button */\n\n &--has-close-button {\n padding-right: spaceCurveValue('big');\n\n @include mq($from: small) {\n @include spaceCurve('padding-right', 'regular');\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Event,\n EventEmitter,\n Method,\n Watch,\n State\n} from \"@stencil/core\";\n\nimport Cookie from \"js-cookie\";\n\nimport { StzhGhettoboxOpenEvent, StzhGhettoboxCloseEvent } from \"../../index\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhGhettoboxLocalizedText } from \"./stzh-ghettobox.localization\"\n\nconst KEY_PREFIX_CLOSE_TIME = \"stzh-components-ghettobox-close-time\";\n\n/**\n * @slot - Slot for description content (use instead of description property)\n * @prop --background-color: Set background and button text hover color\n */\n@Component({\n tag: \"stzh-ghettobox\",\n styleUrl: \"stzh-ghettobox.scss\",\n scoped: true\n})\nexport class StzhGhettobox {\n /** Overwrite hidden h1 title */\n @Prop() hiddenTitle: string = \"\";\n\n /** Main title */\n @Prop() mainTitle: string = \"\";\n\n /** Description */\n @Prop() description: string = \"\";\n\n /** Hide close button */\n @Prop() hideClose: boolean = false;\n\n /**\n * Publish date for ghettobox.\n * If user hasn't closed it yet or closed before this date\n * (cookie check), it will be shown.\n */\n @Prop() publishDate: string | Date;\n private _publishDate: Date;\n\n /**\n * Name of cookie to compare its value with set `publishDate`\n * to determine if ghettobox was already closed before by the user.\n * If empty (\"\"), no check is done and ghettobox\n * will always be shown again after a refresh.\n * Cookie name will be prefixed with `stzh-components-ghettobox-close-time`.\n */\n @Prop() closeTimeKey: string = \"global-alert\";\n\n /** Translation strings */\n @Prop() localization: StzhGhettoboxLocalizedText;\n\n /** Ghettobox open event */\n @Event() stzhOpen: EventEmitter<StzhGhettoboxOpenEvent>;\n\n /** Ghettobox close event */\n @Event() stzhClose: EventEmitter<StzhGhettoboxCloseEvent>;\n\n @Element() element: HTMLStzhGhettoboxElement;\n\n /** Open state */\n @State() open: boolean = true;\n\n @Watch(\"publishDate\")\n publishDateWatcher(newValue: string | Date) {\n if (typeof newValue === \"string\") {\n this._publishDate = new Date(newValue);\n } else {\n this._publishDate = newValue;\n }\n\n if (this.closeTimeKey && this._publishDate) {\n const timeClosed = Cookie.get(`${KEY_PREFIX_CLOSE_TIME}-${this.closeTimeKey}`);\n if (timeClosed && Number(timeClosed) >= this._publishDate.getTime()) {\n this.hide(false);\n }\n }\n }\n\n @Method()\n async show() {\n this.open = true;\n this.stzhOpen.emit({\n component: \"stzh-ghettobox\"\n })\n }\n\n @Method()\n async hide(setCloseKey: boolean = true) {\n this.open = false;\n this.stzhClose.emit({\n component: \"stzh-ghettobox\"\n });\n\n if (this.closeTimeKey && setCloseKey) {\n Cookie.set(`${KEY_PREFIX_CLOSE_TIME}-${this.closeTimeKey}`, Date.now().toString());\n }\n }\n\n private observer: MutationObserver;\n\n private onCloseButtonClick = () => {\n this.hide();\n }\n\n private init = () => {\n const button = this.element.querySelector('stzh-button[slot=\"button\"]');\n\n if (button) {\n setPropsIfNull(button, {\n size: \"small\",\n variant: \"secondary\",\n effect: \"cta\",\n icon: \"arrow-right-long\",\n iconPosition: \"right\"\n } as HTMLStzhButtonElement)\n }\n }\n\n async componentWillLoad() {\n this.publishDateWatcher(this.publishDate);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"ghettobox\");\n }\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-ghettobox\": true,\n \"stzh-ghettobox--has-close-button\": !this.hideClose\n };\n\n return (\n <Host hidden={!this.open}>\n <div class={classes}>\n <h1 class=\"stzh-ghettobox__hidden-title\">\n {this.hiddenTitle || this.localization.hiddenTitle}\n </h1>\n <div class=\"stzh-ghettobox__message\">\n <h2 class=\"stzh-ghettobox__main-title\">\n {this.mainTitle}\n </h2>\n <div class=\"stzh-ghettobox__description\">\n {this.description ? this.description : <slot></slot>}\n </div>\n <div class=\"stzh-ghettobox__button\">\n <slot name=\"button\"></slot>\n </div>\n </div>\n {!this.hideClose &&\n <stzh-button\n class=\"stzh-ghettobox__close\"\n onClick={this.onCloseButtonClick}\n a11yLabel={this.localization.close}\n variant=\"tertiary\"\n size=\"small\"\n iconOnly={true}\n icon=\"close\"\n ></stzh-button>\n }\n </div>\n </Host>\n );\n }\n}\n",":host {\n @include richtext-host;\n\n ::slotted(*) {\n @include richtext-slotted;\n }\n\n ::slotted(*:first-child) {\n margin-top: 0 !important;\n }\n\n ::slotted(*:last-child) {\n margin-bottom: 0 !important;\n }\n}\n\n.stzh-richtext {\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element\n} from \"@stencil/core\";\n\nconst CLASS_EXTERNAL_LINK = 'stzh-richtext__external-link';\nconst CLASS_EXTERNAL_ICON_WRAPPER = 'stzh-richtext__external-icon-wrapper';\nconst CLASS_EXTERNAL_ICON = 'stzh-richtext__external-icon';\nconst CLASS_EXTERNAL_VHIDDEN = 'stzh-richtext__external-vhidden';\n\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\n/**\n * @slot - Text content that should be styled\n */\n@Component({\n tag: \"stzh-richtext\",\n styleUrl: \"stzh-richtext.scss\",\n scoped: true\n})\nexport class StzhRichtext {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Selector to recognize external link and attach an icon */\n @Prop() externalLinkSelector: string = 'a[rel*=\"external\"], a.external, a.extern';\n\n /** Icon used for marking external links */\n @Prop() externalLinkIcon: string = 'external-link';\n\n @Element() element: HTMLStzhRichtextElement;\n\n private externalLinks: HTMLElement[];\n\n private addExternalLinkIcons() {\n this.externalLinks.forEach(externalLink => {\n externalLink.classList.add(CLASS_EXTERNAL_LINK);\n\n const screenreaderText = document.createElement('span');\n screenreaderText.classList.add(CLASS_EXTERNAL_VHIDDEN);\n screenreaderText.innerText = this.localization.$globals.externalLinkLabel;\n\n const iconWrapper = document.createElement('span');\n iconWrapper.classList.add(CLASS_EXTERNAL_ICON_WRAPPER);\n\n const icon = document.createElement('stzh-icon');\n icon.classList.add(CLASS_EXTERNAL_ICON);\n icon.name = this.externalLinkIcon;\n iconWrapper.appendChild(icon);\n\n externalLink.prepend(screenreaderText);\n externalLink.appendChild(iconWrapper);\n });\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"richtext\");\n }\n }\n\n componentDidRender() {\n this.externalLinks = Array.from(this.element.querySelectorAll(this.externalLinkSelector));\n this.addExternalLinkIcons();\n }\n\n render() {\n const classes = {\n \"stzh-richtext\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"stzh-ghettobox.stzh-richtext.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,omXAAomX;;ACqB7nX,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;MAWxD,aAAa;;;;;IAkFhB,uBAAkB,GAAG;MAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAA;IAEO,SAAI,GAAG;MACb,MAAM,MAAM,GA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W,CAAC,CAAC;MACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;MACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC;MAClC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;MAE9B,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;MACvC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;KACvC,CAAC,CAAC;GACJ;EAED,MAAM,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;MACtB,IAAI,CAAC,YAAY,GAAG,MAAMD,kCAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;KACvE;GACF;EAED,kBAAkB;IAChB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC1F,IAAI,CAAC,oBAAoB,EAAE,CAAC;GAC7B;EAED,MAAM;IACJ,MAAM,OAAO,GAAG;MACd,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,QACEC,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IACjBA,qBAAa,CACT,CACD,EACP;GACH;;;;;;;;","names":["setPropsIfNull","Cookie","fetchTranslations","h","Host"],"sources":["./src/components/stzh-ghettobox/stzh-ghettobox.scss?tag=stzh-ghettobox&encapsulation=scoped","./src/components/stzh-ghettobox/stzh-ghettobox.tsx","./src/components/stzh-richtext/stzh-richtext.scss?tag=stzh-richtext&encapsulation=scoped","./src/components/stzh-richtext/stzh-richtext.tsx"],"sourcesContent":[":host {\n @include base-invert;\n\n --background-color: #{$colorError};\n --color: #{$baseInvertColor};\n --richtext-color: var(--color);\n --close-color: #{$baseInvertColor};\n --button-color: var(--color);\n\n --hover-button-color: var(--background-color);\n --hover-close-color: var(--background-color);\n\n ::slotted(stzh-richtext) {\n --stzh-base-color: var(--richtext-color);\n }\n\n ::slotted(stzh-button[slot=\"button\"]) {\n @include button-invert(var(--hover-button-color));\n }\n}\n\n.stzh-ghettobox {\n @include spaceCurve('padding-top', 'large');\n @include spaceCurve('padding-bottom', 'large');\n @include spaceCurve('padding-left', 'big');\n @include spaceCurve('padding-right', 'big');\n position: relative;\n display: flex;\n background-color: var(--background-color);\n color: var(--color);\n box-shadow: $boxShadowMessage;\n border-radius: $buttonBorderRadius;\n\n @include mq($from: large) {\n border-radius: 3px;\n }\n\n &__hidden-title {\n @include visuallyhidden;\n }\n\n &__message {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n\n &__main-title {\n @include font('title');\n @include fontCurve('h1', 'heading');\n margin: 0;\n color: inherit;\n }\n\n &__description {\n @include fontCurve('p1');\n }\n\n &__description,\n &__button {\n &:not(:empty) {\n @include spaceCurve('margin-top', 'small');\n }\n }\n\n &__close {\n flex-shrink: 0;\n\n @include mq($from: small) {\n margin-left: space('small');\n }\n }\n\n &__close {\n @include button-invert(var(--hover-close-color));\n\n position: absolute;\n top: 0;\n right: 0;\n }\n\n /* Has close button */\n\n &--has-close-button {\n padding-right: spaceCurveValue('big');\n\n @include mq($from: small) {\n @include spaceCurve('padding-right', 'regular');\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Event,\n EventEmitter,\n Method,\n Watch,\n State\n} from \"@stencil/core\";\n\nimport Cookie from \"js-cookie\";\n\nimport { StzhGhettoboxOpenEvent, StzhGhettoboxCloseEvent } from \"../../index\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhGhettoboxLocalizedText } from \"./stzh-ghettobox.localization\"\n\nconst KEY_PREFIX_CLOSE_TIME = \"stzh-components-ghettobox-close-time\";\n\n/**\n * @slot - Slot for description content (use instead of description property)\n * @prop --background-color: Set background and button text hover color\n */\n@Component({\n tag: \"stzh-ghettobox\",\n styleUrl: \"stzh-ghettobox.scss\",\n scoped: true\n})\nexport class StzhGhettobox {\n /** Overwrite hidden h1 title */\n @Prop() hiddenTitle: string = \"\";\n\n /** Main title */\n @Prop() mainTitle: string = \"\";\n\n /** Description */\n @Prop() description: string = \"\";\n\n /** Hide close button */\n @Prop() hideClose: boolean = false;\n\n /**\n * Publish date for ghettobox.\n * If user hasn't closed it yet or closed before this date\n * (cookie check), it will be shown.\n */\n @Prop() publishDate: string | Date;\n private _publishDate: Date;\n\n /**\n * Name of cookie to compare its value with set `publishDate`\n * to determine if ghettobox was already closed before by the user.\n * If empty (\"\"), no check is done and ghettobox\n * will always be shown again after a refresh.\n * Cookie name will be prefixed with `stzh-components-ghettobox-close-time`.\n */\n @Prop() closeTimeKey: string = \"global-alert\";\n\n /** Translation strings */\n @Prop() localization: StzhGhettoboxLocalizedText;\n\n /** Ghettobox open event */\n @Event() stzhOpen: EventEmitter<StzhGhettoboxOpenEvent>;\n\n /** Ghettobox close event */\n @Event() stzhClose: EventEmitter<StzhGhettoboxCloseEvent>;\n\n @Element() element: HTMLStzhGhettoboxElement;\n\n /** Open state */\n @State() open: boolean = true;\n\n @Watch(\"publishDate\")\n publishDateWatcher(newValue: string | Date) {\n if (typeof newValue === \"string\") {\n this._publishDate = new Date(newValue);\n } else {\n this._publishDate = newValue;\n }\n\n if (this.closeTimeKey && this._publishDate) {\n const timeClosed = Cookie.get(`${KEY_PREFIX_CLOSE_TIME}-${this.closeTimeKey}`);\n if (timeClosed && Number(timeClosed) >= this._publishDate.getTime()) {\n this.hide(false);\n }\n }\n }\n\n @Method()\n async show() {\n this.open = true;\n this.stzhOpen.emit({\n component: \"stzh-ghettobox\"\n })\n }\n\n @Method()\n async hide(setCloseKey: boolean = true) {\n this.open = false;\n this.stzhClose.emit({\n component: \"stzh-ghettobox\"\n });\n\n if (this.closeTimeKey && setCloseKey) {\n Cookie.set(`${KEY_PREFIX_CLOSE_TIME}-${this.closeTimeKey}`, Date.now().toString());\n }\n }\n\n private observer: MutationObserver;\n\n private onCloseButtonClick = () => {\n this.hide();\n }\n\n private init = () => {\n const button = this.element.querySelector('stzh-button[slot=\"button\"]');\n\n if (button) {\n setPropsIfNull(button, {\n size: \"small\",\n variant: \"secondary\",\n effect: \"cta\",\n icon: \"arrow-right-long\",\n iconPosition: \"right\"\n } as HTMLStzhButtonElement)\n }\n }\n\n async componentWillLoad() {\n this.publishDateWatcher(this.publishDate);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"ghettobox\");\n }\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-ghettobox\": true,\n \"stzh-ghettobox--has-close-button\": !this.hideClose\n };\n\n return (\n <Host hidden={!this.open}>\n <div class={classes}>\n <h1 class=\"stzh-ghettobox__hidden-title\">\n {this.hiddenTitle || this.localization.hiddenTitle}\n </h1>\n <div class=\"stzh-ghettobox__message\">\n <h2 class=\"stzh-ghettobox__main-title\">\n {this.mainTitle}\n </h2>\n <div class=\"stzh-ghettobox__description\">\n {this.description ? this.description : <slot></slot>}\n </div>\n <div class=\"stzh-ghettobox__button\">\n <slot name=\"button\"></slot>\n </div>\n </div>\n {!this.hideClose &&\n <stzh-button\n class=\"stzh-ghettobox__close\"\n onClick={this.onCloseButtonClick}\n a11yLabel={this.localization.close}\n variant=\"tertiary\"\n size=\"small\"\n iconOnly={true}\n icon=\"close\"\n ></stzh-button>\n }\n </div>\n </Host>\n );\n }\n}\n",":host {\n @include richtext-host;\n\n ::slotted(*) {\n @include richtext-slotted;\n }\n\n ::slotted(*:first-child) {\n margin-top: 0 !important;\n }\n\n ::slotted(*:last-child) {\n margin-bottom: 0 !important;\n }\n}\n\n.stzh-richtext {\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element\n} from \"@stencil/core\";\n\nconst CLASS_EXTERNAL_LINK = 'stzh-richtext__external-link';\nconst CLASS_EXTERNAL_ICON_WRAPPER = 'stzh-richtext__external-icon-wrapper';\nconst CLASS_EXTERNAL_ICON = 'stzh-richtext__external-icon';\nconst CLASS_EXTERNAL_VHIDDEN = 'stzh-richtext__external-vhidden';\n\nimport { fetchTranslations, StzhLocaleComponent } from \"../../utils/translation-utils\";\n\n/**\n * @slot - Text content that should be styled\n */\n@Component({\n tag: \"stzh-richtext\",\n styleUrl: \"stzh-richtext.scss\",\n scoped: true\n})\nexport class StzhRichtext {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Selector to recognize external link and attach an icon */\n @Prop() externalLinkSelector: string = 'a[rel*=\"external\"], a.external, a.extern';\n\n /** Icon used for marking external links */\n @Prop() externalLinkIcon: string = 'external-link';\n\n @Element() element: HTMLStzhRichtextElement;\n\n private externalLinks: HTMLElement[];\n\n private addExternalLinkIcons() {\n this.externalLinks.forEach(externalLink => {\n externalLink.classList.add(CLASS_EXTERNAL_LINK);\n\n const screenreaderText = document.createElement('span');\n screenreaderText.classList.add(CLASS_EXTERNAL_VHIDDEN);\n screenreaderText.innerText = this.localization.$globals.externalLinkLabel;\n\n const iconWrapper = document.createElement('span');\n iconWrapper.classList.add(CLASS_EXTERNAL_ICON_WRAPPER);\n\n const icon = document.createElement('stzh-icon');\n icon.classList.add(CLASS_EXTERNAL_ICON);\n icon.name = this.externalLinkIcon;\n iconWrapper.appendChild(icon);\n\n externalLink.prepend(screenreaderText);\n externalLink.appendChild(iconWrapper);\n });\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"richtext\");\n }\n }\n\n componentDidRender() {\n this.externalLinks = Array.from(this.element.querySelectorAll(this.externalLinkSelector));\n this.addExternalLinkIcons();\n }\n\n render() {\n const classes = {\n \"stzh-richtext\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -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I,CAAC,MAAM,GAAG,QAAQ,GAAG,cAAc,qBAEhF,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,EACxD,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAgB,mBACvC,IAAI,CAAC,OAAO,GACd;;QAEfA,kBAAM,IAAI,EAAC,cAAc,GAAQ,CAE/B,EACNA,QAACI,yCAAoB,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,EACP;GACH;;;;;;;;;;;;","names":["h","fetchTranslations","hasSlot","Host","StzhInputDescription"],"sources":["./src/components/stzh-input/stzh-input.scss?tag=stzh-input&encapsulation=scoped","./src/components/stzh-input/stzh-input.tsx"],"sourcesContent":[":host {\n --text-align: left;\n width: 100%;\n}\n\n:host ::slotted([slot=\"button-right\"]),\n.stzh-input__button-right {\n position: absolute;\n top: 0;\n right: 0;\n}\n\n:host ::slotted(stzh-button[slot=\"button-right\"][variant=\"input\"]),\n:host ::slotted([slot=\"button-right\"]) stzh-button[variant=\"input\"],\n.stzh-input__button-right[variant=\"input\"] {\n --border-color: transparent;\n --hover-border-color: transparent;\n}\n\n.stzh-input {\n\t@include input-description;\n\t@include fontSize('milli');\n\n &__field-wrapper {\n position: relative;\n display: flex;\n }\n\n &__input {\n @include font;\n @include fontSize('milli');\n border: 1px solid $formBorderColor;\n transition-property: color, border-color;\n transition-duration: $baseTransitionAnimationSpeed;\n border-radius: $formInputBorderRadius;\n padding: space('xsmall') space('medium');\n width: 100%;\n color: $colorPrimary;\n background: $colorWhite;\n appearance: none;\n text-align: var(--text-align);\n\n @include placeholder {\n color: $formInputPlaceholderColor;\n }\n\n &:hover,\n &:focus {\n color: $colorPrimaryHover;\n border-color: $colorPrimaryHover;\n }\n\n // remove clear button for IE11\n &::-ms-clear {\n display: none;\n }\n\n // prevent ugly autofill background color in chrome\n &:-webkit-autofill {\n background-clip: text;\n }\n\n // show ellipsis for placeholders that are too long\n &:placeholder-shown {\n text-overflow: ellipsis;\n }\n\n // hide search clear icon on chrome\n &[type=\"search\"]::-webkit-search-decoration,\n &[type=\"search\"]::-webkit-search-cancel-button,\n &[type=\"search\"]::-webkit-search-results-button,\n &[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n /* Normal inputs */\n\n &--input {\n height: $formInputHeight;\n }\n\n /* Textarea */\n\n &--textarea {\n min-height: $formInputHeight;\n resize: vertical;\n }\n }\n\n &__label {\n @include font('heavy');\n @include fontSize('nano');\n @include truncate;\n color: $formColor;\n width: auto;\n position: absolute;\n top: calc(#{$formInputHeight} / 2);\n // padding-left (medium) + border-left\n left: calc(#{space('medium')} + 1px);\n max-width: calc(100% - #{space('medium')} * 2);\n transform: translateY(-50%);\n transition: all $baseTransitionAnimationSpeed;\n pointer-events: none;\n\n &:empty {\n display: none;\n }\n\n &::before {\n content: '';\n display: none;\n background: $colorWhite;\n position: absolute;\n width: 100%;\n z-index: -1;\n left: 0;\n top: 50%;\n // prevent white line not fully overlaping border of input\n margin-top: -0.5px;\n height: 2px;\n }\n }\n\n &__input:hover + &__label,\n &__input:focus + &__label {\n color: $colorPrimaryHover;\n }\n\n &__button-right {\n display: none;\n\n &[disabled]:not([disabled=\"false\"])[variant=\"input\"] {\n --color: #{$formColor};\n --background-color: transparent;\n --border-color: transparent;\n\n --hover-color: #{$colorPrimaryHover};\n --hover-background-color: transparent;\n --hover-border-color: transparent;\n }\n }\n\n /* Clearable / Search input */\n\n &--is-clearable#{&}--is-filled:not(#{&}--is-readonly):not(#{&}--is-disabled) &__button-right,\n &--type-search &__button-right {\n display: block;\n }\n\n &--type-search:not(#{&}--is-filled) &__button-right,\n &--type-search#{&}--is-readonly &__button-right,\n &--type-search#{&}--is-disabled &__button-right {\n pointer-events: none;\n }\n\n /* Filled variant */\n\n &--is-filled &__button-right {\n &.is-search {\n pointer-events: initial;\n }\n }\n\n /* Styles for floating label */\n\n &:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--has-fixed-label &__label,\n &--is-filled &__label,\n &--is-readonly &__label,\n &--is-disabled &__label,\n &--is-invalid &__label {\n display: block;\n top: 0;\n // padding-left (input field medium) - padding-left\n left: calc(#{space('medium')} - #{space('xxsmall')});\n height: 20px; // dividable by two (so before element is always positioned correctly)\n line-height: 20px;\n padding: 0 space('xxsmall');\n max-width: calc(100% - #{space('small')} * 2);\n pointer-events: all;\n\n &:not(:empty)::before {\n display: block;\n }\n }\n\n /* Button Right Variant */\n\n &--has-button-right &__input {\n // distance to icon + icon button width\n padding-right: calc(#{space('xsmall')} + #{$formInputHeight});\n }\n\n &--has-button-right &__label {\n // 100% - ((padding left of normal variant + border 1px) * 2) - icon button width\n max-width: calc(100% - (#{space('medium')} + 1px) * 2 - #{$formInputHeight});\n }\n\n &--has-button-right#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--has-button-right#{&}--has-fixed-label &__label,\n &--has-button-right#{&}--is-filled &__label,\n &--has-button-right#{&}--is-readonly &__label,\n &--has-button-right#{&}--is-disabled &__label,\n &--has-button-right#{&}--is-invalid &__label {\n // 100% - left distance to text + 1px border + padding label right side - icon button width\n max-width: calc(100% - #{space('medium')} - #{space('xxsmall')} - 1px + #{space('xxsmall')} - #{$formInputHeight});\n }\n\n /* Size variants */\n\n &--size-small {\n @include fontSize('micro');\n }\n\n &--size-small &__input {\n @include fontSize('micro');\n\n &--input {\n height: $formInputHeightSmall;\n }\n\n &--textarea {\n min-height: $formInputHeightSmall;\n }\n }\n\n &--size-small &__label {\n top: calc(#{$formInputHeightSmall} / 2);\n }\n\n &--size-small#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--size-small#{&}--has-fixed-label &__label,\n &--size-small#{&}--is-filled &__label,\n &--size-small#{&}--is-readonly &__label,\n &--size-small#{&}--is-disabled &__label,\n &--size-small#{&}--is-invalid &__label {\n top: 0;\n }\n\n &--size-small#{&}--has-button-right &__input {\n padding-right: calc(#{space('xxsmall')} + #{$formInputHeightSmall});\n }\n\n &--size-small#{&}--has-button-right &__label {\n max-width: calc(100% - (#{space('medium')} + 1px) * 2 - #{$formInputHeightSmall});\n }\n\n &--size-small#{&}--has-button-right#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--size-small#{&}--has-button-right#{&}--has-fixed-label &__label,\n &--size-small#{&}--has-button-right#{&}--is-filled &__label,\n &--size-small#{&}--has-button-right#{&}--is-readonly &__label,\n &--size-small#{&}--has-button-right#{&}--is-disabled &__label,\n &--size-small#{&}--has-button-right#{&}--is-invalid &__label {\n max-width: calc(100% - #{space('medium')} - #{space('xxsmall')} - 1px + #{space('xsmall')} - #{$formInputHeightSmall});\n }\n\n /* Spin button */\n\n &:not(#{&}--has-spin) &__input {\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type=number] {\n appearance: textfield;\n }\n }\n\n /* Invalid */\n\n &--is-invalid &__input,\n &--is-invalid &__label,\n &--is-invalid &__input + &__label {\n color: $colorError;\n }\n\n &--is-invalid &__input {\n border-color: $colorError;\n\n @include placeholder {\n color: $colorError;\n }\n }\n\n /* Readonly / Disabled */\n\n &--is-readonly &__input,\n &--is-readonly &__input + &__label,\n &--is-disabled &__input,\n &--is-disabled &__input + &__label {\n color: $formDisabledColor;\n }\n\n &--is-readonly &__input,\n &--is-disabled &__input {\n color: $formDisabledColor;\n border-color: $formDisabledBorderColor;\n background-color: $formDisabledBackgroundColor;\n cursor: not-allowed;\n\n @include placeholder {\n color: $formDisabledColor;\n }\n\n &:hover,\n &:focus {\n border-color: $formDisabledBorderColor;\n }\n }\n\n &--is-readonly &__label,\n &--is-disabled &__label {\n cursor: not-allowed;\n\n &::before {\n background: transparent;\n }\n }\n\n &--is-readonly &__button-right,\n &--is-disabled &__button-right {\n &[disabled]:not([disabled=\"false\"])[variant=\"input\"] {\n --color: #{$formDisabledColor};\n --hover-color: #{$formDisabledColor};\n }\n }\n}\n","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"],"version":3}
|
|
1
|
+
{"file":"stzh-input.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,YAAY,GAAG,gzhBAAgzhB;;ACwBr0hB,IAAI,YAAY,GAAG,CAAC,CAAC;MAcR,SAAS;;;;;;IAoJZ,mBAAc,GAAY,KAAK,CAAC;IAEhC,iBAAY,GAAG,CAAC,KAAiB;MACvC,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;KACJ,CAAA;IAEO,YAAO,GAAG,CAAC,KAAiB;MAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;MAE9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,YAAY;QACvB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;OAClB,CAAC,CAAC;KACJ,CAAA;IAEO,gBAAW,GAAG;MACpB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;OACjB;MAED,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC7B,CAAA;IAEO,YAAO,GAAG,CAAC,KAAiB;MAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;MAE3B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE;QACzC,IAAI,EAAE,MAAM;QACZ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ACF,CAEH,EACP,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;;QAEvCA,yBACE,KAAK,EAAC,0BAA0B,EAChC,IAAI,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,cAAc,qBAEhF,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,EACxD,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAgB,mBACvC,IAAI,CAAC,OAAO,GACd;;QAEfA,kBAAM,IAAI,EAAC,cAAc,GAAQ,CAE/B,EACNA,QAACI,yCAAoB,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,EACP;GACH;;;;;;;;;;;;","names":["h","fetchTranslations","hasSlot","Host","StzhInputDescription"],"sources":["./src/components/stzh-input/stzh-input.scss?tag=stzh-input&encapsulation=scoped","./src/components/stzh-input/stzh-input.tsx"],"sourcesContent":[":host {\n --text-align: left;\n width: 100%;\n}\n\n:host ::slotted([slot=\"button-right\"]),\n.stzh-input__button-right {\n position: absolute;\n top: 0;\n right: 0;\n}\n\n:host ::slotted(stzh-button[slot=\"button-right\"][variant=\"input\"]),\n:host ::slotted([slot=\"button-right\"]) stzh-button[variant=\"input\"],\n.stzh-input__button-right[variant=\"input\"] {\n --border-color: transparent;\n --hover-border-color: transparent;\n}\n\n.stzh-input {\n\t@include input-description;\n\t@include fontSize('milli');\n\n &__field-wrapper {\n position: relative;\n display: flex;\n }\n\n &__input {\n @include font;\n @include fontSize('milli');\n border: 1px solid $formBorderColor;\n transition-property: color, border-color;\n transition-duration: $baseTransitionAnimationSpeed;\n border-radius: $formInputBorderRadius;\n padding: space('xsmall') space('medium');\n width: 100%;\n color: $colorPrimary;\n background: $colorWhite;\n appearance: none;\n text-align: var(--text-align);\n\n @include placeholder {\n color: $formInputPlaceholderColor;\n }\n\n &:hover,\n &:focus {\n color: $colorPrimaryHover;\n border-color: $colorPrimaryHover;\n }\n\n // remove clear button for IE11\n &::-ms-clear {\n display: none;\n }\n\n // prevent ugly autofill background color in chrome\n &:-webkit-autofill {\n background-clip: text;\n }\n\n // show ellipsis for placeholders that are too long\n &:placeholder-shown {\n text-overflow: ellipsis;\n }\n\n // hide search clear icon on chrome\n &[type=\"search\"]::-webkit-search-decoration,\n &[type=\"search\"]::-webkit-search-cancel-button,\n &[type=\"search\"]::-webkit-search-results-button,\n &[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n /* Normal inputs */\n\n &--input {\n height: $formInputHeight;\n }\n\n /* Textarea */\n\n &--textarea {\n min-height: $formInputHeight;\n resize: vertical;\n }\n }\n\n &__label {\n @include font('heavy');\n @include fontSize('nano');\n @include truncate;\n color: $formColor;\n width: auto;\n position: absolute;\n top: calc(#{$formInputHeight} / 2);\n // padding-left (medium) + border-left\n left: calc(#{space('medium')} + 1px);\n max-width: calc(100% - #{space('medium')} * 2);\n transform: translateY(-50%);\n transition: all $baseTransitionAnimationSpeed;\n pointer-events: none;\n\n &:empty {\n display: none;\n }\n\n &::before {\n content: '';\n display: none;\n background: $colorWhite;\n position: absolute;\n width: 100%;\n z-index: -1;\n left: 0;\n top: 50%;\n // prevent white line not fully overlaping border of input\n margin-top: -0.5px;\n height: 2px;\n }\n }\n\n &__input:hover + &__label,\n &__input:focus + &__label {\n color: $colorPrimaryHover;\n }\n\n &__button-right {\n display: none;\n\n &[disabled]:not([disabled=\"false\"])[variant=\"input\"] {\n --color: #{$formColor};\n --background-color: transparent;\n --border-color: transparent;\n\n --hover-color: #{$colorPrimaryHover};\n --hover-background-color: transparent;\n --hover-border-color: transparent;\n }\n }\n\n /* Clearable / Search input */\n\n &--is-clearable#{&}--is-filled:not(#{&}--is-readonly):not(#{&}--is-disabled) &__button-right,\n &--type-search &__button-right {\n display: block;\n }\n\n &--type-search:not(#{&}--is-filled) &__button-right,\n &--type-search#{&}--is-readonly &__button-right,\n &--type-search#{&}--is-disabled &__button-right {\n pointer-events: none;\n }\n\n /* Filled variant */\n\n &--is-filled &__button-right {\n &.is-search {\n pointer-events: initial;\n }\n }\n\n /* Styles for floating label */\n\n &:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--has-fixed-label &__label,\n &--is-filled &__label,\n &--is-readonly &__label,\n &--is-disabled &__label,\n &--is-invalid &__label {\n display: block;\n top: 0;\n // padding-left (input field medium) - padding-left\n left: calc(#{space('medium')} - #{space('xxsmall')});\n height: 20px; // dividable by two (so before element is always positioned correctly)\n line-height: 20px;\n padding: 0 space('xxsmall');\n max-width: calc(100% - #{space('small')} * 2);\n pointer-events: all;\n\n &:not(:empty)::before {\n display: block;\n }\n }\n\n /* Button Right Variant */\n\n &--has-button-right &__input {\n // distance to icon + icon button width\n padding-right: calc(#{space('xsmall')} + #{$formInputHeight});\n }\n\n &--has-button-right &__label {\n // 100% - ((padding left of normal variant + border 1px) * 2) - icon button width\n max-width: calc(100% - (#{space('medium')} + 1px) * 2 - #{$formInputHeight});\n }\n\n &--has-button-right#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--has-button-right#{&}--has-fixed-label &__label,\n &--has-button-right#{&}--is-filled &__label,\n &--has-button-right#{&}--is-readonly &__label,\n &--has-button-right#{&}--is-disabled &__label,\n &--has-button-right#{&}--is-invalid &__label {\n // 100% - left distance to text + 1px border + padding label right side - icon button width\n max-width: calc(100% - #{space('medium')} - #{space('xxsmall')} - 1px + #{space('xxsmall')} - #{$formInputHeight});\n }\n\n /* Size variants */\n\n &--size-small {\n @include fontSize('micro');\n }\n\n &--size-small &__input {\n @include fontSize('micro');\n\n &--input {\n height: $formInputHeightSmall;\n }\n\n &--textarea {\n min-height: $formInputHeightSmall;\n }\n }\n\n &--size-small &__label {\n top: calc(#{$formInputHeightSmall} / 2);\n }\n\n &--size-small#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--size-small#{&}--has-fixed-label &__label,\n &--size-small#{&}--is-filled &__label,\n &--size-small#{&}--is-readonly &__label,\n &--size-small#{&}--is-disabled &__label,\n &--size-small#{&}--is-invalid &__label {\n top: 0;\n }\n\n &--size-small#{&}--has-button-right &__input {\n padding-right: calc(#{space('xxsmall')} + #{$formInputHeightSmall});\n }\n\n &--size-small#{&}--has-button-right &__label {\n max-width: calc(100% - (#{space('medium')} + 1px) * 2 - #{$formInputHeightSmall});\n }\n\n &--size-small#{&}--has-button-right#{&}:not(#{&}--is-readonly):not(#{&}--is-disabled) &__input:focus + &__label,\n &--size-small#{&}--has-button-right#{&}--has-fixed-label &__label,\n &--size-small#{&}--has-button-right#{&}--is-filled &__label,\n &--size-small#{&}--has-button-right#{&}--is-readonly &__label,\n &--size-small#{&}--has-button-right#{&}--is-disabled &__label,\n &--size-small#{&}--has-button-right#{&}--is-invalid &__label {\n max-width: calc(100% - #{space('medium')} - #{space('xxsmall')} - 1px + #{space('xsmall')} - #{$formInputHeightSmall});\n }\n\n /* Spin button */\n\n &:not(#{&}--has-spin) &__input {\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type=number] {\n appearance: textfield;\n }\n }\n\n /* Invalid */\n\n &--is-invalid &__input,\n &--is-invalid &__label,\n &--is-invalid &__input + &__label {\n color: $colorError;\n }\n\n &--is-invalid &__input {\n border-color: $colorError;\n\n @include placeholder {\n color: $colorError;\n }\n }\n\n /* Readonly / Disabled */\n\n &--is-readonly &__input,\n &--is-readonly &__input + &__label,\n &--is-disabled &__input,\n &--is-disabled &__input + &__label {\n color: $formDisabledColor;\n }\n\n &--is-readonly &__input,\n &--is-disabled &__input {\n color: $formDisabledColor;\n border-color: $formDisabledBorderColor;\n background-color: $formDisabledBackgroundColor;\n cursor: not-allowed;\n\n @include placeholder {\n color: $formDisabledColor;\n }\n\n &:hover,\n &:focus {\n border-color: $formDisabledBorderColor;\n }\n }\n\n &--is-readonly &__label,\n &--is-disabled &__label {\n cursor: not-allowed;\n\n &::before {\n background: transparent;\n }\n }\n\n &--is-readonly &__button-right,\n &--is-disabled &__button-right {\n &[disabled]:not([disabled=\"false\"])[variant=\"input\"] {\n --color: #{$formDisabledColor};\n --hover-color: #{$formDisabledColor};\n }\n }\n}\n","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"],"version":3}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-bf651831.js');
|
|
6
6
|
|
|
7
|
-
const stzhInvertCss = ".sc-stzh-invert-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-invert-h{display:none}.sc-stzh-invert-h *.sc-stzh-invert,.sc-stzh-invert-h *.sc-stzh-invert::before,.sc-stzh-invert-h *.sc-stzh-invert::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-invert-h{--stzh-flyingfocus-color:var(--stzh-base-invert-color);--stzh-base-color:var(--stzh-base-invert-color);--stzh-base-lead-color:var(--stzh-base-invert-color);--stzh-base-border-color:var(--stzh-base-invert-color);--stzh-heading-color:var(--stzh-base-invert-color);--stzh-link-color:var(--stzh-base-invert-color);--stzh-link-hover-color:var(--stzh-base-invert-color);background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.sc-stzh-invert-h .sc-stzh-invert-s stzh-container{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=default]{--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=secondary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=tertiary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[active]:not([active=false]){--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=secondary],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=input],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[variant=filter]{--color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--remove-color:var(--stzh-base-invert-color);--background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--counter-color:var(--stzh-color-white56);--icon-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-base-invert-color);--hover-border:0.0625rem solid transparent;--hover-background-color:var(--stzh-base-invert-color16);--hover-remove-color:var(--stzh-base-invert-color);--hover-remove-background-color:var(--stzh-base-invert-color16);--hover-counter-color:var(--stzh-base-invert-color);--hover-icon-color:var(--stzh-base-invert-color)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[variant=filter][non-interactive]:not([non-interactive=false]){--hover-color:var(--color);--hover-border-color:var(--border-color);--hover-background-color:var(--background-color);--hover-icon-color:var(--icon-color);--hover-counter-color:var(--counter-color)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[active]:not([active=false]){--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--border-color:transparent;--remove-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color);--icon-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--counter-color:var(--stzh-color-primary60op);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color72);--hover-remove-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-remove-background-color:var(--stzh-base-invert-color16);--hover-icon-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-counter-color:var(--stzh-color-primary60op)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[disabled]:not([disabled=false]){--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--remove-color:var(--stzh-base-invert-color32);--background-color:transparent;--icon-color:var(--stzh-base-invert-color32);--counter-color:var(--stzh-base-invert-color16);--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent;--hover-remove-color:var(--stzh-base-invert-color32);--hover-remove-background-color:transparent;--hover-icon-color:var(--stzh-base-invert-color32);--hover-counter-color:var(--stzh-base-invert-color16)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-richtext{--richtext-blockquote-color:var(--stzh-base-invert-color);--richtext-blockquote-line-color:var(--stzh-base-invert-color);--richtext-blockquote-footer-color:var(--stzh-base-invert-color)}";
|
|
7
|
+
const stzhInvertCss = ".sc-stzh-invert-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-invert-h{display:none}.sc-stzh-invert-h *.sc-stzh-invert,.sc-stzh-invert-h *.sc-stzh-invert::before,.sc-stzh-invert-h *.sc-stzh-invert::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-invert-h{--stzh-flyingfocus-color:var(--stzh-base-invert-color);--stzh-base-color:var(--stzh-base-invert-color);--stzh-base-lead-color:var(--stzh-base-invert-color);--stzh-base-border-color:var(--stzh-base-invert-color);--stzh-heading-color:var(--stzh-base-invert-color);--stzh-link-color:var(--stzh-base-invert-color);--stzh-link-hover-color:var(--stzh-base-invert-color);background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.sc-stzh-invert-h .sc-stzh-invert-s stzh-container{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=default]{--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=secondary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--border-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[variant=tertiary]{--color:var(--stzh-base-invert-color);--background-color:transparent;--hover-color:var(--stzh-base-invert-color);--hover-background-color:var(--stzh-base-invert-color16)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[active]:not([active=false]){--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color72);--border-color:transparent;--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-background-color:var(--stzh-base-invert-color72);--hover-border-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false]),.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[a11y-disabled]:not([a11y-disabled=false]){--border-color:transparent;--background-color:var(--stzh-base-invert-color32);--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color32)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=secondary],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=input],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[disabled]:not([disabled=false])[variant=tertiary],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=secondary],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=input],.sc-stzh-invert-h .sc-stzh-invert-s stzh-button[a11y-disabled]:not([a11y-disabled=false])[variant=tertiary]{--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--background-color:transparent;--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[variant=filter]{--color:var(--stzh-base-invert-color);--border-color:var(--stzh-base-invert-color);--remove-color:var(--stzh-base-invert-color);--background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--counter-color:var(--stzh-color-white56);--icon-color:var(--stzh-base-invert-color);--hover-color:var(--stzh-base-invert-color);--hover-border:0.0625rem solid transparent;--hover-background-color:var(--stzh-base-invert-color16);--hover-remove-color:var(--stzh-base-invert-color);--hover-remove-background-color:var(--stzh-base-invert-color16);--hover-counter-color:var(--stzh-base-invert-color);--hover-icon-color:var(--stzh-base-invert-color)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[variant=filter][non-interactive]:not([non-interactive=false]){--hover-color:var(--color);--hover-border-color:var(--border-color);--hover-background-color:var(--background-color);--hover-icon-color:var(--icon-color);--hover-counter-color:var(--counter-color)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[active]:not([active=false]){--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--border-color:transparent;--remove-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--background-color:var(--stzh-base-invert-color);--icon-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--counter-color:var(--stzh-color-primary60op);--hover-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-border-color:transparent;--hover-background-color:var(--stzh-base-invert-color72);--hover-remove-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-remove-background-color:var(--stzh-base-invert-color16);--hover-icon-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--hover-counter-color:var(--stzh-color-primary60op)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-chip[disabled]:not([disabled=false]){--color:var(--stzh-base-invert-color32);--border-color:var(--stzh-base-invert-color32);--remove-color:var(--stzh-base-invert-color32);--background-color:transparent;--icon-color:var(--stzh-base-invert-color32);--counter-color:var(--stzh-base-invert-color16);--hover-color:var(--stzh-base-invert-color32);--hover-border-color:var(--stzh-base-invert-color32);--hover-background-color:transparent;--hover-remove-color:var(--stzh-base-invert-color32);--hover-remove-background-color:transparent;--hover-icon-color:var(--stzh-base-invert-color32);--hover-counter-color:var(--stzh-base-invert-color16)}.sc-stzh-invert-h .sc-stzh-invert-s stzh-richtext{--richtext-blockquote-color:var(--stzh-base-invert-color);--richtext-blockquote-line-color:var(--stzh-base-invert-color);--richtext-blockquote-footer-color:var(--stzh-base-invert-color)}";
|
|
8
8
|
|
|
9
9
|
const StzhInvert = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-invert.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,
|
|
1
|
+
{"file":"stzh-invert.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,wxMAAwxM;;MCejyM,UAAU;;;;EAGrB,MAAM;IACJ,MAAM,OAAO,GAAG;MACd,aAAa,EAAE,IAAI;KACpB,CAAC;IAEF,QACEA,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IACjBA,qBAAa,CACT,CACD,EACP;GACH;;;;;;;","names":["h","Host"],"sources":["./src/components/stzh-invert/stzh-invert.scss?tag=stzh-invert&encapsulation=scoped","./src/components/stzh-invert/stzh-invert.tsx"],"sourcesContent":[":host {\n @include base-invert;\n background-color: $colorPrimary;\n\n ::slotted(*) {\n stzh-container {\n background-color: $colorPrimary;\n }\n\n stzh-button {\n @include button-invert;\n }\n\n stzh-chip {\n @include chip-invert;\n }\n\n stzh-richtext {\n @include richtext-invert;\n }\n }\n}\n\n.stzh-invert {\n}\n","import {\n Component,\n Host,\n h,\n Element\n} from \"@stencil/core\";\n\n/**\n * @slot - Slot for any element that will be inverted.\n */\n@Component({\n tag: \"stzh-invert\",\n styleUrl: \"stzh-invert.scss\",\n scoped: true\n})\nexport class StzhInvert {\n @Element() element: HTMLStzhInvertElement;\n\n render() {\n const classes = {\n \"stzh-invert\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-bf651831.js');
|
|
6
6
|
const utils = require('./utils-a2ff9f84.js');
|
|
7
7
|
|
|
8
|
-
const stzhTableCss = ":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-table{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;--max-height:var(--stzh-table-max-height);--min-width:var(--stzh-table-min-width);--cell-padding:var(--stzh-table-cell-padding);--input-width:var(--stzh-table-input-width)}stzh-table[hidden]{display:none}stzh-table *,stzh-table *::before,stzh-table *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-table[disable-min-width]:not([disable-min-width=false]){--min-width:none}.stzh-table{}.stzh-table__header{
|
|
8
|
+
const stzhTableCss = ":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-table{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;--max-height:var(--stzh-table-max-height);--min-width:var(--stzh-table-min-width);--cell-padding:var(--stzh-table-cell-padding);--input-width:var(--stzh-table-input-width)}stzh-table[hidden]{display:none}stzh-table *,stzh-table *::before,stzh-table *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-table[disable-min-width]:not([disable-min-width=false]){--min-width:none}.stzh-table{}.stzh-table__header{border-bottom:0.0625rem solid var(--stzh-base-border-color);padding-bottom:var(--stzh-space-small);margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 1024px){.stzh-table__header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-table__header{padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1024px){.stzh-table__header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1260px){.stzh-table__header{margin-bottom:var(--stzh-space-xlarge)}}.stzh-table__sub-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.stzh-table__heading{margin-bottom:var(--stzh-space-small)}.stzh-table__header .stzh-table__search{-ms-flex-positive:1;flex-grow:1}@media screen and (min-width: 600px){.stzh-table__header .stzh-table__search{width:var(--stzh-table-input-width);-ms-flex-positive:0;flex-grow:0}}.stzh-table__action-button{-ms-flex-negative:0;flex-shrink:0}.stzh-table__action-button:not(:empty){margin-left:var(--stzh-space-medium)}.stzh-table__outer-wrapper{position:relative}.stzh-table__outer-wrapper::before,.stzh-table__outer-wrapper::after{z-index:4;background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);opacity:0}.stzh-table__outer-wrapper::before{left:0}.stzh-table__outer-wrapper::after{right:0;-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.stzh-table__wrapper{overflow-x:auto;max-height:var(--max-height)}.stzh-table__sort-button{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;font-size:inherit;line-height:inherit;color:inherit;padding:var(--cell-padding)}.stzh-table__sort-button:hover,.stzh-table__sort-button:focus{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-table stzh-icon.stzh-table__sort-icon{display:none}.stzh-table table{width:100%;border-spacing:0;min-width:var(--min-width)}.stzh-table thead{position:-webkit-sticky;position:sticky;top:0;z-index:3}.stzh-table tr:hover td,.stzh-table tr:hover th{background-color:var(--stzh-color-grey5)}.stzh-table td,.stzh-table th{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;border:none;vertical-align:top;border:none;border-bottom:0.0625rem solid var(--stzh-base-border-color);background-color:var(--stzh-color-white);-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed);padding:var(--cell-padding);}.stzh-table td a,.stzh-table th a{color:var(--stzh-link-color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);border-radius:var(--stzh-button-border-radius)}.stzh-table td a:hover,.stzh-table td a:focus,.stzh-table th a:hover,.stzh-table th a:focus{color:var(--stzh-link-hover-color)}.stzh-table td b,.stzh-table td strong,.stzh-table th b,.stzh-table th strong{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal}.stzh-table td i,.stzh-table td em,.stzh-table th i,.stzh-table th em{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-table td.align-left,.stzh-table th.align-left{text-align:left}.stzh-table td.align-right,.stzh-table th.align-right{text-align:right}.stzh-table td.align-center,.stzh-table th.align-center{text-align:center}.stzh-table td.valign-auto,.stzh-table th.valign-auto{vertical-align:auto}.stzh-table td.valign-middle,.stzh-table th.valign-middle{vertical-align:middle}.stzh-table td.valign-bottom,.stzh-table th.valign-bottom{vertical-align:bottom}.stzh-table td.nowrap,.stzh-table th.nowrap{white-space:nowrap}.stzh-table td.is-sticky-left,.stzh-table td.is-sticky-right,.stzh-table th.is-sticky-left,.stzh-table th.is-sticky-right{position:-webkit-sticky;position:sticky;z-index:1}.stzh-table td.has-sticked,.stzh-table th.has-sticked{z-index:2}.stzh-table td.is-sticky-left,.stzh-table th.is-sticky-left{left:0}.stzh-table td.is-sticky-right,.stzh-table th.is-sticky-right{right:0}.stzh-table td.is-sticky-left::after,.stzh-table td.is-sticky-right::after,.stzh-table th.is-sticky-left::after,.stzh-table th.is-sticky-right::after{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transform:translate(100%);transform:translate(100%);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-table td.is-sticky-left::after,.stzh-table th.is-sticky-left::after{right:0}.stzh-table td.is-sticky-right::after,.stzh-table th.is-sticky-right::after{left:0;-webkit-transform:rotate(-180deg) translate(100%);transform:rotate(-180deg) translate(100%)}.stzh-table td.has-sticked.is-sticky-left::after,.stzh-table td.has-sticked.is-sticky-right::after,.stzh-table th.has-sticked.is-sticky-left::after,.stzh-table th.has-sticked.is-sticky-right::after{opacity:1}.stzh-table th{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-table th.is-sortable{padding:0}td.has-sorted .stzh-table__sort-icon,th.has-sorted .stzh-table__sort-icon{display:-ms-inline-flexbox;display:inline-flex}td.has-sorted-desc .stzh-table__sort-icon,th.has-sorted-desc .stzh-table__sort-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.stzh-table.has-scroll-left-shadow .stzh-table__outer-wrapper::before,.stzh-table.has-scroll-right-shadow .stzh-table__outer-wrapper::after{opacity:1}";
|
|
9
9
|
|
|
10
10
|
const CLASS_HAS_STICKED = "has-sticked";
|
|
11
11
|
const CLASS_IS_STICKY_LEFT = "is-sticky-left";
|
|
@@ -139,7 +139,7 @@ const StzhTable = class {
|
|
|
139
139
|
"has-scroll-left-shadow": this.hasScrollLeft && this.cellsStickyLeft.length === 0,
|
|
140
140
|
"has-scroll-right-shadow": this.hasScrollRight && this.cellsStickyRight.length === 0
|
|
141
141
|
};
|
|
142
|
-
return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("div", { class: "stzh-table__header" }, index.h("div", { class: "stzh-table__heading" }, index.h("slot", { name: "heading" })), index.h("div", { class: "stzh-table__search" }, index.h("slot", { name: "search" }))), index.h("div", { class: "stzh-table__outer-wrapper" }, index.h("div", { ref: (el) => (this.tableWrapper = el), class: "stzh-table__wrapper", onScroll: this.handleScroll }, index.h("slot", null))))));
|
|
142
|
+
return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("div", { class: "stzh-table__header" }, index.h("div", { class: "stzh-table__heading" }, index.h("slot", { name: "heading" })), index.h("div", { class: "stzh-table__sub-header" }, index.h("div", { class: "stzh-table__search" }, index.h("slot", { name: "search" })), index.h("div", { class: "stzh-table__action-button" }, index.h("slot", { name: "action-button" })))), index.h("div", { class: "stzh-table__outer-wrapper" }, index.h("div", { ref: (el) => (this.tableWrapper = el), class: "stzh-table__wrapper", onScroll: this.handleScroll }, index.h("slot", null))))));
|
|
143
143
|
}
|
|
144
144
|
get element() { return index.getElement(this); }
|
|
145
145
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-table.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,2+OAA2+O;;ACYhgP,MAAM,iBAAiB,GAAG,aAAa,CAA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AK,EAAC,oBAAoB,IAC7BA,kBAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,EACNA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,iBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,YAAY,GAAG,EAAoB,CAAC,EACvD,KAAK,EAAC,qBAAqB,EAC3B,QAAQ,EAAE,IAAI,CAAC,YAAY,IAE3BA,qBAAa,CACT,CACF,CACF,CACD,EACP;GACH;;;;;;;;;;;","names":["setPropsIfNull","h","Host"],"sources":["./src/components/stzh-table/stzh-table.scss?tag=stzh-table","./src/components/stzh-table/stzh-table.tsx"],"sourcesContent":["stzh-table {\n @include host;\n @include table-host();\n}\n\n.stzh-table {\n @include table(\"table\");\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Watch\n} from \"@stencil/core\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\n\nconst CLASS_HAS_STICKED = \"has-sticked\";\nconst CLASS_IS_STICKY_LEFT = \"is-sticky-left\";\nconst CLASS_IS_STICKY_RIGHT = \"is-sticky-right\";\n\n/**\n * @slot - Slot for table element\n * @slot heading - Slot for `stzh-heading`\n * @slot search - Slot for search `stzh-input` element\n *\n * @prop --max-height: Maximum height of table\n * @prop --min-width: Minium width of table\n * @prop --cell-padding: Cells padding\n */\n@Component({\n tag: \"stzh-table\",\n styleUrl: \"stzh-table.scss\"\n})\nexport class StzhTable {\n /** Columns that should be sticky on the left side (column indexes separated by comma) */\n @Prop() fixedLeft: number = null;\n\n /** Columns that should be sticky on the right side (column indexes separated by comma) */\n @Prop() fixedRight: number = null;\n\n /**\n * Whether to disable min-width of the table.\n *\n * If `false`, the default `min-width` is `700px`\n * If `true`, the `min-width` is `none`, so the table will try to squeeze down content as much as possible.\n *\n * You can also overwrite the min-width via CSS with the custom property `--min-width`.\n */\n @Prop({ reflect: true }) disableMinWidth: boolean = false;\n\n @State() hasScrollLeft: boolean = false;\n @State() hasScrollRight: boolean = false;\n @State() isScrollable: boolean = false;\n @State() cellsStickyLeft: number[] = [];\n @State() cellsStickyRight: number[] = [];\n\n @Element() element: HTMLStzhTableElement;\n\n @Watch(\"fixedLeft\")\n @Watch(\"fixedRight\")\n fixedCellWatcher() {\n this.updateCellClasses();\n this.updateScrollStates();\n }\n\n private tableWrapper: HTMLDivElement;\n private observer: MutationObserver;\n private debounceScroll: number;\n\n private debounceResize: number;\n private resizeObserver: ResizeObserver;\n\n private updateCellClasses = () => {\n if (!this.tableWrapper) {\n return;\n }\n\n const rows: HTMLTableRowElement[] = Array.from(this.tableWrapper.querySelectorAll(\"tr\"));\n rows.forEach((row: HTMLTableRowElement) => {\n const cells = Array.from(row.children);\n cells.forEach((cell: HTMLTableCellElement, index) => {\n cell.classList.remove(CLASS_IS_STICKY_LEFT);\n cell.classList.remove(CLASS_IS_STICKY_RIGHT);\n\n if (index === this.fixedLeft) {\n cell.classList.add(CLASS_IS_STICKY_LEFT);\n }\n\n if (index === this.fixedRight) {\n cell.classList.add(CLASS_IS_STICKY_RIGHT);\n }\n });\n });\n }\n\n private updateScrollStates = () => {\n if (!this.tableWrapper) {\n return;\n }\n\n const wrapperScrollLeft = this.tableWrapper.scrollLeft;\n const wrapperScrollWidth = this.tableWrapper.scrollWidth;\n const wrapperClientWidth = this.tableWrapper.clientWidth;\n\n this.isScrollable = wrapperScrollWidth > wrapperClientWidth;\n this.hasScrollLeft = wrapperScrollLeft > 0;\n this.hasScrollRight = wrapperScrollLeft < wrapperScrollWidth - wrapperClientWidth;\n\n const rows: HTMLTableRowElement[] = Array.from(this.tableWrapper.querySelectorAll(\"tr\"));\n const firstRow = rows[0];\n\n if (!firstRow) {\n return;\n }\n\n this.cellsStickyLeft = [];\n this.cellsStickyRight = [];\n const cells: Element[] = Array.from(firstRow.children);\n\n cells.forEach((cell: HTMLTableCellElement, index: number) => {\n const offsetLeft = cell.offsetLeft;\n const offsetRight = offsetLeft + cell.offsetWidth;\n\n if (\n this.hasScrollLeft\n && index === this.fixedLeft\n && Math.ceil(wrapperScrollLeft) >= offsetLeft\n ) {\n this.cellsStickyLeft.push(index);\n }\n\n if (\n this.hasScrollRight\n && index === this.fixedRight\n && Math.ceil(wrapperScrollLeft) + wrapperClientWidth <= offsetRight\n ) {\n this.cellsStickyRight.push(index);\n }\n });\n\n rows.forEach((row: HTMLTableRowElement) => {\n const cells = Array.from(row.children);\n cells.forEach((cell: HTMLTableCellElement, index: number) => {\n if (\n this.cellsStickyLeft.indexOf(index) > -1\n || this.cellsStickyRight.indexOf(index) > -1\n ) {\n cell.classList.add(CLASS_HAS_STICKED);\n } else {\n cell.classList.remove(CLASS_HAS_STICKED);\n }\n });\n });\n }\n\n private init = () => {\n const searchInput = this.element.querySelector(\n 'stzh-input[slot=\"search\"], [slot=\"search\"] stzh-input'\n );\n\n if (searchInput) {\n setPropsIfNull(searchInput, {\n size: \"small\"\n } as HTMLStzhInputElement)\n }\n\n this.updateCellClasses();\n this.updateScrollStates();\n }\n\n handleResize = () => {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.updateScrollStates);\n }\n\n private handleScroll = () => {\n if (this.debounceScroll) {\n window.cancelAnimationFrame(this.debounceScroll);\n }\n\n this.debounceScroll = requestAnimationFrame(this.updateScrollStates);\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this.element);\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-table\": true,\n \"is-scrollable\": this.isScrollable,\n \"has-scroll-left\": this.hasScrollLeft,\n \"has-scroll-right\": this.hasScrollRight,\n \"has-scroll-left-shadow\": this.hasScrollLeft && this.cellsStickyLeft.length === 0,\n \"has-scroll-right-shadow\": this.hasScrollRight && this.cellsStickyRight.length === 0\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-table__header\">\n <div class=\"stzh-table__heading\">\n <slot name=\"heading\"></slot>\n </div>\n <div class=\"stzh-table__search\">\n <slot name=\"search\"></slot>\n </div>\n </div>\n <div class=\"stzh-table__outer-wrapper\">\n <div\n ref={(el) => (this.tableWrapper = el as HTMLDivElement)}\n class=\"stzh-table__wrapper\"\n onScroll={this.handleScroll}\n >\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"stzh-table.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,0jPAA0jP;;ACY/kP,MAAM,iBAAiB,GAAG,aAAa,CAAC;AACxC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAC9C,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;MAgBnC,SAAS;;;IAuCZ,sBAAiB,GAAG;MAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;QACtB,OAAO;OACR;MAED,MAAM,IAAI,GAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;MACzF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAwB;QACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC,IAA0B,EAAE,KAAK;UAC9C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;UAC5C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;UAE7C,IAAI,KAAK,KAAK,IAAI,CAAC,SAAS,EAAE;YAC5B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;WAC1C;UAED,IAAI,KAAK,KAAK,IAAI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,eAAe,EAAE,IAAI,CAAC,YAAY;MAClC,iBAAiB,EAAE,IAAI,CAAC,aAAa;MACrC,kBAAkB,EAAE,IAAI,CAAC,cAAc;MACvC,wBAAwB,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC;MACjF,yBAAyB,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC;KACrF,CAAC;IAEF,QACEC,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IACjBA,iBAAK,KAAK,EAAC,oBAAoB,IAC7BA,iBAAK,KAAK,EAAC,qBAAqB,IAC9BA,kBAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,EACNA,iBAAK,KAAK,EAAC,wBAAwB,IACjCA,iBAAK,KAAK,EAAC,oBAAoB,IAC7BA,kBAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,EACNA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,kBAAM,IAAI,EAAC,eAAe,GAAQ,CAC9B,CACF,CACF,EACNA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,iBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,YAAY,GAAG,EAAoB,CAAC,EACvD,KAAK,EAAC,qBAAqB,EAC3B,QAAQ,EAAE,IAAI,CAAC,YAAY,IAE3BA,qBAAa,CACT,CACF,CACF,CACD,EACP;GACH;;;;;;;;;;;","names":["setPropsIfNull","h","Host"],"sources":["./src/components/stzh-table/stzh-table.scss?tag=stzh-table","./src/components/stzh-table/stzh-table.tsx"],"sourcesContent":["stzh-table {\n @include host;\n @include table-host();\n}\n\n.stzh-table {\n @include table(\"table\");\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Watch\n} from \"@stencil/core\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\n\nconst CLASS_HAS_STICKED = \"has-sticked\";\nconst CLASS_IS_STICKY_LEFT = \"is-sticky-left\";\nconst CLASS_IS_STICKY_RIGHT = \"is-sticky-right\";\n\n/**\n * @slot - Slot for table element\n * @slot heading - Slot for `stzh-heading`\n * @slot search - Slot for search `stzh-input` element\n * @slot action-button - Slot for action `stzh-button` element\n *\n * @prop --max-height: Maximum height of table\n * @prop --min-width: Minium width of table\n * @prop --cell-padding: Cells padding\n */\n@Component({\n tag: \"stzh-table\",\n styleUrl: \"stzh-table.scss\"\n})\nexport class StzhTable {\n /** Columns that should be sticky on the left side (column indexes separated by comma) */\n @Prop() fixedLeft: number = null;\n\n /** Columns that should be sticky on the right side (column indexes separated by comma) */\n @Prop() fixedRight: number = null;\n\n /**\n * Whether to disable min-width of the table.\n *\n * If `false`, the default `min-width` is `700px`\n * If `true`, the `min-width` is `none`, so the table will try to squeeze down content as much as possible.\n *\n * You can also overwrite the min-width via CSS with the custom property `--min-width`.\n */\n @Prop({ reflect: true }) disableMinWidth: boolean = false;\n\n @State() hasScrollLeft: boolean = false;\n @State() hasScrollRight: boolean = false;\n @State() isScrollable: boolean = false;\n @State() cellsStickyLeft: number[] = [];\n @State() cellsStickyRight: number[] = [];\n\n @Element() element: HTMLStzhTableElement;\n\n @Watch(\"fixedLeft\")\n @Watch(\"fixedRight\")\n fixedCellWatcher() {\n this.updateCellClasses();\n this.updateScrollStates();\n }\n\n private tableWrapper: HTMLDivElement;\n private observer: MutationObserver;\n private debounceScroll: number;\n\n private debounceResize: number;\n private resizeObserver: ResizeObserver;\n\n private updateCellClasses = () => {\n if (!this.tableWrapper) {\n return;\n }\n\n const rows: HTMLTableRowElement[] = Array.from(this.tableWrapper.querySelectorAll(\"tr\"));\n rows.forEach((row: HTMLTableRowElement) => {\n const cells = Array.from(row.children);\n cells.forEach((cell: HTMLTableCellElement, index) => {\n cell.classList.remove(CLASS_IS_STICKY_LEFT);\n cell.classList.remove(CLASS_IS_STICKY_RIGHT);\n\n if (index === this.fixedLeft) {\n cell.classList.add(CLASS_IS_STICKY_LEFT);\n }\n\n if (index === this.fixedRight) {\n cell.classList.add(CLASS_IS_STICKY_RIGHT);\n }\n });\n });\n }\n\n private updateScrollStates = () => {\n if (!this.tableWrapper) {\n return;\n }\n\n const wrapperScrollLeft = this.tableWrapper.scrollLeft;\n const wrapperScrollWidth = this.tableWrapper.scrollWidth;\n const wrapperClientWidth = this.tableWrapper.clientWidth;\n\n this.isScrollable = wrapperScrollWidth > wrapperClientWidth;\n this.hasScrollLeft = wrapperScrollLeft > 0;\n this.hasScrollRight = wrapperScrollLeft < wrapperScrollWidth - wrapperClientWidth;\n\n const rows: HTMLTableRowElement[] = Array.from(this.tableWrapper.querySelectorAll(\"tr\"));\n const firstRow = rows[0];\n\n if (!firstRow) {\n return;\n }\n\n this.cellsStickyLeft = [];\n this.cellsStickyRight = [];\n const cells: Element[] = Array.from(firstRow.children);\n\n cells.forEach((cell: HTMLTableCellElement, index: number) => {\n const offsetLeft = cell.offsetLeft;\n const offsetRight = offsetLeft + cell.offsetWidth;\n\n if (\n this.hasScrollLeft\n && index === this.fixedLeft\n && Math.ceil(wrapperScrollLeft) >= offsetLeft\n ) {\n this.cellsStickyLeft.push(index);\n }\n\n if (\n this.hasScrollRight\n && index === this.fixedRight\n && Math.ceil(wrapperScrollLeft) + wrapperClientWidth <= offsetRight\n ) {\n this.cellsStickyRight.push(index);\n }\n });\n\n rows.forEach((row: HTMLTableRowElement) => {\n const cells = Array.from(row.children);\n cells.forEach((cell: HTMLTableCellElement, index: number) => {\n if (\n this.cellsStickyLeft.indexOf(index) > -1\n || this.cellsStickyRight.indexOf(index) > -1\n ) {\n cell.classList.add(CLASS_HAS_STICKED);\n } else {\n cell.classList.remove(CLASS_HAS_STICKED);\n }\n });\n });\n }\n\n private init = () => {\n const searchInput = this.element.querySelector(\n 'stzh-input[slot=\"search\"], [slot=\"search\"] stzh-input'\n );\n\n if (searchInput) {\n setPropsIfNull(searchInput, {\n size: \"small\"\n } as HTMLStzhInputElement)\n }\n\n this.updateCellClasses();\n this.updateScrollStates();\n }\n\n handleResize = () => {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.updateScrollStates);\n }\n\n private handleScroll = () => {\n if (this.debounceScroll) {\n window.cancelAnimationFrame(this.debounceScroll);\n }\n\n this.debounceScroll = requestAnimationFrame(this.updateScrollStates);\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this.element);\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-table\": true,\n \"is-scrollable\": this.isScrollable,\n \"has-scroll-left\": this.hasScrollLeft,\n \"has-scroll-right\": this.hasScrollRight,\n \"has-scroll-left-shadow\": this.hasScrollLeft && this.cellsStickyLeft.length === 0,\n \"has-scroll-right-shadow\": this.hasScrollRight && this.cellsStickyRight.length === 0\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-table__header\">\n <div class=\"stzh-table__heading\">\n <slot name=\"heading\"></slot>\n </div> \n <div class=\"stzh-table__sub-header\">\n <div class=\"stzh-table__search\">\n <slot name=\"search\"></slot>\n </div>\n <div class=\"stzh-table__action-button\">\n <slot name=\"action-button\"></slot>\n </div>\n </div>\n </div>\n <div class=\"stzh-table__outer-wrapper\">\n <div\n ref={(el) => (this.tableWrapper = el as HTMLDivElement)}\n class=\"stzh-table__wrapper\"\n onScroll={this.handleScroll}\n >\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"stzh-toggle.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,y1QAAy1Q;;ACuB/2Q,IAAI,aAAa,GAAG,CAAC,CAAC;MAaT,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I,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,IAAI,CAAC,MAAM,GACnB,EACFA,iBAAK,KAAK,EAAC,mBAAmB,IAC5BA,iBAAK,KAAK,EAAC,oBAAoB,GAAO,CAClC,EACNA,iBAAK,KAAK,EAAC,oBAAoB,IAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAGA,qBAAa,EACvC,IAAI,CAAC,UAAU;MACdA,kBAAM,KAAK,EAAC,qBAAqB,IAC/BA,kBAAM,KAAK,EAAC,4BAA4B,iBAAa,MAAM,IACxD,IAAI,CAAC,QAAQ;UACV,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB;UAC9C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,CAE7C,EACPA,kBAAM,KAAK,EAAC,0BAA0B,IACnC,IAAI,CAAC,QAAQ;UACV,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB;UAC5C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAE3C,CACF,CAEL,CACA,EACRA,QAACE,yCAAoB,IACnB,WAAW,EAAC,aAAa,EACzB,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,EACP;GACH;;;;;;;;;;","names":["fetchTranslations","hasSlot","h","Host","StzhInputDescription"],"sources":["./src/components/stzh-toggle/stzh-toggle.scss?tag=stzh-toggle&encapsulation=scoped","./src/components/stzh-toggle/stzh-toggle.tsx"],"sourcesContent":[":host {\n display: inline-block;\n\n ::slotted(stzh-text) {\n --color: inherit;\n }\n}\n\n.stzh-toggle {\n @include input-description;\n\n &__field-wrapper {\n @include fontSize('milli');\n position: relative;\n display: flex;\n user-select: none;\n cursor: pointer;\n }\n\n &__input {\n @include visuallyhiddenInput;\n border-radius: $formInputBorderRadius;\n }\n\n &__mark {\n position: relative;\n background-color: $colorBlack8;\n width: 44px;\n height: 16px;\n flex-shrink: 0;\n border-radius: 12px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n transition: background-color $baseTransitionAnimationSpeed;\n margin-top: 4px;\n }\n\n &__check {\n position: absolute;\n border: 2px solid $baseColor;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background-color: $colorWhite;\n top: 50%;\n left: 0;\n transform: translate(0, -50%);\n transition-property: border-color, background-color, transform;\n transition-duration: $baseTransitionAnimationSpeed;\n }\n\n &__label {\n display: inline-block;\n color: $baseColor;\n transition: color $baseTransitionAnimationSpeed;\n line-height: 24px;\n\n &:empty {\n display: none;\n }\n }\n\n /* Hover / Focus / Checked */\n\n &__input:checked ~ &__mark {\n background-color: $colorPrimary48;\n }\n\n &__input:checked ~ &__mark &__check {\n border-color: $colorPrimary;\n background-color: $colorPrimary;\n transform: translate(100%, -50%);\n }\n\n &:hover &__label,\n &__input:checked:hover ~ &__label {\n color: $colorPrimaryHover;\n }\n\n &__input:checked ~ &__label {\n color: $colorPrimary;\n }\n\n &:hover &__mark &__check,\n &__input:focus:hover ~ &__mark &__check,\n &__input:checked:hover ~ &__mark &__check,\n &__input:checked:focus ~ &__mark &__check {\n border-color: $colorPrimaryHover;\n }\n\n\n &__input:checked:hover ~ &__mark &__check,\n &__input:checked:focus ~ &__mark &__check {\n background-color: $colorPrimaryHover;\n }\n\n /* Label right */\n\n &--has-label-right &__label {\n margin-left: space('xsmall');\n }\n\n /* Label left */\n\n &--has-label-left &__field-wrapper {\n flex-direction: row-reverse;\n }\n\n &--has-label-left &__label {\n margin-right: space('xsmall');\n }\n\n /* Invalid */\n\n &--is-invalid &__input ~ &__label {\n color: $colorError;\n }\n\n &--is-invalid &__input ~ &__mark &__check {\n border-color: $colorError;\n }\n\n &--is-invalid &__input:checked ~ &__mark {\n background-color: $colorBlack8;\n }\n\n &--is-invalid &__input:checked ~ &__mark &__check {\n background-color: $colorError;\n }\n\n /* Disabled */\n\n\t&--is-disabled &__field-wrapper {\n cursor: not-allowed;\n }\n\n &--is-disabled &__input ~ &__label {\n color: $formDisabledColor;\n }\n\n &--is-disabled &__input ~ &__mark &__check {\n border-color: $colorGrey13;\n }\n\n &--is-disabled &__input:checked ~ &__mark {\n background-color: $formDisabledBackgroundColor;\n }\n\n &--is-disabled &__input:checked ~ &__mark &__check {\n background-color: $colorGrey25;\n border-color: $colorGrey25;\n }\n}\n","import {\n Host,\n Component,\n Prop,\n Event,\n EventEmitter,\n Element,\n Method,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhToggleChangeEvent,\n StzhToggleFocusEvent,\n StzhToggleBlurEvent\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 toggleCounter = 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-toggle\",\n styleUrl: \"stzh-toggle.scss\",\n scoped: true\n})\nexport class StzhToggle {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the toggle is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Name of the input element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** 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 /** Position of label */\n @Prop({ reflect: true }) labelPosition: \"right\" | \"left\" = \"right\";\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 input (this will be overwritten if description prop or slot is used) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhToggleChangeEvent>;\n\n /** Focus event */\n @Event() stzhFocus: EventEmitter<StzhToggleFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhToggleBlurEvent>;\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-toggle\",\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-toggle\",\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-toggle\",\n originalEvent: event\n });\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-toggle-${toggleCounter++}`;\n\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, 'toggle');\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-toggle\": true,\n \"stzh-toggle--has-error\": errorUsed,\n \"stzh-toggle--is-required\": this.required,\n \"stzh-toggle--is-invalid\": this.invalid,\n \"stzh-toggle--is-disabled\": this.disabled,\n \"stzh-toggle--has-description\": descriptionUsed,\n \"stzh-toggle--has-description-long\": descriptionLongUsed,\n [`stzh-toggle--has-label-${this.labelPosition}`]: !!this.labelPosition\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <label class=\"stzh-toggle__field-wrapper\">\n <input\n class=\"stzh-toggle__input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n type=\"checkbox\"\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-toggle__mark\">\n <div class=\"stzh-toggle__check\"></div>\n </div>\n <div class=\"stzh-toggle__label\">\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-toggle__marker\">\n <span class=\"stzh-toggle__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-toggle__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-toggle\"\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"],"version":3}
|
|
1
|
+
{"file":"stzh-toggle.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,y1QAAy1Q;;ACuB/2Q,IAAI,aAAa,GAAG,CAAC,CAAC;MAaT,UAAU;;;;;;IAoFb,mBAAc,GAAY,KAAK,CAAC;IAEhC,YAAO,GAAG,CAAC,KAAiB;MAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;MAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;OACtB,CAAC,CAAC;KACJ,CAAA;IAEO,gBAAW,GAAG;MACpB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;OACjB;MAED,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;KAC7B,CAAA;IAEO,YAAO,GAAG,CAAC,KAAiB;MAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;MAE3B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE;QACzC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;OAClB,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EACRA,QAACE,yCAAoB,IACnB,WAAW,EAAC,aAAa,EACzB,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,EACP;GACH;;;;;;;;;;","names":["fetchTranslations","hasSlot","h","Host","StzhInputDescription"],"sources":["./src/components/stzh-toggle/stzh-toggle.scss?tag=stzh-toggle&encapsulation=scoped","./src/components/stzh-toggle/stzh-toggle.tsx"],"sourcesContent":[":host {\n display: inline-block;\n\n ::slotted(stzh-text) {\n --color: inherit;\n }\n}\n\n.stzh-toggle {\n @include input-description;\n\n &__field-wrapper {\n @include fontSize('milli');\n position: relative;\n display: flex;\n user-select: none;\n cursor: pointer;\n }\n\n &__input {\n @include visuallyhiddenInput;\n border-radius: $formInputBorderRadius;\n }\n\n &__mark {\n position: relative;\n background-color: $colorBlack8;\n width: 44px;\n height: 16px;\n flex-shrink: 0;\n border-radius: 12px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n transition: background-color $baseTransitionAnimationSpeed;\n margin-top: 4px;\n }\n\n &__check {\n position: absolute;\n border: 2px solid $baseColor;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background-color: $colorWhite;\n top: 50%;\n left: 0;\n transform: translate(0, -50%);\n transition-property: border-color, background-color, transform;\n transition-duration: $baseTransitionAnimationSpeed;\n }\n\n &__label {\n display: inline-block;\n color: $baseColor;\n transition: color $baseTransitionAnimationSpeed;\n line-height: 24px;\n\n &:empty {\n display: none;\n }\n }\n\n /* Hover / Focus / Checked */\n\n &__input:checked ~ &__mark {\n background-color: $colorPrimary48;\n }\n\n &__input:checked ~ &__mark &__check {\n border-color: $colorPrimary;\n background-color: $colorPrimary;\n transform: translate(100%, -50%);\n }\n\n &:hover &__label,\n &__input:checked:hover ~ &__label {\n color: $colorPrimaryHover;\n }\n\n &__input:checked ~ &__label {\n color: $colorPrimary;\n }\n\n &:hover &__mark &__check,\n &__input:focus:hover ~ &__mark &__check,\n &__input:checked:hover ~ &__mark &__check,\n &__input:checked:focus ~ &__mark &__check {\n border-color: $colorPrimaryHover;\n }\n\n\n &__input:checked:hover ~ &__mark &__check,\n &__input:checked:focus ~ &__mark &__check {\n background-color: $colorPrimaryHover;\n }\n\n /* Label right */\n\n &--has-label-right &__label {\n margin-left: space('xsmall');\n }\n\n /* Label left */\n\n &--has-label-left &__field-wrapper {\n flex-direction: row-reverse;\n }\n\n &--has-label-left &__label {\n margin-right: space('xsmall');\n }\n\n /* Invalid */\n\n &--is-invalid &__input ~ &__label {\n color: $colorError;\n }\n\n &--is-invalid &__input ~ &__mark &__check {\n border-color: $colorError;\n }\n\n &--is-invalid &__input:checked ~ &__mark {\n background-color: $colorBlack8;\n }\n\n &--is-invalid &__input:checked ~ &__mark &__check {\n background-color: $colorError;\n }\n\n /* Disabled */\n\n\t&--is-disabled &__field-wrapper {\n cursor: not-allowed;\n }\n\n &--is-disabled &__input ~ &__label {\n color: $formDisabledColor;\n }\n\n &--is-disabled &__input ~ &__mark &__check {\n border-color: $colorGrey13;\n }\n\n &--is-disabled &__input:checked ~ &__mark {\n background-color: $formDisabledBackgroundColor;\n }\n\n &--is-disabled &__input:checked ~ &__mark &__check {\n background-color: $colorGrey25;\n border-color: $colorGrey25;\n }\n}\n","import {\n Host,\n Component,\n Prop,\n Event,\n EventEmitter,\n Element,\n Method,\n h,\n Watch\n} from \"@stencil/core\";\n\nimport {\n StzhToggleChangeEvent,\n StzhToggleFocusEvent,\n StzhToggleBlurEvent\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 toggleCounter = 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-toggle\",\n styleUrl: \"stzh-toggle.scss\",\n scoped: true\n})\nexport class StzhToggle {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the toggle is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Name of the input element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** 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 /** Position of label */\n @Prop({ reflect: true }) labelPosition: \"right\" | \"left\" = \"right\";\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 input (this will be overwritten if description prop or slot is used) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Focus input field */\n @Method()\n async setFocus() {\n this.input.focus();\n }\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhToggleChangeEvent>;\n\n /** Focus event */\n @Event() stzhFocus: EventEmitter<StzhToggleFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhToggleBlurEvent>;\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-toggle\",\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-toggle\",\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-toggle\",\n originalEvent: event\n });\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-toggle-${toggleCounter++}`;\n\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, 'toggle');\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-toggle\": true,\n \"stzh-toggle--has-error\": errorUsed,\n \"stzh-toggle--is-required\": this.required,\n \"stzh-toggle--is-invalid\": this.invalid,\n \"stzh-toggle--is-disabled\": this.disabled,\n \"stzh-toggle--has-description\": descriptionUsed,\n \"stzh-toggle--has-description-long\": descriptionLongUsed,\n [`stzh-toggle--has-label-${this.labelPosition}`]: !!this.labelPosition\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <label class=\"stzh-toggle__field-wrapper\">\n <input\n class=\"stzh-toggle__input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n type=\"checkbox\"\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-toggle__mark\">\n <div class=\"stzh-toggle__check\"></div>\n </div>\n <div class=\"stzh-toggle__label\">\n {this.label ? this.label : <slot></slot>}\n {this.showMarker &&\n <span class=\"stzh-toggle__marker\">\n <span class=\"stzh-toggle__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-toggle__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-toggle\"\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"],"version":3}
|
|
@@ -8683,10 +8683,14 @@ var Dropzone = /*#__PURE__*/function (_Emitter) {
|
|
|
8683
8683
|
}, {
|
|
8684
8684
|
key: "removeFile",
|
|
8685
8685
|
value: function removeFile(file) {
|
|
8686
|
-
var
|
|
8686
|
+
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
8687
8687
|
|
|
8688
|
-
if (!
|
|
8689
|
-
|
|
8688
|
+
if (!force) {
|
|
8689
|
+
var executeRemove = this.emit("removefile", file);
|
|
8690
|
+
|
|
8691
|
+
if (!executeRemove) {
|
|
8692
|
+
return false;
|
|
8693
|
+
}
|
|
8690
8694
|
}
|
|
8691
8695
|
|
|
8692
8696
|
if (file.status === Dropzone.UPLOADING) {
|
|
@@ -8694,7 +8698,7 @@ var Dropzone = /*#__PURE__*/function (_Emitter) {
|
|
|
8694
8698
|
}
|
|
8695
8699
|
|
|
8696
8700
|
this.files = without(this.files, file);
|
|
8697
|
-
this.emit("removedfile", file);
|
|
8701
|
+
this.emit("removedfile", file, force);
|
|
8698
8702
|
|
|
8699
8703
|
if (this.files.length === 0) {
|
|
8700
8704
|
this.emit("reset");
|
|
@@ -8706,6 +8710,8 @@ var Dropzone = /*#__PURE__*/function (_Emitter) {
|
|
|
8706
8710
|
}, {
|
|
8707
8711
|
key: "removeAllFiles",
|
|
8708
8712
|
value: function removeAllFiles(cancelIfNecessary) {
|
|
8713
|
+
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
8714
|
+
|
|
8709
8715
|
// Create a copy of files since removeFile() changes the @files array.
|
|
8710
8716
|
if (cancelIfNecessary == null) {
|
|
8711
8717
|
cancelIfNecessary = false;
|
|
@@ -8719,7 +8725,7 @@ var Dropzone = /*#__PURE__*/function (_Emitter) {
|
|
|
8719
8725
|
var file = _step9.value;
|
|
8720
8726
|
|
|
8721
8727
|
if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
|
|
8722
|
-
this.removeFile(file);
|
|
8728
|
+
this.removeFile(file, force);
|
|
8723
8729
|
}
|
|
8724
8730
|
}
|
|
8725
8731
|
} catch (err) {
|
|
@@ -10468,6 +10474,12 @@ const StzhUpload = class {
|
|
|
10468
10474
|
async processQueue() {
|
|
10469
10475
|
return this.dropzone.processQueue();
|
|
10470
10476
|
}
|
|
10477
|
+
async removeFile(file, force = false) {
|
|
10478
|
+
return this.dropzone.removeFile(file, force);
|
|
10479
|
+
}
|
|
10480
|
+
async removeAllFiles(onlyCancelCurrentlyUploadingFiles = false, force = false) {
|
|
10481
|
+
return this.dropzone.removeAllFiles(onlyCancelCurrentlyUploadingFiles, force);
|
|
10482
|
+
}
|
|
10471
10483
|
async componentWillLoad() {
|
|
10472
10484
|
this.uploadId = `stzh-upload-${uploadCounter++}`;
|
|
10473
10485
|
this.existingFilesWatcher(this.existingFiles);
|
|
@@ -10690,8 +10702,8 @@ const StzhUpload = class {
|
|
|
10690
10702
|
this.dropzone.on("removefile", (file) => this.stzhFileRemove.emit({
|
|
10691
10703
|
component: "stzh-upload", file
|
|
10692
10704
|
}).defaultPrevented === false);
|
|
10693
|
-
this.dropzone.on("removedfile", (file) => this.stzhFileRemoved.emit({
|
|
10694
|
-
component: "stzh-upload", file
|
|
10705
|
+
this.dropzone.on("removedfile", (file, force) => this.stzhFileRemoved.emit({
|
|
10706
|
+
component: "stzh-upload", file, force
|
|
10695
10707
|
}));
|
|
10696
10708
|
this.dropzone.on("sending", (file, xhr, formData) => this.stzhSending.emit({
|
|
10697
10709
|
component: "stzh-upload", file, xhr, formData
|