@six-group/ui-library 3.0.0-beta.1.7 → 3.0.0-beta.1.8
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/{event-listeners-4a8d66d5.js → event-listeners-74715e62.js} +38 -38
- package/dist/cjs/{execution-control-3bc9c7c4.js → execution-control-46f388e0.js} +35 -35
- package/dist/cjs/{focus-visible-b08d956f.js → focus-visible-0b352c74.js} +40 -40
- package/dist/cjs/{form-control-9e4dffd1.js → form-control-866bbece.js} +25 -25
- package/dist/cjs/{modal-a9679ddf.js → modal-48d42228.js} +41 -41
- package/dist/cjs/{popover-e3781f5a.js → popover-1d2a037c.js} +95 -95
- package/dist/cjs/{scroll-5b8676ba.js → scroll-76e6f5d7.js} +57 -57
- package/dist/cjs/set-attributes_2.cjs.entry.js +57 -57
- package/dist/cjs/six-alert.cjs.entry.js +131 -131
- package/dist/cjs/six-avatar.cjs.entry.js +28 -28
- package/dist/cjs/six-badge.cjs.entry.js +26 -26
- package/dist/cjs/six-button.cjs.entry.js +97 -97
- package/dist/cjs/six-card.cjs.entry.js +8 -8
- package/dist/cjs/six-checkbox.cjs.entry.js +152 -152
- package/dist/cjs/six-datepicker.cjs.entry.js +1189 -1189
- package/dist/cjs/six-details.cjs.entry.js +139 -139
- package/dist/cjs/six-dialog.cjs.entry.js +152 -152
- package/dist/cjs/six-drawer.cjs.entry.js +174 -174
- package/dist/cjs/six-dropdown_3.cjs.entry.js +728 -728
- package/dist/cjs/six-error-page.cjs.entry.js +94 -94
- package/dist/cjs/six-file-list-item.cjs.entry.js +38 -38
- package/dist/cjs/six-file-list.cjs.entry.js +8 -8
- package/dist/cjs/six-file-upload.cjs.entry.js +96 -96
- package/dist/cjs/six-footer.cjs.entry.js +8 -8
- package/dist/cjs/six-form.cjs.entry.js +219 -219
- package/dist/cjs/six-group-label.cjs.entry.js +46 -46
- package/dist/cjs/six-header.cjs.entry.js +149 -149
- package/dist/cjs/six-icon-button.cjs.entry.js +33 -33
- package/dist/cjs/six-icon.cjs.entry.js +24 -24
- package/dist/cjs/six-input.cjs.entry.js +230 -230
- package/dist/cjs/six-item-picker.cjs.entry.js +361 -361
- package/dist/cjs/six-language-switcher.cjs.entry.js +52 -52
- package/dist/cjs/six-layout-grid.cjs.entry.js +19 -19
- package/dist/cjs/six-main-container.cjs.entry.js +11 -11
- package/dist/cjs/six-menu-divider.cjs.entry.js +8 -8
- package/dist/cjs/six-menu-label.cjs.entry.js +8 -8
- package/dist/cjs/six-picto.cjs.entry.js +15 -15
- package/dist/cjs/six-progress-bar.cjs.entry.js +17 -17
- package/dist/cjs/six-progress-ring.cjs.entry.js +31 -31
- package/dist/cjs/six-radio.cjs.entry.js +121 -121
- package/dist/cjs/six-range.cjs.entry.js +198 -198
- package/dist/cjs/six-root.cjs.entry.js +34 -34
- package/dist/cjs/six-search-field.cjs.entry.js +43 -43
- package/dist/cjs/six-select.cjs.entry.js +447 -447
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +42 -42
- package/dist/cjs/six-sidebar-item.cjs.entry.js +18 -18
- package/dist/cjs/six-sidebar.cjs.entry.js +171 -171
- package/dist/cjs/six-spinner.cjs.entry.js +16 -16
- package/dist/cjs/six-switch.cjs.entry.js +100 -100
- package/dist/cjs/six-tab-group.cjs.entry.js +226 -226
- package/dist/cjs/six-tab-panel.cjs.entry.js +17 -17
- package/dist/cjs/six-tab.cjs.entry.js +42 -42
- package/dist/cjs/six-table-cell_4.cjs.entry.js +70 -70
- package/dist/cjs/six-table.cjs.entry.js +145 -145
- package/dist/cjs/six-tag.cjs.entry.js +40 -40
- package/dist/cjs/six-textarea.cjs.entry.js +211 -211
- package/dist/cjs/six-tile.cjs.entry.js +89 -89
- package/dist/cjs/six-timepicker.cjs.entry.js +489 -489
- package/dist/cjs/{six-timepicker.types-c58cc88b.js → six-timepicker.types-c19ebff3.js} +43 -43
- package/dist/cjs/six-tooltip.cjs.entry.js +172 -172
- package/dist/cjs/{slot-8abe833c.js → slot-ad537f24.js} +42 -42
- package/dist/cjs/{types-65e5c95b.js → types-581e8ff0.js} +12 -12
- package/dist/cjs/{types-0c28e484.js → types-64878648.js} +12 -12
- package/dist/collection/components/six-alert/six-alert.js +366 -366
- package/dist/collection/components/six-avatar/six-avatar.js +131 -131
- package/dist/collection/components/six-badge/six-badge.js +101 -101
- package/dist/collection/components/six-button/six-button.js +466 -466
- package/dist/collection/components/six-card/six-card.js +21 -21
- package/dist/collection/components/six-checkbox/six-checkbox.js +550 -550
- package/dist/collection/components/six-datepicker/components/day-selection.js +13 -13
- package/dist/collection/components/six-datepicker/components/month-selection.js +12 -12
- package/dist/collection/components/six-datepicker/components/year-selection.js +10 -10
- package/dist/collection/components/six-datepicker/six-date-formats.js +23 -23
- package/dist/collection/components/six-datepicker/six-datepicker.js +1343 -1343
- package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js +16 -16
- package/dist/collection/components/six-details/six-details.js +432 -432
- package/dist/collection/components/six-dialog/six-dialog.js +401 -401
- package/dist/collection/components/six-drawer/six-drawer.js +458 -458
- package/dist/collection/components/six-dropdown/six-dropdown.js +939 -939
- package/dist/collection/components/six-error-page/six-error-page.js +199 -199
- package/dist/collection/components/six-file-list/six-file-list.js +20 -20
- package/dist/collection/components/six-file-list-item/six-file-list-item.js +203 -203
- package/dist/collection/components/six-file-upload/six-file-upload.js +272 -272
- package/dist/collection/components/six-footer/six-footer.js +21 -21
- package/dist/collection/components/six-form/six-form.js +408 -408
- package/dist/collection/components/six-group-label/six-group-label.js +166 -166
- package/dist/collection/components/six-header/six-header.js +420 -420
- package/dist/collection/components/six-icon/six-icon.js +77 -77
- package/dist/collection/components/six-icon-button/six-icon-button.js +142 -142
- package/dist/collection/components/six-input/six-input.js +1141 -1141
- package/dist/collection/components/six-item-picker/six-item-picker.js +688 -688
- package/dist/collection/components/six-item-picker/types.js +13 -13
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +128 -128
- package/dist/collection/components/six-layout-grid/six-layout-grid.js +52 -52
- package/dist/collection/components/six-main-container/six-main-container.js +53 -53
- package/dist/collection/components/six-menu/six-menu.js +406 -406
- package/dist/collection/components/six-menu-divider/six-menu-divider.js +22 -22
- package/dist/collection/components/six-menu-item/six-menu-item.js +177 -177
- package/dist/collection/components/six-menu-label/six-menu-label.js +25 -25
- package/dist/collection/components/six-picto/six-picto.js +50 -50
- package/dist/collection/components/six-progress-bar/six-progress-bar.js +77 -77
- package/dist/collection/components/six-progress-ring/six-progress-ring.js +111 -111
- package/dist/collection/components/six-radio/six-radio.js +410 -410
- package/dist/collection/components/six-range/six-range.js +620 -620
- package/dist/collection/components/six-root/six-root.js +167 -167
- package/dist/collection/components/six-search-field/six-search-field.js +171 -171
- package/dist/collection/components/six-select/six-select.js +1105 -1105
- package/dist/collection/components/six-sidebar/six-sidebar.js +455 -455
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +89 -89
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +158 -158
- package/dist/collection/components/six-spinner/six-spinner.js +55 -55
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +46 -46
- package/dist/collection/components/six-switch/six-switch.js +393 -393
- package/dist/collection/components/six-tab/six-tab.js +198 -198
- package/dist/collection/components/six-tab-group/six-tab-group.js +362 -362
- package/dist/collection/components/six-tab-panel/six-tab-panel.js +75 -75
- package/dist/collection/components/six-table/six-table.js +209 -209
- package/dist/collection/components/six-table/test/helpers.js +13 -13
- package/dist/collection/components/six-table/types.js +8 -8
- package/dist/collection/components/six-table/util/filter-by.js +34 -34
- package/dist/collection/components/six-table/util/from-data.js +33 -33
- package/dist/collection/components/six-table/util/is.js +3 -3
- package/dist/collection/components/six-table/util/quick-filter-by.js +13 -13
- package/dist/collection/components/six-table/util/sort-by.js +25 -25
- package/dist/collection/components/six-table-cell/six-table-cell.js +21 -21
- package/dist/collection/components/six-table-header/six-table-header.js +21 -21
- package/dist/collection/components/six-table-header-cell/get-next-state.js +7 -7
- package/dist/collection/components/six-table-header-cell/icons.js +12 -12
- package/dist/collection/components/six-table-header-cell/six-table-header-cell.js +174 -174
- package/dist/collection/components/six-table-header-cell/types.js +13 -13
- package/dist/collection/components/six-table-header-cell/util/create-model.js +6 -6
- package/dist/collection/components/six-table-header-cell/util/get-next-state.js +7 -7
- package/dist/collection/components/six-table-row/six-table-row.js +21 -21
- package/dist/collection/components/six-tag/six-tag.js +157 -157
- package/dist/collection/components/six-textarea/six-textarea.js +912 -912
- package/dist/collection/components/six-tile/six-tile.js +315 -315
- package/dist/collection/components/six-timepicker/six-time-format.js +14 -14
- package/dist/collection/components/six-timepicker/six-timepicker.js +980 -980
- package/dist/collection/components/six-timepicker/six-timepicker.types.js +40 -40
- package/dist/collection/components/six-tooltip/six-tooltip.js +435 -435
- package/dist/collection/functional-components/form-control/form-control.js +28 -28
- package/dist/collection/index.js +1 -1
- package/dist/collection/testUtil/delay.js +3 -3
- package/dist/collection/utils/as-array.js +1 -1
- package/dist/collection/utils/date-util.js +712 -712
- package/dist/collection/utils/event-listeners.js +39 -39
- package/dist/collection/utils/execution-control.js +38 -38
- package/dist/collection/utils/focus-visible.js +41 -41
- package/dist/collection/utils/matchers.js +2 -2
- package/dist/collection/utils/modal.js +28 -28
- package/dist/collection/utils/offset.js +13 -13
- package/dist/collection/utils/popover.js +113 -113
- package/dist/collection/utils/scroll.js +47 -47
- package/dist/collection/utils/slot.js +59 -59
- package/dist/collection/utils/support.js +15 -15
- package/dist/collection/utils/tabbable.js +22 -22
- package/dist/collection/utils/testing.js +38 -38
- package/dist/collection/utils/time.util.js +74 -74
- package/dist/collection/utils/type-check.js +5 -5
- package/dist/collection/utils/types.js +1 -1
- package/dist/collection/wrappers/set-attributes/set-attributes.js +68 -68
- package/dist/components.json +1 -1
- package/dist/custom-elements/index.js +7595 -7595
- package/dist/esm/{event-listeners-1bef934e.js → event-listeners-570a24ea.js} +38 -38
- package/dist/esm/{execution-control-235f5126.js → execution-control-1a60d709.js} +35 -35
- package/dist/esm/{focus-visible-4b7946aa.js → focus-visible-97933ea9.js} +40 -40
- package/dist/esm/{form-control-17478ad2.js → form-control-24f446af.js} +25 -25
- package/dist/esm/{modal-e5709f6b.js → modal-5ebdc320.js} +41 -41
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{popover-5a51f84d.js → popover-1c7a1139.js} +95 -95
- package/dist/esm/{scroll-99b214c2.js → scroll-180b53fd.js} +57 -57
- package/dist/esm/set-attributes_2.entry.js +57 -57
- package/dist/esm/six-alert.entry.js +131 -131
- package/dist/esm/six-avatar.entry.js +28 -28
- package/dist/esm/six-badge.entry.js +26 -26
- package/dist/esm/six-button.entry.js +97 -97
- package/dist/esm/six-card.entry.js +8 -8
- package/dist/esm/six-checkbox.entry.js +152 -152
- package/dist/esm/six-datepicker.entry.js +1189 -1189
- package/dist/esm/six-details.entry.js +139 -139
- package/dist/esm/six-dialog.entry.js +152 -152
- package/dist/esm/six-drawer.entry.js +174 -174
- package/dist/esm/six-dropdown_3.entry.js +728 -728
- package/dist/esm/six-error-page.entry.js +94 -94
- package/dist/esm/six-file-list-item.entry.js +38 -38
- package/dist/esm/six-file-list.entry.js +8 -8
- package/dist/esm/six-file-upload.entry.js +96 -96
- package/dist/esm/six-footer.entry.js +8 -8
- package/dist/esm/six-form.entry.js +219 -219
- package/dist/esm/six-group-label.entry.js +46 -46
- package/dist/esm/six-header.entry.js +149 -149
- package/dist/esm/six-icon-button.entry.js +33 -33
- package/dist/esm/six-icon.entry.js +24 -24
- package/dist/esm/six-input.entry.js +230 -230
- package/dist/esm/six-item-picker.entry.js +361 -361
- package/dist/esm/six-language-switcher.entry.js +52 -52
- package/dist/esm/six-layout-grid.entry.js +19 -19
- package/dist/esm/six-main-container.entry.js +11 -11
- package/dist/esm/six-menu-divider.entry.js +8 -8
- package/dist/esm/six-menu-label.entry.js +8 -8
- package/dist/esm/six-picto.entry.js +15 -15
- package/dist/esm/six-progress-bar.entry.js +17 -17
- package/dist/esm/six-progress-ring.entry.js +31 -31
- package/dist/esm/six-radio.entry.js +121 -121
- package/dist/esm/six-range.entry.js +198 -198
- package/dist/esm/six-root.entry.js +34 -34
- package/dist/esm/six-search-field.entry.js +43 -43
- package/dist/esm/six-select.entry.js +447 -447
- package/dist/esm/six-sidebar-item-group.entry.js +42 -42
- package/dist/esm/six-sidebar-item.entry.js +18 -18
- package/dist/esm/six-sidebar.entry.js +171 -171
- package/dist/esm/six-spinner.entry.js +16 -16
- package/dist/esm/six-switch.entry.js +100 -100
- package/dist/esm/six-tab-group.entry.js +226 -226
- package/dist/esm/six-tab-panel.entry.js +17 -17
- package/dist/esm/six-tab.entry.js +42 -42
- package/dist/esm/six-table-cell_4.entry.js +70 -70
- package/dist/esm/six-table.entry.js +145 -145
- package/dist/esm/six-tag.entry.js +40 -40
- package/dist/esm/six-textarea.entry.js +211 -211
- package/dist/esm/six-tile.entry.js +89 -89
- package/dist/esm/six-timepicker.entry.js +489 -489
- package/dist/esm/{six-timepicker.types-cd6bac03.js → six-timepicker.types-e161a447.js} +43 -43
- package/dist/esm/six-tooltip.entry.js +172 -172
- package/dist/esm/{slot-5253e199.js → slot-6f3984c7.js} +42 -42
- package/dist/esm/{types-a37c1695.js → types-4b10b413.js} +12 -12
- package/dist/esm/{types-33d15673.js → types-ed860f7c.js} +12 -12
- package/dist/types/components/six-alert/six-alert.d.ts +60 -60
- package/dist/types/components/six-avatar/six-avatar.d.ts +27 -27
- package/dist/types/components/six-badge/six-badge.d.ts +20 -20
- package/dist/types/components/six-button/six-button.d.ts +69 -69
- package/dist/types/components/six-card/six-card.d.ts +9 -9
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +86 -86
- package/dist/types/components/six-datepicker/components/day-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/components/month-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/components/year-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/six-date-formats.d.ts +22 -22
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +214 -214
- package/dist/types/components/six-datepicker/test/six-datepicker.test-helpers.d.ts +1 -1
- package/dist/types/components/six-details/six-details.d.ts +61 -61
- package/dist/types/components/six-dialog/six-dialog.d.ts +75 -75
- package/dist/types/components/six-drawer/six-drawer.d.ts +82 -82
- package/dist/types/components/six-dropdown/six-dropdown.d.ts +140 -140
- package/dist/types/components/six-error-page/six-error-page.d.ts +27 -27
- package/dist/types/components/six-file-list/six-file-list.d.ts +8 -8
- package/dist/types/components/six-file-list-item/six-file-list-item.d.ts +35 -35
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +42 -42
- package/dist/types/components/six-footer/six-footer.d.ts +9 -9
- package/dist/types/components/six-form/six-form.d.ts +69 -69
- package/dist/types/components/six-group-label/six-group-label.d.ts +37 -37
- package/dist/types/components/six-header/six-header.d.ts +90 -90
- package/dist/types/components/six-icon/six-icon.d.ts +13 -13
- package/dist/types/components/six-icon-button/six-icon-button.d.ts +28 -28
- package/dist/types/components/six-input/six-input.d.ts +165 -165
- package/dist/types/components/six-item-picker/six-item-picker.d.ts +106 -106
- package/dist/types/components/six-item-picker/types.d.ts +11 -11
- package/dist/types/components/six-language-switcher/six-language-switcher.d.ts +25 -25
- package/dist/types/components/six-layout-grid/six-layout-grid.d.ts +14 -14
- package/dist/types/components/six-main-container/six-main-container.d.ts +16 -16
- package/dist/types/components/six-menu/six-menu.d.ts +81 -81
- package/dist/types/components/six-menu-divider/six-menu-divider.d.ts +11 -11
- package/dist/types/components/six-menu-item/six-menu-item.d.ts +36 -36
- package/dist/types/components/six-menu-label/six-menu-label.d.ts +13 -13
- package/dist/types/components/six-picto/six-picto.d.ts +14 -14
- package/dist/types/components/six-progress-bar/six-progress-bar.d.ts +19 -19
- package/dist/types/components/six-progress-ring/six-progress-ring.d.ts +24 -24
- package/dist/types/components/six-radio/six-radio.d.ts +66 -66
- package/dist/types/components/six-range/six-range.d.ts +101 -101
- package/dist/types/components/six-root/six-root.d.ts +34 -34
- package/dist/types/components/six-search-field/six-search-field.d.ts +32 -32
- package/dist/types/components/six-select/six-select.d.ts +163 -163
- package/dist/types/components/six-sidebar/six-sidebar.d.ts +55 -55
- package/dist/types/components/six-sidebar-item/six-sidebar-item.d.ts +15 -15
- package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +26 -26
- package/dist/types/components/six-spinner/six-spinner.d.ts +15 -15
- package/dist/types/components/six-stage-indicator/six-stage-indicator.d.ts +6 -6
- package/dist/types/components/six-switch/six-switch.d.ts +62 -62
- package/dist/types/components/six-tab/six-tab.d.ts +35 -35
- package/dist/types/components/six-tab-group/six-tab-group.d.ts +62 -62
- package/dist/types/components/six-tab-panel/six-tab-panel.d.ts +19 -19
- package/dist/types/components/six-table/six-table.d.ts +30 -30
- package/dist/types/components/six-table/test/helpers.d.ts +2 -2
- package/dist/types/components/six-table/types.d.ts +33 -33
- package/dist/types/components/six-table/util/filter-by.d.ts +2 -2
- package/dist/types/components/six-table/util/from-data.d.ts +8 -8
- package/dist/types/components/six-table/util/is.d.ts +3 -3
- package/dist/types/components/six-table/util/quick-filter-by.d.ts +2 -2
- package/dist/types/components/six-table/util/sort-by.d.ts +2 -2
- package/dist/types/components/six-table-cell/six-table-cell.d.ts +9 -9
- package/dist/types/components/six-table-header/six-table-header.d.ts +9 -9
- package/dist/types/components/six-table-header-cell/get-next-state.d.ts +2 -2
- package/dist/types/components/six-table-header-cell/icons.d.ts +3 -3
- package/dist/types/components/six-table-header-cell/six-table-header-cell.d.ts +32 -32
- package/dist/types/components/six-table-header-cell/types.d.ts +11 -11
- package/dist/types/components/six-table-header-cell/util/create-model.d.ts +4 -4
- package/dist/types/components/six-table-header-cell/util/get-next-state.d.ts +3 -3
- package/dist/types/components/six-table-row/six-table-row.d.ts +9 -9
- package/dist/types/components/six-tag/six-tag.d.ts +30 -30
- package/dist/types/components/six-textarea/six-textarea.d.ts +134 -134
- package/dist/types/components/six-tile/six-tile.d.ts +40 -40
- package/dist/types/components/six-timepicker/six-time-format.d.ts +13 -13
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +184 -184
- package/dist/types/components/six-timepicker/six-timepicker.types.d.ts +36 -36
- package/dist/types/components/six-tooltip/six-tooltip.d.ts +72 -72
- package/dist/types/functional-components/form-control/form-control.d.ts +34 -34
- package/dist/types/index.d.ts +1 -1
- package/dist/types/testUtil/delay.d.ts +1 -1
- package/dist/types/utils/as-array.d.ts +1 -1
- package/dist/types/utils/date-util.d.ts +194 -194
- package/dist/types/utils/event-listeners.d.ts +15 -15
- package/dist/types/utils/execution-control.d.ts +26 -26
- package/dist/types/utils/focus-visible.d.ts +6 -6
- package/dist/types/utils/matchers.d.ts +2 -2
- package/dist/types/utils/modal.d.ts +13 -13
- package/dist/types/utils/offset.d.ts +4 -4
- package/dist/types/utils/popover.d.ts +27 -27
- package/dist/types/utils/scroll.d.ts +3 -3
- package/dist/types/utils/slot.d.ts +9 -9
- package/dist/types/utils/support.d.ts +1 -1
- package/dist/types/utils/tabbable.d.ts +2 -2
- package/dist/types/utils/testing.d.ts +2 -2
- package/dist/types/utils/time.util.d.ts +10 -10
- package/dist/types/utils/type-check.d.ts +4 -4
- package/dist/types/utils/types.d.ts +4 -4
- package/dist/types/wrappers/set-attributes/set-attributes.d.ts +9 -9
- package/dist/ui-library/{p-a8c225f2.entry.js → p-007bc8e8.entry.js} +1 -1
- package/dist/ui-library/{p-f9c0cfb7.entry.js → p-044b784e.entry.js} +1 -1
- package/dist/ui-library/{p-c733dead.js → p-0786fa7c.js} +0 -0
- package/dist/ui-library/{p-12cc24c3.js → p-07d1e830.js} +0 -0
- package/dist/ui-library/{p-48ea4419.entry.js → p-09cb13fa.entry.js} +1 -1
- package/dist/ui-library/{p-e96dcf96.entry.js → p-0c596054.entry.js} +1 -1
- package/dist/ui-library/{p-a77a6442.entry.js → p-1b8dc7b7.entry.js} +1 -1
- package/dist/ui-library/{p-68d31736.js → p-25a3bf57.js} +0 -0
- package/dist/ui-library/{p-ebaea182.entry.js → p-281e8c2d.entry.js} +1 -1
- package/dist/ui-library/{p-9f2dc381.entry.js → p-2924f82f.entry.js} +1 -1
- package/dist/ui-library/{p-ea1fcff2.entry.js → p-2d7ed407.entry.js} +1 -1
- package/dist/ui-library/{p-89f68e76.entry.js → p-4162dcdd.entry.js} +1 -1
- package/dist/ui-library/{p-6f67f986.entry.js → p-4d3a4e93.entry.js} +1 -1
- package/dist/ui-library/{p-8bd0873f.entry.js → p-4ed023b8.entry.js} +1 -1
- package/dist/ui-library/{p-af3d757c.js → p-4f8394d7.js} +0 -0
- package/dist/ui-library/{p-1b92cc7a.entry.js → p-530ea6ec.entry.js} +1 -1
- package/dist/ui-library/{p-19543c96.entry.js → p-531ab886.entry.js} +1 -1
- package/dist/ui-library/{p-fdb455d7.entry.js → p-54c48654.entry.js} +1 -1
- package/dist/ui-library/{p-c948d3db.entry.js → p-55c64cbc.entry.js} +1 -1
- package/dist/ui-library/{p-1c9f0dc6.js → p-5f1c6a5f.js} +0 -0
- package/dist/ui-library/{p-60491176.entry.js → p-675a8243.entry.js} +1 -1
- package/dist/ui-library/{p-b9fb8455.entry.js → p-6d622ed0.entry.js} +1 -1
- package/dist/ui-library/{p-572e3690.js → p-75297ad7.js} +0 -0
- package/dist/ui-library/{p-2ff97cdf.entry.js → p-90b26447.entry.js} +1 -1
- package/dist/ui-library/{p-fcd2356c.entry.js → p-93945629.entry.js} +1 -1
- package/dist/ui-library/{p-7735d99f.js → p-9a860acc.js} +0 -0
- package/dist/ui-library/{p-4cc01afc.entry.js → p-aa37e45a.entry.js} +1 -1
- package/dist/ui-library/{p-191f958b.js → p-b1e66136.js} +0 -0
- package/dist/ui-library/{p-c09dc3a9.js → p-b4dfb7cf.js} +0 -0
- package/dist/ui-library/{p-968c5169.entry.js → p-c24292b3.entry.js} +1 -1
- package/dist/ui-library/{p-ed21cc57.entry.js → p-cd79de73.entry.js} +1 -1
- package/dist/ui-library/{p-34e6d8e8.js → p-d12c6092.js} +0 -0
- package/dist/ui-library/{p-f0e91e17.entry.js → p-d28ac80a.entry.js} +1 -1
- package/dist/ui-library/{p-5ead7b2f.entry.js → p-d837e5a8.entry.js} +1 -1
- package/dist/ui-library/{p-ec1ecc2a.entry.js → p-dd3cae68.entry.js} +1 -1
- package/dist/ui-library/{p-044c6bf9.js → p-eb8f05a9.js} +0 -0
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,980 +1,980 @@
|
|
|
1
|
-
import { Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';
|
|
2
|
-
import { ItemPickerType } from '../six-item-picker/types';
|
|
3
|
-
import { SixTimeFormat } from './six-time-format';
|
|
4
|
-
import { SixTimePropertyName, TIME_FORMAT_CHAR } from './six-timepicker.types';
|
|
5
|
-
import { createTimeString, getCurrentTime, isValidTimeString, parseTimeString, TIME_FORMAT_SEPARATOR, } from '../../utils/time.util';
|
|
6
|
-
import { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';
|
|
7
|
-
import { EventListeners } from '../../utils/event-listeners';
|
|
8
|
-
import { hasSlot } from '../../utils/slot';
|
|
9
|
-
import { isNil } from '../../utils/type-check';
|
|
10
|
-
const TAG = `[SIX-TIMEPICKER]`;
|
|
11
|
-
const DEBOUNCE_TIMEPICKER_LISTENER = 'debounced-timepicker';
|
|
12
|
-
const MIN_POPUP_HEIGHT = 145;
|
|
13
|
-
/**
|
|
14
|
-
* @since 2.0.0
|
|
15
|
-
* @status experimental
|
|
16
|
-
*
|
|
17
|
-
* @part input - The input field
|
|
18
|
-
* @part container - The container of whole component
|
|
19
|
-
* @part popup - The popup of the timepicker component
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export class SixTimepicker {
|
|
23
|
-
constructor() {
|
|
24
|
-
this.eventListeners = new EventListeners();
|
|
25
|
-
/**
|
|
26
|
-
* Define the time format. Valid formats are:
|
|
27
|
-
*
|
|
28
|
-
* HH:mm:ss
|
|
29
|
-
* hh:mm:ss:aa
|
|
30
|
-
* HH:mm:ss:ms
|
|
31
|
-
* hh:mm:ss:ms:aa
|
|
32
|
-
* HH:mm
|
|
33
|
-
* hh:mm:aa
|
|
34
|
-
* HH
|
|
35
|
-
* hh:aa
|
|
36
|
-
* mm
|
|
37
|
-
* ss
|
|
38
|
-
* ms
|
|
39
|
-
*
|
|
40
|
-
* where HH is the 24 hour format
|
|
41
|
-
* and hh is the 12 hour format
|
|
42
|
-
*
|
|
43
|
-
* Please notice that when using the 12-hour-clock (hh)
|
|
44
|
-
* you always need a period indicator (aa). So the time can be parsed as either am or pm
|
|
45
|
-
* */
|
|
46
|
-
this.format = SixTimeFormat.HHmmss;
|
|
47
|
-
/**
|
|
48
|
-
* Define the separator to be shown between the time unit pickers.
|
|
49
|
-
* Please be aware that this property will modify the displayed separator only.
|
|
50
|
-
* The separator for a timestring is always expected to be a colon (eg. '13:52:20')
|
|
51
|
-
* */
|
|
52
|
-
this.separator = TIME_FORMAT_SEPARATOR;
|
|
53
|
-
/** Indicates whether or not the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */
|
|
54
|
-
this.open = false;
|
|
55
|
-
/** Indicates whether or not the timepicker should be shown as an inline (always open) component */
|
|
56
|
-
this.inline = false;
|
|
57
|
-
/**
|
|
58
|
-
* If `true` the user can only select a time via the timepicker but not directly edit the input field.
|
|
59
|
-
*/
|
|
60
|
-
this.readonly = false;
|
|
61
|
-
/**
|
|
62
|
-
* If `true` the component is disabled.
|
|
63
|
-
*/
|
|
64
|
-
this.disabled = false;
|
|
65
|
-
/** Timepicker size. */
|
|
66
|
-
this.size = 'medium';
|
|
67
|
-
/** Set to display the error text on blur and not when typing */
|
|
68
|
-
this.errorOnBlur = false;
|
|
69
|
-
/** The input's error text. Alternatively, you can use the error-text slot. */
|
|
70
|
-
this.errorText = '';
|
|
71
|
-
/** The input's label. Alternatively, you can use the label slot. */
|
|
72
|
-
this.label = '';
|
|
73
|
-
/** The input's name attribute. */
|
|
74
|
-
this.name = '';
|
|
75
|
-
/** Set to true to add a clear button when the input is populated. */
|
|
76
|
-
this.clearable = false;
|
|
77
|
-
/** Set the position of the icon */
|
|
78
|
-
this.iconPosition = 'left';
|
|
79
|
-
/**
|
|
80
|
-
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with
|
|
81
|
-
* `overflow: auto|scroll`.
|
|
82
|
-
*/
|
|
83
|
-
this.hoist = false;
|
|
84
|
-
/**
|
|
85
|
-
* Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).
|
|
86
|
-
*/
|
|
87
|
-
this.timeout = DEFAULT_DEBOUNCE_FAST;
|
|
88
|
-
/**
|
|
89
|
-
* Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.
|
|
90
|
-
*/
|
|
91
|
-
this.interval = DEFAULT_DEBOUNCE_INSANELY_FAST;
|
|
92
|
-
/**
|
|
93
|
-
* Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.
|
|
94
|
-
* If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce
|
|
95
|
-
* is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click
|
|
96
|
-
* (and keep pressed) and once you release
|
|
97
|
-
*/
|
|
98
|
-
this.debounce = DEFAULT_DEBOUNCE_FAST;
|
|
99
|
-
this.isPopupContentUp = false;
|
|
100
|
-
this.isDropDownContentUp = false;
|
|
101
|
-
this.defaultValue = null;
|
|
102
|
-
this.handleInputChange = (event) => {
|
|
103
|
-
event.stopPropagation();
|
|
104
|
-
const inputValue = this.inputElement.value;
|
|
105
|
-
if (!isValidTimeString(inputValue, this.format)) {
|
|
106
|
-
this.sixChange.emit({
|
|
107
|
-
value: {},
|
|
108
|
-
valueAsString: '',
|
|
109
|
-
});
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.internalValue = parseTimeString(inputValue, this.format);
|
|
113
|
-
this.sixChange.emit({
|
|
114
|
-
value: this.internalValue,
|
|
115
|
-
valueAsString: createTimeString(this.internalValue, this.format),
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
this.handleSixTimepickerChangeDebounced = ({ detail }) => {
|
|
119
|
-
this.sixChangeDebounced.emit(detail);
|
|
120
|
-
};
|
|
121
|
-
this.handleChange = (event, property) => {
|
|
122
|
-
// stop propagation, since the timepicker should not expose the events of the underlying item-picker
|
|
123
|
-
event.stopPropagation();
|
|
124
|
-
// update the internal state
|
|
125
|
-
this.internalValue[property] = event.detail;
|
|
126
|
-
const timeString = createTimeString(this.internalValue, this.format);
|
|
127
|
-
// fire timepicker's own event
|
|
128
|
-
this.sixChange.emit({
|
|
129
|
-
changedProperty: property,
|
|
130
|
-
value: this.internalValue,
|
|
131
|
-
valueAsString: timeString,
|
|
132
|
-
});
|
|
133
|
-
// update the input value
|
|
134
|
-
this.value = timeString;
|
|
135
|
-
};
|
|
136
|
-
this.handleDocumentMouseDown = (event) => {
|
|
137
|
-
// Close when clicking outside of the containing element
|
|
138
|
-
const path = event.composedPath();
|
|
139
|
-
if (!path.includes(this.host)) {
|
|
140
|
-
this.closePopup();
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
this.handleClearClick = (event) => {
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
this.value = undefined;
|
|
147
|
-
this.sixClear.emit();
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
async resizeHandler() {
|
|
151
|
-
this.calcIsPopupContentUp();
|
|
152
|
-
this.moveOpenHoistedPopup();
|
|
153
|
-
}
|
|
154
|
-
async scrollHandler() {
|
|
155
|
-
this.calcIsPopupContentUp();
|
|
156
|
-
this.moveOpenHoistedPopup();
|
|
157
|
-
}
|
|
158
|
-
debounceChanged() {
|
|
159
|
-
this.eventListeners.removeByIdentifier(DEBOUNCE_TIMEPICKER_LISTENER);
|
|
160
|
-
this.eventListeners.add(this.host, 'six-timepicker-change', debounce(this.handleSixTimepickerChangeDebounced, this.debounce), DEBOUNCE_TIMEPICKER_LISTENER);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Update the native input element when the value changes
|
|
164
|
-
*/
|
|
165
|
-
valueChanged(newValue) {
|
|
166
|
-
if (this.value !== newValue) {
|
|
167
|
-
this.value = newValue;
|
|
168
|
-
}
|
|
169
|
-
this.setupInternalTime();
|
|
170
|
-
this.sixChange.emit({
|
|
171
|
-
value: this.internalValue,
|
|
172
|
-
valueAsString: createTimeString(this.internalValue, this.format),
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
176
|
-
async reportValidity() {
|
|
177
|
-
return this.inputElement.reportValidity();
|
|
178
|
-
}
|
|
179
|
-
/** Checks for validity. */
|
|
180
|
-
async checkValidity() {
|
|
181
|
-
return this.inputElement.checkValidity();
|
|
182
|
-
}
|
|
183
|
-
/** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */
|
|
184
|
-
async setCustomValidity(message) {
|
|
185
|
-
await this.inputElement.setCustomValidity(message);
|
|
186
|
-
}
|
|
187
|
-
/** Resets the formcontrol */
|
|
188
|
-
async reset() {
|
|
189
|
-
this.internalValue = this.defaultValue;
|
|
190
|
-
this.inputElement.value = createTimeString(this.internalValue, this.format);
|
|
191
|
-
await this.inputElement.reset();
|
|
192
|
-
}
|
|
193
|
-
componentWillLoad() {
|
|
194
|
-
this.setupInternalTime();
|
|
195
|
-
if (this.inline) {
|
|
196
|
-
this.open = true;
|
|
197
|
-
}
|
|
198
|
-
if (this.open) {
|
|
199
|
-
this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
componentDidLoad() {
|
|
203
|
-
this.eventListeners.add(this.host, 'six-timepicker-change', debounce(this.handleSixTimepickerChangeDebounced, this.debounce), DEBOUNCE_TIMEPICKER_LISTENER);
|
|
204
|
-
this.eventListeners.add(this.inputElement, 'six-input-input', debounce(this.handleInputChange, this.debounce));
|
|
205
|
-
}
|
|
206
|
-
disconnectedCallback() {
|
|
207
|
-
this.eventListeners.removeAll();
|
|
208
|
-
}
|
|
209
|
-
calcIsPopupContentUp() {
|
|
210
|
-
if (!this.inputElement || !this.wrapper) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const inputBoundingRect = this.inputElement.getBoundingClientRect();
|
|
214
|
-
const wrapperBoundingRect = this.wrapper.getBoundingClientRect();
|
|
215
|
-
const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);
|
|
216
|
-
const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;
|
|
217
|
-
this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;
|
|
218
|
-
}
|
|
219
|
-
/*
|
|
220
|
-
* The position of the hoisted timepicker needs to be correctly calculated since the position changes to fixed.
|
|
221
|
-
* Thus if the user scrolls or adjusts the screen size we need to recalculate the timepicker position.
|
|
222
|
-
*/
|
|
223
|
-
moveOpenHoistedPopup() {
|
|
224
|
-
if (!this.hoist || !this.open) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
const popupBoundingClientRect = this.popup.getBoundingClientRect();
|
|
228
|
-
const popupHeight = popupBoundingClientRect.height;
|
|
229
|
-
const inputBoundingClientRect = this.inputElement.getBoundingClientRect();
|
|
230
|
-
const inputTop = inputBoundingClientRect.top;
|
|
231
|
-
const inputHeight = inputBoundingClientRect.height;
|
|
232
|
-
this.calcIsPopupContentUp();
|
|
233
|
-
if (this.isPopupContentUp) {
|
|
234
|
-
this.popup.style.top = `${inputTop - popupHeight}px`;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
this.popup.style.top = `${inputTop + inputHeight}px`;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
getSixTimeUnitPicker(params) {
|
|
241
|
-
return (h("six-item-picker", { class: params.class, timeout: this.timeout, interval: this.interval, padded: true, min: params.min, max: params.max, value: this.internalValue[params.propertyName], items: params.items, type: params.type || ItemPickerType.NUMBER, "padding-length": params.paddingLength, "onSix-item-picker-change": (event) => this.handleChange(event, params.propertyName) }));
|
|
242
|
-
}
|
|
243
|
-
setupInternalTime() {
|
|
244
|
-
if (this.is12HourClock() && !this.format.includes(TIME_FORMAT_CHAR.PERIOD)) {
|
|
245
|
-
console.error(`${TAG} You provided a 12-hour-clock format but are missing the period (am or pm) in the time-format-string!`);
|
|
246
|
-
}
|
|
247
|
-
if (this.value === null || this.value === undefined) {
|
|
248
|
-
this.internalValue = isNil(this.defaultTime)
|
|
249
|
-
? getCurrentTime(this.is24HourClock())
|
|
250
|
-
: parseTimeString(this.defaultTime, this.format);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
this.internalValue = parseTimeString(this.value, this.format);
|
|
254
|
-
}
|
|
255
|
-
this.defaultValue = this.internalValue;
|
|
256
|
-
}
|
|
257
|
-
getHour24Picker() {
|
|
258
|
-
if (!this.is24HourClock()) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: SixTimePropertyName.HOURS });
|
|
262
|
-
}
|
|
263
|
-
is24HourClock() {
|
|
264
|
-
return this.format.includes(TIME_FORMAT_CHAR.HOUR_24);
|
|
265
|
-
}
|
|
266
|
-
getHour12Picker() {
|
|
267
|
-
if (!this.is12HourClock()) {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: SixTimePropertyName.HOURS });
|
|
271
|
-
}
|
|
272
|
-
is12HourClock() {
|
|
273
|
-
return this.format.includes(TIME_FORMAT_CHAR.HOUR_12);
|
|
274
|
-
}
|
|
275
|
-
getAmPmPicker() {
|
|
276
|
-
if (!this.is12HourClock()) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
const items = ['AM', 'PM'];
|
|
280
|
-
return this.getSixTimeUnitPicker({
|
|
281
|
-
items,
|
|
282
|
-
type: ItemPickerType.CUSTOM,
|
|
283
|
-
propertyName: SixTimePropertyName.PERIOD,
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
getMinutePicker() {
|
|
287
|
-
if (!this.format.includes(TIME_FORMAT_CHAR.MINUTE)) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: SixTimePropertyName.MINUTES });
|
|
291
|
-
}
|
|
292
|
-
getSecondsPicker() {
|
|
293
|
-
if (!this.format.includes(TIME_FORMAT_CHAR.SECOND)) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: SixTimePropertyName.SECONDS });
|
|
297
|
-
}
|
|
298
|
-
getMillisecondsPicker() {
|
|
299
|
-
if (!this.format.includes(TIME_FORMAT_CHAR.MILLISECOND)) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
return this.getSixTimeUnitPicker({
|
|
303
|
-
min: 0,
|
|
304
|
-
max: 999,
|
|
305
|
-
class: 'timepicker__item--wide',
|
|
306
|
-
paddingLength: 3,
|
|
307
|
-
propertyName: SixTimePropertyName.MILLISECONDS,
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
getSeparator() {
|
|
311
|
-
return (h("div", { class: "timepicker__separator" },
|
|
312
|
-
h("span", null, this.separator)));
|
|
313
|
-
}
|
|
314
|
-
getContent() {
|
|
315
|
-
const elementsInOrder = [
|
|
316
|
-
this.getHour24Picker(),
|
|
317
|
-
this.getHour12Picker(),
|
|
318
|
-
this.getMinutePicker(),
|
|
319
|
-
this.getSecondsPicker(),
|
|
320
|
-
this.getMillisecondsPicker(),
|
|
321
|
-
];
|
|
322
|
-
const visibleElements = elementsInOrder.filter((el) => el !== undefined);
|
|
323
|
-
return visibleElements.map((el, idx) => {
|
|
324
|
-
if (idx === visibleElements.length - 1) {
|
|
325
|
-
return [el];
|
|
326
|
-
}
|
|
327
|
-
return [el, this.getSeparator()];
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
openPopup() {
|
|
331
|
-
if (!this.open && !this.disabled) {
|
|
332
|
-
this.open = true;
|
|
333
|
-
this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
closePopup() {
|
|
337
|
-
if (this.inline) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
this.open = false;
|
|
341
|
-
this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);
|
|
342
|
-
}
|
|
343
|
-
renderClearable() {
|
|
344
|
-
return (this.clearable && (h("button", { slot: "suffix", class: {
|
|
345
|
-
timepicker_clear: true,
|
|
346
|
-
'timepicker_clear--right': this.iconPosition === 'left',
|
|
347
|
-
'timepicker_clear--left': this.iconPosition === 'right',
|
|
348
|
-
}, type: "button", onClick: this.handleClearClick, tabindex: "-1" },
|
|
349
|
-
h("six-icon", { size: "small" }, "clear"))));
|
|
350
|
-
}
|
|
351
|
-
renderCustomIcon() {
|
|
352
|
-
const icon = hasSlot(this.host, 'custom-icon') ? (h("slot", { name: "custom-icon" })) : (h("six-icon", { size: this.size === 'large' ? 'medium' : this.size }, "watch_later"));
|
|
353
|
-
return (h("span", { slot: "prefix", part: "icon", class: {
|
|
354
|
-
prefix: true,
|
|
355
|
-
'prefix--right': this.iconPosition === 'right',
|
|
356
|
-
} }, icon));
|
|
357
|
-
}
|
|
358
|
-
calcIsDropDownContentUp() {
|
|
359
|
-
if (!this.inputElement || !this.wrapper) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
const inputBoundingRect = this.inputElement.getBoundingClientRect();
|
|
363
|
-
const wrapperBoundingRect = this.wrapper.getBoundingClientRect();
|
|
364
|
-
const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);
|
|
365
|
-
const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;
|
|
366
|
-
this.isDropDownContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;
|
|
367
|
-
}
|
|
368
|
-
/*
|
|
369
|
-
* If the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.
|
|
370
|
-
* To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup
|
|
371
|
-
*/
|
|
372
|
-
adjustPopupForHoisting() {
|
|
373
|
-
if (!this.hoist) {
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
// execute after dropdown has been rendered to make sure the popup reference is correctly set
|
|
377
|
-
setTimeout(() => {
|
|
378
|
-
if (!this.popup) {
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
// take a snapshot of normally rendered popup
|
|
382
|
-
const popupBoundingClientRect = this.popup.getBoundingClientRect();
|
|
383
|
-
// apply screen position to fixed popup
|
|
384
|
-
this.popup.style.position = 'fixed';
|
|
385
|
-
['top', 'left', 'width', 'height'].forEach((property) => {
|
|
386
|
-
this.popup.style[property] = `${popupBoundingClientRect[property]}px`;
|
|
387
|
-
});
|
|
388
|
-
const inputBoundingClientRect = this.inputElement.getBoundingClientRect();
|
|
389
|
-
const inputTop = inputBoundingClientRect.top;
|
|
390
|
-
const popupTop = popupBoundingClientRect.top;
|
|
391
|
-
this.calcIsDropDownContentUp();
|
|
392
|
-
// check screen position to check whether the popup should be moved above or below the trigger element
|
|
393
|
-
if (this.isDropDownContentUp && inputTop < popupTop) {
|
|
394
|
-
// move popup above input field if timepicker is at bottom of screen
|
|
395
|
-
this.popup.style.top = `${popupTop - popupBoundingClientRect.height - inputBoundingClientRect.height}px`;
|
|
396
|
-
}
|
|
397
|
-
}, 0);
|
|
398
|
-
}
|
|
399
|
-
render() {
|
|
400
|
-
this.adjustPopupForHoisting();
|
|
401
|
-
return (h("div", { part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" },
|
|
402
|
-
h("six-input", { ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), value: this.value, placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, size: this.size, name: this.name, label: this.label, required: this.required, "error-text": this.errorText, "error-on-blur": this.errorOnBlur, class: {
|
|
403
|
-
'input--empty': !this.value,
|
|
404
|
-
'input--hide': this.inline,
|
|
405
|
-
} },
|
|
406
|
-
this.renderCustomIcon(),
|
|
407
|
-
this.renderClearable(),
|
|
408
|
-
hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" },
|
|
409
|
-
h("slot", { name: "error-text" }))) : null,
|
|
410
|
-
hasSlot(this.host, 'label') ? (h("span", { slot: "label" },
|
|
411
|
-
h("slot", { name: "label" }))) : null),
|
|
412
|
-
this.open && (h("div", { ref: (el) => (this.popup = el), part: "popup", class: {
|
|
413
|
-
timepicker__popup: true,
|
|
414
|
-
'timepicker__popup--is-up': this.placement ? this.placement === 'top' : this.isPopupContentUp,
|
|
415
|
-
'timepicker__popup--is-inline': this.inline,
|
|
416
|
-
} },
|
|
417
|
-
...this.getContent(),
|
|
418
|
-
this.getAmPmPicker()))));
|
|
419
|
-
}
|
|
420
|
-
static get is() { return "six-timepicker"; }
|
|
421
|
-
static get encapsulation() { return "shadow"; }
|
|
422
|
-
static get originalStyleUrls() { return {
|
|
423
|
-
"$": ["six-timepicker.scss"]
|
|
424
|
-
}; }
|
|
425
|
-
static get styleUrls() { return {
|
|
426
|
-
"$": ["six-timepicker.css"]
|
|
427
|
-
}; }
|
|
428
|
-
static get properties() { return {
|
|
429
|
-
"format": {
|
|
430
|
-
"type": "string",
|
|
431
|
-
"mutable": false,
|
|
432
|
-
"complexType": {
|
|
433
|
-
"original": "SixTimeFormat",
|
|
434
|
-
"resolved": "SixTimeFormat.HH | SixTimeFormat.HHmm | SixTimeFormat.HHmmss | SixTimeFormat.HHmmssms | SixTimeFormat.hhaa | SixTimeFormat.hhmmaa | SixTimeFormat.hhmmssaa | SixTimeFormat.hhmmssmsaa | SixTimeFormat.mm | SixTimeFormat.ms | SixTimeFormat.ss",
|
|
435
|
-
"references": {
|
|
436
|
-
"SixTimeFormat": {
|
|
437
|
-
"location": "import",
|
|
438
|
-
"path": "./six-time-format"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
"required": false,
|
|
443
|
-
"optional": false,
|
|
444
|
-
"docs": {
|
|
445
|
-
"tags": [],
|
|
446
|
-
"text": "Define the time format. Valid formats are:\n\nHH:mm:ss\nhh:mm:ss:aa\nHH:mm:ss:ms\nhh:mm:ss:ms:aa\nHH:mm\nhh:mm:aa\nHH\nhh:aa\nmm\nss\nms\n\nwhere HH is the 24 hour format\nand hh is the 12 hour format\n\nPlease notice that when using the 12-hour-clock (hh)\nyou always need a period indicator (aa). So the time can be parsed as either am or pm"
|
|
447
|
-
},
|
|
448
|
-
"attribute": "format",
|
|
449
|
-
"reflect": false,
|
|
450
|
-
"defaultValue": "SixTimeFormat.HHmmss"
|
|
451
|
-
},
|
|
452
|
-
"separator": {
|
|
453
|
-
"type": "string",
|
|
454
|
-
"mutable": false,
|
|
455
|
-
"complexType": {
|
|
456
|
-
"original": "string",
|
|
457
|
-
"resolved": "string",
|
|
458
|
-
"references": {}
|
|
459
|
-
},
|
|
460
|
-
"required": false,
|
|
461
|
-
"optional": false,
|
|
462
|
-
"docs": {
|
|
463
|
-
"tags": [],
|
|
464
|
-
"text": "Define the separator to be shown between the time unit pickers.\nPlease be aware that this property will modify the displayed separator only.\nThe separator for a timestring is always expected to be a colon (eg. '13:52:20')"
|
|
465
|
-
},
|
|
466
|
-
"attribute": "separator",
|
|
467
|
-
"reflect": false,
|
|
468
|
-
"defaultValue": "TIME_FORMAT_SEPARATOR"
|
|
469
|
-
},
|
|
470
|
-
"value": {
|
|
471
|
-
"type": "string",
|
|
472
|
-
"mutable": true,
|
|
473
|
-
"complexType": {
|
|
474
|
-
"original": "string | null",
|
|
475
|
-
"resolved": "string",
|
|
476
|
-
"references": {}
|
|
477
|
-
},
|
|
478
|
-
"required": false,
|
|
479
|
-
"optional": true,
|
|
480
|
-
"docs": {
|
|
481
|
-
"tags": [],
|
|
482
|
-
"text": "The value of the timepicker provided as a string. The string mast match the provided format (or default format)"
|
|
483
|
-
},
|
|
484
|
-
"attribute": "value",
|
|
485
|
-
"reflect": false
|
|
486
|
-
},
|
|
487
|
-
"open": {
|
|
488
|
-
"type": "boolean",
|
|
489
|
-
"mutable": true,
|
|
490
|
-
"complexType": {
|
|
491
|
-
"original": "boolean",
|
|
492
|
-
"resolved": "boolean",
|
|
493
|
-
"references": {}
|
|
494
|
-
},
|
|
495
|
-
"required": false,
|
|
496
|
-
"optional": false,
|
|
497
|
-
"docs": {
|
|
498
|
-
"tags": [],
|
|
499
|
-
"text": "Indicates whether or not the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods."
|
|
500
|
-
},
|
|
501
|
-
"attribute": "open",
|
|
502
|
-
"reflect": true,
|
|
503
|
-
"defaultValue": "false"
|
|
504
|
-
},
|
|
505
|
-
"inline": {
|
|
506
|
-
"type": "boolean",
|
|
507
|
-
"mutable": false,
|
|
508
|
-
"complexType": {
|
|
509
|
-
"original": "boolean",
|
|
510
|
-
"resolved": "boolean",
|
|
511
|
-
"references": {}
|
|
512
|
-
},
|
|
513
|
-
"required": false,
|
|
514
|
-
"optional": false,
|
|
515
|
-
"docs": {
|
|
516
|
-
"tags": [],
|
|
517
|
-
"text": "Indicates whether or not the timepicker should be shown as an inline (always open) component"
|
|
518
|
-
},
|
|
519
|
-
"attribute": "inline",
|
|
520
|
-
"reflect": true,
|
|
521
|
-
"defaultValue": "false"
|
|
522
|
-
},
|
|
523
|
-
"readonly": {
|
|
524
|
-
"type": "boolean",
|
|
525
|
-
"mutable": false,
|
|
526
|
-
"complexType": {
|
|
527
|
-
"original": "boolean",
|
|
528
|
-
"resolved": "boolean",
|
|
529
|
-
"references": {}
|
|
530
|
-
},
|
|
531
|
-
"required": false,
|
|
532
|
-
"optional": false,
|
|
533
|
-
"docs": {
|
|
534
|
-
"tags": [],
|
|
535
|
-
"text": "If `true` the user can only select a time via the timepicker but not directly edit the input field."
|
|
536
|
-
},
|
|
537
|
-
"attribute": "readonly",
|
|
538
|
-
"reflect": false,
|
|
539
|
-
"defaultValue": "false"
|
|
540
|
-
},
|
|
541
|
-
"disabled": {
|
|
542
|
-
"type": "boolean",
|
|
543
|
-
"mutable": false,
|
|
544
|
-
"complexType": {
|
|
545
|
-
"original": "boolean",
|
|
546
|
-
"resolved": "boolean",
|
|
547
|
-
"references": {}
|
|
548
|
-
},
|
|
549
|
-
"required": false,
|
|
550
|
-
"optional": false,
|
|
551
|
-
"docs": {
|
|
552
|
-
"tags": [],
|
|
553
|
-
"text": "If `true` the component is disabled."
|
|
554
|
-
},
|
|
555
|
-
"attribute": "disabled",
|
|
556
|
-
"reflect": false,
|
|
557
|
-
"defaultValue": "false"
|
|
558
|
-
},
|
|
559
|
-
"placement": {
|
|
560
|
-
"type": "string",
|
|
561
|
-
"mutable": false,
|
|
562
|
-
"complexType": {
|
|
563
|
-
"original": "'top' | 'bottom'",
|
|
564
|
-
"resolved": "\"bottom\" | \"top\"",
|
|
565
|
-
"references": {}
|
|
566
|
-
},
|
|
567
|
-
"required": false,
|
|
568
|
-
"optional": false,
|
|
569
|
-
"docs": {
|
|
570
|
-
"tags": [],
|
|
571
|
-
"text": "The enforced placement of the dropdown panel."
|
|
572
|
-
},
|
|
573
|
-
"attribute": "placement",
|
|
574
|
-
"reflect": false
|
|
575
|
-
},
|
|
576
|
-
"size": {
|
|
577
|
-
"type": "string",
|
|
578
|
-
"mutable": false,
|
|
579
|
-
"complexType": {
|
|
580
|
-
"original": "'small' | 'medium' | 'large'",
|
|
581
|
-
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
582
|
-
"references": {}
|
|
583
|
-
},
|
|
584
|
-
"required": false,
|
|
585
|
-
"optional": false,
|
|
586
|
-
"docs": {
|
|
587
|
-
"tags": [],
|
|
588
|
-
"text": "Timepicker size."
|
|
589
|
-
},
|
|
590
|
-
"attribute": "size",
|
|
591
|
-
"reflect": false,
|
|
592
|
-
"defaultValue": "'medium'"
|
|
593
|
-
},
|
|
594
|
-
"required": {
|
|
595
|
-
"type": "boolean",
|
|
596
|
-
"mutable": false,
|
|
597
|
-
"complexType": {
|
|
598
|
-
"original": "boolean",
|
|
599
|
-
"resolved": "boolean",
|
|
600
|
-
"references": {}
|
|
601
|
-
},
|
|
602
|
-
"required": false,
|
|
603
|
-
"optional": false,
|
|
604
|
-
"docs": {
|
|
605
|
-
"tags": [],
|
|
606
|
-
"text": "Set to true to make the input a required field."
|
|
607
|
-
},
|
|
608
|
-
"attribute": "required",
|
|
609
|
-
"reflect": true
|
|
610
|
-
},
|
|
611
|
-
"placeholder": {
|
|
612
|
-
"type": "string",
|
|
613
|
-
"mutable": false,
|
|
614
|
-
"complexType": {
|
|
615
|
-
"original": "string | null",
|
|
616
|
-
"resolved": "string",
|
|
617
|
-
"references": {}
|
|
618
|
-
},
|
|
619
|
-
"required": false,
|
|
620
|
-
"optional": true,
|
|
621
|
-
"docs": {
|
|
622
|
-
"tags": [],
|
|
623
|
-
"text": "The placeholder defines what text to be shown on the input element"
|
|
624
|
-
},
|
|
625
|
-
"attribute": "placeholder",
|
|
626
|
-
"reflect": false
|
|
627
|
-
},
|
|
628
|
-
"errorOnBlur": {
|
|
629
|
-
"type": "boolean",
|
|
630
|
-
"mutable": false,
|
|
631
|
-
"complexType": {
|
|
632
|
-
"original": "boolean",
|
|
633
|
-
"resolved": "boolean",
|
|
634
|
-
"references": {}
|
|
635
|
-
},
|
|
636
|
-
"required": false,
|
|
637
|
-
"optional": false,
|
|
638
|
-
"docs": {
|
|
639
|
-
"tags": [],
|
|
640
|
-
"text": "Set to display the error text on blur and not when typing"
|
|
641
|
-
},
|
|
642
|
-
"attribute": "error-on-blur",
|
|
643
|
-
"reflect": false,
|
|
644
|
-
"defaultValue": "false"
|
|
645
|
-
},
|
|
646
|
-
"errorText": {
|
|
647
|
-
"type": "string",
|
|
648
|
-
"mutable": false,
|
|
649
|
-
"complexType": {
|
|
650
|
-
"original": "string",
|
|
651
|
-
"resolved": "string",
|
|
652
|
-
"references": {}
|
|
653
|
-
},
|
|
654
|
-
"required": false,
|
|
655
|
-
"optional": false,
|
|
656
|
-
"docs": {
|
|
657
|
-
"tags": [],
|
|
658
|
-
"text": "The input's error text. Alternatively, you can use the error-text slot."
|
|
659
|
-
},
|
|
660
|
-
"attribute": "error-text",
|
|
661
|
-
"reflect": false,
|
|
662
|
-
"defaultValue": "''"
|
|
663
|
-
},
|
|
664
|
-
"label": {
|
|
665
|
-
"type": "string",
|
|
666
|
-
"mutable": false,
|
|
667
|
-
"complexType": {
|
|
668
|
-
"original": "string",
|
|
669
|
-
"resolved": "string",
|
|
670
|
-
"references": {}
|
|
671
|
-
},
|
|
672
|
-
"required": false,
|
|
673
|
-
"optional": false,
|
|
674
|
-
"docs": {
|
|
675
|
-
"tags": [],
|
|
676
|
-
"text": "The input's label. Alternatively, you can use the label slot."
|
|
677
|
-
},
|
|
678
|
-
"attribute": "label",
|
|
679
|
-
"reflect": false,
|
|
680
|
-
"defaultValue": "''"
|
|
681
|
-
},
|
|
682
|
-
"name": {
|
|
683
|
-
"type": "string",
|
|
684
|
-
"mutable": false,
|
|
685
|
-
"complexType": {
|
|
686
|
-
"original": "string",
|
|
687
|
-
"resolved": "string",
|
|
688
|
-
"references": {}
|
|
689
|
-
},
|
|
690
|
-
"required": false,
|
|
691
|
-
"optional": false,
|
|
692
|
-
"docs": {
|
|
693
|
-
"tags": [],
|
|
694
|
-
"text": "The input's name attribute."
|
|
695
|
-
},
|
|
696
|
-
"attribute": "name",
|
|
697
|
-
"reflect": true,
|
|
698
|
-
"defaultValue": "''"
|
|
699
|
-
},
|
|
700
|
-
"clearable": {
|
|
701
|
-
"type": "boolean",
|
|
702
|
-
"mutable": false,
|
|
703
|
-
"complexType": {
|
|
704
|
-
"original": "boolean",
|
|
705
|
-
"resolved": "boolean",
|
|
706
|
-
"references": {}
|
|
707
|
-
},
|
|
708
|
-
"required": false,
|
|
709
|
-
"optional": false,
|
|
710
|
-
"docs": {
|
|
711
|
-
"tags": [],
|
|
712
|
-
"text": "Set to true to add a clear button when the input is populated."
|
|
713
|
-
},
|
|
714
|
-
"attribute": "clearable",
|
|
715
|
-
"reflect": false,
|
|
716
|
-
"defaultValue": "false"
|
|
717
|
-
},
|
|
718
|
-
"iconPosition": {
|
|
719
|
-
"type": "string",
|
|
720
|
-
"mutable": false,
|
|
721
|
-
"complexType": {
|
|
722
|
-
"original": "'left' | 'right'",
|
|
723
|
-
"resolved": "\"left\" | \"right\"",
|
|
724
|
-
"references": {}
|
|
725
|
-
},
|
|
726
|
-
"required": false,
|
|
727
|
-
"optional": false,
|
|
728
|
-
"docs": {
|
|
729
|
-
"tags": [],
|
|
730
|
-
"text": "Set the position of the icon"
|
|
731
|
-
},
|
|
732
|
-
"attribute": "icon-position",
|
|
733
|
-
"reflect": false,
|
|
734
|
-
"defaultValue": "'left'"
|
|
735
|
-
},
|
|
736
|
-
"hoist": {
|
|
737
|
-
"type": "boolean",
|
|
738
|
-
"mutable": false,
|
|
739
|
-
"complexType": {
|
|
740
|
-
"original": "boolean",
|
|
741
|
-
"resolved": "boolean",
|
|
742
|
-
"references": {}
|
|
743
|
-
},
|
|
744
|
-
"required": false,
|
|
745
|
-
"optional": false,
|
|
746
|
-
"docs": {
|
|
747
|
-
"tags": [],
|
|
748
|
-
"text": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`."
|
|
749
|
-
},
|
|
750
|
-
"attribute": "hoist",
|
|
751
|
-
"reflect": false,
|
|
752
|
-
"defaultValue": "false"
|
|
753
|
-
},
|
|
754
|
-
"timeout": {
|
|
755
|
-
"type": "number",
|
|
756
|
-
"mutable": false,
|
|
757
|
-
"complexType": {
|
|
758
|
-
"original": "number",
|
|
759
|
-
"resolved": "number",
|
|
760
|
-
"references": {}
|
|
761
|
-
},
|
|
762
|
-
"required": false,
|
|
763
|
-
"optional": false,
|
|
764
|
-
"docs": {
|
|
765
|
-
"tags": [],
|
|
766
|
-
"text": "Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours)."
|
|
767
|
-
},
|
|
768
|
-
"attribute": "timeout",
|
|
769
|
-
"reflect": false,
|
|
770
|
-
"defaultValue": "DEFAULT_DEBOUNCE_FAST"
|
|
771
|
-
},
|
|
772
|
-
"interval": {
|
|
773
|
-
"type": "number",
|
|
774
|
-
"mutable": false,
|
|
775
|
-
"complexType": {
|
|
776
|
-
"original": "number",
|
|
777
|
-
"resolved": "number",
|
|
778
|
-
"references": {}
|
|
779
|
-
},
|
|
780
|
-
"required": false,
|
|
781
|
-
"optional": false,
|
|
782
|
-
"docs": {
|
|
783
|
-
"tags": [],
|
|
784
|
-
"text": "Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed."
|
|
785
|
-
},
|
|
786
|
-
"attribute": "interval",
|
|
787
|
-
"reflect": false,
|
|
788
|
-
"defaultValue": "DEFAULT_DEBOUNCE_INSANELY_FAST"
|
|
789
|
-
},
|
|
790
|
-
"defaultTime": {
|
|
791
|
-
"type": "string",
|
|
792
|
-
"mutable": false,
|
|
793
|
-
"complexType": {
|
|
794
|
-
"original": "string | null",
|
|
795
|
-
"resolved": "string",
|
|
796
|
-
"references": {}
|
|
797
|
-
},
|
|
798
|
-
"required": false,
|
|
799
|
-
"optional": true,
|
|
800
|
-
"docs": {
|
|
801
|
-
"tags": [],
|
|
802
|
-
"text": "The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format."
|
|
803
|
-
},
|
|
804
|
-
"attribute": "default-time",
|
|
805
|
-
"reflect": false
|
|
806
|
-
},
|
|
807
|
-
"debounce": {
|
|
808
|
-
"type": "number",
|
|
809
|
-
"mutable": false,
|
|
810
|
-
"complexType": {
|
|
811
|
-
"original": "number",
|
|
812
|
-
"resolved": "number",
|
|
813
|
-
"references": {}
|
|
814
|
-
},
|
|
815
|
-
"required": false,
|
|
816
|
-
"optional": false,
|
|
817
|
-
"docs": {
|
|
818
|
-
"tags": [],
|
|
819
|
-
"text": "Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\nIf you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\nis 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"
|
|
820
|
-
},
|
|
821
|
-
"attribute": "debounce",
|
|
822
|
-
"reflect": false,
|
|
823
|
-
"defaultValue": "DEFAULT_DEBOUNCE_FAST"
|
|
824
|
-
}
|
|
825
|
-
}; }
|
|
826
|
-
static get states() { return {
|
|
827
|
-
"isPopupContentUp": {},
|
|
828
|
-
"isDropDownContentUp": {},
|
|
829
|
-
"internalValue": {}
|
|
830
|
-
}; }
|
|
831
|
-
static get events() { return [{
|
|
832
|
-
"method": "sixChange",
|
|
833
|
-
"name": "six-timepicker-change",
|
|
834
|
-
"bubbles": true,
|
|
835
|
-
"cancelable": true,
|
|
836
|
-
"composed": true,
|
|
837
|
-
"docs": {
|
|
838
|
-
"tags": [],
|
|
839
|
-
"text": "Emitted when the timepicker's value changes"
|
|
840
|
-
},
|
|
841
|
-
"complexType": {
|
|
842
|
-
"original": "SixTimepickerChange",
|
|
843
|
-
"resolved": "SixTimepickerChange",
|
|
844
|
-
"references": {
|
|
845
|
-
"SixTimepickerChange": {
|
|
846
|
-
"location": "local"
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
}, {
|
|
851
|
-
"method": "sixChangeDebounced",
|
|
852
|
-
"name": "six-timepicker-change-debounced",
|
|
853
|
-
"bubbles": true,
|
|
854
|
-
"cancelable": true,
|
|
855
|
-
"composed": true,
|
|
856
|
-
"docs": {
|
|
857
|
-
"tags": [],
|
|
858
|
-
"text": "Emitted when the timepicker's value changes, but debounced"
|
|
859
|
-
},
|
|
860
|
-
"complexType": {
|
|
861
|
-
"original": "SixTimepickerChange",
|
|
862
|
-
"resolved": "SixTimepickerChange",
|
|
863
|
-
"references": {
|
|
864
|
-
"SixTimepickerChange": {
|
|
865
|
-
"location": "local"
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
}, {
|
|
870
|
-
"method": "sixClear",
|
|
871
|
-
"name": "six-timepicker-clear",
|
|
872
|
-
"bubbles": true,
|
|
873
|
-
"cancelable": true,
|
|
874
|
-
"composed": true,
|
|
875
|
-
"docs": {
|
|
876
|
-
"tags": [],
|
|
877
|
-
"text": "Emitted when the clear button is activated."
|
|
878
|
-
},
|
|
879
|
-
"complexType": {
|
|
880
|
-
"original": "EmptyPayload",
|
|
881
|
-
"resolved": "undefined",
|
|
882
|
-
"references": {
|
|
883
|
-
"EmptyPayload": {
|
|
884
|
-
"location": "import",
|
|
885
|
-
"path": "../../utils/types"
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
}]; }
|
|
890
|
-
static get methods() { return {
|
|
891
|
-
"reportValidity": {
|
|
892
|
-
"complexType": {
|
|
893
|
-
"signature": "() => Promise<boolean>",
|
|
894
|
-
"parameters": [],
|
|
895
|
-
"references": {
|
|
896
|
-
"Promise": {
|
|
897
|
-
"location": "global"
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
"return": "Promise<boolean>"
|
|
901
|
-
},
|
|
902
|
-
"docs": {
|
|
903
|
-
"text": "Checks for validity and shows the browser's validation message if the control is invalid.",
|
|
904
|
-
"tags": []
|
|
905
|
-
}
|
|
906
|
-
},
|
|
907
|
-
"checkValidity": {
|
|
908
|
-
"complexType": {
|
|
909
|
-
"signature": "() => Promise<boolean>",
|
|
910
|
-
"parameters": [],
|
|
911
|
-
"references": {
|
|
912
|
-
"Promise": {
|
|
913
|
-
"location": "global"
|
|
914
|
-
}
|
|
915
|
-
},
|
|
916
|
-
"return": "Promise<boolean>"
|
|
917
|
-
},
|
|
918
|
-
"docs": {
|
|
919
|
-
"text": "Checks for validity.",
|
|
920
|
-
"tags": []
|
|
921
|
-
}
|
|
922
|
-
},
|
|
923
|
-
"setCustomValidity": {
|
|
924
|
-
"complexType": {
|
|
925
|
-
"signature": "(message: string) => Promise<void>",
|
|
926
|
-
"parameters": [{
|
|
927
|
-
"tags": [],
|
|
928
|
-
"text": ""
|
|
929
|
-
}],
|
|
930
|
-
"references": {
|
|
931
|
-
"Promise": {
|
|
932
|
-
"location": "global"
|
|
933
|
-
}
|
|
934
|
-
},
|
|
935
|
-
"return": "Promise<void>"
|
|
936
|
-
},
|
|
937
|
-
"docs": {
|
|
938
|
-
"text": "Sets a custom validation message. If `message` is not empty, the field will be considered invalid.",
|
|
939
|
-
"tags": []
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
"reset": {
|
|
943
|
-
"complexType": {
|
|
944
|
-
"signature": "() => Promise<void>",
|
|
945
|
-
"parameters": [],
|
|
946
|
-
"references": {
|
|
947
|
-
"Promise": {
|
|
948
|
-
"location": "global"
|
|
949
|
-
}
|
|
950
|
-
},
|
|
951
|
-
"return": "Promise<void>"
|
|
952
|
-
},
|
|
953
|
-
"docs": {
|
|
954
|
-
"text": "Resets the formcontrol",
|
|
955
|
-
"tags": []
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}; }
|
|
959
|
-
static get elementRef() { return "host"; }
|
|
960
|
-
static get watchers() { return [{
|
|
961
|
-
"propName": "debounce",
|
|
962
|
-
"methodName": "debounceChanged"
|
|
963
|
-
}, {
|
|
964
|
-
"propName": "value",
|
|
965
|
-
"methodName": "valueChanged"
|
|
966
|
-
}]; }
|
|
967
|
-
static get listeners() { return [{
|
|
968
|
-
"name": "resize",
|
|
969
|
-
"method": "resizeHandler",
|
|
970
|
-
"target": "window",
|
|
971
|
-
"capture": false,
|
|
972
|
-
"passive": true
|
|
973
|
-
}, {
|
|
974
|
-
"name": "scroll",
|
|
975
|
-
"method": "scrollHandler",
|
|
976
|
-
"target": "window",
|
|
977
|
-
"capture": false,
|
|
978
|
-
"passive": true
|
|
979
|
-
}]; }
|
|
980
|
-
}
|
|
1
|
+
import { Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';
|
|
2
|
+
import { ItemPickerType } from '../six-item-picker/types';
|
|
3
|
+
import { SixTimeFormat } from './six-time-format';
|
|
4
|
+
import { SixTimePropertyName, TIME_FORMAT_CHAR } from './six-timepicker.types';
|
|
5
|
+
import { createTimeString, getCurrentTime, isValidTimeString, parseTimeString, TIME_FORMAT_SEPARATOR, } from '../../utils/time.util';
|
|
6
|
+
import { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';
|
|
7
|
+
import { EventListeners } from '../../utils/event-listeners';
|
|
8
|
+
import { hasSlot } from '../../utils/slot';
|
|
9
|
+
import { isNil } from '../../utils/type-check';
|
|
10
|
+
const TAG = `[SIX-TIMEPICKER]`;
|
|
11
|
+
const DEBOUNCE_TIMEPICKER_LISTENER = 'debounced-timepicker';
|
|
12
|
+
const MIN_POPUP_HEIGHT = 145;
|
|
13
|
+
/**
|
|
14
|
+
* @since 2.0.0
|
|
15
|
+
* @status experimental
|
|
16
|
+
*
|
|
17
|
+
* @part input - The input field
|
|
18
|
+
* @part container - The container of whole component
|
|
19
|
+
* @part popup - The popup of the timepicker component
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export class SixTimepicker {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.eventListeners = new EventListeners();
|
|
25
|
+
/**
|
|
26
|
+
* Define the time format. Valid formats are:
|
|
27
|
+
*
|
|
28
|
+
* HH:mm:ss
|
|
29
|
+
* hh:mm:ss:aa
|
|
30
|
+
* HH:mm:ss:ms
|
|
31
|
+
* hh:mm:ss:ms:aa
|
|
32
|
+
* HH:mm
|
|
33
|
+
* hh:mm:aa
|
|
34
|
+
* HH
|
|
35
|
+
* hh:aa
|
|
36
|
+
* mm
|
|
37
|
+
* ss
|
|
38
|
+
* ms
|
|
39
|
+
*
|
|
40
|
+
* where HH is the 24 hour format
|
|
41
|
+
* and hh is the 12 hour format
|
|
42
|
+
*
|
|
43
|
+
* Please notice that when using the 12-hour-clock (hh)
|
|
44
|
+
* you always need a period indicator (aa). So the time can be parsed as either am or pm
|
|
45
|
+
* */
|
|
46
|
+
this.format = SixTimeFormat.HHmmss;
|
|
47
|
+
/**
|
|
48
|
+
* Define the separator to be shown between the time unit pickers.
|
|
49
|
+
* Please be aware that this property will modify the displayed separator only.
|
|
50
|
+
* The separator for a timestring is always expected to be a colon (eg. '13:52:20')
|
|
51
|
+
* */
|
|
52
|
+
this.separator = TIME_FORMAT_SEPARATOR;
|
|
53
|
+
/** Indicates whether or not the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */
|
|
54
|
+
this.open = false;
|
|
55
|
+
/** Indicates whether or not the timepicker should be shown as an inline (always open) component */
|
|
56
|
+
this.inline = false;
|
|
57
|
+
/**
|
|
58
|
+
* If `true` the user can only select a time via the timepicker but not directly edit the input field.
|
|
59
|
+
*/
|
|
60
|
+
this.readonly = false;
|
|
61
|
+
/**
|
|
62
|
+
* If `true` the component is disabled.
|
|
63
|
+
*/
|
|
64
|
+
this.disabled = false;
|
|
65
|
+
/** Timepicker size. */
|
|
66
|
+
this.size = 'medium';
|
|
67
|
+
/** Set to display the error text on blur and not when typing */
|
|
68
|
+
this.errorOnBlur = false;
|
|
69
|
+
/** The input's error text. Alternatively, you can use the error-text slot. */
|
|
70
|
+
this.errorText = '';
|
|
71
|
+
/** The input's label. Alternatively, you can use the label slot. */
|
|
72
|
+
this.label = '';
|
|
73
|
+
/** The input's name attribute. */
|
|
74
|
+
this.name = '';
|
|
75
|
+
/** Set to true to add a clear button when the input is populated. */
|
|
76
|
+
this.clearable = false;
|
|
77
|
+
/** Set the position of the icon */
|
|
78
|
+
this.iconPosition = 'left';
|
|
79
|
+
/**
|
|
80
|
+
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with
|
|
81
|
+
* `overflow: auto|scroll`.
|
|
82
|
+
*/
|
|
83
|
+
this.hoist = false;
|
|
84
|
+
/**
|
|
85
|
+
* Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).
|
|
86
|
+
*/
|
|
87
|
+
this.timeout = DEFAULT_DEBOUNCE_FAST;
|
|
88
|
+
/**
|
|
89
|
+
* Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.
|
|
90
|
+
*/
|
|
91
|
+
this.interval = DEFAULT_DEBOUNCE_INSANELY_FAST;
|
|
92
|
+
/**
|
|
93
|
+
* Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.
|
|
94
|
+
* If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce
|
|
95
|
+
* is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click
|
|
96
|
+
* (and keep pressed) and once you release
|
|
97
|
+
*/
|
|
98
|
+
this.debounce = DEFAULT_DEBOUNCE_FAST;
|
|
99
|
+
this.isPopupContentUp = false;
|
|
100
|
+
this.isDropDownContentUp = false;
|
|
101
|
+
this.defaultValue = null;
|
|
102
|
+
this.handleInputChange = (event) => {
|
|
103
|
+
event.stopPropagation();
|
|
104
|
+
const inputValue = this.inputElement.value;
|
|
105
|
+
if (!isValidTimeString(inputValue, this.format)) {
|
|
106
|
+
this.sixChange.emit({
|
|
107
|
+
value: {},
|
|
108
|
+
valueAsString: '',
|
|
109
|
+
});
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.internalValue = parseTimeString(inputValue, this.format);
|
|
113
|
+
this.sixChange.emit({
|
|
114
|
+
value: this.internalValue,
|
|
115
|
+
valueAsString: createTimeString(this.internalValue, this.format),
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this.handleSixTimepickerChangeDebounced = ({ detail }) => {
|
|
119
|
+
this.sixChangeDebounced.emit(detail);
|
|
120
|
+
};
|
|
121
|
+
this.handleChange = (event, property) => {
|
|
122
|
+
// stop propagation, since the timepicker should not expose the events of the underlying item-picker
|
|
123
|
+
event.stopPropagation();
|
|
124
|
+
// update the internal state
|
|
125
|
+
this.internalValue[property] = event.detail;
|
|
126
|
+
const timeString = createTimeString(this.internalValue, this.format);
|
|
127
|
+
// fire timepicker's own event
|
|
128
|
+
this.sixChange.emit({
|
|
129
|
+
changedProperty: property,
|
|
130
|
+
value: this.internalValue,
|
|
131
|
+
valueAsString: timeString,
|
|
132
|
+
});
|
|
133
|
+
// update the input value
|
|
134
|
+
this.value = timeString;
|
|
135
|
+
};
|
|
136
|
+
this.handleDocumentMouseDown = (event) => {
|
|
137
|
+
// Close when clicking outside of the containing element
|
|
138
|
+
const path = event.composedPath();
|
|
139
|
+
if (!path.includes(this.host)) {
|
|
140
|
+
this.closePopup();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
this.handleClearClick = (event) => {
|
|
145
|
+
event.stopPropagation();
|
|
146
|
+
this.value = undefined;
|
|
147
|
+
this.sixClear.emit();
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async resizeHandler() {
|
|
151
|
+
this.calcIsPopupContentUp();
|
|
152
|
+
this.moveOpenHoistedPopup();
|
|
153
|
+
}
|
|
154
|
+
async scrollHandler() {
|
|
155
|
+
this.calcIsPopupContentUp();
|
|
156
|
+
this.moveOpenHoistedPopup();
|
|
157
|
+
}
|
|
158
|
+
debounceChanged() {
|
|
159
|
+
this.eventListeners.removeByIdentifier(DEBOUNCE_TIMEPICKER_LISTENER);
|
|
160
|
+
this.eventListeners.add(this.host, 'six-timepicker-change', debounce(this.handleSixTimepickerChangeDebounced, this.debounce), DEBOUNCE_TIMEPICKER_LISTENER);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Update the native input element when the value changes
|
|
164
|
+
*/
|
|
165
|
+
valueChanged(newValue) {
|
|
166
|
+
if (this.value !== newValue) {
|
|
167
|
+
this.value = newValue;
|
|
168
|
+
}
|
|
169
|
+
this.setupInternalTime();
|
|
170
|
+
this.sixChange.emit({
|
|
171
|
+
value: this.internalValue,
|
|
172
|
+
valueAsString: createTimeString(this.internalValue, this.format),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
176
|
+
async reportValidity() {
|
|
177
|
+
return this.inputElement.reportValidity();
|
|
178
|
+
}
|
|
179
|
+
/** Checks for validity. */
|
|
180
|
+
async checkValidity() {
|
|
181
|
+
return this.inputElement.checkValidity();
|
|
182
|
+
}
|
|
183
|
+
/** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */
|
|
184
|
+
async setCustomValidity(message) {
|
|
185
|
+
await this.inputElement.setCustomValidity(message);
|
|
186
|
+
}
|
|
187
|
+
/** Resets the formcontrol */
|
|
188
|
+
async reset() {
|
|
189
|
+
this.internalValue = this.defaultValue;
|
|
190
|
+
this.inputElement.value = createTimeString(this.internalValue, this.format);
|
|
191
|
+
await this.inputElement.reset();
|
|
192
|
+
}
|
|
193
|
+
componentWillLoad() {
|
|
194
|
+
this.setupInternalTime();
|
|
195
|
+
if (this.inline) {
|
|
196
|
+
this.open = true;
|
|
197
|
+
}
|
|
198
|
+
if (this.open) {
|
|
199
|
+
this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
componentDidLoad() {
|
|
203
|
+
this.eventListeners.add(this.host, 'six-timepicker-change', debounce(this.handleSixTimepickerChangeDebounced, this.debounce), DEBOUNCE_TIMEPICKER_LISTENER);
|
|
204
|
+
this.eventListeners.add(this.inputElement, 'six-input-input', debounce(this.handleInputChange, this.debounce));
|
|
205
|
+
}
|
|
206
|
+
disconnectedCallback() {
|
|
207
|
+
this.eventListeners.removeAll();
|
|
208
|
+
}
|
|
209
|
+
calcIsPopupContentUp() {
|
|
210
|
+
if (!this.inputElement || !this.wrapper) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const inputBoundingRect = this.inputElement.getBoundingClientRect();
|
|
214
|
+
const wrapperBoundingRect = this.wrapper.getBoundingClientRect();
|
|
215
|
+
const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);
|
|
216
|
+
const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;
|
|
217
|
+
this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;
|
|
218
|
+
}
|
|
219
|
+
/*
|
|
220
|
+
* The position of the hoisted timepicker needs to be correctly calculated since the position changes to fixed.
|
|
221
|
+
* Thus if the user scrolls or adjusts the screen size we need to recalculate the timepicker position.
|
|
222
|
+
*/
|
|
223
|
+
moveOpenHoistedPopup() {
|
|
224
|
+
if (!this.hoist || !this.open) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const popupBoundingClientRect = this.popup.getBoundingClientRect();
|
|
228
|
+
const popupHeight = popupBoundingClientRect.height;
|
|
229
|
+
const inputBoundingClientRect = this.inputElement.getBoundingClientRect();
|
|
230
|
+
const inputTop = inputBoundingClientRect.top;
|
|
231
|
+
const inputHeight = inputBoundingClientRect.height;
|
|
232
|
+
this.calcIsPopupContentUp();
|
|
233
|
+
if (this.isPopupContentUp) {
|
|
234
|
+
this.popup.style.top = `${inputTop - popupHeight}px`;
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
this.popup.style.top = `${inputTop + inputHeight}px`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
getSixTimeUnitPicker(params) {
|
|
241
|
+
return (h("six-item-picker", { class: params.class, timeout: this.timeout, interval: this.interval, padded: true, min: params.min, max: params.max, value: this.internalValue[params.propertyName], items: params.items, type: params.type || ItemPickerType.NUMBER, "padding-length": params.paddingLength, "onSix-item-picker-change": (event) => this.handleChange(event, params.propertyName) }));
|
|
242
|
+
}
|
|
243
|
+
setupInternalTime() {
|
|
244
|
+
if (this.is12HourClock() && !this.format.includes(TIME_FORMAT_CHAR.PERIOD)) {
|
|
245
|
+
console.error(`${TAG} You provided a 12-hour-clock format but are missing the period (am or pm) in the time-format-string!`);
|
|
246
|
+
}
|
|
247
|
+
if (this.value === null || this.value === undefined) {
|
|
248
|
+
this.internalValue = isNil(this.defaultTime)
|
|
249
|
+
? getCurrentTime(this.is24HourClock())
|
|
250
|
+
: parseTimeString(this.defaultTime, this.format);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.internalValue = parseTimeString(this.value, this.format);
|
|
254
|
+
}
|
|
255
|
+
this.defaultValue = this.internalValue;
|
|
256
|
+
}
|
|
257
|
+
getHour24Picker() {
|
|
258
|
+
if (!this.is24HourClock()) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: SixTimePropertyName.HOURS });
|
|
262
|
+
}
|
|
263
|
+
is24HourClock() {
|
|
264
|
+
return this.format.includes(TIME_FORMAT_CHAR.HOUR_24);
|
|
265
|
+
}
|
|
266
|
+
getHour12Picker() {
|
|
267
|
+
if (!this.is12HourClock()) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: SixTimePropertyName.HOURS });
|
|
271
|
+
}
|
|
272
|
+
is12HourClock() {
|
|
273
|
+
return this.format.includes(TIME_FORMAT_CHAR.HOUR_12);
|
|
274
|
+
}
|
|
275
|
+
getAmPmPicker() {
|
|
276
|
+
if (!this.is12HourClock()) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const items = ['AM', 'PM'];
|
|
280
|
+
return this.getSixTimeUnitPicker({
|
|
281
|
+
items,
|
|
282
|
+
type: ItemPickerType.CUSTOM,
|
|
283
|
+
propertyName: SixTimePropertyName.PERIOD,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
getMinutePicker() {
|
|
287
|
+
if (!this.format.includes(TIME_FORMAT_CHAR.MINUTE)) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: SixTimePropertyName.MINUTES });
|
|
291
|
+
}
|
|
292
|
+
getSecondsPicker() {
|
|
293
|
+
if (!this.format.includes(TIME_FORMAT_CHAR.SECOND)) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: SixTimePropertyName.SECONDS });
|
|
297
|
+
}
|
|
298
|
+
getMillisecondsPicker() {
|
|
299
|
+
if (!this.format.includes(TIME_FORMAT_CHAR.MILLISECOND)) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
return this.getSixTimeUnitPicker({
|
|
303
|
+
min: 0,
|
|
304
|
+
max: 999,
|
|
305
|
+
class: 'timepicker__item--wide',
|
|
306
|
+
paddingLength: 3,
|
|
307
|
+
propertyName: SixTimePropertyName.MILLISECONDS,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
getSeparator() {
|
|
311
|
+
return (h("div", { class: "timepicker__separator" },
|
|
312
|
+
h("span", null, this.separator)));
|
|
313
|
+
}
|
|
314
|
+
getContent() {
|
|
315
|
+
const elementsInOrder = [
|
|
316
|
+
this.getHour24Picker(),
|
|
317
|
+
this.getHour12Picker(),
|
|
318
|
+
this.getMinutePicker(),
|
|
319
|
+
this.getSecondsPicker(),
|
|
320
|
+
this.getMillisecondsPicker(),
|
|
321
|
+
];
|
|
322
|
+
const visibleElements = elementsInOrder.filter((el) => el !== undefined);
|
|
323
|
+
return visibleElements.map((el, idx) => {
|
|
324
|
+
if (idx === visibleElements.length - 1) {
|
|
325
|
+
return [el];
|
|
326
|
+
}
|
|
327
|
+
return [el, this.getSeparator()];
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
openPopup() {
|
|
331
|
+
if (!this.open && !this.disabled) {
|
|
332
|
+
this.open = true;
|
|
333
|
+
this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
closePopup() {
|
|
337
|
+
if (this.inline) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
this.open = false;
|
|
341
|
+
this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);
|
|
342
|
+
}
|
|
343
|
+
renderClearable() {
|
|
344
|
+
return (this.clearable && (h("button", { slot: "suffix", class: {
|
|
345
|
+
timepicker_clear: true,
|
|
346
|
+
'timepicker_clear--right': this.iconPosition === 'left',
|
|
347
|
+
'timepicker_clear--left': this.iconPosition === 'right',
|
|
348
|
+
}, type: "button", onClick: this.handleClearClick, tabindex: "-1" },
|
|
349
|
+
h("six-icon", { size: "small" }, "clear"))));
|
|
350
|
+
}
|
|
351
|
+
renderCustomIcon() {
|
|
352
|
+
const icon = hasSlot(this.host, 'custom-icon') ? (h("slot", { name: "custom-icon" })) : (h("six-icon", { size: this.size === 'large' ? 'medium' : this.size }, "watch_later"));
|
|
353
|
+
return (h("span", { slot: "prefix", part: "icon", class: {
|
|
354
|
+
prefix: true,
|
|
355
|
+
'prefix--right': this.iconPosition === 'right',
|
|
356
|
+
} }, icon));
|
|
357
|
+
}
|
|
358
|
+
calcIsDropDownContentUp() {
|
|
359
|
+
if (!this.inputElement || !this.wrapper) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const inputBoundingRect = this.inputElement.getBoundingClientRect();
|
|
363
|
+
const wrapperBoundingRect = this.wrapper.getBoundingClientRect();
|
|
364
|
+
const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);
|
|
365
|
+
const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;
|
|
366
|
+
this.isDropDownContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;
|
|
367
|
+
}
|
|
368
|
+
/*
|
|
369
|
+
* If the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.
|
|
370
|
+
* To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup
|
|
371
|
+
*/
|
|
372
|
+
adjustPopupForHoisting() {
|
|
373
|
+
if (!this.hoist) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
// execute after dropdown has been rendered to make sure the popup reference is correctly set
|
|
377
|
+
setTimeout(() => {
|
|
378
|
+
if (!this.popup) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
// take a snapshot of normally rendered popup
|
|
382
|
+
const popupBoundingClientRect = this.popup.getBoundingClientRect();
|
|
383
|
+
// apply screen position to fixed popup
|
|
384
|
+
this.popup.style.position = 'fixed';
|
|
385
|
+
['top', 'left', 'width', 'height'].forEach((property) => {
|
|
386
|
+
this.popup.style[property] = `${popupBoundingClientRect[property]}px`;
|
|
387
|
+
});
|
|
388
|
+
const inputBoundingClientRect = this.inputElement.getBoundingClientRect();
|
|
389
|
+
const inputTop = inputBoundingClientRect.top;
|
|
390
|
+
const popupTop = popupBoundingClientRect.top;
|
|
391
|
+
this.calcIsDropDownContentUp();
|
|
392
|
+
// check screen position to check whether the popup should be moved above or below the trigger element
|
|
393
|
+
if (this.isDropDownContentUp && inputTop < popupTop) {
|
|
394
|
+
// move popup above input field if timepicker is at bottom of screen
|
|
395
|
+
this.popup.style.top = `${popupTop - popupBoundingClientRect.height - inputBoundingClientRect.height}px`;
|
|
396
|
+
}
|
|
397
|
+
}, 0);
|
|
398
|
+
}
|
|
399
|
+
render() {
|
|
400
|
+
this.adjustPopupForHoisting();
|
|
401
|
+
return (h("div", { part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" },
|
|
402
|
+
h("six-input", { ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), value: this.value, placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, size: this.size, name: this.name, label: this.label, required: this.required, "error-text": this.errorText, "error-on-blur": this.errorOnBlur, class: {
|
|
403
|
+
'input--empty': !this.value,
|
|
404
|
+
'input--hide': this.inline,
|
|
405
|
+
} },
|
|
406
|
+
this.renderCustomIcon(),
|
|
407
|
+
this.renderClearable(),
|
|
408
|
+
hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" },
|
|
409
|
+
h("slot", { name: "error-text" }))) : null,
|
|
410
|
+
hasSlot(this.host, 'label') ? (h("span", { slot: "label" },
|
|
411
|
+
h("slot", { name: "label" }))) : null),
|
|
412
|
+
this.open && (h("div", { ref: (el) => (this.popup = el), part: "popup", class: {
|
|
413
|
+
timepicker__popup: true,
|
|
414
|
+
'timepicker__popup--is-up': this.placement ? this.placement === 'top' : this.isPopupContentUp,
|
|
415
|
+
'timepicker__popup--is-inline': this.inline,
|
|
416
|
+
} },
|
|
417
|
+
...this.getContent(),
|
|
418
|
+
this.getAmPmPicker()))));
|
|
419
|
+
}
|
|
420
|
+
static get is() { return "six-timepicker"; }
|
|
421
|
+
static get encapsulation() { return "shadow"; }
|
|
422
|
+
static get originalStyleUrls() { return {
|
|
423
|
+
"$": ["six-timepicker.scss"]
|
|
424
|
+
}; }
|
|
425
|
+
static get styleUrls() { return {
|
|
426
|
+
"$": ["six-timepicker.css"]
|
|
427
|
+
}; }
|
|
428
|
+
static get properties() { return {
|
|
429
|
+
"format": {
|
|
430
|
+
"type": "string",
|
|
431
|
+
"mutable": false,
|
|
432
|
+
"complexType": {
|
|
433
|
+
"original": "SixTimeFormat",
|
|
434
|
+
"resolved": "SixTimeFormat.HH | SixTimeFormat.HHmm | SixTimeFormat.HHmmss | SixTimeFormat.HHmmssms | SixTimeFormat.hhaa | SixTimeFormat.hhmmaa | SixTimeFormat.hhmmssaa | SixTimeFormat.hhmmssmsaa | SixTimeFormat.mm | SixTimeFormat.ms | SixTimeFormat.ss",
|
|
435
|
+
"references": {
|
|
436
|
+
"SixTimeFormat": {
|
|
437
|
+
"location": "import",
|
|
438
|
+
"path": "./six-time-format"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": false,
|
|
443
|
+
"optional": false,
|
|
444
|
+
"docs": {
|
|
445
|
+
"tags": [],
|
|
446
|
+
"text": "Define the time format. Valid formats are:\n\nHH:mm:ss\nhh:mm:ss:aa\nHH:mm:ss:ms\nhh:mm:ss:ms:aa\nHH:mm\nhh:mm:aa\nHH\nhh:aa\nmm\nss\nms\n\nwhere HH is the 24 hour format\nand hh is the 12 hour format\n\nPlease notice that when using the 12-hour-clock (hh)\nyou always need a period indicator (aa). So the time can be parsed as either am or pm"
|
|
447
|
+
},
|
|
448
|
+
"attribute": "format",
|
|
449
|
+
"reflect": false,
|
|
450
|
+
"defaultValue": "SixTimeFormat.HHmmss"
|
|
451
|
+
},
|
|
452
|
+
"separator": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "string",
|
|
457
|
+
"resolved": "string",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [],
|
|
464
|
+
"text": "Define the separator to be shown between the time unit pickers.\nPlease be aware that this property will modify the displayed separator only.\nThe separator for a timestring is always expected to be a colon (eg. '13:52:20')"
|
|
465
|
+
},
|
|
466
|
+
"attribute": "separator",
|
|
467
|
+
"reflect": false,
|
|
468
|
+
"defaultValue": "TIME_FORMAT_SEPARATOR"
|
|
469
|
+
},
|
|
470
|
+
"value": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"mutable": true,
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "string | null",
|
|
475
|
+
"resolved": "string",
|
|
476
|
+
"references": {}
|
|
477
|
+
},
|
|
478
|
+
"required": false,
|
|
479
|
+
"optional": true,
|
|
480
|
+
"docs": {
|
|
481
|
+
"tags": [],
|
|
482
|
+
"text": "The value of the timepicker provided as a string. The string mast match the provided format (or default format)"
|
|
483
|
+
},
|
|
484
|
+
"attribute": "value",
|
|
485
|
+
"reflect": false
|
|
486
|
+
},
|
|
487
|
+
"open": {
|
|
488
|
+
"type": "boolean",
|
|
489
|
+
"mutable": true,
|
|
490
|
+
"complexType": {
|
|
491
|
+
"original": "boolean",
|
|
492
|
+
"resolved": "boolean",
|
|
493
|
+
"references": {}
|
|
494
|
+
},
|
|
495
|
+
"required": false,
|
|
496
|
+
"optional": false,
|
|
497
|
+
"docs": {
|
|
498
|
+
"tags": [],
|
|
499
|
+
"text": "Indicates whether or not the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods."
|
|
500
|
+
},
|
|
501
|
+
"attribute": "open",
|
|
502
|
+
"reflect": true,
|
|
503
|
+
"defaultValue": "false"
|
|
504
|
+
},
|
|
505
|
+
"inline": {
|
|
506
|
+
"type": "boolean",
|
|
507
|
+
"mutable": false,
|
|
508
|
+
"complexType": {
|
|
509
|
+
"original": "boolean",
|
|
510
|
+
"resolved": "boolean",
|
|
511
|
+
"references": {}
|
|
512
|
+
},
|
|
513
|
+
"required": false,
|
|
514
|
+
"optional": false,
|
|
515
|
+
"docs": {
|
|
516
|
+
"tags": [],
|
|
517
|
+
"text": "Indicates whether or not the timepicker should be shown as an inline (always open) component"
|
|
518
|
+
},
|
|
519
|
+
"attribute": "inline",
|
|
520
|
+
"reflect": true,
|
|
521
|
+
"defaultValue": "false"
|
|
522
|
+
},
|
|
523
|
+
"readonly": {
|
|
524
|
+
"type": "boolean",
|
|
525
|
+
"mutable": false,
|
|
526
|
+
"complexType": {
|
|
527
|
+
"original": "boolean",
|
|
528
|
+
"resolved": "boolean",
|
|
529
|
+
"references": {}
|
|
530
|
+
},
|
|
531
|
+
"required": false,
|
|
532
|
+
"optional": false,
|
|
533
|
+
"docs": {
|
|
534
|
+
"tags": [],
|
|
535
|
+
"text": "If `true` the user can only select a time via the timepicker but not directly edit the input field."
|
|
536
|
+
},
|
|
537
|
+
"attribute": "readonly",
|
|
538
|
+
"reflect": false,
|
|
539
|
+
"defaultValue": "false"
|
|
540
|
+
},
|
|
541
|
+
"disabled": {
|
|
542
|
+
"type": "boolean",
|
|
543
|
+
"mutable": false,
|
|
544
|
+
"complexType": {
|
|
545
|
+
"original": "boolean",
|
|
546
|
+
"resolved": "boolean",
|
|
547
|
+
"references": {}
|
|
548
|
+
},
|
|
549
|
+
"required": false,
|
|
550
|
+
"optional": false,
|
|
551
|
+
"docs": {
|
|
552
|
+
"tags": [],
|
|
553
|
+
"text": "If `true` the component is disabled."
|
|
554
|
+
},
|
|
555
|
+
"attribute": "disabled",
|
|
556
|
+
"reflect": false,
|
|
557
|
+
"defaultValue": "false"
|
|
558
|
+
},
|
|
559
|
+
"placement": {
|
|
560
|
+
"type": "string",
|
|
561
|
+
"mutable": false,
|
|
562
|
+
"complexType": {
|
|
563
|
+
"original": "'top' | 'bottom'",
|
|
564
|
+
"resolved": "\"bottom\" | \"top\"",
|
|
565
|
+
"references": {}
|
|
566
|
+
},
|
|
567
|
+
"required": false,
|
|
568
|
+
"optional": false,
|
|
569
|
+
"docs": {
|
|
570
|
+
"tags": [],
|
|
571
|
+
"text": "The enforced placement of the dropdown panel."
|
|
572
|
+
},
|
|
573
|
+
"attribute": "placement",
|
|
574
|
+
"reflect": false
|
|
575
|
+
},
|
|
576
|
+
"size": {
|
|
577
|
+
"type": "string",
|
|
578
|
+
"mutable": false,
|
|
579
|
+
"complexType": {
|
|
580
|
+
"original": "'small' | 'medium' | 'large'",
|
|
581
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
582
|
+
"references": {}
|
|
583
|
+
},
|
|
584
|
+
"required": false,
|
|
585
|
+
"optional": false,
|
|
586
|
+
"docs": {
|
|
587
|
+
"tags": [],
|
|
588
|
+
"text": "Timepicker size."
|
|
589
|
+
},
|
|
590
|
+
"attribute": "size",
|
|
591
|
+
"reflect": false,
|
|
592
|
+
"defaultValue": "'medium'"
|
|
593
|
+
},
|
|
594
|
+
"required": {
|
|
595
|
+
"type": "boolean",
|
|
596
|
+
"mutable": false,
|
|
597
|
+
"complexType": {
|
|
598
|
+
"original": "boolean",
|
|
599
|
+
"resolved": "boolean",
|
|
600
|
+
"references": {}
|
|
601
|
+
},
|
|
602
|
+
"required": false,
|
|
603
|
+
"optional": false,
|
|
604
|
+
"docs": {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": "Set to true to make the input a required field."
|
|
607
|
+
},
|
|
608
|
+
"attribute": "required",
|
|
609
|
+
"reflect": true
|
|
610
|
+
},
|
|
611
|
+
"placeholder": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"mutable": false,
|
|
614
|
+
"complexType": {
|
|
615
|
+
"original": "string | null",
|
|
616
|
+
"resolved": "string",
|
|
617
|
+
"references": {}
|
|
618
|
+
},
|
|
619
|
+
"required": false,
|
|
620
|
+
"optional": true,
|
|
621
|
+
"docs": {
|
|
622
|
+
"tags": [],
|
|
623
|
+
"text": "The placeholder defines what text to be shown on the input element"
|
|
624
|
+
},
|
|
625
|
+
"attribute": "placeholder",
|
|
626
|
+
"reflect": false
|
|
627
|
+
},
|
|
628
|
+
"errorOnBlur": {
|
|
629
|
+
"type": "boolean",
|
|
630
|
+
"mutable": false,
|
|
631
|
+
"complexType": {
|
|
632
|
+
"original": "boolean",
|
|
633
|
+
"resolved": "boolean",
|
|
634
|
+
"references": {}
|
|
635
|
+
},
|
|
636
|
+
"required": false,
|
|
637
|
+
"optional": false,
|
|
638
|
+
"docs": {
|
|
639
|
+
"tags": [],
|
|
640
|
+
"text": "Set to display the error text on blur and not when typing"
|
|
641
|
+
},
|
|
642
|
+
"attribute": "error-on-blur",
|
|
643
|
+
"reflect": false,
|
|
644
|
+
"defaultValue": "false"
|
|
645
|
+
},
|
|
646
|
+
"errorText": {
|
|
647
|
+
"type": "string",
|
|
648
|
+
"mutable": false,
|
|
649
|
+
"complexType": {
|
|
650
|
+
"original": "string",
|
|
651
|
+
"resolved": "string",
|
|
652
|
+
"references": {}
|
|
653
|
+
},
|
|
654
|
+
"required": false,
|
|
655
|
+
"optional": false,
|
|
656
|
+
"docs": {
|
|
657
|
+
"tags": [],
|
|
658
|
+
"text": "The input's error text. Alternatively, you can use the error-text slot."
|
|
659
|
+
},
|
|
660
|
+
"attribute": "error-text",
|
|
661
|
+
"reflect": false,
|
|
662
|
+
"defaultValue": "''"
|
|
663
|
+
},
|
|
664
|
+
"label": {
|
|
665
|
+
"type": "string",
|
|
666
|
+
"mutable": false,
|
|
667
|
+
"complexType": {
|
|
668
|
+
"original": "string",
|
|
669
|
+
"resolved": "string",
|
|
670
|
+
"references": {}
|
|
671
|
+
},
|
|
672
|
+
"required": false,
|
|
673
|
+
"optional": false,
|
|
674
|
+
"docs": {
|
|
675
|
+
"tags": [],
|
|
676
|
+
"text": "The input's label. Alternatively, you can use the label slot."
|
|
677
|
+
},
|
|
678
|
+
"attribute": "label",
|
|
679
|
+
"reflect": false,
|
|
680
|
+
"defaultValue": "''"
|
|
681
|
+
},
|
|
682
|
+
"name": {
|
|
683
|
+
"type": "string",
|
|
684
|
+
"mutable": false,
|
|
685
|
+
"complexType": {
|
|
686
|
+
"original": "string",
|
|
687
|
+
"resolved": "string",
|
|
688
|
+
"references": {}
|
|
689
|
+
},
|
|
690
|
+
"required": false,
|
|
691
|
+
"optional": false,
|
|
692
|
+
"docs": {
|
|
693
|
+
"tags": [],
|
|
694
|
+
"text": "The input's name attribute."
|
|
695
|
+
},
|
|
696
|
+
"attribute": "name",
|
|
697
|
+
"reflect": true,
|
|
698
|
+
"defaultValue": "''"
|
|
699
|
+
},
|
|
700
|
+
"clearable": {
|
|
701
|
+
"type": "boolean",
|
|
702
|
+
"mutable": false,
|
|
703
|
+
"complexType": {
|
|
704
|
+
"original": "boolean",
|
|
705
|
+
"resolved": "boolean",
|
|
706
|
+
"references": {}
|
|
707
|
+
},
|
|
708
|
+
"required": false,
|
|
709
|
+
"optional": false,
|
|
710
|
+
"docs": {
|
|
711
|
+
"tags": [],
|
|
712
|
+
"text": "Set to true to add a clear button when the input is populated."
|
|
713
|
+
},
|
|
714
|
+
"attribute": "clearable",
|
|
715
|
+
"reflect": false,
|
|
716
|
+
"defaultValue": "false"
|
|
717
|
+
},
|
|
718
|
+
"iconPosition": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"mutable": false,
|
|
721
|
+
"complexType": {
|
|
722
|
+
"original": "'left' | 'right'",
|
|
723
|
+
"resolved": "\"left\" | \"right\"",
|
|
724
|
+
"references": {}
|
|
725
|
+
},
|
|
726
|
+
"required": false,
|
|
727
|
+
"optional": false,
|
|
728
|
+
"docs": {
|
|
729
|
+
"tags": [],
|
|
730
|
+
"text": "Set the position of the icon"
|
|
731
|
+
},
|
|
732
|
+
"attribute": "icon-position",
|
|
733
|
+
"reflect": false,
|
|
734
|
+
"defaultValue": "'left'"
|
|
735
|
+
},
|
|
736
|
+
"hoist": {
|
|
737
|
+
"type": "boolean",
|
|
738
|
+
"mutable": false,
|
|
739
|
+
"complexType": {
|
|
740
|
+
"original": "boolean",
|
|
741
|
+
"resolved": "boolean",
|
|
742
|
+
"references": {}
|
|
743
|
+
},
|
|
744
|
+
"required": false,
|
|
745
|
+
"optional": false,
|
|
746
|
+
"docs": {
|
|
747
|
+
"tags": [],
|
|
748
|
+
"text": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`."
|
|
749
|
+
},
|
|
750
|
+
"attribute": "hoist",
|
|
751
|
+
"reflect": false,
|
|
752
|
+
"defaultValue": "false"
|
|
753
|
+
},
|
|
754
|
+
"timeout": {
|
|
755
|
+
"type": "number",
|
|
756
|
+
"mutable": false,
|
|
757
|
+
"complexType": {
|
|
758
|
+
"original": "number",
|
|
759
|
+
"resolved": "number",
|
|
760
|
+
"references": {}
|
|
761
|
+
},
|
|
762
|
+
"required": false,
|
|
763
|
+
"optional": false,
|
|
764
|
+
"docs": {
|
|
765
|
+
"tags": [],
|
|
766
|
+
"text": "Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours)."
|
|
767
|
+
},
|
|
768
|
+
"attribute": "timeout",
|
|
769
|
+
"reflect": false,
|
|
770
|
+
"defaultValue": "DEFAULT_DEBOUNCE_FAST"
|
|
771
|
+
},
|
|
772
|
+
"interval": {
|
|
773
|
+
"type": "number",
|
|
774
|
+
"mutable": false,
|
|
775
|
+
"complexType": {
|
|
776
|
+
"original": "number",
|
|
777
|
+
"resolved": "number",
|
|
778
|
+
"references": {}
|
|
779
|
+
},
|
|
780
|
+
"required": false,
|
|
781
|
+
"optional": false,
|
|
782
|
+
"docs": {
|
|
783
|
+
"tags": [],
|
|
784
|
+
"text": "Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed."
|
|
785
|
+
},
|
|
786
|
+
"attribute": "interval",
|
|
787
|
+
"reflect": false,
|
|
788
|
+
"defaultValue": "DEFAULT_DEBOUNCE_INSANELY_FAST"
|
|
789
|
+
},
|
|
790
|
+
"defaultTime": {
|
|
791
|
+
"type": "string",
|
|
792
|
+
"mutable": false,
|
|
793
|
+
"complexType": {
|
|
794
|
+
"original": "string | null",
|
|
795
|
+
"resolved": "string",
|
|
796
|
+
"references": {}
|
|
797
|
+
},
|
|
798
|
+
"required": false,
|
|
799
|
+
"optional": true,
|
|
800
|
+
"docs": {
|
|
801
|
+
"tags": [],
|
|
802
|
+
"text": "The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format."
|
|
803
|
+
},
|
|
804
|
+
"attribute": "default-time",
|
|
805
|
+
"reflect": false
|
|
806
|
+
},
|
|
807
|
+
"debounce": {
|
|
808
|
+
"type": "number",
|
|
809
|
+
"mutable": false,
|
|
810
|
+
"complexType": {
|
|
811
|
+
"original": "number",
|
|
812
|
+
"resolved": "number",
|
|
813
|
+
"references": {}
|
|
814
|
+
},
|
|
815
|
+
"required": false,
|
|
816
|
+
"optional": false,
|
|
817
|
+
"docs": {
|
|
818
|
+
"tags": [],
|
|
819
|
+
"text": "Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\nIf you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\nis 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"
|
|
820
|
+
},
|
|
821
|
+
"attribute": "debounce",
|
|
822
|
+
"reflect": false,
|
|
823
|
+
"defaultValue": "DEFAULT_DEBOUNCE_FAST"
|
|
824
|
+
}
|
|
825
|
+
}; }
|
|
826
|
+
static get states() { return {
|
|
827
|
+
"isPopupContentUp": {},
|
|
828
|
+
"isDropDownContentUp": {},
|
|
829
|
+
"internalValue": {}
|
|
830
|
+
}; }
|
|
831
|
+
static get events() { return [{
|
|
832
|
+
"method": "sixChange",
|
|
833
|
+
"name": "six-timepicker-change",
|
|
834
|
+
"bubbles": true,
|
|
835
|
+
"cancelable": true,
|
|
836
|
+
"composed": true,
|
|
837
|
+
"docs": {
|
|
838
|
+
"tags": [],
|
|
839
|
+
"text": "Emitted when the timepicker's value changes"
|
|
840
|
+
},
|
|
841
|
+
"complexType": {
|
|
842
|
+
"original": "SixTimepickerChange",
|
|
843
|
+
"resolved": "SixTimepickerChange",
|
|
844
|
+
"references": {
|
|
845
|
+
"SixTimepickerChange": {
|
|
846
|
+
"location": "local"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}, {
|
|
851
|
+
"method": "sixChangeDebounced",
|
|
852
|
+
"name": "six-timepicker-change-debounced",
|
|
853
|
+
"bubbles": true,
|
|
854
|
+
"cancelable": true,
|
|
855
|
+
"composed": true,
|
|
856
|
+
"docs": {
|
|
857
|
+
"tags": [],
|
|
858
|
+
"text": "Emitted when the timepicker's value changes, but debounced"
|
|
859
|
+
},
|
|
860
|
+
"complexType": {
|
|
861
|
+
"original": "SixTimepickerChange",
|
|
862
|
+
"resolved": "SixTimepickerChange",
|
|
863
|
+
"references": {
|
|
864
|
+
"SixTimepickerChange": {
|
|
865
|
+
"location": "local"
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}, {
|
|
870
|
+
"method": "sixClear",
|
|
871
|
+
"name": "six-timepicker-clear",
|
|
872
|
+
"bubbles": true,
|
|
873
|
+
"cancelable": true,
|
|
874
|
+
"composed": true,
|
|
875
|
+
"docs": {
|
|
876
|
+
"tags": [],
|
|
877
|
+
"text": "Emitted when the clear button is activated."
|
|
878
|
+
},
|
|
879
|
+
"complexType": {
|
|
880
|
+
"original": "EmptyPayload",
|
|
881
|
+
"resolved": "undefined",
|
|
882
|
+
"references": {
|
|
883
|
+
"EmptyPayload": {
|
|
884
|
+
"location": "import",
|
|
885
|
+
"path": "../../utils/types"
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}]; }
|
|
890
|
+
static get methods() { return {
|
|
891
|
+
"reportValidity": {
|
|
892
|
+
"complexType": {
|
|
893
|
+
"signature": "() => Promise<boolean>",
|
|
894
|
+
"parameters": [],
|
|
895
|
+
"references": {
|
|
896
|
+
"Promise": {
|
|
897
|
+
"location": "global"
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
"return": "Promise<boolean>"
|
|
901
|
+
},
|
|
902
|
+
"docs": {
|
|
903
|
+
"text": "Checks for validity and shows the browser's validation message if the control is invalid.",
|
|
904
|
+
"tags": []
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
"checkValidity": {
|
|
908
|
+
"complexType": {
|
|
909
|
+
"signature": "() => Promise<boolean>",
|
|
910
|
+
"parameters": [],
|
|
911
|
+
"references": {
|
|
912
|
+
"Promise": {
|
|
913
|
+
"location": "global"
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
"return": "Promise<boolean>"
|
|
917
|
+
},
|
|
918
|
+
"docs": {
|
|
919
|
+
"text": "Checks for validity.",
|
|
920
|
+
"tags": []
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
"setCustomValidity": {
|
|
924
|
+
"complexType": {
|
|
925
|
+
"signature": "(message: string) => Promise<void>",
|
|
926
|
+
"parameters": [{
|
|
927
|
+
"tags": [],
|
|
928
|
+
"text": ""
|
|
929
|
+
}],
|
|
930
|
+
"references": {
|
|
931
|
+
"Promise": {
|
|
932
|
+
"location": "global"
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
"return": "Promise<void>"
|
|
936
|
+
},
|
|
937
|
+
"docs": {
|
|
938
|
+
"text": "Sets a custom validation message. If `message` is not empty, the field will be considered invalid.",
|
|
939
|
+
"tags": []
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
"reset": {
|
|
943
|
+
"complexType": {
|
|
944
|
+
"signature": "() => Promise<void>",
|
|
945
|
+
"parameters": [],
|
|
946
|
+
"references": {
|
|
947
|
+
"Promise": {
|
|
948
|
+
"location": "global"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"return": "Promise<void>"
|
|
952
|
+
},
|
|
953
|
+
"docs": {
|
|
954
|
+
"text": "Resets the formcontrol",
|
|
955
|
+
"tags": []
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}; }
|
|
959
|
+
static get elementRef() { return "host"; }
|
|
960
|
+
static get watchers() { return [{
|
|
961
|
+
"propName": "debounce",
|
|
962
|
+
"methodName": "debounceChanged"
|
|
963
|
+
}, {
|
|
964
|
+
"propName": "value",
|
|
965
|
+
"methodName": "valueChanged"
|
|
966
|
+
}]; }
|
|
967
|
+
static get listeners() { return [{
|
|
968
|
+
"name": "resize",
|
|
969
|
+
"method": "resizeHandler",
|
|
970
|
+
"target": "window",
|
|
971
|
+
"capture": false,
|
|
972
|
+
"passive": true
|
|
973
|
+
}, {
|
|
974
|
+
"name": "scroll",
|
|
975
|
+
"method": "scrollHandler",
|
|
976
|
+
"target": "window",
|
|
977
|
+
"capture": false,
|
|
978
|
+
"passive": true
|
|
979
|
+
}]; }
|
|
980
|
+
}
|