@six-group/ui-library 0.0.0-insider.faf050a → 0.0.0-insider.fbc1348
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/error-messages-6e8049a4.js +119 -0
- package/dist/cjs/error-messages-6e8049a4.js.map +1 -0
- package/dist/cjs/{form-control-f9bc25dd.js → form-control-de259450.js} +2 -2
- package/dist/cjs/{form-control-f9bc25dd.js.map → form-control-de259450.js.map} +1 -1
- package/dist/cjs/{index-3baddcdc.js → index-1f707a55.js} +127 -76
- package/dist/cjs/index-1f707a55.js.map +1 -0
- package/dist/cjs/index.cjs.js +54 -101
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{modal-3ce015be.js → modal-bd7fc5bc.js} +1 -18
- package/dist/cjs/modal-bd7fc5bc.js.map +1 -0
- package/dist/cjs/{popup-40a9adbb.js → popup-e854acda.js} +2 -2
- package/dist/cjs/popup-e854acda.js.map +1 -0
- package/dist/cjs/six-alert.cjs.entry.js +42 -9
- package/dist/cjs/six-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/six-avatar.cjs.entry.js +5 -4
- package/dist/cjs/six-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-badge.cjs.entry.js +6 -5
- package/dist/cjs/six-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/six-button.cjs.entry.js +8 -6
- package/dist/cjs/six-button.cjs.entry.js.map +1 -1
- package/dist/cjs/six-card.cjs.entry.js +5 -4
- package/dist/cjs/six-card.cjs.entry.js.map +1 -1
- package/dist/cjs/six-checkbox_2.cjs.entry.js +192 -0
- package/dist/cjs/six-checkbox_2.cjs.entry.js.map +1 -0
- package/dist/cjs/six-datepicker.cjs.entry.js +44 -15
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-details.cjs.entry.js +7 -6
- package/dist/cjs/six-details.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dialog.cjs.entry.js +16 -32
- package/dist/cjs/six-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/six-drawer.cjs.entry.js +15 -32
- package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +204 -130
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error-page.cjs.entry.js +4 -3
- package/dist/cjs/six-error-page.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error.cjs.entry.js +4 -3
- package/dist/cjs/six-error.cjs.entry.js.map +1 -1
- package/dist/cjs/six-file-list-item.cjs.entry.js +6 -5
- package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/six-file-list.cjs.entry.js +4 -3
- package/dist/cjs/six-file-list.cjs.entry.js.map +1 -1
- package/dist/cjs/six-file-upload.cjs.entry.js +34 -9
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/six-footer.cjs.entry.js +5 -4
- package/dist/cjs/six-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/six-group-label.cjs.entry.js +7 -6
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-header.cjs.entry.js +43 -20
- package/dist/cjs/six-header.cjs.entry.js.map +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js +7 -6
- package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/six-icon.cjs.entry.js +6 -5
- package/dist/cjs/six-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +11 -8
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-item-picker.cjs.entry.js +106 -9
- package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-language-switcher.cjs.entry.js +11 -6
- package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
- package/dist/cjs/six-layout-grid.cjs.entry.js +4 -3
- package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/six-main-container.cjs.entry.js +4 -3
- package/dist/cjs/six-main-container.cjs.entry.js.map +1 -1
- package/dist/cjs/six-menu-divider.cjs.entry.js +5 -4
- package/dist/cjs/six-menu-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/six-menu-label.cjs.entry.js +5 -4
- package/dist/cjs/six-menu-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-picto.cjs.entry.js +4 -3
- package/dist/cjs/six-picto.cjs.entry.js.map +1 -1
- package/dist/cjs/six-progress-bar.cjs.entry.js +6 -5
- package/dist/cjs/six-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-progress-ring.cjs.entry.js +5 -4
- package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +6 -5
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +18 -7
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-root.cjs.entry.js +4 -22
- package/dist/cjs/six-root.cjs.entry.js.map +1 -1
- package/dist/cjs/six-search-field.cjs.entry.js +5 -4
- package/dist/cjs/six-search-field.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +340 -182
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +5 -4
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar-item.cjs.entry.js +5 -4
- package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +6 -5
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-spinner.cjs.entry.js +5 -4
- package/dist/cjs/six-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/six-stage-indicator.cjs.entry.js +23 -0
- package/dist/cjs/six-stage-indicator.cjs.entry.js.map +1 -0
- package/dist/cjs/six-switch.cjs.entry.js +8 -7
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tab-group.cjs.entry.js +35 -9
- package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tab-panel.cjs.entry.js +5 -4
- package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tab.cjs.entry.js +6 -5
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +7 -6
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +8 -7
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tile.cjs.entry.js +8 -7
- package/dist/cjs/six-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +8 -7
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +6 -5
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{slot-9821749e.js → slot-1b1232a1.js} +1 -3
- package/dist/cjs/slot-1b1232a1.js.map +1 -0
- package/dist/cjs/{types-0a6d66f6.js → types-d3da200b.js} +3 -1
- package/dist/cjs/types-d3da200b.js.map +1 -0
- package/dist/cjs/ui-library.cjs.js +6 -4
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/assets/TRADEMARKS.md +3 -3
- package/dist/collection/collection-manifest.json +5 -6
- package/dist/collection/components/six-alert/six-alert.css +5 -1
- package/dist/collection/components/six-alert/six-alert.js +57 -12
- package/dist/collection/components/six-alert/six-alert.js.map +1 -1
- package/dist/collection/components/six-avatar/six-avatar.css +2 -2
- package/dist/collection/components/six-avatar/six-avatar.js +1 -1
- package/dist/collection/components/six-avatar/six-avatar.js.map +1 -1
- package/dist/collection/components/six-badge/six-badge.css +1 -1
- package/dist/collection/components/six-badge/six-badge.js +2 -2
- package/dist/collection/components/six-badge/six-badge.js.map +1 -1
- package/dist/collection/components/six-button/six-button.css +19 -1
- package/dist/collection/components/six-button/six-button.js +8 -6
- package/dist/collection/components/six-button/six-button.js.map +1 -1
- package/dist/collection/components/six-button/test/six-button.spec.js.map +1 -1
- package/dist/collection/components/six-card/six-card.css +4 -5
- package/dist/collection/components/six-card/six-card.js +1 -1
- package/dist/collection/components/six-card/six-card.js.map +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +8 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +5 -4
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-date-formats.js +1 -0
- package/dist/collection/components/six-datepicker/six-date-formats.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.css +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +20 -16
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-details/six-details.css +1 -5
- package/dist/collection/components/six-details/six-details.js +3 -3
- package/dist/collection/components/six-details/six-details.js.map +1 -1
- package/dist/collection/components/six-dialog/six-dialog.css +2 -2
- package/dist/collection/components/six-dialog/six-dialog.js +10 -28
- package/dist/collection/components/six-dialog/six-dialog.js.map +1 -1
- package/dist/collection/components/six-drawer/six-drawer.css +2 -2
- package/dist/collection/components/six-drawer/six-drawer.js +9 -28
- package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
- package/dist/collection/components/six-dropdown/six-dropdown.css +22 -7
- package/dist/collection/components/six-dropdown/six-dropdown.js +216 -124
- package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -1
- package/dist/collection/components/six-dropdown/test/six-dropdown.spec.js +54 -29
- package/dist/collection/components/six-dropdown/test/six-dropdown.spec.js.map +1 -1
- package/dist/collection/components/six-error/six-error.js +1 -1
- package/dist/collection/components/six-error/six-error.js.map +1 -1
- package/dist/collection/components/six-error-page/six-error-page.js +1 -1
- package/dist/collection/components/six-error-page/six-error-page.js.map +1 -1
- package/dist/collection/components/six-file-list/six-file-list.js +1 -1
- package/dist/collection/components/six-file-list/six-file-list.js.map +1 -1
- package/dist/collection/components/six-file-list-item/six-file-list-item.css +1 -1
- package/dist/collection/components/six-file-list-item/six-file-list-item.js +2 -2
- package/dist/collection/components/six-file-list-item/six-file-list-item.js.map +1 -1
- package/dist/collection/components/six-file-upload/six-file-upload.css +12 -4
- 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-footer/six-footer.css +2 -2
- package/dist/collection/components/six-footer/six-footer.js +1 -1
- package/dist/collection/components/six-footer/six-footer.js.map +1 -1
- package/dist/collection/components/six-group-label/six-group-label.css +1 -1
- package/dist/collection/components/six-group-label/six-group-label.js +1 -1
- package/dist/collection/components/six-group-label/six-group-label.js.map +1 -1
- package/dist/collection/components/six-header/six-header.css +15 -2
- package/dist/collection/components/six-header/six-header.js +77 -18
- package/dist/collection/components/six-header/six-header.js.map +1 -1
- package/dist/collection/components/six-icon/six-icon.css +5 -2
- package/dist/collection/components/six-icon/six-icon.js +2 -2
- package/dist/collection/components/six-icon/six-icon.js.map +1 -1
- package/dist/collection/components/six-icon-button/six-icon-button.css +1 -1
- package/dist/collection/components/six-icon-button/six-icon-button.js +3 -3
- package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -1
- package/dist/collection/components/six-input/six-input.css +10 -1
- package/dist/collection/components/six-input/six-input.js +47 -19
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-item-picker/six-item-picker.css +8 -0
- package/dist/collection/components/six-item-picker/six-item-picker.js +101 -5
- package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -1
- package/dist/collection/components/six-item-picker/test/six-item-picker.spec.js +57 -57
- package/dist/collection/components/six-item-picker/test/six-item-picker.spec.js.map +1 -1
- package/dist/collection/components/six-item-picker/types.js +2 -0
- package/dist/collection/components/six-item-picker/types.js.map +1 -1
- package/dist/collection/components/six-language-switcher/six-language-switcher.css +7 -2
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +7 -3
- 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 +20 -20
- 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-layout-grid/six-layout-grid.js.map +1 -1
- package/dist/collection/components/six-main-container/six-main-container.js +1 -1
- package/dist/collection/components/six-main-container/six-main-container.js.map +1 -1
- package/dist/collection/components/six-menu/six-menu.css +8 -7
- package/dist/collection/components/six-menu/six-menu.js +30 -8
- package/dist/collection/components/six-menu/six-menu.js.map +1 -1
- package/dist/collection/components/six-menu/test/six-menu.spec.js +6 -6
- package/dist/collection/components/six-menu/test/six-menu.spec.js.map +1 -1
- package/dist/collection/components/six-menu-divider/six-menu-divider.css +3 -2
- package/dist/collection/components/six-menu-divider/six-menu-divider.js +1 -1
- package/dist/collection/components/six-menu-divider/six-menu-divider.js.map +1 -1
- package/dist/collection/components/six-menu-item/six-menu-item.css +13 -2
- package/dist/collection/components/six-menu-item/six-menu-item.js +37 -8
- package/dist/collection/components/six-menu-item/six-menu-item.js.map +1 -1
- package/dist/collection/components/six-menu-label/six-menu-label.css +1 -1
- package/dist/collection/components/six-menu-label/six-menu-label.js +1 -1
- package/dist/collection/components/six-menu-label/six-menu-label.js.map +1 -1
- package/dist/collection/components/six-picto/six-picto.js +1 -1
- package/dist/collection/components/six-picto/six-picto.js.map +1 -1
- package/dist/collection/components/six-progress-bar/six-progress-bar.css +1 -1
- package/dist/collection/components/six-progress-bar/six-progress-bar.js +2 -2
- package/dist/collection/components/six-progress-bar/six-progress-bar.js.map +1 -1
- package/dist/collection/components/six-progress-ring/six-progress-ring.css +1 -1
- package/dist/collection/components/six-progress-ring/six-progress-ring.js +1 -1
- package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -1
- package/dist/collection/components/six-radio/six-radio.css +1 -1
- package/dist/collection/components/six-radio/six-radio.js +5 -4
- package/dist/collection/components/six-radio/six-radio.js.map +1 -1
- package/dist/collection/components/six-range/six-range.css +2 -2
- package/dist/collection/components/six-range/six-range.js +15 -4
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-root/six-root.js +1 -69
- package/dist/collection/components/six-root/six-root.js.map +1 -1
- package/dist/collection/components/six-root/test/six-root.spec.js +0 -7
- package/dist/collection/components/six-root/test/six-root.spec.js.map +1 -1
- package/dist/collection/components/six-search-field/six-search-field.css +1 -1
- package/dist/collection/components/six-search-field/six-search-field.js +1 -1
- package/dist/collection/components/six-search-field/six-search-field.js.map +1 -1
- package/dist/collection/components/six-select/six-select.css +54 -66
- package/dist/collection/components/six-select/six-select.js +351 -183
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/six-select.spec.js +31 -15
- package/dist/collection/components/six-select/test/six-select.spec.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.css +2 -2
- package/dist/collection/components/six-sidebar/six-sidebar.js +8 -6
- package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -1
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js.map +1 -1
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +2 -1
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
- package/dist/collection/components/six-spinner/six-spinner.css +1 -1
- package/dist/collection/components/six-spinner/six-spinner.js +2 -1
- package/dist/collection/components/six-spinner/six-spinner.js.map +1 -1
- package/dist/collection/components/six-spinner/test/six-spinner.spec.js +1 -1
- package/dist/collection/components/six-spinner/test/six-spinner.spec.js.map +1 -1
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.css +1 -1
- package/dist/collection/components/six-switch/six-switch.css +1 -1
- package/dist/collection/components/six-switch/six-switch.js +5 -4
- package/dist/collection/components/six-switch/six-switch.js.map +1 -1
- package/dist/collection/components/six-tab/six-tab.css +1 -1
- package/dist/collection/components/six-tab/six-tab.js +5 -4
- package/dist/collection/components/six-tab/six-tab.js.map +1 -1
- package/dist/collection/components/six-tab-group/six-tab-group.css +1 -1
- package/dist/collection/components/six-tab-group/six-tab-group.js +36 -9
- package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
- package/dist/collection/components/six-tab-panel/six-tab-panel.css +1 -1
- package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
- package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -1
- package/dist/collection/components/six-tag/six-tag.css +1 -1
- package/dist/collection/components/six-tag/six-tag.js +2 -2
- package/dist/collection/components/six-tag/six-tag.js.map +1 -1
- package/dist/collection/components/six-textarea/six-textarea.css +1 -1
- package/dist/collection/components/six-textarea/six-textarea.js +26 -18
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
- package/dist/collection/components/six-tile/six-tile.css +2 -2
- package/dist/collection/components/six-tile/six-tile.js +3 -3
- package/dist/collection/components/six-tile/six-tile.js.map +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.css +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.js +4 -3
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/alert.js +54 -0
- package/dist/collection/utils/alert.js.map +1 -0
- package/dist/collection/utils/date-util.js +25 -0
- package/dist/collection/utils/date-util.js.map +1 -1
- package/dist/collection/utils/date-util.spec.js.map +1 -1
- package/dist/collection/utils/error-messages.js +7 -0
- package/dist/collection/utils/error-messages.js.map +1 -1
- package/dist/collection/utils/event-listeners.js.map +1 -1
- package/dist/collection/utils/focus-visible.js.map +1 -1
- package/dist/collection/utils/form.js.map +1 -1
- package/dist/collection/utils/modal.js.map +1 -1
- package/dist/collection/utils/popover.js.map +1 -1
- package/dist/collection/utils/popup.js +1 -1
- package/dist/collection/utils/popup.js.map +1 -1
- package/dist/collection/utils/scroll.js.map +1 -1
- package/dist/collection/utils/slot.js +0 -1
- package/dist/collection/utils/slot.js.map +1 -1
- package/dist/collection/utils/tabbable.js.map +1 -1
- package/dist/collection/utils/time.util.js.map +1 -1
- package/dist/collection/utils/time.util.spec.js.map +1 -1
- package/dist/components/index.js +50 -102
- package/dist/components/index.js.map +1 -1
- package/dist/components/modal.js +1 -17
- package/dist/components/modal.js.map +1 -1
- package/dist/components/six-alert.js +41 -8
- package/dist/components/six-alert.js.map +1 -1
- package/dist/components/six-avatar.js +4 -3
- package/dist/components/six-avatar.js.map +1 -1
- package/dist/components/six-badge.js +5 -4
- package/dist/components/six-badge.js.map +1 -1
- package/dist/components/six-button.js +1 -142
- package/dist/components/six-button.js.map +1 -1
- package/dist/components/six-button2.js +148 -0
- package/dist/components/six-button2.js.map +1 -0
- package/dist/components/six-card.js +4 -3
- package/dist/components/six-card.js.map +1 -1
- package/dist/components/six-checkbox.js +1 -161
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-checkbox2.js +166 -0
- package/dist/components/six-checkbox2.js.map +1 -0
- package/dist/components/six-datepicker.js +41 -12
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-details2.js +6 -5
- package/dist/components/six-details2.js.map +1 -1
- package/dist/components/six-dialog.js +14 -30
- package/dist/components/six-dialog.js.map +1 -1
- package/dist/components/six-drawer.js +13 -30
- package/dist/components/six-drawer.js.map +1 -1
- package/dist/components/six-dropdown2.js +204 -127
- package/dist/components/six-dropdown2.js.map +1 -1
- package/dist/components/six-error-page.js +3 -2
- package/dist/components/six-error-page.js.map +1 -1
- package/dist/components/six-error2.js +3 -2
- package/dist/components/six-error2.js.map +1 -1
- package/dist/components/six-file-list-item.js +5 -4
- package/dist/components/six-file-list-item.js.map +1 -1
- package/dist/components/six-file-list.js +3 -2
- package/dist/components/six-file-list.js.map +1 -1
- package/dist/components/six-file-upload.js +53 -12
- package/dist/components/six-file-upload.js.map +1 -1
- package/dist/components/six-footer.js +4 -3
- package/dist/components/six-footer.js.map +1 -1
- package/dist/components/six-group-label.js +4 -3
- package/dist/components/six-group-label.js.map +1 -1
- package/dist/components/six-header.js +50 -19
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-icon-button2.js +6 -5
- package/dist/components/six-icon-button2.js.map +1 -1
- package/dist/components/six-icon2.js +5 -4
- package/dist/components/six-icon2.js.map +1 -1
- package/dist/components/six-input2.js +9 -5
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-item-picker2.js +106 -7
- package/dist/components/six-item-picker2.js.map +1 -1
- package/dist/components/six-language-switcher.js +10 -5
- package/dist/components/six-language-switcher.js.map +1 -1
- package/dist/components/six-layout-grid.js +3 -2
- package/dist/components/six-layout-grid.js.map +1 -1
- package/dist/components/six-main-container.js +3 -2
- package/dist/components/six-main-container.js.map +1 -1
- package/dist/components/six-menu-divider.js +4 -3
- package/dist/components/six-menu-divider.js.map +1 -1
- package/dist/components/six-menu-item2.js +31 -7
- package/dist/components/six-menu-item2.js.map +1 -1
- package/dist/components/six-menu-label.js +4 -3
- package/dist/components/six-menu-label.js.map +1 -1
- package/dist/components/six-menu2.js +26 -9
- package/dist/components/six-menu2.js.map +1 -1
- package/dist/components/six-picto2.js +3 -2
- package/dist/components/six-picto2.js.map +1 -1
- package/dist/components/six-progress-bar.js +5 -4
- package/dist/components/six-progress-bar.js.map +1 -1
- package/dist/components/six-progress-ring.js +4 -3
- package/dist/components/six-progress-ring.js.map +1 -1
- package/dist/components/six-radio.js +5 -4
- package/dist/components/six-radio.js.map +1 -1
- package/dist/components/six-range.js +15 -4
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-root.js +6 -34
- package/dist/components/six-root.js.map +1 -1
- package/dist/components/six-search-field.js +4 -3
- package/dist/components/six-search-field.js.map +1 -1
- package/dist/components/six-select.js +478 -201
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar-item-group.js +3 -2
- package/dist/components/six-sidebar-item-group.js.map +1 -1
- package/dist/components/six-sidebar-item.js +4 -3
- package/dist/components/six-sidebar-item.js.map +1 -1
- package/dist/components/six-sidebar.js +5 -4
- package/dist/components/six-sidebar.js.map +1 -1
- package/dist/components/six-spinner2.js +4 -3
- package/dist/components/six-spinner2.js.map +1 -1
- package/dist/components/six-stage-indicator2.js +3 -2
- package/dist/components/six-stage-indicator2.js.map +1 -1
- package/dist/components/six-switch.js +5 -4
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tab-group.js +36 -9
- package/dist/components/six-tab-group.js.map +1 -1
- package/dist/components/six-tab-panel.js +4 -3
- package/dist/components/six-tab-panel.js.map +1 -1
- package/dist/components/six-tab.js +5 -4
- package/dist/components/six-tab.js.map +1 -1
- package/dist/components/six-tag.js +99 -1
- package/dist/components/six-tag.js.map +1 -1
- package/dist/components/six-textarea.js +5 -4
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-tile.js +6 -5
- package/dist/components/six-tile.js.map +1 -1
- package/dist/components/six-timepicker2.js +5 -4
- package/dist/components/six-timepicker2.js.map +1 -1
- package/dist/components/six-tooltip2.js +5 -4
- package/dist/components/six-tooltip2.js.map +1 -1
- package/dist/components/slot.js +1 -2
- package/dist/components/slot.js.map +1 -1
- package/dist/components.d.ts +1 -21
- package/dist/components.json +741 -242
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/error-messages-1eaaad23.js +115 -0
- package/dist/esm/error-messages-1eaaad23.js.map +1 -0
- package/dist/esm/{form-control-6b30894f.js → form-control-30c5bd8b.js} +2 -2
- package/dist/esm/{form-control-6b30894f.js.map → form-control-30c5bd8b.js.map} +1 -1
- package/dist/esm/{index-17d8173e.js → index-5390c1d6.js} +127 -76
- package/dist/esm/index-5390c1d6.js.map +1 -0
- package/dist/esm/index.js +51 -100
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +6 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{modal-96526245.js → modal-6c1288e3.js} +2 -18
- package/dist/esm/modal-6c1288e3.js.map +1 -0
- package/dist/esm/{popup-e8049817.js → popup-7209e9d5.js} +2 -2
- package/dist/esm/popup-7209e9d5.js.map +1 -0
- package/dist/esm/six-alert.entry.js +42 -9
- package/dist/esm/six-alert.entry.js.map +1 -1
- package/dist/esm/six-avatar.entry.js +5 -4
- package/dist/esm/six-avatar.entry.js.map +1 -1
- package/dist/esm/six-badge.entry.js +6 -5
- package/dist/esm/six-badge.entry.js.map +1 -1
- package/dist/esm/six-button.entry.js +8 -6
- package/dist/esm/six-button.entry.js.map +1 -1
- package/dist/esm/six-card.entry.js +5 -4
- package/dist/esm/six-card.entry.js.map +1 -1
- package/dist/esm/six-checkbox_2.entry.js +187 -0
- package/dist/esm/six-checkbox_2.entry.js.map +1 -0
- package/dist/esm/six-datepicker.entry.js +44 -15
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-details.entry.js +7 -6
- package/dist/esm/six-details.entry.js.map +1 -1
- package/dist/esm/six-dialog.entry.js +16 -32
- package/dist/esm/six-dialog.entry.js.map +1 -1
- package/dist/esm/six-drawer.entry.js +15 -32
- package/dist/esm/six-drawer.entry.js.map +1 -1
- package/dist/esm/six-dropdown_2.entry.js +205 -131
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error-page.entry.js +4 -3
- package/dist/esm/six-error-page.entry.js.map +1 -1
- package/dist/esm/six-error.entry.js +4 -3
- package/dist/esm/six-error.entry.js.map +1 -1
- package/dist/esm/six-file-list-item.entry.js +6 -5
- package/dist/esm/six-file-list-item.entry.js.map +1 -1
- package/dist/esm/six-file-list.entry.js +4 -3
- package/dist/esm/six-file-list.entry.js.map +1 -1
- package/dist/esm/six-file-upload.entry.js +34 -9
- package/dist/esm/six-file-upload.entry.js.map +1 -1
- package/dist/esm/six-footer.entry.js +5 -4
- package/dist/esm/six-footer.entry.js.map +1 -1
- package/dist/esm/six-group-label.entry.js +7 -6
- package/dist/esm/six-group-label.entry.js.map +1 -1
- package/dist/esm/six-header.entry.js +43 -20
- package/dist/esm/six-header.entry.js.map +1 -1
- package/dist/esm/six-icon-button.entry.js +7 -6
- package/dist/esm/six-icon-button.entry.js.map +1 -1
- package/dist/esm/six-icon.entry.js +6 -5
- package/dist/esm/six-icon.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +11 -8
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-item-picker.entry.js +106 -9
- package/dist/esm/six-item-picker.entry.js.map +1 -1
- package/dist/esm/six-language-switcher.entry.js +11 -6
- package/dist/esm/six-language-switcher.entry.js.map +1 -1
- package/dist/esm/six-layout-grid.entry.js +4 -3
- package/dist/esm/six-layout-grid.entry.js.map +1 -1
- package/dist/esm/six-main-container.entry.js +4 -3
- package/dist/esm/six-main-container.entry.js.map +1 -1
- package/dist/esm/six-menu-divider.entry.js +5 -4
- package/dist/esm/six-menu-divider.entry.js.map +1 -1
- package/dist/esm/six-menu-label.entry.js +5 -4
- package/dist/esm/six-menu-label.entry.js.map +1 -1
- package/dist/esm/six-picto.entry.js +4 -3
- package/dist/esm/six-picto.entry.js.map +1 -1
- package/dist/esm/six-progress-bar.entry.js +6 -5
- package/dist/esm/six-progress-bar.entry.js.map +1 -1
- package/dist/esm/six-progress-ring.entry.js +5 -4
- package/dist/esm/six-progress-ring.entry.js.map +1 -1
- package/dist/esm/six-radio.entry.js +6 -5
- package/dist/esm/six-radio.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +18 -7
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-root.entry.js +4 -22
- package/dist/esm/six-root.entry.js.map +1 -1
- package/dist/esm/six-search-field.entry.js +5 -4
- package/dist/esm/six-search-field.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +340 -182
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar-item-group.entry.js +5 -4
- package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
- package/dist/esm/six-sidebar-item.entry.js +5 -4
- package/dist/esm/six-sidebar-item.entry.js.map +1 -1
- package/dist/esm/six-sidebar.entry.js +6 -5
- package/dist/esm/six-sidebar.entry.js.map +1 -1
- package/dist/esm/six-spinner.entry.js +5 -4
- package/dist/esm/six-spinner.entry.js.map +1 -1
- package/dist/esm/six-stage-indicator.entry.js +19 -0
- package/dist/esm/six-stage-indicator.entry.js.map +1 -0
- package/dist/esm/six-switch.entry.js +8 -7
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tab-group.entry.js +35 -9
- package/dist/esm/six-tab-group.entry.js.map +1 -1
- package/dist/esm/six-tab-panel.entry.js +5 -4
- package/dist/esm/six-tab-panel.entry.js.map +1 -1
- package/dist/esm/six-tab.entry.js +6 -5
- package/dist/esm/six-tab.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +7 -6
- package/dist/esm/six-tag.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +8 -7
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-tile.entry.js +8 -7
- package/dist/esm/six-tile.entry.js.map +1 -1
- package/dist/esm/six-timepicker.entry.js +8 -7
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +6 -5
- package/dist/esm/six-tooltip.entry.js.map +1 -1
- package/dist/esm/{slot-41bc439a.js → slot-56531341.js} +2 -3
- package/dist/esm/slot-56531341.js.map +1 -0
- package/dist/esm/{types-07748c42.js → types-a07bb999.js} +3 -1
- package/dist/esm/types-a07bb999.js.map +1 -0
- package/dist/esm/ui-library.js +7 -5
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-alert/six-alert.d.ts +13 -6
- package/dist/types/components/six-button/six-button.d.ts +1 -1
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
- package/dist/types/components/six-dialog/six-dialog.d.ts +1 -0
- package/dist/types/components/six-dropdown/six-dropdown.d.ts +28 -9
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +10 -0
- package/dist/types/components/six-header/six-header.d.ts +8 -2
- package/dist/types/components/six-input/six-input.d.ts +4 -0
- package/dist/types/components/six-item-picker/six-item-picker.d.ts +7 -0
- package/dist/types/components/six-menu/six-menu.d.ts +4 -0
- package/dist/types/components/six-menu-item/six-menu-item.d.ts +7 -1
- package/dist/types/components/six-range/six-range.d.ts +2 -0
- package/dist/types/components/six-root/six-root.d.ts +0 -13
- package/dist/types/components/six-select/six-select.d.ts +27 -13
- package/dist/types/components/six-select/util.d.ts +2 -0
- package/dist/types/components/six-spinner/six-spinner.d.ts +1 -0
- package/dist/types/components/six-tab-group/six-tab-group.d.ts +4 -1
- package/dist/types/components.d.ts +120 -62
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/utils/alert.d.ts +10 -0
- package/dist/types/utils/date-util.d.ts +9 -1
- package/dist/types/utils/error-messages.d.ts +1 -0
- package/dist/types/utils/slot.d.ts +0 -1
- package/dist/ui-library/assets/TRADEMARKS.md +3 -3
- package/dist/ui-library/index.esm.js +1 -1
- package/dist/ui-library/index.esm.js.map +1 -1
- package/dist/ui-library/p-030fa1fa.entry.js +2 -0
- package/dist/ui-library/p-030fa1fa.entry.js.map +1 -0
- package/dist/ui-library/p-03d1b956.entry.js +2 -0
- package/dist/ui-library/p-03d1b956.entry.js.map +1 -0
- package/dist/ui-library/p-047d02ad.entry.js +2 -0
- package/dist/ui-library/p-047d02ad.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-060069d4.entry.js +2 -0
- package/dist/ui-library/p-060069d4.entry.js.map +1 -0
- package/dist/ui-library/p-06ba653e.entry.js +2 -0
- package/dist/ui-library/p-06ba653e.entry.js.map +1 -0
- package/dist/ui-library/p-07c8de65.entry.js +2 -0
- package/dist/ui-library/p-07c8de65.entry.js.map +1 -0
- package/dist/ui-library/p-0cebf1d2.js +2 -0
- package/dist/ui-library/p-0cebf1d2.js.map +1 -0
- package/dist/ui-library/p-0fb3fb30.entry.js +2 -0
- package/dist/ui-library/p-0fb3fb30.entry.js.map +1 -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-189602e4.entry.js.map +1 -0
- package/dist/ui-library/p-19560508.entry.js +2 -0
- package/dist/ui-library/p-19560508.entry.js.map +1 -0
- package/dist/ui-library/p-21074819.entry.js +2 -0
- package/dist/ui-library/p-21074819.entry.js.map +1 -0
- package/dist/ui-library/p-2386627e.entry.js +2 -0
- package/dist/ui-library/p-2386627e.entry.js.map +1 -0
- 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-32e421a3.entry.js +2 -0
- package/dist/ui-library/p-32e421a3.entry.js.map +1 -0
- package/dist/ui-library/p-3603dd96.entry.js +2 -0
- package/dist/ui-library/p-3603dd96.entry.js.map +1 -0
- package/dist/ui-library/p-39ff5f61.entry.js +2 -0
- package/dist/ui-library/p-39ff5f61.entry.js.map +1 -0
- package/dist/ui-library/p-3b5a76ea.entry.js +2 -0
- package/dist/ui-library/p-3b5a76ea.entry.js.map +1 -0
- package/dist/ui-library/p-419ed003.entry.js +2 -0
- package/dist/ui-library/p-419ed003.entry.js.map +1 -0
- package/dist/ui-library/p-45003bae.entry.js +2 -0
- package/dist/ui-library/p-45003bae.entry.js.map +1 -0
- package/dist/ui-library/p-4963f03c.entry.js +2 -0
- package/dist/ui-library/p-4963f03c.entry.js.map +1 -0
- package/dist/ui-library/p-4d89932f.entry.js +2 -0
- package/dist/ui-library/p-4d89932f.entry.js.map +1 -0
- package/dist/ui-library/{p-6907a7dc.js → p-605bdd81.js} +2 -2
- package/dist/ui-library/p-63acceb6.entry.js +2 -0
- package/dist/ui-library/p-63acceb6.entry.js.map +1 -0
- package/dist/ui-library/p-651293e7.js +2 -0
- package/dist/ui-library/p-651293e7.js.map +1 -0
- package/dist/ui-library/p-6888b9ee.entry.js +2 -0
- package/dist/ui-library/p-6888b9ee.entry.js.map +1 -0
- package/dist/ui-library/p-6f9153be.entry.js +2 -0
- package/dist/ui-library/p-6f9153be.entry.js.map +1 -0
- package/dist/ui-library/p-7561b336.entry.js +2 -0
- package/dist/ui-library/p-7561b336.entry.js.map +1 -0
- package/dist/ui-library/p-7c18b8ca.entry.js +2 -0
- package/dist/ui-library/p-7c18b8ca.entry.js.map +1 -0
- 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-0861899a.js → p-862d474e.js} +1 -1
- package/dist/ui-library/p-862d474e.js.map +1 -0
- package/dist/ui-library/p-89db9a8b.entry.js +2 -0
- package/dist/ui-library/p-89db9a8b.entry.js.map +1 -0
- package/dist/ui-library/{p-d310a6dd.entry.js → p-8f1d3461.entry.js} +2 -2
- package/dist/ui-library/p-8f1d3461.entry.js.map +1 -0
- package/dist/ui-library/p-8fb96142.entry.js +2 -0
- package/dist/ui-library/p-8fb96142.entry.js.map +1 -0
- 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-9bc1639b.entry.js +2 -0
- package/dist/ui-library/p-9bc1639b.entry.js.map +1 -0
- package/dist/ui-library/p-9cb83369.entry.js +2 -0
- package/dist/ui-library/p-9cb83369.entry.js.map +1 -0
- package/dist/ui-library/p-a398e3eb.entry.js +2 -0
- package/dist/ui-library/p-a398e3eb.entry.js.map +1 -0
- package/dist/ui-library/p-a7e2f511.entry.js +2 -0
- package/dist/ui-library/p-a7e2f511.entry.js.map +1 -0
- package/dist/ui-library/p-a8863197.entry.js +2 -0
- package/dist/ui-library/p-a8863197.entry.js.map +1 -0
- package/dist/ui-library/p-a9e009af.entry.js +2 -0
- package/dist/ui-library/p-a9e009af.entry.js.map +1 -0
- package/dist/ui-library/p-ac00076d.entry.js +2 -0
- package/dist/ui-library/p-ac00076d.entry.js.map +1 -0
- package/dist/ui-library/p-b4bc4915.entry.js +2 -0
- package/dist/ui-library/p-b4bc4915.entry.js.map +1 -0
- package/dist/ui-library/p-b5acf54d.entry.js +2 -0
- package/dist/ui-library/p-b5acf54d.entry.js.map +1 -0
- package/dist/ui-library/p-b60c20aa.entry.js +2 -0
- package/dist/ui-library/p-b60c20aa.entry.js.map +1 -0
- 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-c35a7cef.entry.js +2 -0
- package/dist/ui-library/p-c35a7cef.entry.js.map +1 -0
- package/dist/ui-library/p-c62893e5.entry.js +2 -0
- package/dist/ui-library/p-c62893e5.entry.js.map +1 -0
- package/dist/ui-library/p-c6464bfe.entry.js +2 -0
- package/dist/ui-library/p-c6464bfe.entry.js.map +1 -0
- package/dist/ui-library/p-cf109cbf.entry.js +2 -0
- package/dist/ui-library/p-cf109cbf.entry.js.map +1 -0
- package/dist/ui-library/p-d07b549f.entry.js +2 -0
- package/dist/ui-library/p-d07b549f.entry.js.map +1 -0
- package/dist/ui-library/p-d42f1ea9.entry.js +2 -0
- package/dist/ui-library/p-d42f1ea9.entry.js.map +1 -0
- package/dist/ui-library/p-e080d5b6.js +2 -0
- package/dist/ui-library/p-e080d5b6.js.map +1 -0
- package/dist/ui-library/p-e1255160.js +2 -0
- package/dist/ui-library/p-e1255160.js.map +1 -0
- package/dist/ui-library/p-f136a6b2.js +2 -0
- package/dist/ui-library/p-f136a6b2.js.map +1 -0
- package/dist/ui-library/p-fe37dadf.entry.js +2 -0
- package/dist/ui-library/p-fe37dadf.entry.js.map +1 -0
- package/dist/ui-library/p-fe89a7c4.entry.js +2 -0
- package/dist/ui-library/p-fe89a7c4.entry.js.map +1 -0
- package/dist/ui-library/ui-library.css +1 -10
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +10 -13
- package/dist/cjs/index-3baddcdc.js.map +0 -1
- package/dist/cjs/modal-3ce015be.js.map +0 -1
- package/dist/cjs/popup-40a9adbb.js.map +0 -1
- package/dist/cjs/set-attributes_2.cjs.entry.js +0 -73
- package/dist/cjs/set-attributes_2.cjs.entry.js.map +0 -1
- package/dist/cjs/six-checkbox.cjs.entry.js +0 -127
- package/dist/cjs/six-checkbox.cjs.entry.js.map +0 -1
- package/dist/cjs/six-menu-item.cjs.entry.js +0 -63
- package/dist/cjs/six-menu-item.cjs.entry.js.map +0 -1
- package/dist/cjs/slot-9821749e.js.map +0 -1
- package/dist/cjs/types-0a6d66f6.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 -133
- package/dist/collection/components/six-header/test/six-header.spec.js.map +0 -1
- package/dist/collection/utils/support.js +0 -16
- package/dist/collection/utils/support.js.map +0 -1
- package/dist/collection/wrappers/set-attributes/set-attributes.js +0 -74
- package/dist/collection/wrappers/set-attributes/set-attributes.js.map +0 -1
- package/dist/collection/wrappers/set-attributes/test/set-attributes.spec.js +0 -16
- package/dist/collection/wrappers/set-attributes/test/set-attributes.spec.js.map +0 -1
- package/dist/components/set-attributes.d.ts +0 -11
- package/dist/components/set-attributes.js +0 -8
- package/dist/components/set-attributes.js.map +0 -1
- package/dist/components/set-attributes2.js +0 -73
- package/dist/components/set-attributes2.js.map +0 -1
- package/dist/components/six-tag2.js +0 -102
- package/dist/components/six-tag2.js.map +0 -1
- package/dist/esm/index-17d8173e.js.map +0 -1
- package/dist/esm/modal-96526245.js.map +0 -1
- package/dist/esm/popup-e8049817.js.map +0 -1
- package/dist/esm/set-attributes_2.entry.js +0 -68
- package/dist/esm/set-attributes_2.entry.js.map +0 -1
- package/dist/esm/six-checkbox.entry.js +0 -123
- package/dist/esm/six-checkbox.entry.js.map +0 -1
- package/dist/esm/six-menu-item.entry.js +0 -59
- package/dist/esm/six-menu-item.entry.js.map +0 -1
- package/dist/esm/slot-41bc439a.js.map +0 -1
- package/dist/esm/types-07748c42.js.map +0 -1
- package/dist/types/utils/support.d.ts +0 -1
- package/dist/types/wrappers/set-attributes/set-attributes.d.ts +0 -9
- package/dist/ui-library/assets/six-logo.svg +0 -1
- package/dist/ui-library/p-0861899a.js.map +0 -1
- package/dist/ui-library/p-0a81b42c.entry.js +0 -2
- package/dist/ui-library/p-0a81b42c.entry.js.map +0 -1
- package/dist/ui-library/p-0beec94f.js +0 -3
- package/dist/ui-library/p-0beec94f.js.map +0 -1
- package/dist/ui-library/p-100d5a25.entry.js +0 -2
- package/dist/ui-library/p-100d5a25.entry.js.map +0 -1
- package/dist/ui-library/p-178f5782.entry.js +0 -2
- package/dist/ui-library/p-178f5782.entry.js.map +0 -1
- package/dist/ui-library/p-19a61686.entry.js +0 -2
- package/dist/ui-library/p-19a61686.entry.js.map +0 -1
- package/dist/ui-library/p-1d0c5929.entry.js +0 -2
- package/dist/ui-library/p-1d0c5929.entry.js.map +0 -1
- package/dist/ui-library/p-23c02c98.entry.js +0 -2
- package/dist/ui-library/p-23c02c98.entry.js.map +0 -1
- package/dist/ui-library/p-2f9f2532.entry.js +0 -2
- package/dist/ui-library/p-2f9f2532.entry.js.map +0 -1
- package/dist/ui-library/p-3187bc23.entry.js +0 -2
- package/dist/ui-library/p-3187bc23.entry.js.map +0 -1
- package/dist/ui-library/p-32e1a5ab.entry.js +0 -2
- package/dist/ui-library/p-32e1a5ab.entry.js.map +0 -1
- package/dist/ui-library/p-3d54ecf2.entry.js +0 -2
- package/dist/ui-library/p-3d54ecf2.entry.js.map +0 -1
- package/dist/ui-library/p-4229f7e8.entry.js +0 -2
- package/dist/ui-library/p-4229f7e8.entry.js.map +0 -1
- package/dist/ui-library/p-479d8087.entry.js +0 -2
- package/dist/ui-library/p-479d8087.entry.js.map +0 -1
- package/dist/ui-library/p-49aa8d1e.entry.js +0 -2
- package/dist/ui-library/p-49aa8d1e.entry.js.map +0 -1
- package/dist/ui-library/p-58661675.entry.js +0 -2
- package/dist/ui-library/p-58661675.entry.js.map +0 -1
- package/dist/ui-library/p-5d43ea07.entry.js +0 -2
- package/dist/ui-library/p-5d43ea07.entry.js.map +0 -1
- package/dist/ui-library/p-6aa2929a.entry.js +0 -2
- package/dist/ui-library/p-6aa2929a.entry.js.map +0 -1
- package/dist/ui-library/p-7432d409.entry.js +0 -2
- package/dist/ui-library/p-7432d409.entry.js.map +0 -1
- package/dist/ui-library/p-74a714c0.entry.js +0 -2
- package/dist/ui-library/p-74a714c0.entry.js.map +0 -1
- package/dist/ui-library/p-76825395.entry.js +0 -2
- package/dist/ui-library/p-76825395.entry.js.map +0 -1
- package/dist/ui-library/p-816f857d.entry.js +0 -2
- package/dist/ui-library/p-816f857d.entry.js.map +0 -1
- package/dist/ui-library/p-882fbf6f.entry.js +0 -2
- package/dist/ui-library/p-882fbf6f.entry.js.map +0 -1
- package/dist/ui-library/p-88fd4973.entry.js +0 -2
- package/dist/ui-library/p-88fd4973.entry.js.map +0 -1
- package/dist/ui-library/p-8b750c9e.entry.js +0 -2
- package/dist/ui-library/p-8b750c9e.entry.js.map +0 -1
- package/dist/ui-library/p-911eb578.entry.js +0 -2
- package/dist/ui-library/p-911eb578.entry.js.map +0 -1
- package/dist/ui-library/p-93fcda4a.entry.js +0 -2
- package/dist/ui-library/p-93fcda4a.entry.js.map +0 -1
- package/dist/ui-library/p-981b3228.entry.js +0 -2
- package/dist/ui-library/p-981b3228.entry.js.map +0 -1
- package/dist/ui-library/p-998de05d.js +0 -2
- package/dist/ui-library/p-998de05d.js.map +0 -1
- package/dist/ui-library/p-9b1ff147.entry.js +0 -2
- package/dist/ui-library/p-9b1ff147.entry.js.map +0 -1
- package/dist/ui-library/p-a21f8d06.entry.js +0 -2
- package/dist/ui-library/p-a21f8d06.entry.js.map +0 -1
- package/dist/ui-library/p-a2461274.entry.js +0 -2
- package/dist/ui-library/p-a2461274.entry.js.map +0 -1
- package/dist/ui-library/p-a4e4620c.entry.js +0 -2
- package/dist/ui-library/p-a4e4620c.entry.js.map +0 -1
- package/dist/ui-library/p-ada23fe3.entry.js +0 -2
- package/dist/ui-library/p-ada23fe3.entry.js.map +0 -1
- package/dist/ui-library/p-b5ac1219.entry.js +0 -2
- package/dist/ui-library/p-b5ac1219.entry.js.map +0 -1
- package/dist/ui-library/p-ba247565.entry.js +0 -2
- package/dist/ui-library/p-ba247565.entry.js.map +0 -1
- package/dist/ui-library/p-bdb79948.entry.js +0 -2
- package/dist/ui-library/p-bdb79948.entry.js.map +0 -1
- package/dist/ui-library/p-c021a9c9.entry.js +0 -2
- package/dist/ui-library/p-c021a9c9.entry.js.map +0 -1
- package/dist/ui-library/p-c07b1240.entry.js +0 -2
- package/dist/ui-library/p-c07b1240.entry.js.map +0 -1
- package/dist/ui-library/p-c12a94ce.entry.js +0 -2
- package/dist/ui-library/p-c12a94ce.entry.js.map +0 -1
- package/dist/ui-library/p-c1675a45.entry.js +0 -2
- package/dist/ui-library/p-c1675a45.entry.js.map +0 -1
- package/dist/ui-library/p-c2df8c27.entry.js +0 -2
- package/dist/ui-library/p-c2df8c27.entry.js.map +0 -1
- package/dist/ui-library/p-c86aa5b3.entry.js +0 -2
- package/dist/ui-library/p-c86aa5b3.entry.js.map +0 -1
- package/dist/ui-library/p-cd35b3c6.entry.js +0 -2
- package/dist/ui-library/p-cd35b3c6.entry.js.map +0 -1
- package/dist/ui-library/p-d2cf4280.entry.js +0 -2
- package/dist/ui-library/p-d2cf4280.entry.js.map +0 -1
- package/dist/ui-library/p-d310a6dd.entry.js.map +0 -1
- package/dist/ui-library/p-d6838141.entry.js +0 -2
- package/dist/ui-library/p-d6838141.entry.js.map +0 -1
- package/dist/ui-library/p-dc908cbb.entry.js +0 -2
- package/dist/ui-library/p-dc908cbb.entry.js.map +0 -1
- package/dist/ui-library/p-dfb6bff6.entry.js +0 -2
- package/dist/ui-library/p-dfb6bff6.entry.js.map +0 -1
- package/dist/ui-library/p-ee71e3a3.entry.js +0 -2
- package/dist/ui-library/p-ee71e3a3.entry.js.map +0 -1
- package/dist/ui-library/p-ef317d69.entry.js +0 -2
- package/dist/ui-library/p-ef317d69.entry.js.map +0 -1
- package/dist/ui-library/p-f2ef23c4.js +0 -2
- package/dist/ui-library/p-f2ef23c4.js.map +0 -1
- package/dist/ui-library/p-f385f1c2.entry.js +0 -2
- package/dist/ui-library/p-f385f1c2.entry.js.map +0 -1
- package/dist/ui-library/p-f73a6bdc.entry.js +0 -2
- package/dist/ui-library/p-f73a6bdc.entry.js.map +0 -1
- package/dist/ui-library/p-faa04bb5.js +0 -2
- package/dist/ui-library/p-faa04bb5.js.map +0 -1
- package/dist/ui-library/p-fcd57e0a.entry.js +0 -2
- package/dist/ui-library/p-fcd57e0a.entry.js.map +0 -1
- /package/dist/ui-library/{p-6907a7dc.js.map → p-605bdd81.js.map} +0 -0
|
@@ -6,7 +6,8 @@ import { s as submitForm } from './form.js';
|
|
|
6
6
|
import { d as defineCustomElement$2 } from './six-error2.js';
|
|
7
7
|
import { d as defineCustomElement$1 } from './six-icon2.js';
|
|
8
8
|
|
|
9
|
-
const sixInputCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:
|
|
9
|
+
const sixInputCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:\"*\";transform:scale(1.1);margin-left:var(--six-spacing-xxx-small);position:absolute}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input:hover.input--dropdown-search{border-color:transparent}.input--dropdown-search{border-color:transparent}.input--dropdown-search.input--focused{border-color:var(--six-input-border-color)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}";
|
|
10
|
+
const SixInputStyle0 = sixInputCss;
|
|
10
11
|
|
|
11
12
|
const ICON_SIZES = {
|
|
12
13
|
large: 'medium',
|
|
@@ -99,6 +100,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
99
100
|
this.max = undefined;
|
|
100
101
|
this.step = undefined;
|
|
101
102
|
this.pattern = undefined;
|
|
103
|
+
this.dropdownSearch = false;
|
|
102
104
|
this.required = false;
|
|
103
105
|
this.autocapitalize = 'off';
|
|
104
106
|
this.autocorrect = 'off';
|
|
@@ -176,7 +178,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
176
178
|
return ((_a = this.value) !== null && _a !== void 0 ? _a : '').toString();
|
|
177
179
|
}
|
|
178
180
|
render() {
|
|
179
|
-
return (h(FormControl, { 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.hasErrorSlot, size: this.size, disabled: this.disabled, required: this.required, displayError: this.invalid }, h("div", { part: "base", class: {
|
|
181
|
+
return (h(FormControl, { key: 'c814025e7db66cd628c466316a5bd3fe4c3e77bf', 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.hasErrorSlot, size: this.size, disabled: this.disabled, required: this.required, displayError: this.invalid }, h("div", { key: 'bad7f2e31ec8465f3292927e9d9fb37aa919cb33', part: "base", class: {
|
|
180
182
|
input: true,
|
|
181
183
|
// Sizes
|
|
182
184
|
'input--small': this.size === 'small',
|
|
@@ -186,13 +188,14 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
186
188
|
'input--line': this.line,
|
|
187
189
|
'input--pill': this.pill,
|
|
188
190
|
'input--disabled': this.disabled,
|
|
191
|
+
'input--dropdown-search': this.dropdownSearch,
|
|
189
192
|
'input--focused': this.hasFocus,
|
|
190
193
|
'input--empty': this.getValue().length === 0,
|
|
191
194
|
'input--invalid': this.invalid,
|
|
192
|
-
} }, h("span", { part: "prefix", class: "input__prefix" }, h("slot", { name: "prefix" })), h("input", { part: "input", ref: (el) => (this.nativeInput = el), id: this.inputId, size: 1, class: {
|
|
195
|
+
} }, h("span", { key: 'fa0b1320b4d44794f36047ca65efa9c03d180234', part: "prefix", class: "input__prefix" }, h("slot", { key: '8312c426648c862ef669cb424a219cb85f2b193c', name: "prefix" })), h("input", { key: '87ce5517721681533fc7bcf18d20cb3d1ee7fb6f', part: "input", ref: (el) => (this.nativeInput = el), id: this.inputId, size: 1, class: {
|
|
193
196
|
input__control: true,
|
|
194
197
|
input__control__prefix: hasSlot(this.host, 'prefix'),
|
|
195
|
-
}, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { part: "suffix", class: "input__suffix" }, h("slot", { name: "suffix" })))));
|
|
198
|
+
}, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { key: '5768204290a458c6025f93d7eed7b4762fa8ab94', part: "suffix", class: "input__suffix" }, h("slot", { key: '9f1917c71eeb148d31adf808299ef43c5307678f', name: "suffix" })))));
|
|
196
199
|
}
|
|
197
200
|
get host() { return this; }
|
|
198
201
|
static get watchers() { return {
|
|
@@ -201,7 +204,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
201
204
|
"label": ["handleLabelChange"],
|
|
202
205
|
"value": ["handleValueChange"]
|
|
203
206
|
}; }
|
|
204
|
-
static get style() { return
|
|
207
|
+
static get style() { return SixInputStyle0; }
|
|
205
208
|
}, [1, "six-input", {
|
|
206
209
|
"type": [513],
|
|
207
210
|
"size": [513],
|
|
@@ -218,6 +221,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
218
221
|
"max": [514],
|
|
219
222
|
"step": [514],
|
|
220
223
|
"pattern": [513],
|
|
224
|
+
"dropdownSearch": [4, "dropdown-search"],
|
|
221
225
|
"required": [4],
|
|
222
226
|
"autocapitalize": [1],
|
|
223
227
|
"autocorrect": [1],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-input2.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,8gQAA8gQ;;ACOliQ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AC,cAAc,EACpB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,QAAQ,EAAC,IAAI,iBACD,oBAAoB,IAEhC,YAAM,IAAI,EAAC,YAAY,IACrB,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAkB,CAClD,CACA,CACV,EAEA,IAAI,CAAC,cAAc,KAClB,cACE,IAAI,EAAC,wBAAwB,EAC7B,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAClC,QAAQ,EAAC,IAAI,IAEZ,IAAI,CAAC,iBAAiB,IACrB,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,qBAA2B,CAC3D,KAEP,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAuB,CACvD,CACR,CACM,CACV,EAED,YAAM,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,eAAe,IACvC,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACH,CACM,EACd;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\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 * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, error-text and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n * @part error-text - The input error text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\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 /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\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E,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,SAAS,EAAE,IAAI,CAAC,aAAa,iBACjB,eAAe,GAC3B,EAED,IAAI,CAAC,SAAS,KACb,cACE,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,QAAQ,EAAC,IAAI,iBACD,oBAAoB,IAEhC,YAAM,IAAI,EAAC,YAAY,IACrB,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAkB,CAClD,CACA,CACV,EAEA,IAAI,CAAC,cAAc,KAClB,cACE,IAAI,EAAC,wBAAwB,EAC7B,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAClC,QAAQ,EAAC,IAAI,IAEZ,IAAI,CAAC,iBAAiB,IACrB,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,qBAA2B,CAC3D,KAEP,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAuB,CACvD,CACR,CACM,CACV,EAED,6DAAM,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,eAAe,IACvC,6DAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACH,CACM,EACd;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &:hover.input--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search.input--focused {\n border-color: var(--six-input-border-color);\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\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 * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, error-text and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n * @part error-text - The input error text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /**\n * Internal: Styles the input for the dropdown filter search.\n */\n @Prop() dropdownSearch = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\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 /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--dropdown-search': this.dropdownSearch,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,6 +3,7 @@ import { D as DEFAULT_DEBOUNCE_FAST, b as DEFAULT_DEBOUNCE_INSANELY_FAST, a as d
|
|
|
3
3
|
import { E as EventListeners } from './event-listeners.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './six-icon2.js';
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @stencil-community/ban-exported-const-enums
|
|
6
7
|
var ItemPickerType;
|
|
7
8
|
(function (ItemPickerType) {
|
|
8
9
|
ItemPickerType["NUMBER"] = "number";
|
|
@@ -11,13 +12,15 @@ var ItemPickerType;
|
|
|
11
12
|
ItemPickerType["LOWER_LETTER"] = "lower-letter";
|
|
12
13
|
ItemPickerType["CUSTOM"] = "custom";
|
|
13
14
|
})(ItemPickerType || (ItemPickerType = {}));
|
|
15
|
+
// eslint-disable-next-line @stencil-community/ban-exported-const-enums
|
|
14
16
|
var ItemPickerPaddingDirection;
|
|
15
17
|
(function (ItemPickerPaddingDirection) {
|
|
16
18
|
ItemPickerPaddingDirection["BEFORE"] = "before";
|
|
17
19
|
ItemPickerPaddingDirection["AFTER"] = "after";
|
|
18
20
|
})(ItemPickerPaddingDirection || (ItemPickerPaddingDirection = {}));
|
|
19
21
|
|
|
20
|
-
const sixItemPickerCss = ".item_picker__container{width:2.5em;display:flex;flex-wrap:wrap;justify-content:center}.item_picker__content{font-size:1.5rem}.item_picker__btn{cursor:pointer;width:2.5em;height:2.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--six-color-web-rock-500)}.item_picker__btn:hover{background-color:var(--six-color-web-rock-100);border-radius:100%}.item_picker__btn:active{color:var(--six-color-web-rock-400)}.item_picker__btn--disabled{color:var(--six-color-web-rock-300);cursor:not-allowed}.item_picker__btn--disabled:hover{background-color:initial}.item_picker__btn--disabled:active{color:var(--six-color-web-rock-300)}";
|
|
22
|
+
const sixItemPickerCss = ".item_picker__container{width:2.5em;display:flex;flex-wrap:wrap;justify-content:center}.item_picker__container:focus-visible{outline:var(--six-focus-ring);outline-offset:0}.item_picker__content{font-size:1.5rem}.item_picker__btn{cursor:pointer;width:2.5em;height:2.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--six-color-web-rock-500)}.item_picker__btn:hover{background-color:var(--six-color-web-rock-100);border-radius:100%}.item_picker__btn:active{color:var(--six-color-web-rock-400)}.item_picker__btn--disabled{color:var(--six-color-web-rock-300);cursor:not-allowed}.item_picker__btn--disabled:hover{background-color:initial}.item_picker__btn--disabled:active{color:var(--six-color-web-rock-300)}.item_picker__btn:focus-visible{outline:var(--six-focus-ring);outline-offset:0}";
|
|
23
|
+
const SixItemPickerStyle0 = sixItemPickerCss;
|
|
21
24
|
|
|
22
25
|
const uppercaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
23
26
|
const upperAndLowercaseLetters = [...uppercaseLetters].flatMap((c) => [c, c.toLowerCase()]);
|
|
@@ -224,9 +227,9 @@ const SixItemPicker = /*@__PURE__*/ proxyCustomElement(class SixItemPicker exten
|
|
|
224
227
|
isRoundtripPossible: () => this.min === undefined && this.roundtrip,
|
|
225
228
|
});
|
|
226
229
|
}
|
|
227
|
-
getNextItemByOperation(operation) {
|
|
230
|
+
getNextItemByOperation(operation, increment = this.step) {
|
|
228
231
|
const value = String(this.value);
|
|
229
|
-
const nextIndexCandidate = operation(this.getStringItemIndex(value),
|
|
232
|
+
const nextIndexCandidate = operation(this.getStringItemIndex(value), increment);
|
|
230
233
|
const numberOfItems = this._items.length;
|
|
231
234
|
const nextIndex = ((nextIndexCandidate % numberOfItems) + numberOfItems) % numberOfItems;
|
|
232
235
|
return this._items[nextIndex];
|
|
@@ -245,6 +248,7 @@ const SixItemPicker = /*@__PURE__*/ proxyCustomElement(class SixItemPicker exten
|
|
|
245
248
|
return;
|
|
246
249
|
}
|
|
247
250
|
console.warn(`${TAG} Roundtrip is not allowed, but was still triggered, please report this issue to the developer of six-item-picker`);
|
|
251
|
+
this.sixChange.emit(this.value);
|
|
248
252
|
}
|
|
249
253
|
isNumber() {
|
|
250
254
|
return this.type === ItemPickerType.NUMBER;
|
|
@@ -327,14 +331,109 @@ const SixItemPicker = /*@__PURE__*/ proxyCustomElement(class SixItemPicker exten
|
|
|
327
331
|
}
|
|
328
332
|
return this.value;
|
|
329
333
|
}
|
|
334
|
+
handleKeyPress(event) {
|
|
335
|
+
if (event.key === 'Enter') {
|
|
336
|
+
event.preventDefault();
|
|
337
|
+
if (event.target === this.upButton) {
|
|
338
|
+
this.nextItem();
|
|
339
|
+
}
|
|
340
|
+
else if (event.target === this.downButton) {
|
|
341
|
+
this.previousItem();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else if (event.key === 'ArrowUp') {
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
this.nextItem();
|
|
347
|
+
}
|
|
348
|
+
else if (event.key === 'ArrowDown') {
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
this.previousItem();
|
|
351
|
+
}
|
|
352
|
+
else if (event.key === 'PageUp') {
|
|
353
|
+
event.preventDefault();
|
|
354
|
+
this.pageUp();
|
|
355
|
+
}
|
|
356
|
+
else if (event.key === 'PageDown') {
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
this.pageDown();
|
|
359
|
+
}
|
|
360
|
+
else if (event.key === 'Home') {
|
|
361
|
+
event.preventDefault();
|
|
362
|
+
this.goToMin();
|
|
363
|
+
}
|
|
364
|
+
else if (event.key === 'End') {
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
this.goToMax();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
pageUp() {
|
|
370
|
+
if (this.isNumber()) {
|
|
371
|
+
this.changeValue({
|
|
372
|
+
isNextItemAllowed: () => !this.isNextNumberDisabled(),
|
|
373
|
+
getNextItem: () => Number(this.value) + 5 * this.step,
|
|
374
|
+
getRoundtripItem: () => Number(this.min),
|
|
375
|
+
isRoundtripPossible: () => this.min === undefined && this.roundtrip,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
const value = String(this.value);
|
|
380
|
+
const minLetter = String(this.min);
|
|
381
|
+
this.changeValue({
|
|
382
|
+
isNextItemAllowed: () => minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),
|
|
383
|
+
getNextItem: () => this.getNextItemByOperation(add, 5),
|
|
384
|
+
getRoundtripItem: () => String(this.min),
|
|
385
|
+
isRoundtripPossible: () => this.min === undefined && this.roundtrip,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
pageDown() {
|
|
390
|
+
if (this.isNumber()) {
|
|
391
|
+
this.changeValue({
|
|
392
|
+
isNextItemAllowed: () => !this.isPreviousNumberDisabled(),
|
|
393
|
+
getNextItem: () => Number(this.value) - 5 * this.step,
|
|
394
|
+
getRoundtripItem: () => Number(this.max),
|
|
395
|
+
isRoundtripPossible: () => this.max === undefined && this.roundtrip,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
const value = String(this.value);
|
|
400
|
+
const maxLetter = String(this.max);
|
|
401
|
+
this.changeValue({
|
|
402
|
+
isNextItemAllowed: () => maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),
|
|
403
|
+
getNextItem: () => this.getNextItemByOperation(subtract, 5),
|
|
404
|
+
getRoundtripItem: () => String(this.max),
|
|
405
|
+
isRoundtripPossible: () => this.max == null && this.roundtrip,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
goToMin() {
|
|
410
|
+
var _a;
|
|
411
|
+
if (this.isNumber()) {
|
|
412
|
+
this.value = (_a = this.min) !== null && _a !== void 0 ? _a : 0;
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
this.value = this._items[0];
|
|
416
|
+
}
|
|
417
|
+
this.sixChange.emit(this.value);
|
|
418
|
+
}
|
|
419
|
+
goToMax() {
|
|
420
|
+
var _a;
|
|
421
|
+
if (this.isNumber()) {
|
|
422
|
+
this.value = (_a = this.max) !== null && _a !== void 0 ? _a : Infinity;
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
this.value = this.getLastStringItem();
|
|
426
|
+
}
|
|
427
|
+
this.sixChange.emit(this.value);
|
|
428
|
+
}
|
|
330
429
|
render() {
|
|
331
|
-
return (h("div", { part: "container", class: "item_picker__container" }, h("div", { part: "up", class: {
|
|
430
|
+
return (h("div", { key: '773e773a55e33b7486a7d2928ad605c6efadf119', part: "container", class: "item_picker__container", onKeyDown: (event) => this.handleKeyPress(event), tabindex: "0" }, h("div", { key: '3cb5fd7c07ea6b0b8778be5b316ba0d788b900be', ref: (el) => (this.upButton = el), part: "up", class: {
|
|
332
431
|
item_picker__btn: true,
|
|
333
432
|
'item_picker__btn--disabled': this.isNextDisabled(),
|
|
334
|
-
}, onMouseDown: () => this.onMouseDownNext(), onMouseUp: () => this.onMouseUpNext() }, h("six-icon", { size: "large" }, "expand_less")), h("div", { part: "content", class: "item_picker__content" }, this.getFormattedValue()), h("div", { part: "down", class: {
|
|
433
|
+
}, onMouseDown: () => this.onMouseDownNext(), onMouseUp: () => this.onMouseUpNext(), tabindex: "-1" }, h("six-icon", { key: '606bfc7a65c8b5312a952bc9bb85324c95111d17', size: "large" }, "expand_less")), h("div", { key: '181dec86bb4b8d9762595b38f719af4c8a91ea42', part: "content", class: "item_picker__content" }, this.getFormattedValue()), h("div", { key: '195fefb352bbb5d202b3357e429959f4c887d357', ref: (el) => (this.downButton = el), part: "down", class: {
|
|
335
434
|
item_picker__btn: true,
|
|
336
435
|
'item_picker__btn--disabled': this.isPrevDisabled(),
|
|
337
|
-
}, onMouseDown: () => this.onMouseDownPrev(), onMouseUp: () => this.onMouseUpPrev() }, h("six-icon", { size: "large" }, "expand_more"))));
|
|
436
|
+
}, onMouseDown: () => this.onMouseDownPrev(), onMouseUp: () => this.onMouseUpPrev(), tabindex: "-1" }, h("six-icon", { key: '525c90105edea5208737b49c8b2831498c326197', size: "large" }, "expand_more"))));
|
|
338
437
|
}
|
|
339
438
|
get host() { return this; }
|
|
340
439
|
static get watchers() { return {
|
|
@@ -342,7 +441,7 @@ const SixItemPicker = /*@__PURE__*/ proxyCustomElement(class SixItemPicker exten
|
|
|
342
441
|
"debounce": ["debounceChanged"],
|
|
343
442
|
"items": ["handleSetChange"]
|
|
344
443
|
}; }
|
|
345
|
-
static get style() { return
|
|
444
|
+
static get style() { return SixItemPickerStyle0; }
|
|
346
445
|
}, [1, "six-item-picker", {
|
|
347
446
|
"value": [1544],
|
|
348
447
|
"type": [1],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-item-picker2.js","mappings":";;;;;IAAY;AAAZ,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,mCAAiB,CAAA;AACnB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,IAAY,0BAGX;AAHD,WAAY,0BAA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AAI;gBACtB,4BAA4B,EAAE,IAAI,CAAC,cAAc,EAAE;aACpD,EACD,WAAW,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,EACzC,SAAS,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAErC,gBAAU,IAAI,EAAC,OAAO,kBAAuB,CACzC,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-item-picker/types.ts","src/components/six-item-picker/six-item-picker.scss?tag=six-item-picker&encapsulation=shadow","src/components/six-item-picker/six-item-picker.tsx"],"sourcesContent":["export enum ItemPickerType {\n NUMBER = 'number',\n LETTER = 'letter',\n CAPITAL_LETTER = 'capital-letter',\n LOWER_LETTER = 'lower-letter',\n CUSTOM = 'custom',\n}\n\nexport enum ItemPickerPaddingDirection {\n BEFORE = 'before',\n AFTER = 'after',\n}\n",".item_picker {\n &__container {\n width: 2.5em;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n }\n\n &__content {\n font-size: 1.5rem;\n }\n\n &__btn {\n cursor: pointer;\n width: 2.5em;\n height: 2.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: var(--six-color-web-rock-500);\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n border-radius: 100%;\n }\n\n &:active {\n color: var(--six-color-web-rock-400);\n }\n\n &--disabled {\n color: var(--six-color-web-rock-300);\n cursor: not-allowed;\n\n &:hover {\n background-color: initial;\n }\n\n &:active {\n color: var(--six-color-web-rock-300);\n }\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerPaddingDirection, ItemPickerType } from './types';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { TimePeriod } from '../../utils/time.util';\n\ninterface Alphabet {\n alphabet: string[];\n letterIndexes: Record<string, number>;\n}\n\nconst uppercaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst upperAndLowercaseLetters = [...uppercaseLetters].flatMap((c) => [c, c.toLowerCase()]);\nconst ALPHABET: Alphabet = {\n alphabet: upperAndLowercaseLetters,\n letterIndexes: Object.fromEntries(upperAndLowercaseLetters.map((c, i) => [c, i])),\n};\nconst CAPITAL_ALPHABET: Alphabet = {\n alphabet: [...uppercaseLetters].flatMap((c) => [c]),\n letterIndexes: Object.fromEntries([...uppercaseLetters].map((c, i) => [c, i])),\n};\nconst LOWERCASE_ALPHABET: Alphabet = {\n alphabet: [...uppercaseLetters.toLowerCase()].flatMap((c) => [c]),\n letterIndexes: Object.fromEntries([...uppercaseLetters.toLowerCase()].map((c, i) => [c, i])),\n};\n\nconst createItemIndexes = (arr: string[]): Record<string, number> => {\n return Object.fromEntries([...arr].map((c, i) => [c, i]));\n};\n\nconst TAG = `[SIX-ITEM-PICKER]`;\n\nconst subtract = (a: number, b: number) => a - b;\nconst add = (a: number, b: number) => a + b;\n\nexport type SixItemPickerChangePayload = number | string | boolean | TimePeriod;\n\nconst DEBOUNCE_ITEM_PICKER_LISTENER = 'debounced-item-picker';\n\n/**\n * @since 2.0.0\n * @status experimental\n * @part container - The whole component container\n * @part up - The up button\n * @part content - The content area\n * @part down - The down button\n *\n */\n@Component({\n tag: 'six-item-picker',\n styleUrl: 'six-item-picker.scss',\n shadow: true,\n})\nexport class SixItemPicker {\n private readonly eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixItemPickerElement;\n\n /** The item picker's value attribute. */\n @Prop({ mutable: true, reflect: true }) value: number | string = '';\n\n /** The type of items you want to rotate through. */\n @Prop() type: ItemPickerType = ItemPickerType.NUMBER;\n\n /** The minimum value allowed to pick. */\n @Prop({ reflect: true, mutable: true }) min?: number | string;\n\n /** The maximum value allowed to pick. */\n @Prop({ reflect: true, mutable: true }) max?: number | string;\n\n /** Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa. */\n @Prop({ reflect: true }) roundtrip = true;\n\n /** Defines how many steps should be taken when navigating */\n @Prop({ reflect: true }) step = 1;\n\n /** Defines a custom list of items you can iterate through */\n @Prop() items?: string[];\n\n /** Defines whether the items should be padded */\n @Prop() padded = false;\n\n /** Defines the length of the padded area */\n @Prop() paddingLength = 2;\n\n /** Defines the character used for padding */\n @Prop() paddingChar = '0';\n\n /** Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default,\n * before is selected */\n @Prop() paddingDirection: ItemPickerPaddingDirection = ItemPickerPaddingDirection.BEFORE;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between items.\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * Emitted when the item picker's value changes\n */\n @Event({ eventName: 'six-item-picker-change' }) sixChange!: EventEmitter<SixItemPickerChangePayload>;\n\n /**\n * Emitted when the item picker's value changes, but debounced\n */\n @Event({ eventName: 'six-item-picker-change-debounced' })\n sixChangeDebounced!: EventEmitter<SixItemPickerChangePayload>;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n @Watch('value')\n handleValueChange() {\n this.setup();\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.eventListeners.removeByIdentifier(DEBOUNCE_ITEM_PICKER_LISTENER);\n this.eventListeners.add(\n this.host,\n 'six-item-picker-change',\n debounce(this.handleSixItemPickerChangeDebounced, this.debounce),\n DEBOUNCE_ITEM_PICKER_LISTENER\n );\n }\n\n @Watch('items')\n handleSetChange() {\n this.setup();\n this.min = this._items[0];\n this.max = this.getLastStringItem();\n }\n\n @State() _items: string[] = [];\n @State() _itemIndexes: Record<string, number> = {};\n\n // used for fast increasing when keeping the mouse button held down\n private _timeoutNext!: ReturnType<typeof setTimeout>;\n private _intervalNext!: ReturnType<typeof setInterval>;\n\n private _timeoutPrev!: ReturnType<typeof setTimeout>;\n private _intervalPrev!: ReturnType<typeof setInterval>;\n\n componentWillLoad() {\n this.setup();\n }\n\n componentDidLoad() {\n this.eventListeners.add(\n this.host,\n 'six-item-picker-change',\n debounce(this.handleSixItemPickerChangeDebounced, this.debounce),\n DEBOUNCE_ITEM_PICKER_LISTENER\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n private handleSixItemPickerChangeDebounced = () => {\n this.sixChangeDebounced.emit(this.value);\n };\n\n private setup() {\n if (this.isNumber()) {\n this.setupNumberItems();\n } else {\n this.setUpStringItems();\n }\n }\n\n private setupNumberItems() {\n if (this.isInvalidNumber()) {\n console.warn(`${TAG} Expected number but value is not a number: \"${this.value}\"`);\n console.info(`${TAG} Will set value to either minimum or if not provided to zero.`);\n this.value = this.min ?? 0;\n }\n }\n\n private setUpStringItems() {\n this._items = this.getStringItems();\n this._itemIndexes = this.getItemIndexes();\n const itemsMissValue = this._items.find((i) => String(i) === String(this.value)) === undefined;\n if (itemsMissValue) {\n console.warn(`${TAG} Expected item from item set but value was not found in set: \"${this.value}\"`);\n console.info(`${TAG} Will set value to either minimum or if not provided to \"${this._items[0]}\".`);\n this.value = this._items[0];\n }\n\n if (this.min === undefined) {\n if (!this.roundtrip) {\n console.warn(`${TAG} Expected a min value`);\n console.info(`${TAG} Will set min value to ${this._items[0]}`);\n }\n this.min = this._items[0];\n }\n\n if (this.max === undefined) {\n const maxItem = this.getLastStringItem();\n if (!this.roundtrip) {\n console.warn(`${TAG} Expected a min value if roundtrip is enabled`);\n console.info(`${TAG} Will set min value to ${maxItem}`);\n }\n this.max = maxItem;\n }\n }\n\n private getLastStringItem() {\n return this._items[this._items.length - 1];\n }\n\n private getStringItems(): string[] {\n switch (this.type) {\n case ItemPickerType.NUMBER:\n console.warn(`${TAG}: unexpected type ${this.type}`);\n return [];\n case ItemPickerType.LETTER:\n return ALPHABET.alphabet;\n case ItemPickerType.CAPITAL_LETTER:\n return CAPITAL_ALPHABET.alphabet;\n case ItemPickerType.LOWER_LETTER:\n return LOWERCASE_ALPHABET.alphabet;\n case ItemPickerType.CUSTOM:\n if (this.items == null || this.items.length === 0) {\n console.warn(`${TAG}: no items defined for type ${this.type}`);\n return [];\n }\n return this.items;\n }\n }\n\n private getItemIndexes(): Record<string, number> {\n switch (this.type) {\n case ItemPickerType.NUMBER:\n console.warn(`${TAG}: unexpected type ${this.type}`);\n return {};\n case ItemPickerType.LETTER:\n return ALPHABET.letterIndexes;\n case ItemPickerType.CAPITAL_LETTER:\n return CAPITAL_ALPHABET.letterIndexes;\n case ItemPickerType.LOWER_LETTER:\n return LOWERCASE_ALPHABET.letterIndexes;\n case ItemPickerType.CUSTOM:\n return createItemIndexes(this._items);\n }\n }\n\n private previousItem() {\n if (this.isNumber()) {\n this.previousNumber();\n } else {\n this.previousStringItem();\n }\n\n this.sixChange.emit(this.value);\n }\n\n private previousNumber() {\n this.changeValue({\n isNextItemAllowed: () => !this.isPreviousNumberDisabled(),\n getNextItem: () => Number(this.value) - this.step,\n getRoundtripItem: () => Number(this.max),\n isRoundtripPossible: () => this.max === undefined && this.roundtrip,\n });\n }\n\n private previousStringItem() {\n const value = String(this.value);\n const minLetter = String(this.min);\n\n this.changeValue({\n isNextItemAllowed: () =>\n minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),\n getNextItem: () => this.getNextItemByOperation(subtract),\n getRoundtripItem: () => String(this.max),\n isRoundtripPossible: () => this.max == null && this.roundtrip,\n });\n }\n\n private nextItem() {\n if (this.isNumber()) {\n this.nextNumber();\n } else {\n this.nextStringItem();\n }\n\n this.sixChange.emit(this.value);\n }\n\n private nextNumber() {\n this.changeValue({\n isNextItemAllowed: () => !this.isNextNumberDisabled(),\n getNextItem: () => Number(this.value) + this.step,\n getRoundtripItem: () => Number(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n }\n\n private getStringItemIndex(char: string): number {\n return this._itemIndexes[char];\n }\n\n private nextStringItem() {\n const value = String(this.value);\n const maxLetter = String(this.max);\n\n this.changeValue({\n isNextItemAllowed: () =>\n maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),\n getNextItem: () => this.getNextItemByOperation(add),\n getRoundtripItem: () => String(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n }\n\n private getNextItemByOperation(operation: (a: number, b: number) => number) {\n const value = String(this.value);\n const nextIndexCandidate = operation(this.getStringItemIndex(value), this.step);\n const numberOfItems = this._items.length;\n const nextIndex = ((nextIndexCandidate % numberOfItems) + numberOfItems) % numberOfItems;\n return this._items[nextIndex];\n }\n\n private changeValue(params: {\n getNextItem: () => number | string;\n isNextItemAllowed: () => boolean;\n getRoundtripItem: () => number | string;\n isRoundtripPossible: () => boolean;\n }) {\n if (params.isNextItemAllowed()) {\n this.value = params.getNextItem();\n return;\n }\n\n if (params.isRoundtripPossible()) {\n console.error(\n `${TAG} Item picker is expected to perform a roundtrip, but either max or min value is missing so a roundtrip is not possible`\n );\n return;\n }\n\n if (this.roundtrip) {\n this.value = params.getRoundtripItem();\n return;\n }\n\n console.warn(\n `${TAG} Roundtrip is not allowed, but was still triggered, please report this issue to the developer of six-item-picker`\n );\n }\n\n private isNumber() {\n return this.type === ItemPickerType.NUMBER;\n }\n\n private isInvalidNumber() {\n return this.value === '' || isNaN(this.value as number);\n }\n\n private isNextDisabled() {\n if (this.roundtrip) {\n return false;\n }\n\n if (this.isNumber()) {\n return this.isNextNumberDisabled();\n } else {\n return this._itemIndexes[String(this.value)] + this.step > this._itemIndexes[String(this.max)];\n }\n }\n\n private isNextNumberDisabled() {\n return Number(this.value) + this.step > Number(this.max ?? Infinity);\n }\n\n private isPrevDisabled() {\n if (this.roundtrip) {\n return false;\n }\n\n if (this.isNumber()) {\n return this.isPreviousNumberDisabled();\n } else {\n return this._itemIndexes[String(this.value)] - this.step < this._itemIndexes[String(this.min)];\n }\n }\n\n private isPreviousNumberDisabled() {\n return Number(this.value) - this.step < Number(this.min ?? -Infinity);\n }\n\n private onMouseDownNext() {\n if (this.isNextDisabled()) {\n return;\n }\n\n this.nextItem();\n\n this._timeoutNext = setTimeout(() => {\n this._intervalNext = setInterval(() => {\n this.nextItem();\n }, this.interval);\n }, this.timeout);\n }\n\n private onMouseUpNext() {\n clearTimeout(this._timeoutNext);\n clearInterval(this._intervalNext);\n }\n\n private onMouseDownPrev() {\n if (this.isPrevDisabled()) {\n return;\n }\n\n this.previousItem();\n\n this._timeoutPrev = setTimeout(() => {\n this._intervalPrev = setInterval(() => {\n this.previousItem();\n }, this.interval);\n }, this.timeout);\n }\n\n private onMouseUpPrev() {\n clearTimeout(this._timeoutPrev);\n clearInterval(this._intervalPrev);\n }\n\n private getFormattedValue() {\n if (this.value === undefined || this.value === null) {\n return this.value;\n }\n\n if (!this.padded) {\n return this.value;\n }\n\n if (this.paddingDirection === ItemPickerPaddingDirection.BEFORE) {\n return String(this.value).padStart(this.paddingLength, this.paddingChar);\n } else if (this.paddingDirection === ItemPickerPaddingDirection.AFTER) {\n return String(this.value).padEnd(this.paddingLength, this.paddingChar);\n }\n\n return this.value;\n }\n\n render() {\n return (\n <div part=\"container\" class=\"item_picker__container\">\n <div\n part=\"up\"\n class={{\n item_picker__btn: true,\n 'item_picker__btn--disabled': this.isNextDisabled(),\n }}\n onMouseDown={() => this.onMouseDownNext()}\n onMouseUp={() => this.onMouseUpNext()}\n >\n <six-icon size=\"large\">expand_less</six-icon>\n </div>\n <div part=\"content\" class=\"item_picker__content\">\n {this.getFormattedValue()}\n </div>\n <div\n part=\"down\"\n class={{\n item_picker__btn: true,\n 'item_picker__btn--disabled': this.isPrevDisabled(),\n }}\n onMouseDown={() => this.onMouseDownPrev()}\n onMouseUp={() => this.onMouseUpPrev()}\n >\n <six-icon size=\"large\">expand_more</six-icon>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-item-picker2.js","mappings":";;;;;AAAA;IACY;AAAZ,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,mCAAiB,CAAA;AACnB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED;AACA,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,+CAAiB,CAAA;IACjB,6CAAe,CAAA;AACjB,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B;;ACVtC,MAAM,gBAAgB,GAAG,g5BAAg5B,CAAC;AAC16B,4BAAe,gBAAgB;;ACU/B,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AACtD,MAAM,wBAAwB,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5F,MAAM,QAAQ,GAAa;IACzB,QAAQ,EAAE,wBAAwB;IAClC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAClF,CAAC;AACF,MAAM,gBAAgB,GAAa;IACjC,QAAQ,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnD,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,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W,EAChB,KAAK,EAAC,wBAAwB,EAC9B,SAAS,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAChD,QAAQ,EAAC,GAAG,IAEZ,4DACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAoB,CAAC,EACnD,IAAI,EAAC,IAAI,EACT,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI;gBACtB,4BAA4B,EAAE,IAAI,CAAC,cAAc,EAAE;aACpD,EACD,WAAW,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,EACzC,SAAS,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EACrC,QAAQ,EAAC,IAAI,IAEb,iEAAU,IAAI,EAAC,OAAO,kBAAuB,CACzC,EACN,4DAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,sBAAsB,IAC7C,IAAI,CAAC,iBAAiB,EAAE,CACrB,EACN,4DACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,UAAU,GAAG,EAAoB,CAAC,EACrD,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI;gBACtB,4BAA4B,EAAE,IAAI,CAAC,cAAc,EAAE;aACpD,EACD,WAAW,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,EACzC,SAAS,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EACrC,QAAQ,EAAC,IAAI,IAEb,iEAAU,IAAI,EAAC,OAAO,kBAAuB,CACzC,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-item-picker/types.ts","src/components/six-item-picker/six-item-picker.scss?tag=six-item-picker&encapsulation=shadow","src/components/six-item-picker/six-item-picker.tsx"],"sourcesContent":["// eslint-disable-next-line @stencil-community/ban-exported-const-enums\nexport enum ItemPickerType {\n NUMBER = 'number',\n LETTER = 'letter',\n CAPITAL_LETTER = 'capital-letter',\n LOWER_LETTER = 'lower-letter',\n CUSTOM = 'custom',\n}\n\n// eslint-disable-next-line @stencil-community/ban-exported-const-enums\nexport enum ItemPickerPaddingDirection {\n BEFORE = 'before',\n AFTER = 'after',\n}\n",".item_picker {\n &__container {\n width: 2.5em;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n\n &:focus-visible {\n outline: var(--six-focus-ring);\n outline-offset: 0;\n }\n }\n\n &__content {\n font-size: 1.5rem;\n }\n\n &__btn {\n cursor: pointer;\n width: 2.5em;\n height: 2.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: var(--six-color-web-rock-500);\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n border-radius: 100%;\n }\n\n &:active {\n color: var(--six-color-web-rock-400);\n }\n\n &--disabled {\n color: var(--six-color-web-rock-300);\n cursor: not-allowed;\n\n &:hover {\n background-color: initial;\n }\n\n &:active {\n color: var(--six-color-web-rock-300);\n }\n }\n\n &:focus-visible {\n outline: var(--six-focus-ring);\n outline-offset: 0;\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerPaddingDirection, ItemPickerType } from './types';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { TimePeriod } from '../../utils/time.util';\n\ninterface Alphabet {\n alphabet: string[];\n letterIndexes: Record<string, number>;\n}\n\nconst uppercaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst upperAndLowercaseLetters = [...uppercaseLetters].flatMap((c) => [c, c.toLowerCase()]);\nconst ALPHABET: Alphabet = {\n alphabet: upperAndLowercaseLetters,\n letterIndexes: Object.fromEntries(upperAndLowercaseLetters.map((c, i) => [c, i])),\n};\nconst CAPITAL_ALPHABET: Alphabet = {\n alphabet: [...uppercaseLetters].flatMap((c) => [c]),\n letterIndexes: Object.fromEntries([...uppercaseLetters].map((c, i) => [c, i])),\n};\nconst LOWERCASE_ALPHABET: Alphabet = {\n alphabet: [...uppercaseLetters.toLowerCase()].flatMap((c) => [c]),\n letterIndexes: Object.fromEntries([...uppercaseLetters.toLowerCase()].map((c, i) => [c, i])),\n};\n\nconst createItemIndexes = (arr: string[]): Record<string, number> => {\n return Object.fromEntries([...arr].map((c, i) => [c, i]));\n};\n\nconst TAG = `[SIX-ITEM-PICKER]`;\n\nconst subtract = (a: number, b: number) => a - b;\nconst add = (a: number, b: number) => a + b;\n\nexport type SixItemPickerChangePayload = number | string | boolean | TimePeriod;\n\nconst DEBOUNCE_ITEM_PICKER_LISTENER = 'debounced-item-picker';\n\n/**\n * @since 2.0.0\n * @status experimental\n * @part container - The whole component container\n * @part up - The up button\n * @part content - The content area\n * @part down - The down button\n *\n */\n@Component({\n tag: 'six-item-picker',\n styleUrl: 'six-item-picker.scss',\n shadow: true,\n})\nexport class SixItemPicker {\n private readonly eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixItemPickerElement;\n\n /** The item picker's value attribute. */\n @Prop({ mutable: true, reflect: true }) value: number | string = '';\n\n /** The type of items you want to rotate through. */\n @Prop() type: ItemPickerType = ItemPickerType.NUMBER;\n\n /** The minimum value allowed to pick. */\n @Prop({ reflect: true, mutable: true }) min?: number | string;\n\n /** The maximum value allowed to pick. */\n @Prop({ reflect: true, mutable: true }) max?: number | string;\n\n /** Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa. */\n // eslint-disable-next-line @stencil-community/ban-default-true\n @Prop({ reflect: true }) roundtrip = true;\n\n /** Defines how many steps should be taken when navigating */\n @Prop({ reflect: true }) step = 1;\n\n /** Defines a custom list of items you can iterate through */\n @Prop() items?: string[];\n\n /** Defines whether the items should be padded */\n @Prop() padded = false;\n\n /** Defines the length of the padded area */\n @Prop() paddingLength = 2;\n\n /** Defines the character used for padding */\n @Prop() paddingChar = '0';\n\n /** Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default,\n * before is selected */\n @Prop() paddingDirection: ItemPickerPaddingDirection = ItemPickerPaddingDirection.BEFORE;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between items.\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * Emitted when the item picker's value changes\n */\n @Event({ eventName: 'six-item-picker-change' }) sixChange!: EventEmitter<SixItemPickerChangePayload>;\n\n /**\n * Emitted when the item picker's value changes, but debounced\n */\n @Event({ eventName: 'six-item-picker-change-debounced' })\n sixChangeDebounced!: EventEmitter<SixItemPickerChangePayload>;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n @Watch('value')\n handleValueChange() {\n this.setup();\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.eventListeners.removeByIdentifier(DEBOUNCE_ITEM_PICKER_LISTENER);\n this.eventListeners.add(\n this.host,\n 'six-item-picker-change',\n debounce(this.handleSixItemPickerChangeDebounced, this.debounce),\n DEBOUNCE_ITEM_PICKER_LISTENER\n );\n }\n\n @Watch('items')\n handleSetChange() {\n this.setup();\n this.min = this._items[0];\n this.max = this.getLastStringItem();\n }\n\n @State() _items: string[] = [];\n @State() _itemIndexes: Record<string, number> = {};\n\n // used for fast increasing when keeping the mouse button held down\n private _timeoutNext!: ReturnType<typeof setTimeout>;\n private _intervalNext!: ReturnType<typeof setInterval>;\n\n private _timeoutPrev!: ReturnType<typeof setTimeout>;\n private _intervalPrev!: ReturnType<typeof setInterval>;\n\n componentWillLoad() {\n this.setup();\n }\n\n componentDidLoad() {\n this.eventListeners.add(\n this.host,\n 'six-item-picker-change',\n debounce(this.handleSixItemPickerChangeDebounced, this.debounce),\n DEBOUNCE_ITEM_PICKER_LISTENER\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n private handleSixItemPickerChangeDebounced = () => {\n this.sixChangeDebounced.emit(this.value);\n };\n\n private setup() {\n if (this.isNumber()) {\n this.setupNumberItems();\n } else {\n this.setUpStringItems();\n }\n }\n\n private setupNumberItems() {\n if (this.isInvalidNumber()) {\n console.warn(`${TAG} Expected number but value is not a number: \"${this.value}\"`);\n console.info(`${TAG} Will set value to either minimum or if not provided to zero.`);\n this.value = this.min ?? 0;\n }\n }\n\n private setUpStringItems() {\n this._items = this.getStringItems();\n this._itemIndexes = this.getItemIndexes();\n const itemsMissValue = this._items.find((i) => String(i) === String(this.value)) === undefined;\n if (itemsMissValue) {\n console.warn(`${TAG} Expected item from item set but value was not found in set: \"${this.value}\"`);\n console.info(`${TAG} Will set value to either minimum or if not provided to \"${this._items[0]}\".`);\n this.value = this._items[0];\n }\n\n if (this.min === undefined) {\n if (!this.roundtrip) {\n console.warn(`${TAG} Expected a min value`);\n console.info(`${TAG} Will set min value to ${this._items[0]}`);\n }\n this.min = this._items[0];\n }\n\n if (this.max === undefined) {\n const maxItem = this.getLastStringItem();\n if (!this.roundtrip) {\n console.warn(`${TAG} Expected a min value if roundtrip is enabled`);\n console.info(`${TAG} Will set min value to ${maxItem}`);\n }\n this.max = maxItem;\n }\n }\n\n private getLastStringItem() {\n return this._items[this._items.length - 1];\n }\n\n private getStringItems(): string[] {\n switch (this.type) {\n case ItemPickerType.NUMBER:\n console.warn(`${TAG}: unexpected type ${this.type}`);\n return [];\n case ItemPickerType.LETTER:\n return ALPHABET.alphabet;\n case ItemPickerType.CAPITAL_LETTER:\n return CAPITAL_ALPHABET.alphabet;\n case ItemPickerType.LOWER_LETTER:\n return LOWERCASE_ALPHABET.alphabet;\n case ItemPickerType.CUSTOM:\n if (this.items == null || this.items.length === 0) {\n console.warn(`${TAG}: no items defined for type ${this.type}`);\n return [];\n }\n return this.items;\n }\n }\n\n private getItemIndexes(): Record<string, number> {\n switch (this.type) {\n case ItemPickerType.NUMBER:\n console.warn(`${TAG}: unexpected type ${this.type}`);\n return {};\n case ItemPickerType.LETTER:\n return ALPHABET.letterIndexes;\n case ItemPickerType.CAPITAL_LETTER:\n return CAPITAL_ALPHABET.letterIndexes;\n case ItemPickerType.LOWER_LETTER:\n return LOWERCASE_ALPHABET.letterIndexes;\n case ItemPickerType.CUSTOM:\n return createItemIndexes(this._items);\n }\n }\n\n private previousItem() {\n if (this.isNumber()) {\n this.previousNumber();\n } else {\n this.previousStringItem();\n }\n\n this.sixChange.emit(this.value);\n }\n\n private previousNumber() {\n this.changeValue({\n isNextItemAllowed: () => !this.isPreviousNumberDisabled(),\n getNextItem: () => Number(this.value) - this.step,\n getRoundtripItem: () => Number(this.max),\n isRoundtripPossible: () => this.max === undefined && this.roundtrip,\n });\n }\n\n private previousStringItem() {\n const value = String(this.value);\n const minLetter = String(this.min);\n\n this.changeValue({\n isNextItemAllowed: () =>\n minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),\n getNextItem: () => this.getNextItemByOperation(subtract),\n getRoundtripItem: () => String(this.max),\n isRoundtripPossible: () => this.max == null && this.roundtrip,\n });\n }\n\n private nextItem() {\n if (this.isNumber()) {\n this.nextNumber();\n } else {\n this.nextStringItem();\n }\n\n this.sixChange.emit(this.value);\n }\n\n private nextNumber() {\n this.changeValue({\n isNextItemAllowed: () => !this.isNextNumberDisabled(),\n getNextItem: () => Number(this.value) + this.step,\n getRoundtripItem: () => Number(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n }\n\n private getStringItemIndex(char: string): number {\n return this._itemIndexes[char];\n }\n\n private nextStringItem() {\n const value = String(this.value);\n const maxLetter = String(this.max);\n\n this.changeValue({\n isNextItemAllowed: () =>\n maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),\n getNextItem: () => this.getNextItemByOperation(add),\n getRoundtripItem: () => String(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n }\n\n private getNextItemByOperation(operation: (a: number, b: number) => number, increment: number = this.step) {\n const value = String(this.value);\n const nextIndexCandidate = operation(this.getStringItemIndex(value), increment);\n const numberOfItems = this._items.length;\n const nextIndex = ((nextIndexCandidate % numberOfItems) + numberOfItems) % numberOfItems;\n return this._items[nextIndex];\n }\n\n private changeValue(params: {\n getNextItem: () => number | string;\n isNextItemAllowed: () => boolean;\n getRoundtripItem: () => number | string;\n isRoundtripPossible: () => boolean;\n }) {\n if (params.isNextItemAllowed()) {\n this.value = params.getNextItem();\n return;\n }\n\n if (params.isRoundtripPossible()) {\n console.error(\n `${TAG} Item picker is expected to perform a roundtrip, but either max or min value is missing so a roundtrip is not possible`\n );\n return;\n }\n\n if (this.roundtrip) {\n this.value = params.getRoundtripItem();\n return;\n }\n\n console.warn(\n `${TAG} Roundtrip is not allowed, but was still triggered, please report this issue to the developer of six-item-picker`\n );\n\n this.sixChange.emit(this.value);\n }\n\n private isNumber() {\n return this.type === ItemPickerType.NUMBER;\n }\n\n private isInvalidNumber() {\n return this.value === '' || isNaN(this.value as number);\n }\n\n private isNextDisabled() {\n if (this.roundtrip) {\n return false;\n }\n\n if (this.isNumber()) {\n return this.isNextNumberDisabled();\n } else {\n return this._itemIndexes[String(this.value)] + this.step > this._itemIndexes[String(this.max)];\n }\n }\n\n private isNextNumberDisabled() {\n return Number(this.value) + this.step > Number(this.max ?? Infinity);\n }\n\n private isPrevDisabled() {\n if (this.roundtrip) {\n return false;\n }\n\n if (this.isNumber()) {\n return this.isPreviousNumberDisabled();\n } else {\n return this._itemIndexes[String(this.value)] - this.step < this._itemIndexes[String(this.min)];\n }\n }\n\n private isPreviousNumberDisabled() {\n return Number(this.value) - this.step < Number(this.min ?? -Infinity);\n }\n\n private onMouseDownNext() {\n if (this.isNextDisabled()) {\n return;\n }\n\n this.nextItem();\n\n this._timeoutNext = setTimeout(() => {\n this._intervalNext = setInterval(() => {\n this.nextItem();\n }, this.interval);\n }, this.timeout);\n }\n\n private onMouseUpNext() {\n clearTimeout(this._timeoutNext);\n clearInterval(this._intervalNext);\n }\n\n private onMouseDownPrev() {\n if (this.isPrevDisabled()) {\n return;\n }\n\n this.previousItem();\n\n this._timeoutPrev = setTimeout(() => {\n this._intervalPrev = setInterval(() => {\n this.previousItem();\n }, this.interval);\n }, this.timeout);\n }\n\n private onMouseUpPrev() {\n clearTimeout(this._timeoutPrev);\n clearInterval(this._intervalPrev);\n }\n\n private getFormattedValue() {\n if (this.value === undefined || this.value === null) {\n return this.value;\n }\n\n if (!this.padded) {\n return this.value;\n }\n\n if (this.paddingDirection === ItemPickerPaddingDirection.BEFORE) {\n return String(this.value).padStart(this.paddingLength, this.paddingChar);\n } else if (this.paddingDirection === ItemPickerPaddingDirection.AFTER) {\n return String(this.value).padEnd(this.paddingLength, this.paddingChar);\n }\n\n return this.value;\n }\n\n private handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (event.target === this.upButton) {\n this.nextItem();\n } else if (event.target === this.downButton) {\n this.previousItem();\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.nextItem();\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.previousItem();\n } else if (event.key === 'PageUp') {\n event.preventDefault();\n this.pageUp();\n } else if (event.key === 'PageDown') {\n event.preventDefault();\n this.pageDown();\n } else if (event.key === 'Home') {\n event.preventDefault();\n this.goToMin();\n } else if (event.key === 'End') {\n event.preventDefault();\n this.goToMax();\n }\n }\n\n private pageUp() {\n if (this.isNumber()) {\n this.changeValue({\n isNextItemAllowed: () => !this.isNextNumberDisabled(),\n getNextItem: () => Number(this.value) + 5 * this.step,\n getRoundtripItem: () => Number(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n } else {\n const value = String(this.value);\n const minLetter = String(this.min);\n\n this.changeValue({\n isNextItemAllowed: () =>\n minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),\n getNextItem: () => this.getNextItemByOperation(add, 5),\n getRoundtripItem: () => String(this.min),\n isRoundtripPossible: () => this.min === undefined && this.roundtrip,\n });\n }\n }\n\n private pageDown() {\n if (this.isNumber()) {\n this.changeValue({\n isNextItemAllowed: () => !this.isPreviousNumberDisabled(),\n getNextItem: () => Number(this.value) - 5 * this.step,\n getRoundtripItem: () => Number(this.max),\n isRoundtripPossible: () => this.max === undefined && this.roundtrip,\n });\n } else {\n const value = String(this.value);\n const maxLetter = String(this.max);\n\n this.changeValue({\n isNextItemAllowed: () =>\n maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),\n getNextItem: () => this.getNextItemByOperation(subtract, 5),\n getRoundtripItem: () => String(this.max),\n isRoundtripPossible: () => this.max == null && this.roundtrip,\n });\n }\n }\n\n private goToMin() {\n if (this.isNumber()) {\n this.value = this.min ?? 0;\n } else {\n this.value = this._items[0];\n }\n\n this.sixChange.emit(this.value);\n }\n\n private goToMax() {\n if (this.isNumber()) {\n this.value = this.max ?? Infinity;\n } else {\n this.value = this.getLastStringItem();\n }\n\n this.sixChange.emit(this.value);\n }\n\n private upButton!: HTMLDivElement;\n private downButton!: HTMLDivElement;\n\n render() {\n return (\n <div\n part=\"container\"\n class=\"item_picker__container\"\n onKeyDown={(event) => this.handleKeyPress(event)}\n tabindex=\"0\"\n >\n <div\n ref={(el) => (this.upButton = el as HTMLDivElement)}\n part=\"up\"\n class={{\n item_picker__btn: true,\n 'item_picker__btn--disabled': this.isNextDisabled(),\n }}\n onMouseDown={() => this.onMouseDownNext()}\n onMouseUp={() => this.onMouseUpNext()}\n tabindex=\"-1\"\n >\n <six-icon size=\"large\">expand_less</six-icon>\n </div>\n <div part=\"content\" class=\"item_picker__content\">\n {this.getFormattedValue()}\n </div>\n <div\n ref={(el) => (this.downButton = el as HTMLDivElement)}\n part=\"down\"\n class={{\n item_picker__btn: true,\n 'item_picker__btn--disabled': this.isPrevDisabled(),\n }}\n onMouseDown={() => this.onMouseDownPrev()}\n onMouseUp={() => this.onMouseUpPrev()}\n tabindex=\"-1\"\n >\n <six-icon size=\"large\">expand_more</six-icon>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|