@six-group/ui-library 0.0.0-insider.d833923 → 0.0.0-insider.d9aec2b
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/{form-control-b6ca8224.js → form-control-de259450.js} +2 -2
- package/dist/cjs/{form-control-b6ca8224.js.map → form-control-de259450.js.map} +1 -1
- package/dist/cjs/{index-5bfcf88b.js → index-1f707a55.js} +469 -14
- package/dist/cjs/index-1f707a55.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/six-alert.cjs.entry.js +1 -1
- package/dist/cjs/six-avatar.cjs.entry.js +1 -1
- package/dist/cjs/six-badge.cjs.entry.js +1 -1
- package/dist/cjs/six-button.cjs.entry.js +1 -1
- package/dist/cjs/six-card.cjs.entry.js +1 -1
- package/dist/cjs/six-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/six-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +2 -2
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-details.cjs.entry.js +1 -1
- package/dist/cjs/six-dialog.cjs.entry.js +1 -1
- package/dist/cjs/six-drawer.cjs.entry.js +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/six-error-page.cjs.entry.js +1 -1
- package/dist/cjs/six-error.cjs.entry.js +1 -1
- package/dist/cjs/six-file-list-item.cjs.entry.js +1 -1
- package/dist/cjs/six-file-list.cjs.entry.js +1 -1
- package/dist/cjs/six-file-upload.cjs.entry.js +32 -8
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/six-footer.cjs.entry.js +1 -1
- package/dist/cjs/six-group-label.cjs.entry.js +2 -2
- package/dist/cjs/six-header.cjs.entry.js +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/six-icon.cjs.entry.js +1 -1
- package/dist/cjs/six-input.cjs.entry.js +2 -2
- package/dist/cjs/six-item-picker.cjs.entry.js +1 -1
- package/dist/cjs/six-language-switcher.cjs.entry.js +7 -3
- package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
- package/dist/cjs/six-layout-grid.cjs.entry.js +1 -1
- package/dist/cjs/six-main-container.cjs.entry.js +1 -1
- package/dist/cjs/six-menu-divider.cjs.entry.js +1 -1
- package/dist/cjs/six-menu-label.cjs.entry.js +1 -1
- package/dist/cjs/six-picto.cjs.entry.js +1 -1
- package/dist/cjs/six-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/six-progress-ring.cjs.entry.js +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +1 -1
- package/dist/cjs/six-range.cjs.entry.js +2 -2
- package/dist/cjs/six-root.cjs.entry.js +1 -1
- package/dist/cjs/six-search-field.cjs.entry.js +1 -1
- package/dist/cjs/six-select.cjs.entry.js +11 -8
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +2 -2
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar-item.cjs.entry.js +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/six-spinner.cjs.entry.js +1 -1
- package/dist/cjs/six-stage-indicator.cjs.entry.js +1 -1
- package/dist/cjs/six-switch.cjs.entry.js +2 -2
- package/dist/cjs/six-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/six-tab.cjs.entry.js +2 -2
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +2 -2
- package/dist/cjs/six-tile.cjs.entry.js +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ui-library.cjs.js +3 -3
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +2 -0
- package/dist/collection/components/six-datepicker/six-datepicker.js +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-file-upload/six-file-upload.css +11 -0
- package/dist/collection/components/six-file-upload/six-file-upload.js +87 -7
- package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
- package/dist/collection/components/six-file-upload/test/six-file-upload.spec.js +187 -24
- package/dist/collection/components/six-file-upload/test/six-file-upload.spec.js.map +1 -1
- package/dist/collection/components/six-language-switcher/six-language-switcher.css +4 -0
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +5 -1
- package/dist/collection/components/six-language-switcher/six-language-switcher.js.map +1 -1
- package/dist/collection/components/six-language-switcher/test/six-language-switcher.spec.js +12 -12
- package/dist/collection/components/six-language-switcher/test/six-language-switcher.spec.js.map +1 -1
- package/dist/collection/components/six-select/six-select.js +9 -6
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +1 -0
- package/dist/collection/components/six-tab/six-tab.js +1 -1
- package/dist/collection/components/six-tab/six-tab.js.map +1 -1
- package/dist/components/six-checkbox2.js +1 -1
- package/dist/components/six-checkbox2.js.map +1 -1
- package/dist/components/six-datepicker.js +1 -1
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-file-upload.js +51 -11
- package/dist/components/six-file-upload.js.map +1 -1
- package/dist/components/six-language-switcher.js +6 -2
- package/dist/components/six-language-switcher.js.map +1 -1
- package/dist/components/six-select.js +9 -6
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar-item-group.js +1 -1
- package/dist/components/six-sidebar-item-group.js.map +1 -1
- package/dist/components/six-tab.js +1 -1
- package/dist/components/six-tab.js.map +1 -1
- package/dist/components.json +98 -8
- package/dist/esm/{form-control-5d3cf9d4.js → form-control-30c5bd8b.js} +2 -2
- package/dist/esm/{form-control-5d3cf9d4.js.map → form-control-30c5bd8b.js.map} +1 -1
- package/dist/esm/{index-d415464d.js → index-5390c1d6.js} +469 -14
- package/dist/esm/index-5390c1d6.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/six-alert.entry.js +1 -1
- package/dist/esm/six-avatar.entry.js +1 -1
- package/dist/esm/six-badge.entry.js +1 -1
- package/dist/esm/six-button.entry.js +1 -1
- package/dist/esm/six-card.entry.js +1 -1
- package/dist/esm/six-checkbox_2.entry.js +3 -3
- package/dist/esm/six-checkbox_2.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +2 -2
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-details.entry.js +1 -1
- package/dist/esm/six-dialog.entry.js +1 -1
- package/dist/esm/six-drawer.entry.js +1 -1
- package/dist/esm/six-dropdown_2.entry.js +1 -1
- package/dist/esm/six-error-page.entry.js +1 -1
- package/dist/esm/six-error.entry.js +1 -1
- package/dist/esm/six-file-list-item.entry.js +1 -1
- package/dist/esm/six-file-list.entry.js +1 -1
- package/dist/esm/six-file-upload.entry.js +32 -8
- package/dist/esm/six-file-upload.entry.js.map +1 -1
- package/dist/esm/six-footer.entry.js +1 -1
- package/dist/esm/six-group-label.entry.js +2 -2
- package/dist/esm/six-header.entry.js +1 -1
- package/dist/esm/six-icon-button.entry.js +1 -1
- package/dist/esm/six-icon.entry.js +1 -1
- package/dist/esm/six-input.entry.js +2 -2
- package/dist/esm/six-item-picker.entry.js +1 -1
- package/dist/esm/six-language-switcher.entry.js +7 -3
- package/dist/esm/six-language-switcher.entry.js.map +1 -1
- package/dist/esm/six-layout-grid.entry.js +1 -1
- package/dist/esm/six-main-container.entry.js +1 -1
- package/dist/esm/six-menu-divider.entry.js +1 -1
- package/dist/esm/six-menu-label.entry.js +1 -1
- package/dist/esm/six-picto.entry.js +1 -1
- package/dist/esm/six-progress-bar.entry.js +1 -1
- package/dist/esm/six-progress-ring.entry.js +1 -1
- package/dist/esm/six-radio.entry.js +1 -1
- package/dist/esm/six-range.entry.js +2 -2
- package/dist/esm/six-root.entry.js +1 -1
- package/dist/esm/six-search-field.entry.js +1 -1
- package/dist/esm/six-select.entry.js +11 -8
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar-item-group.entry.js +2 -2
- package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
- package/dist/esm/six-sidebar-item.entry.js +1 -1
- package/dist/esm/six-sidebar.entry.js +1 -1
- package/dist/esm/six-spinner.entry.js +1 -1
- package/dist/esm/six-stage-indicator.entry.js +1 -1
- package/dist/esm/six-switch.entry.js +2 -2
- package/dist/esm/six-tab-group.entry.js +1 -1
- package/dist/esm/six-tab-panel.entry.js +1 -1
- package/dist/esm/six-tab.entry.js +2 -2
- package/dist/esm/six-tab.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +1 -1
- package/dist/esm/six-textarea.entry.js +2 -2
- package/dist/esm/six-tile.entry.js +1 -1
- package/dist/esm/six-timepicker.entry.js +1 -1
- package/dist/esm/six-tooltip.entry.js +1 -1
- package/dist/esm/ui-library.js +4 -4
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +10 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/ui-library/{p-7130a678.entry.js → p-030fa1fa.entry.js} +2 -2
- package/dist/ui-library/{p-0a71815c.entry.js → p-03d1b956.entry.js} +2 -2
- package/dist/ui-library/{p-71a4a398.entry.js → p-047d02ad.entry.js} +2 -2
- package/dist/ui-library/p-05eb1bab.js +3 -0
- package/dist/ui-library/p-05eb1bab.js.map +1 -0
- package/dist/ui-library/{p-cec88a79.entry.js → p-060069d4.entry.js} +2 -2
- package/dist/ui-library/{p-fe483fc6.entry.js → p-06ba653e.entry.js} +2 -2
- package/dist/ui-library/{p-a995283c.entry.js → p-07c8de65.entry.js} +2 -2
- package/dist/ui-library/{p-d15331e7.entry.js → p-0fb3fb30.entry.js} +2 -2
- package/dist/ui-library/p-14e5fccc.entry.js +2 -0
- package/dist/ui-library/p-14e5fccc.entry.js.map +1 -0
- package/dist/ui-library/{p-2e7312fc.entry.js → p-16fb5aad.entry.js} +2 -2
- package/dist/ui-library/{p-2e7312fc.entry.js.map → p-16fb5aad.entry.js.map} +1 -1
- package/dist/ui-library/{p-254d32bf.entry.js → p-189602e4.entry.js} +2 -2
- package/dist/ui-library/{p-195619ed.entry.js → p-19560508.entry.js} +2 -2
- package/dist/ui-library/{p-bca7a8c8.entry.js → p-2386627e.entry.js} +2 -2
- package/dist/ui-library/p-2c25cb61.entry.js +2 -0
- package/dist/ui-library/p-2c25cb61.entry.js.map +1 -0
- package/dist/ui-library/{p-8af4ae3e.entry.js → p-3603dd96.entry.js} +2 -2
- package/dist/ui-library/{p-a0e324ad.entry.js → p-39ff5f61.entry.js} +2 -2
- package/dist/ui-library/{p-9e14b37a.entry.js → p-3b5a76ea.entry.js} +2 -2
- package/dist/ui-library/{p-b863dcc4.entry.js → p-419ed003.entry.js} +2 -2
- package/dist/ui-library/{p-6741b418.entry.js → p-45003bae.entry.js} +2 -2
- package/dist/ui-library/{p-9e0f0562.entry.js → p-4963f03c.entry.js} +2 -2
- package/dist/ui-library/{p-e6db01a9.entry.js → p-4d89932f.entry.js} +2 -2
- package/dist/ui-library/{p-6ee48e81.js → p-605bdd81.js} +2 -2
- package/dist/ui-library/{p-a4e3f4e5.entry.js → p-63acceb6.entry.js} +2 -2
- package/dist/ui-library/{p-e5c08d9f.entry.js → p-6888b9ee.entry.js} +2 -2
- package/dist/ui-library/{p-5b8a5a21.entry.js → p-6f9153be.entry.js} +2 -2
- package/dist/ui-library/{p-c46013f4.entry.js → p-73be87a7.entry.js} +2 -2
- package/dist/ui-library/{p-5cde0403.entry.js → p-7561b336.entry.js} +2 -2
- package/dist/ui-library/{p-46817c94.entry.js → p-7c18b8ca.entry.js} +2 -2
- package/dist/ui-library/p-82bd8781.entry.js +2 -0
- package/dist/ui-library/p-82bd8781.entry.js.map +1 -0
- package/dist/ui-library/{p-7254e090.entry.js → p-89db9a8b.entry.js} +2 -2
- package/dist/ui-library/{p-6bf442d5.entry.js → p-8f1d3461.entry.js} +2 -2
- package/dist/ui-library/{p-a31dfc45.entry.js → p-9bc1639b.entry.js} +2 -2
- package/dist/ui-library/{p-b4f81f97.entry.js → p-9cb83369.entry.js} +2 -2
- package/dist/ui-library/{p-f1dcaab0.entry.js → p-a398e3eb.entry.js} +2 -2
- package/dist/ui-library/{p-25b9dacc.entry.js → p-a7e2f511.entry.js} +2 -2
- package/dist/ui-library/{p-6adcd790.entry.js → p-a8863197.entry.js} +2 -2
- package/dist/ui-library/{p-9ddaa7e2.entry.js → p-a9e009af.entry.js} +2 -2
- package/dist/ui-library/{p-a627f6e0.entry.js → p-ac00076d.entry.js} +2 -2
- package/dist/ui-library/{p-957a36f7.entry.js → p-b10652dd.entry.js} +2 -2
- package/dist/ui-library/{p-3f84b852.entry.js → p-b4bc4915.entry.js} +2 -2
- package/dist/ui-library/{p-f2320c65.entry.js → p-b5acf54d.entry.js} +2 -2
- package/dist/ui-library/{p-9effba13.entry.js → p-b60c20aa.entry.js} +2 -2
- package/dist/ui-library/p-b60c632a.entry.js +2 -0
- package/dist/ui-library/{p-f4c61910.entry.js.map → p-b60c632a.entry.js.map} +1 -1
- package/dist/ui-library/p-c1d68730.entry.js +2 -0
- package/dist/ui-library/p-c1d68730.entry.js.map +1 -0
- package/dist/ui-library/{p-29b50eae.entry.js → p-c35a7cef.entry.js} +2 -2
- package/dist/ui-library/{p-a69ba529.entry.js → p-c62893e5.entry.js} +2 -2
- package/dist/ui-library/{p-65b32e2b.entry.js → p-c6464bfe.entry.js} +2 -2
- package/dist/ui-library/{p-65b32e2b.entry.js.map → p-c6464bfe.entry.js.map} +1 -1
- package/dist/ui-library/{p-9a4cc473.entry.js → p-cf109cbf.entry.js} +2 -2
- package/dist/ui-library/{p-57d3562c.entry.js → p-d07b549f.entry.js} +2 -2
- package/dist/ui-library/{p-51530e6d.entry.js → p-d42f1ea9.entry.js} +2 -2
- package/dist/ui-library/{p-35510b9d.entry.js → p-fe37dadf.entry.js} +2 -2
- package/dist/ui-library/{p-d668844e.entry.js → p-fe89a7c4.entry.js} +2 -2
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/index-5bfcf88b.js.map +0 -1
- package/dist/esm/index-d415464d.js.map +0 -1
- package/dist/ui-library/p-00c784f9.entry.js +0 -2
- package/dist/ui-library/p-00c784f9.entry.js.map +0 -1
- package/dist/ui-library/p-2b7e2bcb.entry.js +0 -2
- package/dist/ui-library/p-2b7e2bcb.entry.js.map +0 -1
- package/dist/ui-library/p-2f586b01.entry.js +0 -2
- package/dist/ui-library/p-2f586b01.entry.js.map +0 -1
- package/dist/ui-library/p-5ea7ffad.entry.js +0 -2
- package/dist/ui-library/p-5ea7ffad.entry.js.map +0 -1
- package/dist/ui-library/p-e8d5a789.js +0 -3
- package/dist/ui-library/p-e8d5a789.js.map +0 -1
- package/dist/ui-library/p-f4c61910.entry.js +0 -2
- /package/dist/ui-library/{p-7130a678.entry.js.map → p-030fa1fa.entry.js.map} +0 -0
- /package/dist/ui-library/{p-0a71815c.entry.js.map → p-03d1b956.entry.js.map} +0 -0
- /package/dist/ui-library/{p-71a4a398.entry.js.map → p-047d02ad.entry.js.map} +0 -0
- /package/dist/ui-library/{p-cec88a79.entry.js.map → p-060069d4.entry.js.map} +0 -0
- /package/dist/ui-library/{p-fe483fc6.entry.js.map → p-06ba653e.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a995283c.entry.js.map → p-07c8de65.entry.js.map} +0 -0
- /package/dist/ui-library/{p-d15331e7.entry.js.map → p-0fb3fb30.entry.js.map} +0 -0
- /package/dist/ui-library/{p-254d32bf.entry.js.map → p-189602e4.entry.js.map} +0 -0
- /package/dist/ui-library/{p-195619ed.entry.js.map → p-19560508.entry.js.map} +0 -0
- /package/dist/ui-library/{p-bca7a8c8.entry.js.map → p-2386627e.entry.js.map} +0 -0
- /package/dist/ui-library/{p-8af4ae3e.entry.js.map → p-3603dd96.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a0e324ad.entry.js.map → p-39ff5f61.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9e14b37a.entry.js.map → p-3b5a76ea.entry.js.map} +0 -0
- /package/dist/ui-library/{p-b863dcc4.entry.js.map → p-419ed003.entry.js.map} +0 -0
- /package/dist/ui-library/{p-6741b418.entry.js.map → p-45003bae.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9e0f0562.entry.js.map → p-4963f03c.entry.js.map} +0 -0
- /package/dist/ui-library/{p-e6db01a9.entry.js.map → p-4d89932f.entry.js.map} +0 -0
- /package/dist/ui-library/{p-6ee48e81.js.map → p-605bdd81.js.map} +0 -0
- /package/dist/ui-library/{p-a4e3f4e5.entry.js.map → p-63acceb6.entry.js.map} +0 -0
- /package/dist/ui-library/{p-e5c08d9f.entry.js.map → p-6888b9ee.entry.js.map} +0 -0
- /package/dist/ui-library/{p-5b8a5a21.entry.js.map → p-6f9153be.entry.js.map} +0 -0
- /package/dist/ui-library/{p-c46013f4.entry.js.map → p-73be87a7.entry.js.map} +0 -0
- /package/dist/ui-library/{p-5cde0403.entry.js.map → p-7561b336.entry.js.map} +0 -0
- /package/dist/ui-library/{p-46817c94.entry.js.map → p-7c18b8ca.entry.js.map} +0 -0
- /package/dist/ui-library/{p-7254e090.entry.js.map → p-89db9a8b.entry.js.map} +0 -0
- /package/dist/ui-library/{p-6bf442d5.entry.js.map → p-8f1d3461.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a31dfc45.entry.js.map → p-9bc1639b.entry.js.map} +0 -0
- /package/dist/ui-library/{p-b4f81f97.entry.js.map → p-9cb83369.entry.js.map} +0 -0
- /package/dist/ui-library/{p-f1dcaab0.entry.js.map → p-a398e3eb.entry.js.map} +0 -0
- /package/dist/ui-library/{p-25b9dacc.entry.js.map → p-a7e2f511.entry.js.map} +0 -0
- /package/dist/ui-library/{p-6adcd790.entry.js.map → p-a8863197.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9ddaa7e2.entry.js.map → p-a9e009af.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a627f6e0.entry.js.map → p-ac00076d.entry.js.map} +0 -0
- /package/dist/ui-library/{p-957a36f7.entry.js.map → p-b10652dd.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3f84b852.entry.js.map → p-b4bc4915.entry.js.map} +0 -0
- /package/dist/ui-library/{p-f2320c65.entry.js.map → p-b5acf54d.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9effba13.entry.js.map → p-b60c20aa.entry.js.map} +0 -0
- /package/dist/ui-library/{p-29b50eae.entry.js.map → p-c35a7cef.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a69ba529.entry.js.map → p-c62893e5.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9a4cc473.entry.js.map → p-cf109cbf.entry.js.map} +0 -0
- /package/dist/ui-library/{p-57d3562c.entry.js.map → p-d07b549f.entry.js.map} +0 -0
- /package/dist/ui-library/{p-51530e6d.entry.js.map → p-d42f1ea9.entry.js.map} +0 -0
- /package/dist/ui-library/{p-35510b9d.entry.js.map → p-fe37dadf.entry.js.map} +0 -0
- /package/dist/ui-library/{p-d668844e.entry.js.map → p-fe89a7c4.entry.js.map} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { h as hasSlot } from './slot.js';
|
|
3
|
+
import { d as defineCustomElement$4 } from './six-error2.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './six-icon2.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './six-spinner2.js';
|
|
3
6
|
|
|
4
|
-
const sixFileUploadCss = ".sc-six-file-upload-h{position:relative;box-sizing:border-box}.sc-six-file-upload-h *.sc-six-file-upload,.sc-six-file-upload-h *.sc-six-file-upload:before,.sc-six-file-upload-h *.sc-six-file-upload:after{box-sizing:border-box}.sc-six-file-upload-h{position:static;display:block}.six-file-upload.sc-six-file-upload six-card.sc-six-file-upload{box-shadow:none;padding:0;width:100%}.six-file-upload__label--highlighted.sc-six-file-upload{color:var(--six-color-action-600)}.six-file-upload__container--full.sc-six-file-upload{border:dashed 1px var(--six-color-web-rock-500)}.six-file-upload__label-icon.sc-six-file-upload{margin-right:0.5rem}.six-file-upload__drop-zone.sc-six-file-upload{padding:2rem 0;display:flex;justify-content:center;width:100%;transition:background-color 0.3s}.six-file-upload__drop-zone--compact.sc-six-file-upload{padding:0}.six-file-upload__input.sc-six-file-upload{cursor:pointer;position:absolute;top:0;left:0;width:100%;user-select:none;height:100%;opacity:0;outline:none}.six-file-upload--disabled.sc-six-file-upload .six-file-upload__drop-zone.sc-six-file-upload{background-color:var(--six-color-inactive)}.six-file-upload.sc-six-file-upload:not(.six-file-upload--disabled) .six-file-upload__drop-zone.sc-six-file-upload:hover,.six-file-upload__drop-zone--hover.sc-six-file-upload{background-color:var(--six-color-action-light-to-be-defined)}.six-file-upload.sc-six-file-upload:not(.six-file-upload--disabled) .six-file-upload__drop-zone.sc-six-file-upload:hover.six-file-upload__drop-zone--compact,.six-file-upload__drop-zone--hover.six-file-upload__drop-zone--compact.sc-six-file-upload{background-color:inherit}.six-file-upload--disabled.sc-six-file-upload .six-file-upload__input.sc-six-file-upload{cursor:not-allowed}";
|
|
7
|
+
const sixFileUploadCss = ".sc-six-file-upload-h{position:relative;box-sizing:border-box}.sc-six-file-upload-h *.sc-six-file-upload,.sc-six-file-upload-h *.sc-six-file-upload:before,.sc-six-file-upload-h *.sc-six-file-upload:after{box-sizing:border-box}.sc-six-file-upload-h{position:static;display:block}.six-file-upload.sc-six-file-upload six-card.sc-six-file-upload{box-shadow:none;padding:0;width:100%}.six-file-upload__label--highlighted.sc-six-file-upload{color:var(--six-color-action-600)}.six-file-upload__container--full.sc-six-file-upload{border:dashed 1px var(--six-color-web-rock-500)}.six-file-upload__label-icon.sc-six-file-upload{margin-right:0.5rem}.six-file-upload__drop-zone.sc-six-file-upload{padding:2rem 0;display:flex;justify-content:center;width:100%;transition:background-color 0.3s}.six-file-upload__drop-zone__spinner-container.sc-six-file-upload{display:flex;align-items:center}.six-file-upload__drop-zone__spinner-container.sc-six-file-upload six-spinner.sc-six-file-upload{margin-right:var(--six-spacing-x-small)}.six-file-upload__drop-zone--compact.sc-six-file-upload{padding:0}.six-file-upload__input.sc-six-file-upload{cursor:pointer;position:absolute;top:0;left:0;width:100%;user-select:none;height:100%;opacity:0;outline:none}.six-file-upload--disabled.sc-six-file-upload .six-file-upload__drop-zone.sc-six-file-upload{background-color:var(--six-color-inactive);cursor:not-allowed}.six-file-upload.sc-six-file-upload:not(.six-file-upload--disabled) .six-file-upload__drop-zone.sc-six-file-upload:hover,.six-file-upload__drop-zone--hover.sc-six-file-upload{background-color:var(--six-color-action-light-to-be-defined)}.six-file-upload.sc-six-file-upload:not(.six-file-upload--disabled) .six-file-upload__drop-zone.sc-six-file-upload:hover.six-file-upload__drop-zone--compact,.six-file-upload__drop-zone--hover.six-file-upload__drop-zone--compact.sc-six-file-upload{background-color:inherit}.six-file-upload--disabled.sc-six-file-upload .six-file-upload__input.sc-six-file-upload{cursor:not-allowed}.six-file-upload__error-text.sc-six-file-upload{font-size:var(--six-input-help-text-font-size-medium)}";
|
|
5
8
|
const SixFileUploadStyle0 = sixFileUploadCss;
|
|
6
9
|
|
|
7
10
|
const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload extends HTMLElement {
|
|
@@ -10,8 +13,19 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
10
13
|
this.__registerHost();
|
|
11
14
|
this.success = createEvent(this, "six-file-upload-success", 7);
|
|
12
15
|
this.failure = createEvent(this, "six-file-upload-failure", 7);
|
|
16
|
+
this.handleSlotChange = () => {
|
|
17
|
+
let validType = false;
|
|
18
|
+
if (this.errorText != null &&
|
|
19
|
+
((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||
|
|
20
|
+
(typeof this.errorText == 'object' && this.errorText.length > 0))) {
|
|
21
|
+
validType = true;
|
|
22
|
+
}
|
|
23
|
+
this.hasError = validType || hasSlot(this.host, 'error-text');
|
|
24
|
+
console.log(this.errorText);
|
|
25
|
+
console.log(this.hasError);
|
|
26
|
+
};
|
|
13
27
|
this.handleFiles = (files) => {
|
|
14
|
-
if (this.disabled || files.length === 0) {
|
|
28
|
+
if (this.disabled || files.length === 0 || this.uploading) {
|
|
15
29
|
return;
|
|
16
30
|
}
|
|
17
31
|
if (!this.multiple && files.length > 1) {
|
|
@@ -46,12 +60,16 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
46
60
|
}
|
|
47
61
|
};
|
|
48
62
|
this.isOver = false;
|
|
63
|
+
this.hasError = false;
|
|
49
64
|
this.compact = false;
|
|
50
65
|
this.label = undefined;
|
|
51
66
|
this.disabled = false;
|
|
52
67
|
this.accept = undefined;
|
|
53
68
|
this.multiple = false;
|
|
54
69
|
this.maxFileSize = undefined;
|
|
70
|
+
this.uploading = false;
|
|
71
|
+
this.errorText = '';
|
|
72
|
+
this.invalid = false;
|
|
55
73
|
}
|
|
56
74
|
dragenterHandler() {
|
|
57
75
|
if (!this.disabled) {
|
|
@@ -76,17 +94,24 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
76
94
|
}
|
|
77
95
|
}
|
|
78
96
|
}
|
|
97
|
+
componentWillLoad() {
|
|
98
|
+
this.handleSlotChange();
|
|
99
|
+
}
|
|
79
100
|
componentDidLoad() {
|
|
101
|
+
var _a;
|
|
80
102
|
['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {
|
|
81
103
|
this.host.addEventListener(eventName, this.preventDefaults, false);
|
|
82
104
|
document.body.addEventListener(eventName, this.preventDefaults, false);
|
|
83
105
|
});
|
|
106
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.addEventListener('slotchange', this.handleSlotChange);
|
|
84
107
|
}
|
|
85
108
|
disconnectedCallback() {
|
|
109
|
+
var _a;
|
|
86
110
|
['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {
|
|
87
111
|
this.host.removeEventListener(eventName, this.preventDefaults, false);
|
|
88
112
|
document.body.removeEventListener(eventName, this.preventDefaults, false);
|
|
89
113
|
});
|
|
114
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
|
|
90
115
|
}
|
|
91
116
|
preventDefaults(e) {
|
|
92
117
|
e.preventDefault();
|
|
@@ -98,41 +123,56 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
98
123
|
}
|
|
99
124
|
render() {
|
|
100
125
|
const Container = this.compact ? 'six-button' : 'six-card';
|
|
101
|
-
|
|
126
|
+
const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
127
|
+
return (h("div", { key: 'aeaeba82e5419d410bb070edc4c14e99658a2024', class: {
|
|
102
128
|
'six-file-upload': true,
|
|
103
|
-
'six-file-upload--disabled': this.disabled,
|
|
104
|
-
} }, h(Container, { key: '
|
|
129
|
+
'six-file-upload--disabled': this.disabled || this.uploading,
|
|
130
|
+
} }, h(Container, { key: '18a2c76f6c1cc07d6a8d69f17fa55df61bcfc486', disabled: this.disabled || this.uploading, "aria-invalid": this.invalid ? 'true' : 'false', class: {
|
|
105
131
|
'six-file-upload__container--compact': this.compact,
|
|
106
132
|
'six-file-upload__container--full': !this.compact,
|
|
107
|
-
} }, this.compact && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '
|
|
133
|
+
} }, this.compact && !this.uploading && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '1c4dee810b517670842708c438e280897b80c32a', class: {
|
|
108
134
|
'six-file-upload__drop-zone': true,
|
|
109
135
|
'six-file-upload__drop-zone--hover': this.isOver,
|
|
110
136
|
'six-file-upload__drop-zone--compact': this.compact,
|
|
111
|
-
} }, h("span", {
|
|
137
|
+
} }, this.uploading ? (h("span", { class: "six-file-upload__drop-zone__spinner-container" }, h("six-spinner", null), " Uploading...")) : (h("div", null, h("span", null, this.renderLabel()), h("input", { class: "six-file-upload__input", type: "file", name: "resume", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.onChange, ref: (el) => (this.fileInput = el) }))))), h("div", { key: '4d8524acc6ab4b919ab8ed469b16d11268ed9994', "aria-hidden": this.invalid ? 'false' : 'true' }, h("slot", { key: '8b104ee4a3feb6c5db255157a5530deeec5dec3d', name: "error-text" }, errorMessages.map((text) => (h("six-error", null, h("div", { class: "six-file-upload__error-text" }, text))))))));
|
|
112
138
|
}
|
|
113
139
|
get host() { return this; }
|
|
114
140
|
static get style() { return SixFileUploadStyle0; }
|
|
115
|
-
}, [
|
|
141
|
+
}, [6, "six-file-upload", {
|
|
116
142
|
"compact": [4],
|
|
117
143
|
"label": [1],
|
|
118
144
|
"disabled": [4],
|
|
119
145
|
"accept": [1],
|
|
120
146
|
"multiple": [4],
|
|
121
147
|
"maxFileSize": [2, "max-file-size"],
|
|
122
|
-
"
|
|
148
|
+
"uploading": [516],
|
|
149
|
+
"errorText": [1, "error-text"],
|
|
150
|
+
"invalid": [516],
|
|
151
|
+
"isOver": [32],
|
|
152
|
+
"hasError": [32]
|
|
123
153
|
}, [[1, "dragenter", "dragenterHandler"], [1, "dragover", "dragoverHandler"], [1, "dragleave", "dragleaveHandler"], [1, "drop", "dropHandler"]]]);
|
|
124
154
|
function defineCustomElement$1() {
|
|
125
155
|
if (typeof customElements === "undefined") {
|
|
126
156
|
return;
|
|
127
157
|
}
|
|
128
|
-
const components = ["six-file-upload", "six-icon"];
|
|
158
|
+
const components = ["six-file-upload", "six-error", "six-icon", "six-spinner"];
|
|
129
159
|
components.forEach(tagName => { switch (tagName) {
|
|
130
160
|
case "six-file-upload":
|
|
131
161
|
if (!customElements.get(tagName)) {
|
|
132
162
|
customElements.define(tagName, SixFileUpload$1);
|
|
133
163
|
}
|
|
134
164
|
break;
|
|
165
|
+
case "six-error":
|
|
166
|
+
if (!customElements.get(tagName)) {
|
|
167
|
+
defineCustomElement$4();
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
135
170
|
case "six-icon":
|
|
171
|
+
if (!customElements.get(tagName)) {
|
|
172
|
+
defineCustomElement$3();
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case "six-spinner":
|
|
136
176
|
if (!customElements.get(tagName)) {
|
|
137
177
|
defineCustomElement$2();
|
|
138
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-file-upload.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,wtDAAwtD,CAAC;AAClvD,4BAAe,gBAAgB;;MC0BlBA,eAAa;;;;;;QA8DhB,gBAAW,GAAG,CAAC,KAAe;YACpC,IAAI,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACvC,OAAO;aACR;YAED,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC,CAAC;aACnE;YAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,IAAI,IAAI,IAAI,EAAE;oBAChB,OAAO;iBACR;gBAED,IAAI,iBAAiB,GAAa,EAAE,CAAC;gBACrC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;oBACvB,iBAAiB,GAAG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"sources":["src/components/six-file-upload/six-file-upload.scss?tag=six-file-upload&encapsulation=scoped","src/components/six-file-upload/six-file-upload.tsx"],"sourcesContent":["@import 'src/global/component';\n\n$over-color: var(--six-color-action-light-to-be-defined);\n$disabled-color: var(--six-color-inactive);\n$transition: 0.3s;\n$margin: 1rem;\n\n:host {\n position: static;\n display: block;\n}\n\n.six-file-upload {\n six-card {\n box-shadow: none;\n padding: 0;\n width: 100%;\n }\n\n &__label {\n &--highlighted {\n color: var(--six-color-action-600);\n }\n }\n\n &__container {\n &--full {\n border: dashed 1px var(--six-color-web-rock-500);\n }\n }\n\n &__label-icon {\n margin-right: 0.5rem;\n }\n\n &__drop-zone {\n padding: 2rem 0;\n display: flex;\n justify-content: center;\n width: 100%;\n transition: background-color $transition;\n\n &--compact {\n padding: 0;\n }\n }\n\n &__input {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n user-select: none;\n height: 100%;\n opacity: 0;\n outline: none;\n }\n\n &--disabled &__drop-zone {\n background-color: $disabled-color;\n }\n\n &:not(.six-file-upload--disabled) &__drop-zone:hover,\n &__drop-zone--hover {\n background-color: $over-color;\n\n &.six-file-upload__drop-zone--compact {\n background-color: inherit;\n }\n }\n\n &--disabled &__input {\n cursor: not-allowed;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\n\ninterface ISingleFile {\n file: File;\n}\n\ninterface IMultipleFiles {\n files: FileList;\n}\n\nexport type SixFileUploadSuccessPayload = ISingleFile | IMultipleFiles;\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler({ dataTransfer }: DragEvent) {\n if (!this.disabled) {\n this.isOver = false;\n if (dataTransfer != null) {\n this.handleFiles(dataTransfer.files);\n }\n }\n }\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({ reason: 'Only one file is allowed.' });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n return this.failure.emit({ reason });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n return this.failure.emit({ reason });\n }\n }\n\n const eventPayload: SixFileUploadSuccessPayload = this.multiple ? { files } : { file: files[0] };\n this.success.emit(eventPayload);\n };\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled,\n }}\n >\n <Container\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && (\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">arrow_circle_up</six-icon>\n </span>\n )}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n </Container>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-file-upload.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,4jEAA4jE,CAAC;AACtlE,4BAAe,gBAAgB;;MC4Bl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,KAC9B,YAAM,IAAI,EAAC,QAAQ,IACjB,gBAAU,KAAK,EAAC,6BAA6B,sBAA2B,CACnE,CACR,EACD,4DACE,KAAK,EAAE;gBACL,4BAA4B,EAAE,IAAI;gBAClC,mCAAmC,EAAE,IAAI,CAAC,MAAM;gBAChD,qCAAqC,EAAE,IAAI,CAAC,OAAO;aACpD,IAEA,IAAI,CAAC,SAAS,IACb,YAAM,KAAK,EAAC,+CAA+C,IACzD,sBAAe,kBACV,KAEP,eACE,gBAAO,IAAI,CAAC,WAAW,EAAE,CAAQ,EACjC,aACE,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,GAClC,CACE,CACP,CACG,CACI,EACZ,2EAAkB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,MAAM,IAC/C,6DAAM,IAAI,EAAC,YAAY,IACpB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,MACtB,qBACE,WAAK,KAAK,EAAC,6BAA6B,IAAE,IAAI,CAAO,CAC3C,CACb,CAAC,CACG,CACH,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixFileUpload"],"sources":["src/components/six-file-upload/six-file-upload.scss?tag=six-file-upload&encapsulation=scoped","src/components/six-file-upload/six-file-upload.tsx"],"sourcesContent":["@import 'src/global/component';\n\n$over-color: var(--six-color-action-light-to-be-defined);\n$disabled-color: var(--six-color-inactive);\n$transition: 0.3s;\n$margin: 1rem;\n\n:host {\n position: static;\n display: block;\n}\n\n.six-file-upload {\n six-card {\n box-shadow: none;\n padding: 0;\n width: 100%;\n }\n\n &__label {\n &--highlighted {\n color: var(--six-color-action-600);\n }\n }\n\n &__container {\n &--full {\n border: dashed 1px var(--six-color-web-rock-500);\n }\n }\n\n &__label-icon {\n margin-right: 0.5rem;\n }\n\n &__drop-zone {\n padding: 2rem 0;\n display: flex;\n justify-content: center;\n width: 100%;\n transition: background-color $transition;\n\n &__spinner-container {\n display: flex;\n align-items: center;\n\n six-spinner {\n margin-right: var(--six-spacing-x-small);\n }\n }\n\n &--compact {\n padding: 0;\n }\n }\n\n &__input {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n user-select: none;\n height: 100%;\n opacity: 0;\n outline: none;\n }\n\n &--disabled &__drop-zone {\n background-color: $disabled-color;\n cursor: not-allowed;\n }\n\n &:not(.six-file-upload--disabled) &__drop-zone:hover,\n &__drop-zone--hover {\n background-color: $over-color;\n\n &.six-file-upload__drop-zone--compact {\n background-color: inherit;\n }\n }\n\n &--disabled &__input {\n cursor: not-allowed;\n }\n\n &__error-text {\n font-size: var(--six-input-help-text-font-size-medium);\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\ninterface ISingleFile {\n file: File;\n}\n\ninterface IMultipleFiles {\n files: FileList;\n}\n\nexport type SixFileUploadSuccessPayload = ISingleFile | IMultipleFiles;\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n @State() hasError = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = false;\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler({ dataTransfer }: DragEvent) {\n if (!this.disabled) {\n this.isOver = false;\n if (dataTransfer != null) {\n this.handleFiles(dataTransfer.files);\n }\n }\n }\n\n private handleSlotChange = () => {\n let validType = false;\n\n if (\n this.errorText != null &&\n ((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||\n (typeof this.errorText == 'object' && this.errorText.length > 0))\n ) {\n validType = true;\n }\n\n this.hasError = validType || hasSlot(this.host, 'error-text');\n console.log(this.errorText);\n console.log(this.hasError);\n };\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0 || this.uploading) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({ reason: 'Only one file is allowed.' });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n return this.failure.emit({ reason });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n return this.failure.emit({ reason });\n }\n }\n\n const eventPayload: SixFileUploadSuccessPayload = this.multiple ? { files } : { file: files[0] };\n this.success.emit(eventPayload);\n };\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\n aria-invalid={this.invalid ? 'true' : 'false'}\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && !this.uploading && (\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">arrow_circle_up</six-icon>\n </span>\n )}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n {this.uploading ? (\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner /> Uploading...\n </span>\n ) : (\n <div>\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n )}\n </div>\n </Container>\n <div aria-hidden={this.invalid ? 'false' : 'true'}>\n <slot name=\"error-text\">\n {errorMessages.map((text) => (\n <six-error>\n <div class=\"six-file-upload__error-text\">{text}</div>\n </six-error>\n ))}\n </slot>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const sixLanguageSwitcherCss = ".language-switcher__container{display:flex}.language-switcher__separator{padding:0 0.25rem}.language-switcher__label{cursor:pointer}.language-switcher__label:hover{color:var(--six-color-web-rock-600)}.language-switcher__label--selected{color:var(--six-color-black);text-decoration:underline}";
|
|
3
|
+
const sixLanguageSwitcherCss = ".language-switcher__container{display:flex}.language-switcher__separator{padding:0 0.25rem}.language-switcher__label{cursor:pointer}.language-switcher__label:hover{color:var(--six-color-web-rock-600)}.language-switcher__label:focus-visible{outline:var(--six-focus-ring);outline-offset:var(--six-focus-ring-offset)}.language-switcher__label--selected{color:var(--six-color-black);text-decoration:underline}";
|
|
4
4
|
const SixLanguageSwitcherStyle0 = sixLanguageSwitcherCss;
|
|
5
5
|
|
|
6
6
|
const DEFAULT_LANGUAGES = ['EN', 'DE', 'ES'];
|
|
@@ -47,7 +47,11 @@ const SixLanguageSwitcher$1 = /*@__PURE__*/ proxyCustomElement(class SixLanguage
|
|
|
47
47
|
render() {
|
|
48
48
|
return (h("div", { key: '64f80894523a4b03643949135f18b553cd0517b6', part: "container", class: "language-switcher__container" }, this.languages.map((lang, index) => {
|
|
49
49
|
const language = typeof lang === 'string' ? lang : lang.key;
|
|
50
|
-
return (h("div", { onClick: this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value)
|
|
50
|
+
return (h("div", { onClick: this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value), onKeyDown: (e) => {
|
|
51
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
52
|
+
this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value)();
|
|
53
|
+
}
|
|
54
|
+
} }, h("span", { part: "label", tabindex: "0", class: {
|
|
51
55
|
'language-switcher__label': true,
|
|
52
56
|
'language-switcher__label--selected': this.selected === language,
|
|
53
57
|
} }, language), index < this.languages.length - 1 && (h("span", { part: "separator", class: "language-switcher__separator" }, "|"))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-language-switcher.js","mappings":";;AAAA,MAAM,sBAAsB,GAAG,
|
|
1
|
+
{"file":"six-language-switcher.js","mappings":";;AAAA,MAAM,sBAAsB,GAAG,uZAAuZ,CAAC;AACvb,kCAAe,sBAAsB;;ACYrC,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;MAchCA,qBAAmB;;;;;;QAqCtB,4BAAuB,GAAG,CAAC,WAAmB,EAAE,aAAsB,KAAK;YACjF,IAAI,aAAa,KAAK,SAAS,EAAE;gBAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CA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AK,CAAC,EAC7F,SAAS,EAAE,CAAC,CAAC;oBACX,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;wBACtC,IAAI,CAAC,uBAAuB,CAAC,QAAQ,EAAE,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;qBACxF;iBACF,IAED,YACE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAC,GAAG,EACZ,KAAK,EAAE;oBACL,0BAA0B,EAAE,IAAI;oBAChC,oCAAoC,EAAE,IAAI,CAAC,QAAQ,KAAK,QAAQ;iBACjE,IAEA,QAAQ,CACJ,EAEN,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,KAChC,YAAM,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,8BAA8B,QAEpD,CACR,CACG,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixLanguageSwitcher"],"sources":["src/components/six-language-switcher/six-language-switcher.scss?tag=six-language-switcher&encapsulation=shadow","src/components/six-language-switcher/six-language-switcher.tsx"],"sourcesContent":[".language-switcher {\n &__container {\n display: flex;\n }\n\n &__separator {\n padding: 0 0.25rem;\n }\n\n &__label {\n cursor: pointer;\n\n &:hover {\n color: var(--six-color-web-rock-600);\n }\n\n &:focus-visible {\n outline: var(--six-focus-ring);\n outline-offset: var(--six-focus-ring-offset);\n }\n\n &--selected {\n color: var(--six-color-black);\n text-decoration: underline;\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\n\n/**\n * @since 2.1.0\n * @status experimental\n **/\n\nexport interface SixLanguageSwitcherInput {\n key: string;\n value: string;\n}\nexport type SixLanguageSwitcherChangePayload = string;\n\nconst DEFAULT_LANGUAGES = ['EN', 'DE', 'ES'];\n\n/*\n * @since 2.2.0\n * @status experimental\n * @part container - The whole component container\n * @part label - The language label\n * @part separator - The separator between the language labels\n */\n@Component({\n tag: 'six-language-switcher',\n styleUrl: 'six-language-switcher.scss',\n shadow: true,\n})\nexport class SixLanguageSwitcher {\n /** The language which should be shown as selected */\n @Prop({ mutable: true, reflect: true }) selected?: string;\n\n /** The languages which should be selectable options. */\n @Prop() languages: string[] | SixLanguageSwitcherInput[] = DEFAULT_LANGUAGES;\n\n @Watch('languages')\n handleChangesLanguages(newValue: string[]) {\n if (!Array.isArray(newValue)) {\n throw new Error('languages is expected to be an array');\n }\n\n this.updateSelectedLanguage();\n }\n /**\n * Emitted when the language switchers value changes\n */\n @Event({ eventName: 'six-language-switcher-change' }) sixChange!: EventEmitter<SixLanguageSwitcherChangePayload>;\n\n componentWillLoad() {\n if (this.selected === undefined) {\n this.updateSelectedLanguage();\n }\n }\n\n private updateSelectedLanguage() {\n const selectedLanguage = this.languages[0];\n if (typeof selectedLanguage === 'string') {\n this.selected = selectedLanguage;\n this.sixChange.emit(this.selected);\n } else {\n this.selected = selectedLanguage.key;\n this.sixChange.emit(selectedLanguage.value);\n }\n }\n\n private handleLanguageSwitching = (newLanguage: string, languageValue?: string) => () => {\n if (languageValue !== undefined) {\n this.sixChange.emit(languageValue);\n } else {\n this.sixChange.emit(newLanguage);\n }\n this.selected = newLanguage;\n };\n\n render() {\n return (\n <div part=\"container\" class=\"language-switcher__container\">\n {this.languages.map((lang, index) => {\n const language = typeof lang === 'string' ? lang : lang.key;\n return (\n <div\n onClick={this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value)();\n }\n }}\n >\n <span\n part=\"label\"\n tabindex=\"0\"\n class={{\n 'language-switcher__label': true,\n 'language-switcher__label--selected': this.selected === language,\n }}\n >\n {language}\n </span>\n\n {index < this.languages.length - 1 && (\n <span part=\"separator\" class=\"language-switcher__separator\">\n |\n </span>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -273,6 +273,9 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
|
|
|
273
273
|
};
|
|
274
274
|
this.handleMenuHide = () => {
|
|
275
275
|
this.isOpen = false;
|
|
276
|
+
if (this.multiple) {
|
|
277
|
+
this.handleBlur();
|
|
278
|
+
}
|
|
276
279
|
};
|
|
277
280
|
this.handleSlotChange = () => {
|
|
278
281
|
this.hasHelpTextSlot = hasSlot(this.host, 'help-text');
|
|
@@ -515,7 +518,7 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
|
|
|
515
518
|
showClear = true;
|
|
516
519
|
showExpand = false;
|
|
517
520
|
}
|
|
518
|
-
return (h(FormControl, { key: '
|
|
521
|
+
return (h(FormControl, { key: 'e911d64a763959e5857979618ba264d23711293a', inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, errorTextId: this.errorTextId, errorText: this.errorText, errorTextCount: this.errorTextCount, hasErrorTextSlot: this.hasErrorTextSlot, size: this.size, onLabelClick: this.handleLabelClick, disabled: this.disabled, required: this.required, displayError: this.invalid }, h("six-dropdown", { key: '39828fb43b0ecf41d63c8433ffebf8ee0cfd12ab', part: "base", ref: (el) => (this.dropdown = el), hoist: this.hoist, matchTriggerWidth: true, closeOnSelect: !this.multiple, containingElement: this.host, disableHideOnEnterAndSpace: this.autocomplete, class: {
|
|
519
522
|
select: true,
|
|
520
523
|
'select--open': this.isOpen,
|
|
521
524
|
'select--empty': ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === 0,
|
|
@@ -530,20 +533,20 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
|
|
|
530
533
|
'select--large': this.size === 'large',
|
|
531
534
|
'select--pill': this.pill,
|
|
532
535
|
'select--invalid': this.invalid,
|
|
533
|
-
}, onKeyDown: this.handleKeyDown, "onSix-dropdown-show": this.handleMenuShow, "onSix-dropdown-hide": this.handleMenuHide, filterPlaceholder: this.filterPlaceholder, filterDebounce: this.filterDebounce, filter: this.filter, asyncFilter: this.asyncFilter, virtualScroll: this.virtualScroll }, h("div", { key: '
|
|
536
|
+
}, onKeyDown: this.handleKeyDown, "onSix-dropdown-show": this.handleMenuShow, "onSix-dropdown-hide": this.handleMenuHide, filterPlaceholder: this.filterPlaceholder, filterDebounce: this.filterDebounce, filter: this.filter, asyncFilter: this.asyncFilter, virtualScroll: this.virtualScroll }, h("div", { key: 'b8b4f3dcd54f9e8163956659635e163fc9b5fbcc', slot: "trigger", ref: (el) => (this.box = el), id: this.inputId, class: {
|
|
534
537
|
select__box: true,
|
|
535
538
|
'select__box--line': this.line,
|
|
536
539
|
'select__box--autocomplete': this.autocomplete,
|
|
537
|
-
}, role: "combobox", "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-haspopup": "true", "aria-expanded": this.isOpen ? 'true' : 'false', tabIndex: this.disabled ? -1 : 0, onBlur: this.handleBlur, onFocus: this.handleFocus }, h("div", { key: '
|
|
540
|
+
}, role: "combobox", "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-haspopup": "true", "aria-expanded": this.isOpen ? 'true' : 'false', tabIndex: this.disabled ? -1 : 0, onBlur: this.handleBlur, onFocus: this.handleFocus }, h("div", { key: 'f67fc7d29b086e903f518d2ef78c07d4752e3f38', class: "display__values", ref: (el) => (this.displayValuesContainer = el) }, this.displayedValues.length > 0 ? (h("span", { class: "display__values-and-counter" }, h("span", { class: "display__values-values" }, this.displayedValues.map((value) => (h("span", { key: value, class: "display-value" }, value, h("span", { class: { separator: true } }, ", "))))), h("span", { ref: (el) => (this.overflowCount = el), class: "overflow-count" }, "+10"))) : (h("span", { class: "placeholder" }, this.placeholder))), showClear && (h("six-icon-button", { exportparts: "base:clear-button", class: "select__clear", name: "clear", size: "small", onClick: this.handleClearClick, tabindex: "-1" })), showExpand && (h("span", { part: "icon", class: "select__icon" }, h("six-icon", { size: "medium" }, "expand_more"))), h("six-input", { key: '5e033789b0f554fb5863bd5038506f5bd9f734c7', ref: (el) => (this.autocompleteInput = el), class: {
|
|
538
541
|
select__input: true,
|
|
539
542
|
'select__hidden-select': !this.autocomplete,
|
|
540
|
-
}, "aria-hidden": "true", required: this.required, onFocus: this.handleFocus, clearable: this.clearable, placeholder: this.placeholder, pill: this.pill, disabled: this.disabled, size: this.size, tabIndex: -1 })), h("div", { key: '
|
|
543
|
+
}, "aria-hidden": "true", required: this.required, onFocus: this.handleFocus, clearable: this.clearable, placeholder: this.placeholder, pill: this.pill, disabled: this.disabled, size: this.size, tabIndex: -1 })), h("div", { key: 'ab531a220927aa9e2b25a6d5e5f22f5d44c28d8b', class: {
|
|
541
544
|
'selection-container': true,
|
|
542
545
|
'selection-container--border': this.selectionContainerItems.length > 0 && items.length !== this.selectionContainerItems.length,
|
|
543
|
-
} }, this.selectionContainerItems), h("six-menu", { key: '
|
|
546
|
+
} }, this.selectionContainerItems), h("six-menu", { key: 'a08e8ecb8a669714fc979cb9ea6e108baf078276', ref: (el) => (this.menu = el), part: "menu", class: {
|
|
544
547
|
select__menu: true,
|
|
545
548
|
'select__menu--hidden': !hasMenuItems,
|
|
546
|
-
}, "onSix-menu-item-selected": this.handleMenuSelect, items: this.options, virtualScroll: this.virtualScroll, "remove-box-shadow": true, "disable-keyboard-handling": true }, h("slot", { key: '
|
|
549
|
+
}, "onSix-menu-item-selected": this.handleMenuSelect, items: this.options, virtualScroll: this.virtualScroll, "remove-box-shadow": true, "disable-keyboard-handling": true }, h("slot", { key: '38798660ff3e905cb1717055bb83589d32bdb4e0', onSlotchange: this.handleSlotChange })), this.multiple && this.selectAllButton && (h("div", { class: "select-all", slot: "dropdown-footer" }, h("six-button", { type: "link", onClick: () => this.selectAll() }, this.selectAllText == null ? selectAllDefaultText(hasDeselectedOptions) : this.selectAllText))))));
|
|
547
550
|
}
|
|
548
551
|
hasSelection() {
|
|
549
552
|
return this.multiple ? this.value.length > 0 : this.value !== '';
|