@six-group/ui-library 0.0.0-insider.82e5ea2 → 0.0.0-insider.83aa3dc
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} +465 -10
- 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 +2 -2
- package/dist/cjs/six-badge.cjs.entry.js +3 -3
- package/dist/cjs/six-button.cjs.entry.js +5 -4
- package/dist/cjs/six-button.cjs.entry.js.map +1 -1
- package/dist/cjs/six-card.cjs.entry.js +2 -2
- package/dist/cjs/six-checkbox_2.cjs.entry.js +7 -7
- package/dist/cjs/six-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +13 -11
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-details.cjs.entry.js +4 -4
- package/dist/cjs/six-dialog.cjs.entry.js +3 -3
- package/dist/cjs/six-drawer.cjs.entry.js +3 -3
- package/dist/cjs/six-dropdown_2.cjs.entry.js +14 -5
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error-page.cjs.entry.js +2 -2
- package/dist/cjs/six-error.cjs.entry.js +3 -3
- package/dist/cjs/six-error.cjs.entry.js.map +1 -1
- package/dist/cjs/six-file-list-item.cjs.entry.js +1 -1
- package/dist/cjs/six-file-list.cjs.entry.js +2 -2
- package/dist/cjs/six-file-upload.cjs.entry.js +27 -6
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/six-footer.cjs.entry.js +2 -2
- package/dist/cjs/six-group-label.cjs.entry.js +3 -3
- package/dist/cjs/six-header.cjs.entry.js +22 -15
- package/dist/cjs/six-header.cjs.entry.js.map +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/six-icon.cjs.entry.js +3 -3
- package/dist/cjs/six-input.cjs.entry.js +15 -6
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-item-picker.cjs.entry.js +1 -1
- package/dist/cjs/six-language-switcher.cjs.entry.js +8 -4
- package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
- package/dist/cjs/six-layout-grid.cjs.entry.js +2 -2
- package/dist/cjs/six-main-container.cjs.entry.js +2 -2
- package/dist/cjs/six-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/six-menu-label.cjs.entry.js +2 -2
- package/dist/cjs/six-picto.cjs.entry.js +2 -2
- package/dist/cjs/six-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/six-progress-ring.cjs.entry.js +2 -2
- package/dist/cjs/six-radio.cjs.entry.js +3 -3
- package/dist/cjs/six-range.cjs.entry.js +4 -4
- package/dist/cjs/six-root.cjs.entry.js +2 -2
- package/dist/cjs/six-search-field.cjs.entry.js +2 -2
- package/dist/cjs/six-select.cjs.entry.js +68 -43
- 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 +3 -3
- package/dist/cjs/six-sidebar.cjs.entry.js +3 -3
- 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 +4 -4
- package/dist/cjs/six-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/six-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/six-tab.cjs.entry.js +3 -3
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +3 -3
- package/dist/cjs/six-textarea.cjs.entry.js +5 -5
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tile.cjs.entry.js +4 -4
- package/dist/cjs/six-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/ui-library.cjs.js +3 -3
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/assets/TRADEMARKS.md +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/six-avatar/six-avatar.js +1 -1
- package/dist/collection/components/six-badge/six-badge.js +2 -2
- package/dist/collection/components/six-button/six-button.css +17 -0
- package/dist/collection/components/six-button/six-button.js +5 -4
- package/dist/collection/components/six-button/six-button.js.map +1 -1
- package/dist/collection/components/six-card/six-card.js +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +2 -0
- package/dist/collection/components/six-checkbox/six-checkbox.js +2 -2
- package/dist/collection/components/six-datepicker/six-datepicker.js +12 -10
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-details/six-details.js +3 -3
- package/dist/collection/components/six-dialog/six-dialog.js +2 -2
- package/dist/collection/components/six-drawer/six-drawer.js +2 -2
- package/dist/collection/components/six-error/six-error.css +1 -0
- package/dist/collection/components/six-error/six-error.js +1 -1
- package/dist/collection/components/six-error-page/six-error-page.js +1 -1
- package/dist/collection/components/six-file-list/six-file-list.js +1 -1
- package/dist/collection/components/six-file-upload/six-file-upload.css +3 -0
- package/dist/collection/components/six-file-upload/six-file-upload.js +64 -5
- 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 +114 -6
- package/dist/collection/components/six-file-upload/test/six-file-upload.spec.js.map +1 -1
- package/dist/collection/components/six-footer/six-footer.js +1 -1
- package/dist/collection/components/six-group-label/six-group-label.js +1 -1
- package/dist/collection/components/six-header/six-header.css +9 -0
- package/dist/collection/components/six-header/six-header.js +38 -13
- package/dist/collection/components/six-header/six-header.js.map +1 -1
- package/dist/collection/components/six-icon/six-icon.js +2 -2
- package/dist/collection/components/six-icon-button/six-icon-button.js +3 -3
- package/dist/collection/components/six-input/six-input.css +1 -0
- package/dist/collection/components/six-input/six-input.js +40 -4
- package/dist/collection/components/six-input/six-input.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 +6 -2
- 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-layout-grid/six-layout-grid.js +1 -1
- package/dist/collection/components/six-main-container/six-main-container.js +1 -1
- package/dist/collection/components/six-menu/six-menu.js +13 -4
- package/dist/collection/components/six-menu/six-menu.js.map +1 -1
- package/dist/collection/components/six-menu/test/six-menu.spec.js +1 -1
- package/dist/collection/components/six-menu/test/six-menu.spec.js.map +1 -1
- package/dist/collection/components/six-menu-divider/six-menu-divider.js +1 -1
- package/dist/collection/components/six-menu-item/six-menu-item.js +2 -2
- package/dist/collection/components/six-menu-label/six-menu-label.js +1 -1
- package/dist/collection/components/six-picto/six-picto.js +1 -1
- package/dist/collection/components/six-progress-bar/six-progress-bar.js +2 -2
- package/dist/collection/components/six-progress-ring/six-progress-ring.js +1 -1
- package/dist/collection/components/six-radio/six-radio.js +2 -2
- package/dist/collection/components/six-range/six-range.js +2 -2
- package/dist/collection/components/six-root/six-root.js +1 -1
- package/dist/collection/components/six-search-field/six-search-field.js +1 -1
- package/dist/collection/components/six-select/six-select.js +33 -41
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/util.spec.js +23 -1
- package/dist/collection/components/six-select/test/util.spec.js.map +1 -1
- package/dist/collection/components/six-select/util.js +24 -0
- package/dist/collection/components/six-select/util.js.map +1 -1
- package/dist/collection/components/six-sidebar/six-sidebar.js +2 -2
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +1 -0
- package/dist/collection/components/six-switch/six-switch.js +2 -2
- package/dist/collection/components/six-tab/six-tab.js +2 -2
- package/dist/collection/components/six-tab/six-tab.js.map +1 -1
- package/dist/collection/components/six-tab-group/six-tab-group.js +2 -2
- package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
- package/dist/collection/components/six-tag/six-tag.js +2 -2
- package/dist/collection/components/six-textarea/six-textarea.css +5 -0
- package/dist/collection/components/six-textarea/six-textarea.js +2 -2
- package/dist/collection/components/six-tile/six-tile.js +3 -3
- package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
- package/dist/components/six-avatar.js +1 -1
- package/dist/components/six-badge.js +2 -2
- package/dist/components/six-button2.js +4 -3
- package/dist/components/six-button2.js.map +1 -1
- package/dist/components/six-card.js +1 -1
- package/dist/components/six-checkbox2.js +3 -3
- package/dist/components/six-checkbox2.js.map +1 -1
- package/dist/components/six-datepicker.js +12 -10
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-details2.js +3 -3
- package/dist/components/six-dialog.js +2 -2
- package/dist/components/six-drawer.js +2 -2
- package/dist/components/six-error-page.js +1 -1
- package/dist/components/six-error2.js +2 -2
- package/dist/components/six-error2.js.map +1 -1
- package/dist/components/six-file-list.js +1 -1
- package/dist/components/six-file-upload.js +38 -8
- package/dist/components/six-file-upload.js.map +1 -1
- package/dist/components/six-footer.js +1 -1
- package/dist/components/six-group-label.js +1 -1
- package/dist/components/six-header.js +22 -14
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-icon-button2.js +3 -3
- package/dist/components/six-icon2.js +2 -2
- package/dist/components/six-input2.js +14 -4
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-language-switcher.js +7 -3
- package/dist/components/six-language-switcher.js.map +1 -1
- package/dist/components/six-layout-grid.js +1 -1
- package/dist/components/six-main-container.js +1 -1
- package/dist/components/six-menu-divider.js +1 -1
- package/dist/components/six-menu-item2.js +2 -2
- package/dist/components/six-menu-label.js +1 -1
- package/dist/components/six-menu2.js +13 -4
- package/dist/components/six-menu2.js.map +1 -1
- package/dist/components/six-picto2.js +1 -1
- package/dist/components/six-progress-bar.js +2 -2
- package/dist/components/six-progress-ring.js +1 -1
- package/dist/components/six-radio.js +2 -2
- package/dist/components/six-range.js +2 -2
- package/dist/components/six-root.js +1 -1
- package/dist/components/six-search-field.js +1 -1
- package/dist/components/six-select.js +66 -41
- 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-sidebar-item.js +2 -2
- package/dist/components/six-sidebar.js +2 -2
- package/dist/components/six-switch.js +2 -2
- package/dist/components/six-tab-group.js +2 -2
- package/dist/components/six-tab-panel.js +1 -1
- package/dist/components/six-tab.js +2 -2
- package/dist/components/six-tab.js.map +1 -1
- package/dist/components/six-tag.js +2 -2
- package/dist/components/six-textarea.js +3 -3
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-tile.js +3 -3
- package/dist/components/six-tooltip2.js +2 -2
- package/dist/components.json +160 -14
- 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} +465 -10
- 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 +2 -2
- package/dist/esm/six-badge.entry.js +3 -3
- package/dist/esm/six-button.entry.js +5 -4
- package/dist/esm/six-button.entry.js.map +1 -1
- package/dist/esm/six-card.entry.js +2 -2
- package/dist/esm/six-checkbox_2.entry.js +7 -7
- package/dist/esm/six-checkbox_2.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +13 -11
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-details.entry.js +4 -4
- package/dist/esm/six-dialog.entry.js +3 -3
- package/dist/esm/six-drawer.entry.js +3 -3
- package/dist/esm/six-dropdown_2.entry.js +14 -5
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error-page.entry.js +2 -2
- package/dist/esm/six-error.entry.js +3 -3
- package/dist/esm/six-error.entry.js.map +1 -1
- package/dist/esm/six-file-list-item.entry.js +1 -1
- package/dist/esm/six-file-list.entry.js +2 -2
- package/dist/esm/six-file-upload.entry.js +27 -6
- package/dist/esm/six-file-upload.entry.js.map +1 -1
- package/dist/esm/six-footer.entry.js +2 -2
- package/dist/esm/six-group-label.entry.js +3 -3
- package/dist/esm/six-header.entry.js +22 -15
- package/dist/esm/six-header.entry.js.map +1 -1
- package/dist/esm/six-icon-button.entry.js +4 -4
- package/dist/esm/six-icon.entry.js +3 -3
- package/dist/esm/six-input.entry.js +15 -6
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-item-picker.entry.js +1 -1
- package/dist/esm/six-language-switcher.entry.js +8 -4
- package/dist/esm/six-language-switcher.entry.js.map +1 -1
- package/dist/esm/six-layout-grid.entry.js +2 -2
- package/dist/esm/six-main-container.entry.js +2 -2
- package/dist/esm/six-menu-divider.entry.js +2 -2
- package/dist/esm/six-menu-label.entry.js +2 -2
- package/dist/esm/six-picto.entry.js +2 -2
- package/dist/esm/six-progress-bar.entry.js +3 -3
- package/dist/esm/six-progress-ring.entry.js +2 -2
- package/dist/esm/six-radio.entry.js +3 -3
- package/dist/esm/six-range.entry.js +4 -4
- package/dist/esm/six-root.entry.js +2 -2
- package/dist/esm/six-search-field.entry.js +2 -2
- package/dist/esm/six-select.entry.js +68 -43
- 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 +3 -3
- package/dist/esm/six-sidebar.entry.js +3 -3
- 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 +4 -4
- package/dist/esm/six-tab-group.entry.js +3 -3
- package/dist/esm/six-tab-panel.entry.js +2 -2
- package/dist/esm/six-tab.entry.js +3 -3
- package/dist/esm/six-tab.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +3 -3
- package/dist/esm/six-textarea.entry.js +5 -5
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-tile.entry.js +4 -4
- package/dist/esm/six-timepicker.entry.js +1 -1
- package/dist/esm/six-tooltip.entry.js +3 -3
- package/dist/esm/ui-library.js +4 -4
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-button/six-button.d.ts +1 -1
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +8 -0
- package/dist/types/components/six-header/six-header.d.ts +3 -1
- package/dist/types/components/six-input/six-input.d.ts +9 -1
- package/dist/types/components/six-menu/six-menu.d.ts +1 -1
- package/dist/types/components/six-select/six-select.d.ts +0 -2
- package/dist/types/components/six-select/util.d.ts +2 -0
- package/dist/types/components.d.ts +47 -3
- package/dist/ui-library/assets/TRADEMARKS.md +3 -3
- package/dist/ui-library/p-030fa1fa.entry.js +2 -0
- package/dist/ui-library/p-037afc74.entry.js +2 -0
- package/dist/ui-library/p-037afc74.entry.js.map +1 -0
- package/dist/ui-library/{p-fdf271fd.entry.js → p-047d02ad.entry.js} +2 -2
- package/dist/ui-library/p-049c8910.entry.js +2 -0
- package/dist/ui-library/p-049c8910.entry.js.map +1 -0
- package/dist/ui-library/p-05eb1bab.js +3 -0
- package/dist/ui-library/p-05eb1bab.js.map +1 -0
- package/dist/ui-library/{p-fe483fc6.entry.js → p-06ba653e.entry.js} +2 -2
- package/dist/ui-library/{p-57ab8f42.entry.js → p-07c8de65.entry.js} +2 -2
- package/dist/ui-library/p-0c129b61.entry.js +2 -0
- package/dist/ui-library/p-0c129b61.entry.js.map +1 -0
- package/dist/ui-library/p-11344bb8.entry.js +2 -0
- 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-189602e4.entry.js +2 -0
- package/dist/ui-library/p-18b9189f.entry.js +2 -0
- package/dist/ui-library/p-18b9189f.entry.js.map +1 -0
- package/dist/ui-library/p-1adc26f2.entry.js +2 -0
- package/dist/ui-library/p-1adc26f2.entry.js.map +1 -0
- package/dist/ui-library/{p-81390410.entry.js → p-2386627e.entry.js} +2 -2
- package/dist/ui-library/{p-2e7312fc.entry.js → p-32e421a3.entry.js} +2 -2
- package/dist/ui-library/p-32e421a3.entry.js.map +1 -0
- package/dist/ui-library/p-347e568f.entry.js +2 -0
- package/dist/ui-library/p-36d5f98a.entry.js +2 -0
- package/dist/ui-library/p-36d5f98a.entry.js.map +1 -0
- package/dist/ui-library/p-37433242.entry.js +2 -0
- package/dist/ui-library/p-37433242.entry.js.map +1 -0
- package/dist/ui-library/{p-9e14b37a.entry.js → p-3b5a76ea.entry.js} +2 -2
- package/dist/ui-library/{p-38271a5e.entry.js → p-416b0439.entry.js} +2 -2
- package/dist/ui-library/{p-b863dcc4.entry.js → p-419ed003.entry.js} +2 -2
- package/dist/ui-library/{p-0054410d.entry.js → p-4963f03c.entry.js} +2 -2
- package/dist/ui-library/{p-1903aa37.entry.js → p-4bc7bbdb.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-63acceb6.entry.js +2 -0
- package/dist/ui-library/{p-e924132d.entry.js.map → p-63acceb6.entry.js.map} +1 -1
- package/dist/ui-library/{p-71ff0e72.entry.js → p-63ee5e7e.entry.js} +2 -2
- package/dist/ui-library/{p-5cde0403.entry.js → p-6b40c40c.entry.js} +2 -2
- package/dist/ui-library/p-6b40c40c.entry.js.map +1 -0
- package/dist/ui-library/{p-3f8ed1d4.entry.js → p-6f9153be.entry.js} +2 -2
- package/dist/ui-library/{p-24c42aab.entry.js → p-7bdd1116.entry.js} +2 -2
- package/dist/ui-library/p-7c18b8ca.entry.js +2 -0
- package/dist/ui-library/{p-52e2a64b.entry.js → p-8f1d3461.entry.js} +2 -2
- package/dist/ui-library/p-96d441e9.entry.js +2 -0
- package/dist/ui-library/p-96d441e9.entry.js.map +1 -0
- package/dist/ui-library/{p-ad244587.entry.js → p-99f6fe01.entry.js} +2 -2
- package/dist/ui-library/p-9cb83369.entry.js +2 -0
- package/dist/ui-library/{p-61c91764.entry.js → p-a398e3eb.entry.js} +2 -2
- package/dist/ui-library/{p-ab22dafd.entry.js → p-a9e009af.entry.js} +2 -2
- package/dist/ui-library/{p-dea8f89c.entry.js → p-b335ed9c.entry.js} +2 -2
- package/dist/ui-library/{p-f2320c65.entry.js → p-b5acf54d.entry.js} +2 -2
- package/dist/ui-library/{p-b68f4556.entry.js → p-b60c20aa.entry.js} +2 -2
- package/dist/ui-library/{p-380ba2b7.entry.js → p-b7c68f74.entry.js} +2 -2
- package/dist/ui-library/{p-a69ba529.entry.js → p-c62893e5.entry.js} +2 -2
- package/dist/ui-library/{p-b922e8ac.entry.js → p-c6464bfe.entry.js} +2 -2
- package/dist/ui-library/{p-b922e8ac.entry.js.map → p-c6464bfe.entry.js.map} +1 -1
- package/dist/ui-library/{p-034b3bb1.entry.js → p-cf109cbf.entry.js} +2 -2
- package/dist/ui-library/{p-3c582981.entry.js → p-d1a2f84b.entry.js} +2 -2
- package/dist/ui-library/{p-716019b6.entry.js → p-d42f1ea9.entry.js} +2 -2
- package/dist/ui-library/{p-e9726db2.entry.js → p-d88b9c16.entry.js} +2 -2
- package/dist/ui-library/p-d9586999.entry.js +2 -0
- package/dist/ui-library/p-e14d78e9.entry.js +2 -0
- package/dist/ui-library/p-e14d78e9.entry.js.map +1 -0
- package/dist/ui-library/{p-786148a6.entry.js → p-e9b8ad98.entry.js} +2 -2
- package/dist/ui-library/{p-3a879e1d.entry.js → p-ebbe9bdc.entry.js} +2 -2
- package/dist/ui-library/{p-59744f17.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/collection/components/six-header/assets/six-logo.svg +0 -1
- package/dist/collection/components/six-header/test/six-header.spec.js +0 -177
- package/dist/collection/components/six-header/test/six-header.spec.js.map +0 -1
- package/dist/esm/index-d415464d.js.map +0 -1
- package/dist/ui-library/assets/six-logo.svg +0 -1
- package/dist/ui-library/p-1a17a806.entry.js +0 -2
- package/dist/ui-library/p-1a17a806.entry.js.map +0 -1
- package/dist/ui-library/p-1c5e8dec.entry.js +0 -2
- package/dist/ui-library/p-23f5dae2.entry.js +0 -2
- 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-2e7312fc.entry.js.map +0 -1
- package/dist/ui-library/p-3c05fdf3.entry.js +0 -2
- package/dist/ui-library/p-4272021f.entry.js +0 -2
- package/dist/ui-library/p-4272021f.entry.js.map +0 -1
- package/dist/ui-library/p-499480a2.entry.js +0 -2
- package/dist/ui-library/p-50d589eb.entry.js +0 -2
- package/dist/ui-library/p-50d589eb.entry.js.map +0 -1
- package/dist/ui-library/p-5cde0403.entry.js.map +0 -1
- package/dist/ui-library/p-740d3c8b.entry.js +0 -2
- package/dist/ui-library/p-740d3c8b.entry.js.map +0 -1
- package/dist/ui-library/p-7ad67887.entry.js +0 -2
- package/dist/ui-library/p-7ad67887.entry.js.map +0 -1
- package/dist/ui-library/p-9a7c45c4.entry.js +0 -2
- package/dist/ui-library/p-9a7c45c4.entry.js.map +0 -1
- package/dist/ui-library/p-a2dad0ab.entry.js +0 -2
- package/dist/ui-library/p-a67b3f42.entry.js +0 -2
- package/dist/ui-library/p-a67b3f42.entry.js.map +0 -1
- package/dist/ui-library/p-b902eb65.entry.js +0 -2
- package/dist/ui-library/p-b902eb65.entry.js.map +0 -1
- package/dist/ui-library/p-c297662b.entry.js +0 -2
- package/dist/ui-library/p-c297662b.entry.js.map +0 -1
- package/dist/ui-library/p-ce59d17f.entry.js +0 -2
- package/dist/ui-library/p-e6db442b.entry.js +0 -2
- package/dist/ui-library/p-e8d5a789.js +0 -3
- package/dist/ui-library/p-e8d5a789.js.map +0 -1
- package/dist/ui-library/p-e924132d.entry.js +0 -2
- /package/dist/ui-library/{p-499480a2.entry.js.map → p-030fa1fa.entry.js.map} +0 -0
- /package/dist/ui-library/{p-fdf271fd.entry.js.map → p-047d02ad.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-57ab8f42.entry.js.map → p-07c8de65.entry.js.map} +0 -0
- /package/dist/ui-library/{p-e6db442b.entry.js.map → p-11344bb8.entry.js.map} +0 -0
- /package/dist/ui-library/{p-1c5e8dec.entry.js.map → p-189602e4.entry.js.map} +0 -0
- /package/dist/ui-library/{p-81390410.entry.js.map → p-2386627e.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3c05fdf3.entry.js.map → p-347e568f.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-38271a5e.entry.js.map → p-416b0439.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-0054410d.entry.js.map → p-4963f03c.entry.js.map} +0 -0
- /package/dist/ui-library/{p-1903aa37.entry.js.map → p-4bc7bbdb.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-71ff0e72.entry.js.map → p-63ee5e7e.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3f8ed1d4.entry.js.map → p-6f9153be.entry.js.map} +0 -0
- /package/dist/ui-library/{p-24c42aab.entry.js.map → p-7bdd1116.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a2dad0ab.entry.js.map → p-7c18b8ca.entry.js.map} +0 -0
- /package/dist/ui-library/{p-52e2a64b.entry.js.map → p-8f1d3461.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ad244587.entry.js.map → p-99f6fe01.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ce59d17f.entry.js.map → p-9cb83369.entry.js.map} +0 -0
- /package/dist/ui-library/{p-61c91764.entry.js.map → p-a398e3eb.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ab22dafd.entry.js.map → p-a9e009af.entry.js.map} +0 -0
- /package/dist/ui-library/{p-dea8f89c.entry.js.map → p-b335ed9c.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-b68f4556.entry.js.map → p-b60c20aa.entry.js.map} +0 -0
- /package/dist/ui-library/{p-380ba2b7.entry.js.map → p-b7c68f74.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-034b3bb1.entry.js.map → p-cf109cbf.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3c582981.entry.js.map → p-d1a2f84b.entry.js.map} +0 -0
- /package/dist/ui-library/{p-716019b6.entry.js.map → p-d42f1ea9.entry.js.map} +0 -0
- /package/dist/ui-library/{p-e9726db2.entry.js.map → p-d88b9c16.entry.js.map} +0 -0
- /package/dist/ui-library/{p-23f5dae2.entry.js.map → p-d9586999.entry.js.map} +0 -0
- /package/dist/ui-library/{p-786148a6.entry.js.map → p-e9b8ad98.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3a879e1d.entry.js.map → p-ebbe9bdc.entry.js.map} +0 -0
- /package/dist/ui-library/{p-59744f17.entry.js.map → p-fe89a7c4.entry.js.map} +0 -0
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { hasSlot } from "../../utils/slot";
|
|
2
3
|
/**
|
|
3
4
|
* @since 2.0.0
|
|
4
5
|
* @status experimental
|
|
5
6
|
*
|
|
7
|
+
* @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.
|
|
6
8
|
*/
|
|
7
9
|
export class SixFileUpload {
|
|
8
10
|
constructor() {
|
|
11
|
+
this.handleSlotChange = () => {
|
|
12
|
+
let validType = false;
|
|
13
|
+
if (this.errorText != null &&
|
|
14
|
+
((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||
|
|
15
|
+
(typeof this.errorText == 'object' && this.errorText.length > 0))) {
|
|
16
|
+
validType = true;
|
|
17
|
+
}
|
|
18
|
+
this.hasError = validType || hasSlot(this.host, 'error-text');
|
|
19
|
+
};
|
|
9
20
|
this.handleFiles = (files) => {
|
|
10
21
|
if (this.disabled || files.length === 0 || this.uploading) {
|
|
11
22
|
return;
|
|
@@ -42,6 +53,7 @@ export class SixFileUpload {
|
|
|
42
53
|
}
|
|
43
54
|
};
|
|
44
55
|
this.isOver = false;
|
|
56
|
+
this.hasError = false;
|
|
45
57
|
this.compact = false;
|
|
46
58
|
this.label = undefined;
|
|
47
59
|
this.disabled = false;
|
|
@@ -49,6 +61,8 @@ export class SixFileUpload {
|
|
|
49
61
|
this.multiple = false;
|
|
50
62
|
this.maxFileSize = undefined;
|
|
51
63
|
this.uploading = false;
|
|
64
|
+
this.errorText = '';
|
|
65
|
+
this.invalid = false;
|
|
52
66
|
}
|
|
53
67
|
dragenterHandler() {
|
|
54
68
|
if (!this.disabled) {
|
|
@@ -73,17 +87,24 @@ export class SixFileUpload {
|
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
89
|
}
|
|
90
|
+
componentWillLoad() {
|
|
91
|
+
this.handleSlotChange();
|
|
92
|
+
}
|
|
76
93
|
componentDidLoad() {
|
|
94
|
+
var _a;
|
|
77
95
|
['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {
|
|
78
96
|
this.host.addEventListener(eventName, this.preventDefaults, false);
|
|
79
97
|
document.body.addEventListener(eventName, this.preventDefaults, false);
|
|
80
98
|
});
|
|
99
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.addEventListener('slotchange', this.handleSlotChange);
|
|
81
100
|
}
|
|
82
101
|
disconnectedCallback() {
|
|
102
|
+
var _a;
|
|
83
103
|
['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {
|
|
84
104
|
this.host.removeEventListener(eventName, this.preventDefaults, false);
|
|
85
105
|
document.body.removeEventListener(eventName, this.preventDefaults, false);
|
|
86
106
|
});
|
|
107
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
|
|
87
108
|
}
|
|
88
109
|
preventDefaults(e) {
|
|
89
110
|
e.preventDefault();
|
|
@@ -95,17 +116,18 @@ export class SixFileUpload {
|
|
|
95
116
|
}
|
|
96
117
|
render() {
|
|
97
118
|
const Container = this.compact ? 'six-button' : 'six-card';
|
|
98
|
-
|
|
119
|
+
const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
120
|
+
return (h("div", { key: 'eb14977865630579c21ac9bb4a711d1c31878cb2', class: {
|
|
99
121
|
'six-file-upload': true,
|
|
100
122
|
'six-file-upload--disabled': this.disabled || this.uploading,
|
|
101
|
-
} }, h(Container, { key: '
|
|
123
|
+
} }, h(Container, { key: '7e5399fe2defdcf4c653056c6593e819c45964f0', disabled: this.disabled || this.uploading, "aria-invalid": this.invalid ? 'true' : 'false', class: {
|
|
102
124
|
'six-file-upload__container--compact': this.compact,
|
|
103
125
|
'six-file-upload__container--full': !this.compact,
|
|
104
|
-
} }, this.compact && !this.uploading && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '
|
|
126
|
+
} }, this.compact && !this.uploading && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '6a1870eaebbbdf1bafb6b893342af3730211402e', class: {
|
|
105
127
|
'six-file-upload__drop-zone': true,
|
|
106
128
|
'six-file-upload__drop-zone--hover': this.isOver,
|
|
107
129
|
'six-file-upload__drop-zone--compact': this.compact,
|
|
108
|
-
} }, 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) })))))));
|
|
130
|
+
} }, 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: '063123eb020e8f370733294760d96709a8c22b0a', "aria-hidden": this.invalid ? 'false' : 'true' }, h("slot", { key: '4ac9dad1011635a2974f2d642c5748fa7e5aff3d', name: "error-text" }, errorMessages.map((text) => (h("six-error", null, h("div", { class: "six-file-upload__error-text" }, text))))))));
|
|
109
131
|
}
|
|
110
132
|
static get is() { return "six-file-upload"; }
|
|
111
133
|
static get encapsulation() { return "scoped"; }
|
|
@@ -243,12 +265,49 @@ export class SixFileUpload {
|
|
|
243
265
|
"attribute": "uploading",
|
|
244
266
|
"reflect": true,
|
|
245
267
|
"defaultValue": "false"
|
|
268
|
+
},
|
|
269
|
+
"errorText": {
|
|
270
|
+
"type": "string",
|
|
271
|
+
"mutable": false,
|
|
272
|
+
"complexType": {
|
|
273
|
+
"original": "string | string[]",
|
|
274
|
+
"resolved": "string | string[]",
|
|
275
|
+
"references": {}
|
|
276
|
+
},
|
|
277
|
+
"required": false,
|
|
278
|
+
"optional": false,
|
|
279
|
+
"docs": {
|
|
280
|
+
"tags": [],
|
|
281
|
+
"text": "The error message shown, if `invalid` is set to true."
|
|
282
|
+
},
|
|
283
|
+
"attribute": "error-text",
|
|
284
|
+
"reflect": false,
|
|
285
|
+
"defaultValue": "''"
|
|
286
|
+
},
|
|
287
|
+
"invalid": {
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"mutable": false,
|
|
290
|
+
"complexType": {
|
|
291
|
+
"original": "boolean",
|
|
292
|
+
"resolved": "boolean",
|
|
293
|
+
"references": {}
|
|
294
|
+
},
|
|
295
|
+
"required": false,
|
|
296
|
+
"optional": false,
|
|
297
|
+
"docs": {
|
|
298
|
+
"tags": [],
|
|
299
|
+
"text": "If this property is set to true and an error message is provided by `errorText`, the error message is displayed."
|
|
300
|
+
},
|
|
301
|
+
"attribute": "invalid",
|
|
302
|
+
"reflect": true,
|
|
303
|
+
"defaultValue": "false"
|
|
246
304
|
}
|
|
247
305
|
};
|
|
248
306
|
}
|
|
249
307
|
static get states() {
|
|
250
308
|
return {
|
|
251
|
-
"isOver": {}
|
|
309
|
+
"isOver": {},
|
|
310
|
+
"hasError": {}
|
|
252
311
|
};
|
|
253
312
|
}
|
|
254
313
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"six-file-upload.js","sourceRoot":"","sources":["../../../src/components/six-file-upload/six-file-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAA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G,CACI,CACR,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\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 /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = 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 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 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 || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\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>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"six-file-upload.js","sourceRoot":"","sources":["../../../src/components/six-file-upload/six-file-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAgB3C;;;;;GAKG;AAOH,MAAM,OAAO,aAAa;;QAwEhB,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IACE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACt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E,WAAK,KAAK,EAAC,6BAA6B,IAAE,IAAI,CAAO,CAC3C,CACb,CAAC,CACG,CACH,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 };\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"]}
|
|
@@ -12,7 +12,7 @@ describe('six-file-upload', () => {
|
|
|
12
12
|
expect(page.root).toEqualHtml(`
|
|
13
13
|
<six-file-upload>
|
|
14
14
|
<div class="six-file-upload">
|
|
15
|
-
<six-card class="six-file-upload__container--full">
|
|
15
|
+
<six-card aria-invalid="false" class="six-file-upload__container--full">
|
|
16
16
|
<div class="six-file-upload__drop-zone">
|
|
17
17
|
<div>
|
|
18
18
|
<span>
|
|
@@ -27,6 +27,7 @@ describe('six-file-upload', () => {
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</six-card>
|
|
30
|
+
<div aria-hidden="true"></div>
|
|
30
31
|
</div>
|
|
31
32
|
</six-file-upload>
|
|
32
33
|
`);
|
|
@@ -39,7 +40,7 @@ describe('six-file-upload', () => {
|
|
|
39
40
|
expect(page.root).toEqualHtml(`
|
|
40
41
|
<six-file-upload label="some custom label">
|
|
41
42
|
<div class="six-file-upload">
|
|
42
|
-
<six-card class="six-file-upload__container--full">
|
|
43
|
+
<six-card aria-invalid="false" class="six-file-upload__container--full">
|
|
43
44
|
<div class="six-file-upload__drop-zone">
|
|
44
45
|
<div>
|
|
45
46
|
<span>
|
|
@@ -49,6 +50,7 @@ describe('six-file-upload', () => {
|
|
|
49
50
|
</div>
|
|
50
51
|
</div>
|
|
51
52
|
</six-card>
|
|
53
|
+
<div aria-hidden="true"></div>
|
|
52
54
|
</div>
|
|
53
55
|
</six-file-upload>
|
|
54
56
|
`);
|
|
@@ -61,7 +63,7 @@ describe('six-file-upload', () => {
|
|
|
61
63
|
expect(page.root).toEqualHtml(`
|
|
62
64
|
<six-file-upload disabled="">
|
|
63
65
|
<div class="six-file-upload six-file-upload--disabled">
|
|
64
|
-
<six-card class="six-file-upload__container--full" disabled="">
|
|
66
|
+
<six-card aria-invalid="false" class="six-file-upload__container--full" disabled="">
|
|
65
67
|
<div class="six-file-upload__drop-zone">
|
|
66
68
|
<div>
|
|
67
69
|
<span>
|
|
@@ -76,6 +78,7 @@ describe('six-file-upload', () => {
|
|
|
76
78
|
</div>
|
|
77
79
|
</div>
|
|
78
80
|
</six-card>
|
|
81
|
+
<div aria-hidden="true"></div>
|
|
79
82
|
</div>
|
|
80
83
|
</six-file-upload>
|
|
81
84
|
`);
|
|
@@ -88,7 +91,7 @@ describe('six-file-upload', () => {
|
|
|
88
91
|
expect(page.root).toEqualHtml(`
|
|
89
92
|
<six-file-upload compact="">
|
|
90
93
|
<div class="six-file-upload">
|
|
91
|
-
<six-button class="six-file-upload__container--compact">
|
|
94
|
+
<six-button aria-invalid="false" class="six-file-upload__container--compact">
|
|
92
95
|
<span slot="prefix">
|
|
93
96
|
<six-icon class="six-file-upload__label-icon">
|
|
94
97
|
arrow_circle_up
|
|
@@ -103,6 +106,7 @@ describe('six-file-upload', () => {
|
|
|
103
106
|
</div>
|
|
104
107
|
</div>
|
|
105
108
|
</six-button>
|
|
109
|
+
<div aria-hidden="true"></div>
|
|
106
110
|
</div>
|
|
107
111
|
</six-file-upload>
|
|
108
112
|
`);
|
|
@@ -115,7 +119,7 @@ describe('six-file-upload', () => {
|
|
|
115
119
|
expect(page.root).toEqualHtml(`
|
|
116
120
|
<six-file-upload compact="" disabled="">
|
|
117
121
|
<div class="six-file-upload six-file-upload--disabled">
|
|
118
|
-
<six-button class="six-file-upload__container--compact" disabled="">
|
|
122
|
+
<six-button aria-invalid="false" class="six-file-upload__container--compact" disabled="">
|
|
119
123
|
<span slot="prefix">
|
|
120
124
|
<six-icon class="six-file-upload__label-icon">
|
|
121
125
|
arrow_circle_up
|
|
@@ -130,6 +134,7 @@ describe('six-file-upload', () => {
|
|
|
130
134
|
</div>
|
|
131
135
|
</div>
|
|
132
136
|
</six-button>
|
|
137
|
+
<div aria-hidden="true"></div>
|
|
133
138
|
</div>
|
|
134
139
|
</six-file-upload>
|
|
135
140
|
`);
|
|
@@ -142,7 +147,7 @@ describe('six-file-upload', () => {
|
|
|
142
147
|
expect(page.root).toEqualHtml(`
|
|
143
148
|
<six-file-upload uploading="">
|
|
144
149
|
<div class="six-file-upload six-file-upload--disabled">
|
|
145
|
-
<six-card class="six-file-upload__container--full" disabled="">
|
|
150
|
+
<six-card aria-invalid="false" class="six-file-upload__container--full" disabled="">
|
|
146
151
|
<div class="six-file-upload__drop-zone">
|
|
147
152
|
<span class="six-file-upload__drop-zone__spinner-container">
|
|
148
153
|
<six-spinner></six-spinner>
|
|
@@ -150,6 +155,109 @@ describe('six-file-upload', () => {
|
|
|
150
155
|
</span>
|
|
151
156
|
</div>
|
|
152
157
|
</six-card>
|
|
158
|
+
<div aria-hidden="true"></div>
|
|
159
|
+
</div>
|
|
160
|
+
</six-file-upload>
|
|
161
|
+
`);
|
|
162
|
+
});
|
|
163
|
+
it('renders invalid', async () => {
|
|
164
|
+
const page = await newSpecPage({
|
|
165
|
+
components: [SixFileUpload],
|
|
166
|
+
html: `<six-file-upload invalid error-text="error message"></six-file-upload>`,
|
|
167
|
+
});
|
|
168
|
+
expect(page.root).toEqualHtml(`
|
|
169
|
+
<six-file-upload invalid error-text="error message">
|
|
170
|
+
<div class="six-file-upload">
|
|
171
|
+
<six-card aria-invalid="true" class="six-file-upload__container--full">
|
|
172
|
+
<div class="six-file-upload__drop-zone">
|
|
173
|
+
<div>
|
|
174
|
+
<span>
|
|
175
|
+
<span>
|
|
176
|
+
Drop files to upload, or
|
|
177
|
+
<span class="six-file-upload__label--highlighted">
|
|
178
|
+
browse
|
|
179
|
+
</span>
|
|
180
|
+
</span>
|
|
181
|
+
</span>
|
|
182
|
+
<input class="six-file-upload__input" name="resume" type="file">
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</six-card>
|
|
186
|
+
<div aria-hidden="false">
|
|
187
|
+
<slot-fb name="error-text">
|
|
188
|
+
<six-error>
|
|
189
|
+
<div class="six-file-upload__error-text">error message</div>
|
|
190
|
+
</six-error>
|
|
191
|
+
</slot-fb>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</six-file-upload>
|
|
195
|
+
`);
|
|
196
|
+
});
|
|
197
|
+
it('does not render error message if not invalid', async () => {
|
|
198
|
+
const page = await newSpecPage({
|
|
199
|
+
components: [SixFileUpload],
|
|
200
|
+
html: `<six-file-upload error-text="error message"></six-file-upload>`,
|
|
201
|
+
});
|
|
202
|
+
expect(page.root).toEqualHtml(`
|
|
203
|
+
<six-file-upload error-text="error message">
|
|
204
|
+
<div class="six-file-upload">
|
|
205
|
+
<six-card aria-invalid="false" class="six-file-upload__container--full">
|
|
206
|
+
<div class="six-file-upload__drop-zone">
|
|
207
|
+
<div>
|
|
208
|
+
<span>
|
|
209
|
+
<span>
|
|
210
|
+
Drop files to upload, or
|
|
211
|
+
<span class="six-file-upload__label--highlighted">
|
|
212
|
+
browse
|
|
213
|
+
</span>
|
|
214
|
+
</span>
|
|
215
|
+
</span>
|
|
216
|
+
<input class="six-file-upload__input" name="resume" type="file">
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</six-card>
|
|
220
|
+
<div aria-hidden="true">
|
|
221
|
+
<slot-fb name="error-text">
|
|
222
|
+
<six-error>
|
|
223
|
+
<div class="six-file-upload__error-text">error message</div>
|
|
224
|
+
</six-error>
|
|
225
|
+
</slot-fb>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</six-file-upload>
|
|
229
|
+
`);
|
|
230
|
+
});
|
|
231
|
+
it('render error slot when invalid', async () => {
|
|
232
|
+
const page = await newSpecPage({
|
|
233
|
+
components: [SixFileUpload],
|
|
234
|
+
html: `<six-file-upload invalid><slot name="error-text"><b>bold error</b></six-file-upload>`,
|
|
235
|
+
});
|
|
236
|
+
expect(page.root).toEqualHtml(`
|
|
237
|
+
<six-file-upload invalid>
|
|
238
|
+
<slot hidden="" name="error-text">
|
|
239
|
+
<b>
|
|
240
|
+
bold error
|
|
241
|
+
</b>
|
|
242
|
+
</slot>
|
|
243
|
+
<div class="six-file-upload">
|
|
244
|
+
<six-card aria-invalid="true" class="six-file-upload__container--full">
|
|
245
|
+
<div class="six-file-upload__drop-zone">
|
|
246
|
+
<div>
|
|
247
|
+
<span>
|
|
248
|
+
<span>
|
|
249
|
+
Drop files to upload, or
|
|
250
|
+
<span class="six-file-upload__label--highlighted">
|
|
251
|
+
browse
|
|
252
|
+
</span>
|
|
253
|
+
</span>
|
|
254
|
+
</span>
|
|
255
|
+
<input class="six-file-upload__input" name="resume" type="file">
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</six-card>
|
|
259
|
+
<div aria-hidden="false">
|
|
260
|
+
</div>
|
|
153
261
|
</div>
|
|
154
262
|
</six-file-upload>
|
|
155
263
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"six-file-upload.spec.js","sourceRoot":"","sources":["../../../../src/components/six-file-upload/test/six-file-upload.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,cAAc,CAAC,a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C,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,sDAAsD;SAC7D,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;KAoB7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,+CAA+C;SACtD,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;KAa7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { SixFileUpload } from '../six-file-upload';\nimport { newSpecPage } from '@stencil/core/testing';\n\ndescribe('six-file-upload', () => {\n it('should create a component instance', () => {\n expect(new SixFileUpload()).toBeInstanceOf(SixFileUpload);\n });\n\n it('renders minimal six-file-upload', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload>\n <div class=\"six-file-upload\">\n <six-card class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders custom label', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload label=\"some custom label\"></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload label=\"some custom label\">\n <div class=\"six-file-upload\">\n <six-card class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n some custom label\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders disabled', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload disabled></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload disabled=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-card class=\"six-file-upload__container--full\" disabled=\"\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" disabled=\"\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders compact', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload compact></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload compact=\"\">\n <div class=\"six-file-upload\">\n <six-button class=\"six-file-upload__container--compact\">\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">\n arrow_circle_up\n </six-icon>\n </span>\n <div class=\"six-file-upload__drop-zone six-file-upload__drop-zone--compact\">\n <div>\n <span>\n Upload\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-button>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders compact and disabled', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload compact disabled></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload compact=\"\" disabled=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-button class=\"six-file-upload__container--compact\" disabled=\"\">\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">\n arrow_circle_up\n </six-icon>\n </span>\n <div class=\"six-file-upload__drop-zone six-file-upload__drop-zone--compact\">\n <div>\n <span>\n Upload\n </span>\n <input class=\"six-file-upload__input\" disabled=\"\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-button>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders uploading', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload uploading></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload uploading=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-card class=\"six-file-upload__container--full\" disabled=\"\">\n <div class=\"six-file-upload__drop-zone\">\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner></six-spinner>\n Uploading...\n </span>\n </div>\n </six-card>\n </div>\n </six-file-upload>\n `);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"six-file-upload.spec.js","sourceRoot":"","sources":["../../../../src/components/six-file-upload/test/six-file-upload.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,qCAAqC;SAC5C,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,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;;;;;;KA2B7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { SixFileUpload } from '../six-file-upload';\nimport { newSpecPage } from '@stencil/core/testing';\n\ndescribe('six-file-upload', () => {\n it('should create a component instance', () => {\n expect(new SixFileUpload()).toBeInstanceOf(SixFileUpload);\n });\n\n it('renders minimal six-file-upload', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload>\n <div class=\"six-file-upload\">\n <six-card aria-invalid=\"false\" class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders custom label', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload label=\"some custom label\"></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload label=\"some custom label\">\n <div class=\"six-file-upload\">\n <six-card aria-invalid=\"false\" class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n some custom label\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders disabled', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload disabled></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload disabled=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-card aria-invalid=\"false\" class=\"six-file-upload__container--full\" disabled=\"\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" disabled=\"\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders compact', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload compact></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload compact=\"\">\n <div class=\"six-file-upload\">\n <six-button aria-invalid=\"false\" class=\"six-file-upload__container--compact\">\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">\n arrow_circle_up\n </six-icon>\n </span>\n <div class=\"six-file-upload__drop-zone six-file-upload__drop-zone--compact\">\n <div>\n <span>\n Upload\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-button>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders compact and disabled', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload compact disabled></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload compact=\"\" disabled=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-button aria-invalid=\"false\" class=\"six-file-upload__container--compact\" disabled=\"\">\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">\n arrow_circle_up\n </six-icon>\n </span>\n <div class=\"six-file-upload__drop-zone six-file-upload__drop-zone--compact\">\n <div>\n <span>\n Upload\n </span>\n <input class=\"six-file-upload__input\" disabled=\"\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-button>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders uploading', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload uploading></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload uploading=\"\">\n <div class=\"six-file-upload six-file-upload--disabled\">\n <six-card aria-invalid=\"false\" class=\"six-file-upload__container--full\" disabled=\"\">\n <div class=\"six-file-upload__drop-zone\">\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner></six-spinner>\n Uploading...\n </span>\n </div>\n </six-card>\n <div aria-hidden=\"true\"></div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('renders invalid', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload invalid error-text=\"error message\"></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload invalid error-text=\"error message\">\n <div class=\"six-file-upload\">\n <six-card aria-invalid=\"true\" class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"false\">\n <slot-fb name=\"error-text\">\n <six-error>\n <div class=\"six-file-upload__error-text\">error message</div>\n </six-error>\n </slot-fb>\n </div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('does not render error message if not invalid', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload error-text=\"error message\"></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload error-text=\"error message\">\n <div class=\"six-file-upload\">\n <six-card aria-invalid=\"false\" class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"true\">\n <slot-fb name=\"error-text\">\n <six-error>\n <div class=\"six-file-upload__error-text\">error message</div>\n </six-error>\n </slot-fb>\n </div>\n </div>\n </six-file-upload>\n `);\n });\n\n it('render error slot when invalid', async () => {\n const page = await newSpecPage({\n components: [SixFileUpload],\n html: `<six-file-upload invalid><slot name=\"error-text\"><b>bold error</b></six-file-upload>`,\n });\n\n expect(page.root).toEqualHtml(`\n <six-file-upload invalid>\n <slot hidden=\"\" name=\"error-text\">\n <b>\n bold error\n </b>\n </slot>\n <div class=\"six-file-upload\">\n <six-card aria-invalid=\"true\" class=\"six-file-upload__container--full\">\n <div class=\"six-file-upload__drop-zone\">\n <div>\n <span>\n <span>\n Drop files to upload, or\n <span class=\"six-file-upload__label--highlighted\">\n browse\n </span>\n </span>\n </span>\n <input class=\"six-file-upload__input\" name=\"resume\" type=\"file\">\n </div>\n </div>\n </six-card>\n <div aria-hidden=\"false\">\n </div>\n </div>\n </six-file-upload>\n `);\n });\n});\n"]}
|
|
@@ -7,7 +7,7 @@ import { h } from "@stencil/core";
|
|
|
7
7
|
*/
|
|
8
8
|
export class SixFooter {
|
|
9
9
|
render() {
|
|
10
|
-
return (h("footer", { key: '
|
|
10
|
+
return (h("footer", { key: '83474fa81c726623db04c5a06cfd72d9163257e4', class: "six-footer" }, h("slot", { key: '8a463c3b9f6ee3c00fd9222eca173f7b912bf54e' })));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "six-footer"; }
|
|
13
13
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class SixGroupLabel {
|
|
|
47
47
|
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(FormControl, { key: '
|
|
50
|
+
return (h(FormControl, { key: 'edc2f21913a2e4a40b516b69ac640950f8351a00', inputId: this.wrapperLabelId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, size: this.size, disabled: this.disabled, required: this.required }, h("slot", { key: 'a7fd4d86c9fcf071eb80239340d54925091c465d' })));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "six-group-label"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -35,6 +35,15 @@
|
|
|
35
35
|
.six-header__logo--clickable {
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
}
|
|
38
|
+
.six-header__logo--six {
|
|
39
|
+
height: 20px;
|
|
40
|
+
overflow: visible;
|
|
41
|
+
}
|
|
42
|
+
.six-header__logo--bme {
|
|
43
|
+
margin-top: 6px;
|
|
44
|
+
height: 40px;
|
|
45
|
+
overflow: visible;
|
|
46
|
+
}
|
|
38
47
|
.six-header__placeholder {
|
|
39
48
|
flex: 1;
|
|
40
49
|
}
|