@six-group/ui-library 0.0.0-insider.db2b416 → 0.0.0-insider.ddecb41
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/README.md +9 -0
- package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
- package/dist/cjs/form-control-9769b310.js.map +1 -0
- package/dist/cjs/index-900437fc.js +214 -1
- package/dist/cjs/index-900437fc.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scroll-03678de1.js → scroll-2c4200dc.js} +1 -2
- package/dist/cjs/scroll-2c4200dc.js.map +1 -0
- package/dist/cjs/six-button.cjs.entry.js +3 -3
- package/dist/cjs/six-button.cjs.entry.js.map +1 -1
- package/dist/cjs/six-checkbox.cjs.entry.js +8 -13
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +5 -8
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-details.cjs.entry.js +1 -1
- package/dist/cjs/six-details.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dialog.cjs.entry.js +1 -1
- package/dist/cjs/six-drawer.cjs.entry.js +2 -2
- package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error.cjs.entry.js +21 -0
- package/dist/cjs/six-error.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +2 -2
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +6 -3
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +9 -17
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +6 -3
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +12 -8
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +2 -1
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/six-switch.cjs.entry.js +25 -5
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tab-group.cjs.entry.js +45 -50
- package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tab.cjs.entry.js +19 -3
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +24 -2
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +6 -3
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/ui-library.cjs.js +2 -2
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/six-button/six-button.css +5 -30
- package/dist/collection/components/six-button/six-button.js +2 -2
- package/dist/collection/components/six-button/six-button.js.map +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +27 -31
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +25 -12
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
- package/dist/collection/components/six-details/six-details.css +3 -1
- package/dist/collection/components/six-drawer/six-drawer.js +1 -1
- package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
- package/dist/collection/components/six-drawer/test/six-drawer.spec.js +1 -1
- package/dist/collection/components/six-drawer/test/six-drawer.spec.js.map +1 -1
- package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
- package/dist/collection/components/six-error/six-error.css +5 -0
- package/dist/collection/components/six-error/six-error.js +25 -0
- package/dist/collection/components/six-error/six-error.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.css +1 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
- package/dist/collection/components/six-icon-button/six-icon-button.css +4 -4
- package/dist/collection/components/six-input/six-input.css +2 -2
- package/dist/collection/components/six-input/six-input.js +27 -4
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
- package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
- package/dist/collection/components/six-radio/six-radio.js +9 -34
- package/dist/collection/components/six-radio/six-radio.js.map +1 -1
- package/dist/collection/components/six-range/six-range.css +1 -1
- package/dist/collection/components/six-range/six-range.js +24 -3
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
- package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
- package/dist/collection/components/six-select/six-select.css +7 -10
- package/dist/collection/components/six-select/six-select.js +30 -8
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/six-select.spec.js +8 -4
- package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +4 -0
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +1 -0
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
- package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js +2 -2
- package/dist/collection/components/six-sidebar-item-group/test/six-sidebar-item-group.spec.js.map +1 -1
- package/dist/collection/components/six-switch/six-switch.css +1 -1
- package/dist/collection/components/six-switch/six-switch.js +48 -5
- package/dist/collection/components/six-switch/six-switch.js.map +1 -1
- package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
- package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
- package/dist/collection/components/six-tab/six-tab.css +54 -5
- package/dist/collection/components/six-tab/six-tab.js +18 -2
- package/dist/collection/components/six-tab/six-tab.js.map +1 -1
- package/dist/collection/components/six-tab-group/six-tab-group.css +0 -31
- package/dist/collection/components/six-tab-group/six-tab-group.js +10 -51
- package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
- package/dist/collection/components/six-tag/six-tag.css +6 -0
- package/dist/collection/components/six-tag/six-tag.js +23 -1
- package/dist/collection/components/six-tag/six-tag.js.map +1 -1
- package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
- package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
- package/dist/collection/components/six-textarea/six-textarea.css +1 -1
- package/dist/collection/components/six-textarea/six-textarea.js +25 -4
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
- package/dist/collection/functional-components/form-control/form-control.js +8 -6
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
- package/dist/collection/utils/animation.js +34 -0
- package/dist/collection/utils/animation.js.map +1 -0
- package/dist/components/form-control.js +9 -6
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/scroll.js +1 -1
- package/dist/components/six-button.js +3 -3
- package/dist/components/six-button.js.map +1 -1
- package/dist/components/six-checkbox.js +17 -15
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-datepicker.js +13 -9
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-details2.js +1 -1
- package/dist/components/six-details2.js.map +1 -1
- package/dist/components/six-drawer.js +1 -1
- package/dist/components/six-drawer.js.map +1 -1
- package/dist/components/six-dropdown2.js +8 -2
- package/dist/components/six-dropdown2.js.map +1 -1
- package/dist/components/six-error.d.ts +11 -0
- package/dist/components/six-error.js +8 -0
- package/dist/components/six-error.js.map +1 -0
- package/dist/components/six-error2.js +32 -0
- package/dist/components/six-error2.js.map +1 -0
- package/dist/components/six-group-label.js +8 -2
- package/dist/components/six-group-label.js.map +1 -1
- package/dist/components/six-header.js +8 -2
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-icon-button2.js +1 -1
- package/dist/components/six-icon-button2.js.map +1 -1
- package/dist/components/six-input2.js +14 -3
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-radio.js +10 -19
- package/dist/components/six-radio.js.map +1 -1
- package/dist/components/six-range.js +14 -3
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-search-field.js +7 -1
- package/dist/components/six-search-field.js.map +1 -1
- package/dist/components/six-select.js +39 -21
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar-item-group.js +2 -1
- package/dist/components/six-sidebar-item-group.js.map +1 -1
- package/dist/components/six-switch.js +33 -5
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tab-group.js +45 -50
- package/dist/components/six-tab-group.js.map +1 -1
- package/dist/components/six-tab.js +19 -3
- package/dist/components/six-tab.js.map +1 -1
- package/dist/components/six-tag2.js +34 -6
- package/dist/components/six-tag2.js.map +1 -1
- package/dist/components/six-textarea.js +14 -3
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-timepicker2.js +12 -10
- package/dist/components/six-timepicker2.js.map +1 -1
- package/dist/components/six-tooltip2.js +2 -2
- package/dist/components/six-tooltip2.js.map +1 -1
- package/dist/components.json +426 -100
- package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
- package/dist/esm/form-control-b0febe88.js.map +1 -0
- package/dist/esm/index-8a74f992.js +214 -1
- package/dist/esm/index-8a74f992.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scroll-3fb087a2.js → scroll-774762d6.js} +2 -2
- package/dist/esm/{scroll-3fb087a2.js.map → scroll-774762d6.js.map} +1 -1
- package/dist/esm/six-button.entry.js +3 -3
- package/dist/esm/six-button.entry.js.map +1 -1
- package/dist/esm/six-checkbox.entry.js +8 -13
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +5 -8
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-details.entry.js +1 -1
- package/dist/esm/six-details.entry.js.map +1 -1
- package/dist/esm/six-dialog.entry.js +1 -1
- package/dist/esm/six-drawer.entry.js +2 -2
- package/dist/esm/six-drawer.entry.js.map +1 -1
- package/dist/esm/six-dropdown_2.entry.js +1 -1
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error.entry.js +17 -0
- package/dist/esm/six-error.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +2 -2
- package/dist/esm/six-group-label.entry.js.map +1 -1
- package/dist/esm/six-icon-button.entry.js +1 -1
- package/dist/esm/six-icon-button.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +6 -3
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-radio.entry.js +9 -17
- package/dist/esm/six-radio.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +6 -3
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +12 -8
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar-item-group.entry.js +2 -1
- package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
- package/dist/esm/six-sidebar.entry.js +1 -1
- package/dist/esm/six-switch.entry.js +25 -5
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tab-group.entry.js +45 -50
- package/dist/esm/six-tab-group.entry.js.map +1 -1
- package/dist/esm/six-tab.entry.js +19 -3
- package/dist/esm/six-tab.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +24 -2
- package/dist/esm/six-tag.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +6 -3
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-timepicker.entry.js +4 -9
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +2 -2
- package/dist/esm/six-tooltip.entry.js.map +1 -1
- package/dist/esm/ui-library.js +2 -2
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -5
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
- package/dist/types/components/six-error/six-error.d.ts +9 -0
- package/dist/types/components/six-input/six-input.d.ts +7 -2
- package/dist/types/components/six-radio/six-radio.d.ts +0 -5
- package/dist/types/components/six-range/six-range.d.ts +4 -1
- package/dist/types/components/six-select/six-select.d.ts +4 -1
- package/dist/types/components/six-switch/six-switch.d.ts +8 -1
- package/dist/types/components/six-tab-group/six-tab-group.d.ts +0 -3
- package/dist/types/components/six-tag/six-tag.d.ts +8 -0
- package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
- package/dist/types/components.d.ts +109 -24
- package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
- package/dist/types/utils/animation.d.ts +12 -0
- package/dist/ui-library/{p-1f18768a.js → p-052aa8d3.js} +2 -2
- package/dist/ui-library/{p-da19c7ce.entry.js → p-14c1ec31.entry.js} +2 -2
- package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
- package/dist/ui-library/p-22c9b8c3.entry.js +2 -0
- package/dist/ui-library/p-22c9b8c3.entry.js.map +1 -0
- package/dist/ui-library/p-25bb1752.entry.js +2 -0
- package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
- package/dist/ui-library/p-264d4ea8.entry.js +2 -0
- package/dist/ui-library/p-264d4ea8.entry.js.map +1 -0
- package/dist/ui-library/p-3f1a5ecb.entry.js +2 -0
- package/dist/ui-library/p-3f1a5ecb.entry.js.map +1 -0
- package/dist/ui-library/p-4435ff73.entry.js +2 -0
- package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
- package/dist/ui-library/p-538f3c50.entry.js +2 -0
- package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
- package/dist/ui-library/{p-330a4988.entry.js → p-5800663b.entry.js} +2 -2
- package/dist/ui-library/p-5ba3a0fe.entry.js +2 -0
- package/dist/ui-library/p-5ba3a0fe.entry.js.map +1 -0
- package/dist/ui-library/{p-99e24daf.entry.js → p-5ef2bdb3.entry.js} +2 -2
- package/dist/ui-library/{p-99e24daf.entry.js.map → p-5ef2bdb3.entry.js.map} +1 -1
- package/dist/ui-library/p-6153045b.js.map +1 -1
- package/dist/ui-library/p-658d9f79.entry.js +2 -0
- package/dist/ui-library/p-658d9f79.entry.js.map +1 -0
- package/dist/ui-library/p-66fe54b3.entry.js +2 -0
- package/dist/ui-library/p-66fe54b3.entry.js.map +1 -0
- package/dist/ui-library/p-a457fee8.entry.js +2 -0
- package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
- package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
- package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
- package/dist/ui-library/p-b57afbe4.entry.js +2 -0
- package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
- package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
- package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
- package/dist/ui-library/p-cba69e9d.entry.js +2 -0
- package/dist/ui-library/p-cba69e9d.entry.js.map +1 -0
- package/dist/ui-library/{p-19ed7a4c.entry.js → p-d1bda563.entry.js} +2 -2
- package/dist/ui-library/p-db34a6cc.entry.js +2 -0
- package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
- package/dist/ui-library/p-db936ad7.entry.js +2 -0
- package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
- package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
- package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
- package/dist/ui-library/p-e5020f0d.js +2 -0
- package/dist/ui-library/p-e5020f0d.js.map +1 -0
- package/dist/ui-library/p-e775dcb4.entry.js +2 -0
- package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
- package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
- package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
- package/dist/ui-library/ui-library.css +2 -2
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +6 -3
- package/dist/cjs/form-control-d369af14.js.map +0 -1
- package/dist/cjs/scroll-03678de1.js.map +0 -1
- package/dist/collection/components/six-tab/test/six-tab.spec.js +0 -20
- package/dist/collection/components/six-tab/test/six-tab.spec.js.map +0 -1
- package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js +0 -45
- package/dist/collection/components/six-tab-group/test/six-tab-group.spec.js.map +0 -1
- package/dist/esm/form-control-32cb533f.js.map +0 -1
- package/dist/ui-library/p-1256cc0a.entry.js +0 -2
- package/dist/ui-library/p-1256cc0a.entry.js.map +0 -1
- package/dist/ui-library/p-1730a174.entry.js +0 -2
- package/dist/ui-library/p-1730a174.entry.js.map +0 -1
- package/dist/ui-library/p-1d0bee53.entry.js +0 -2
- package/dist/ui-library/p-1d0bee53.entry.js.map +0 -1
- package/dist/ui-library/p-21b3b321.entry.js +0 -2
- package/dist/ui-library/p-21b3b321.entry.js.map +0 -1
- package/dist/ui-library/p-29ac3d7d.entry.js +0 -2
- package/dist/ui-library/p-29ac3d7d.entry.js.map +0 -1
- package/dist/ui-library/p-314b2096.entry.js +0 -2
- package/dist/ui-library/p-314b2096.entry.js.map +0 -1
- package/dist/ui-library/p-4705a51e.entry.js +0 -2
- package/dist/ui-library/p-4705a51e.entry.js.map +0 -1
- package/dist/ui-library/p-4abed9df.entry.js +0 -2
- package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
- package/dist/ui-library/p-5d6b7353.entry.js +0 -2
- package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
- package/dist/ui-library/p-6eb24bcb.entry.js +0 -2
- package/dist/ui-library/p-6eb24bcb.entry.js.map +0 -1
- package/dist/ui-library/p-72254eef.entry.js +0 -2
- package/dist/ui-library/p-72254eef.entry.js.map +0 -1
- package/dist/ui-library/p-83864cfe.entry.js +0 -2
- package/dist/ui-library/p-83864cfe.entry.js.map +0 -1
- package/dist/ui-library/p-cf49252a.entry.js +0 -2
- package/dist/ui-library/p-cf49252a.entry.js.map +0 -1
- package/dist/ui-library/p-d367f4f9.entry.js +0 -2
- package/dist/ui-library/p-d42c2025.js +0 -2
- package/dist/ui-library/p-d42c2025.js.map +0 -1
- package/dist/ui-library/p-da19c7ce.entry.js.map +0 -1
- package/dist/ui-library/p-e0b13ad3.entry.js +0 -2
- package/dist/ui-library/p-e0b13ad3.entry.js.map +0 -1
- package/dist/ui-library/p-ee8342e1.entry.js +0 -2
- package/dist/ui-library/p-ee8342e1.entry.js.map +0 -1
- package/dist/ui-library/p-f1eb03ba.entry.js +0 -2
- package/dist/ui-library/p-f1eb03ba.entry.js.map +0 -1
- package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
- package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
- package/readme.md +0 -156
- /package/dist/ui-library/{p-1f18768a.js.map → p-052aa8d3.js.map} +0 -0
- /package/dist/ui-library/{p-330a4988.entry.js.map → p-5800663b.entry.js.map} +0 -0
- /package/dist/ui-library/{p-19ed7a4c.entry.js.map → p-d1bda563.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"six-timepicker.js","sourceRoot":"","sources":["../../../src/components/six-timepicker/six-timepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAEhH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkBtE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;GAQG;AAMH,MAAM,OAAO,aAAa;;IAChB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IA2RtC,uBAAkB,GAAG,CAAC,KAA8C,EAAE,QAAwB,EAAE,EAAE;MACxG,oGAAoG;MACpG,KAAK,CAAC,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CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n @Watch('invalid')\n protected invalidChanged(invalid: boolean) {\n if (this.inputElement) {\n this.inputElement.invalid = invalid;\n }\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n }\n\n // update value and popup value, and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n value={this.value}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n error-text={this.errorText}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"six-timepicker.js","sourceRoot":"","sources":["../../../src/components/six-timepicker/six-timepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAEhH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkBtE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;;;GAUG;AAMH,MAAM,OAAO,aAAa;;IAChB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAuRtC,uBAAkB,GAAG,CAAC,KAA8C,EAAE,QAAwB,EAAE,EAAE;MACxG,oGAAoG;MACpG,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;QAC3B,OAAO;OACR;MAED,4BAA4B;MAC5B,6DAA6D;MAC7D,aAAa;MACb,IAAI,CAA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J,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n }\n\n // update value and popup value, and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n value={this.value}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n errorTextCount={this.errorTextCount}\n errorText={this.errorText}\n invalid={this.invalid}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@ describe('six-timepicker', () => {
|
|
|
15
15
|
<six-timepicker>
|
|
16
16
|
<mock:shadow-root>
|
|
17
17
|
<div class="timepicker__container" part="container">
|
|
18
|
-
<six-input class="input--empty"
|
|
18
|
+
<six-input class="input--empty" errortext="" label="" part="input" size="medium" value="">
|
|
19
19
|
<span class="prefix" part="icon" slot="prefix">
|
|
20
20
|
<six-icon size="medium">
|
|
21
21
|
watch_later
|
|
@@ -37,7 +37,7 @@ describe('six-timepicker', () => {
|
|
|
37
37
|
<six-timepicker open="">
|
|
38
38
|
<mock:shadow-root>
|
|
39
39
|
<div class="timepicker__container" part="container">
|
|
40
|
-
<six-input
|
|
40
|
+
<six-input errortext="" label="" part="input" size="medium" value="20:00:00">
|
|
41
41
|
<span class="prefix" part="icon" slot="prefix">
|
|
42
42
|
<six-icon size="medium">
|
|
43
43
|
watch_later
|
|
@@ -77,7 +77,7 @@ describe('six-timepicker', () => {
|
|
|
77
77
|
<six-timepicker open="" value="13:20:59">
|
|
78
78
|
<mock:shadow-root>
|
|
79
79
|
<div class="timepicker__container" part="container">
|
|
80
|
-
<six-input
|
|
80
|
+
<six-input errortext="" label="" part="input" size="medium" value="13:20:59">
|
|
81
81
|
<span class="prefix" part="icon" slot="prefix">
|
|
82
82
|
<six-icon size="medium">
|
|
83
83
|
watch_later
|
|
@@ -117,7 +117,7 @@ describe('six-timepicker', () => {
|
|
|
117
117
|
<six-timepicker inline="" open="" value="13:20:59">
|
|
118
118
|
<mock:shadow-root>
|
|
119
119
|
<div class="timepicker__container" part="container">
|
|
120
|
-
<six-input class="input--hide"
|
|
120
|
+
<six-input class="input--hide" errortext="" label="" part="input" size="medium" value="13:20:59">
|
|
121
121
|
<span class="prefix" part="icon" slot="prefix">
|
|
122
122
|
<six-icon size="medium">
|
|
123
123
|
watch_later
|
|
@@ -157,7 +157,7 @@ describe('six-timepicker', () => {
|
|
|
157
157
|
<six-timepicker default-time="13:20:59" open="">
|
|
158
158
|
<mock:shadow-root>
|
|
159
159
|
<div class="timepicker__container" part="container">
|
|
160
|
-
<six-input class="input--empty"
|
|
160
|
+
<six-input class="input--empty" errortext="" label="" part="input" size="medium" value="">
|
|
161
161
|
<span class="prefix" part="icon" slot="prefix">
|
|
162
162
|
<six-icon size="medium">
|
|
163
163
|
watch_later
|
|
@@ -197,7 +197,7 @@ describe('six-timepicker', () => {
|
|
|
197
197
|
<six-timepicker open="" separator="-" value="11:59:20">
|
|
198
198
|
<mock:shadow-root>
|
|
199
199
|
<div class="timepicker__container" part="container">
|
|
200
|
-
<six-input
|
|
200
|
+
<six-input errortext="" label="" part="input" size="medium" value="11:59:20">
|
|
201
201
|
<span class="prefix" part="icon" slot="prefix">
|
|
202
202
|
<six-icon size="medium">
|
|
203
203
|
watch_later
|
|
@@ -237,7 +237,7 @@ describe('six-timepicker', () => {
|
|
|
237
237
|
<six-timepicker format="hh:mm:ss:aa" open="" value="03:45:20:PM">
|
|
238
238
|
<mock:shadow-root>
|
|
239
239
|
<div class="timepicker__container" part="container">
|
|
240
|
-
<six-input
|
|
240
|
+
<six-input errortext="" label="" part="input" size="medium" value="03:45:20:PM">
|
|
241
241
|
<span class="prefix" part="icon" slot="prefix">
|
|
242
242
|
<six-icon size="medium">
|
|
243
243
|
watch_later
|
|
@@ -278,7 +278,7 @@ describe('six-timepicker', () => {
|
|
|
278
278
|
<six-timepicker interval="150" open="" timeout="500" value="13:20:59">
|
|
279
279
|
<mock:shadow-root>
|
|
280
280
|
<div class="timepicker__container" part="container">
|
|
281
|
-
<six-input
|
|
281
|
+
<six-input errortext="" label="" part="input" size="medium" value="13:20:59">
|
|
282
282
|
<span class="prefix" part="icon" slot="prefix">
|
|
283
283
|
<six-icon size="medium">
|
|
284
284
|
watch_later
|
|
@@ -318,7 +318,7 @@ describe('six-timepicker', () => {
|
|
|
318
318
|
<six-timepicker placeholder="HH:mm:ss">
|
|
319
319
|
<mock:shadow-root>
|
|
320
320
|
<div class="timepicker__container" part="container">
|
|
321
|
-
<six-input class="input--empty"
|
|
321
|
+
<six-input class="input--empty" errortext="" label="" part="input" placeholder="HH:mm:ss" size="medium" value="">
|
|
322
322
|
<span class="prefix" part="icon" slot="prefix">
|
|
323
323
|
<six-icon size="medium">
|
|
324
324
|
watch_later
|
|
@@ -343,7 +343,7 @@ describe('six-timepicker', () => {
|
|
|
343
343
|
<six-timepicker readonly="" value="02:00:00">
|
|
344
344
|
<mock:shadow-root>
|
|
345
345
|
<div class="timepicker__container" part="container">
|
|
346
|
-
<six-input
|
|
346
|
+
<six-input errortext="" label="" part="input" readonly="" size="medium" value="02:00:00">
|
|
347
347
|
<span class="prefix" part="icon" slot="prefix">
|
|
348
348
|
<six-icon size="medium">
|
|
349
349
|
watch_later
|
|
@@ -368,7 +368,7 @@ describe('six-timepicker', () => {
|
|
|
368
368
|
<six-timepicker disabled="" value="02:00:00">
|
|
369
369
|
<mock:shadow-root>
|
|
370
370
|
<div class="timepicker__container" part="container">
|
|
371
|
-
<six-input disabled=""
|
|
371
|
+
<six-input disabled="" errortext="" label="" part="input" size="medium" value="02:00:00">
|
|
372
372
|
<span class="prefix" part="icon" slot="prefix">
|
|
373
373
|
<six-icon size="medium">
|
|
374
374
|
watch_later
|
|
@@ -393,7 +393,7 @@ describe('six-timepicker', () => {
|
|
|
393
393
|
<six-timepicker size="small">
|
|
394
394
|
<mock:shadow-root>
|
|
395
395
|
<div class="timepicker__container" part="container">
|
|
396
|
-
<six-input class="input--empty"
|
|
396
|
+
<six-input class="input--empty" errortext="" label="" part="input" size="small" value="">
|
|
397
397
|
<span class="prefix" part="icon" slot="prefix">
|
|
398
398
|
<six-icon size="small">
|
|
399
399
|
watch_later
|
|
@@ -414,7 +414,7 @@ describe('six-timepicker', () => {
|
|
|
414
414
|
<six-timepicker size="small">
|
|
415
415
|
<mock:shadow-root>
|
|
416
416
|
<div class="timepicker__container" part="container">
|
|
417
|
-
<six-input class="input--empty"
|
|
417
|
+
<six-input class="input--empty" errortext="" label="" part="input" size="medium" value="">
|
|
418
418
|
<span class="prefix" part="icon" slot="prefix">
|
|
419
419
|
<six-icon size="medium">
|
|
420
420
|
watch_later
|
|
@@ -435,7 +435,7 @@ describe('six-timepicker', () => {
|
|
|
435
435
|
<six-timepicker size="small">
|
|
436
436
|
<mock:shadow-root>
|
|
437
437
|
<div class="timepicker__container" part="container">
|
|
438
|
-
<six-input class="input--empty"
|
|
438
|
+
<six-input class="input--empty" errortext="" label="" part="input" size="large" value="">
|
|
439
439
|
<span class="prefix" part="icon" slot="prefix">
|
|
440
440
|
<six-icon size="medium">
|
|
441
441
|
watch_later
|
|
@@ -460,7 +460,7 @@ describe('six-timepicker', () => {
|
|
|
460
460
|
<six-timepicker clearable="" icon-position="right" open="" value="13:20:59">
|
|
461
461
|
<mock:shadow-root>
|
|
462
462
|
<div class="timepicker__container" part="container">
|
|
463
|
-
<six-input
|
|
463
|
+
<six-input errortext="" label="" part="input" size="medium" value="13:20:59">
|
|
464
464
|
<span class="prefix prefix--right" part="icon" slot="prefix">
|
|
465
465
|
<six-icon size="medium">
|
|
466
466
|
watch_later
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"six-timepicker.spec.js","sourceRoot":"","sources":["../../../../src/components/six-timepicker/test/six-timepicker.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;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AI,CAAC,IAAI,IAAI,IAAI,EAAE;MACrB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;KAC1B;IACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,sCAAsC;IACtC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;IAc9B,CAAC,CAAC;EACJ,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;IACpE,QAAQ;IACR,MAAM,MAAM,GAAG;MACb,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,yFAAyF;KAChG,CAAC;IAEF,OAAO;IACP,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO;IACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC9B,CAAC,CAAC;EACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixTimepicker } from '../six-timepicker';\n\ndescribe('six-timepicker', () => {\n it('should render default timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker></six-timepicker>`,\n };\n\n // when initially loaded\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker>\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n\n // when setting a value and opening the popup\n if (page.root?.shadowRoot != null) {\n page.root.value = '20:00:00';\n page.root.shadowRoot.querySelector('six-input')?.click();\n }\n await page.waitForChanges();\n\n // then expect the correct time to be rendered\n expect(page.root).toEqualHtml(`\n<six-timepicker open=\"\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"20:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"0\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"0\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render open timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render inline timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker inline value=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker inline=\"\" open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--hide\" error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup timepicker__popup--is-inline\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render open timepicker with default time', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open default-time=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker default-time=\"13:20:59\" open=\"\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render timepicker with different separator', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"11:59:20\" separator=\"-\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker open=\"\" separator=\"-\" value=\"11:59:20\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"11:59:20\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"11\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n -\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n -\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render timepicker with different format', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"03:45:20:PM\" format=\"hh:mm:ss:aa\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker format=\"hh:mm:ss:aa\" open=\"\" value=\"03:45:20:PM\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"03:45:20:PM\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"11\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"3\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"45\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <six-item-picker interval=\"35\" padded=\"\" timeout=\"300\" type=\"custom\" value=\"PM\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker with adjusted timeout and interval', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\" timeout=\"500\" interval=\"150\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker interval=\"150\" open=\"\" timeout=\"500\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"150\" max=\"23\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"150\" max=\"59\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"150\" max=\"59\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker with placeholder', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker placeholder=\"HH:mm:ss\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker placeholder=\"HH:mm:ss\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" placeholder=\"HH:mm:ss\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render readonly timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker value=\"02:00:00\" readonly></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker readonly=\"\" value=\"02:00:00\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" readonly=\"\" size=\"medium\" value=\"02:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render disabled timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker value=\"02:00:00\" disabled></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker disabled=\"\" value=\"02:00:00\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input disabled=\"\" error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"02:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker in correct sizes', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker size=\"small\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" size=\"small\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"small\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n\n // when changing size\n if (page.root != null) {\n page.root.size = 'medium';\n }\n await page.waitForChanges();\n\n // then expect medium sized timepicker\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n\n // when changing size\n if (page.root != null) {\n page.root.size = 'large';\n }\n await page.waitForChanges();\n\n // then expect medium sized timepicker\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" error-text=\"\" label=\"\" part=\"input\" size=\"large\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render open timepicker with icon on the right', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\" icon-position=\"right\" clearable></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker clearable=\"\" icon-position=\"right\" open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input error-text=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix prefix--right\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n <button class=\"timepicker_clear timepicker_clear--left\" slot=\"suffix\" tabindex=\"-1\" type=\"button\">\n <six-icon size=\"small\">\n clear\n </six-icon>\n </button>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"six-timepicker.spec.js","sourceRoot":"","sources":["../../../../src/components/six-timepicker/test/six-timepicker.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;;IAChD,QAAQ;IACR,MAAM,MAAM,GAAG;MACb,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,mCAAmC;KAC1C,CAAC;IAEF,wBAAwB;IACxB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO;IACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;IAc9B,CAAC,CAAC;IAEF,6CAA6C;IAC7C,IAAI,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,KAAI,IAAI,EAAE;MACjC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;MAC7B,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,0CAAE,KAAK,EAAE,CAAC;KAC1D;IACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,8CAA8C;IAC9C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;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OAAO;IACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;IAc9B,CAAC,CAAC;IAEF,qBAAqB;IACrB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;MACrB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;KAC3B;IACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,sCAAsC;IACtC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;IAc9B,CAAC,CAAC;IAEF,qBAAqB;IACrB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;MACrB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;KAC1B;IACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,sCAAsC;IACtC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;IAc9B,CAAC,CAAC;EACJ,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;IACpE,QAAQ;IACR,MAAM,MAAM,GAAG;MACb,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,yFAAyF;KAChG,CAAC;IAEF,OAAO;IACP,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO;IACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC9B,CAAC,CAAC;EACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixTimepicker } from '../six-timepicker';\n\ndescribe('six-timepicker', () => {\n it('should render default timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker></six-timepicker>`,\n };\n\n // when initially loaded\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker>\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n\n // when setting a value and opening the popup\n if (page.root?.shadowRoot != null) {\n page.root.value = '20:00:00';\n page.root.shadowRoot.querySelector('six-input')?.click();\n }\n await page.waitForChanges();\n\n // then expect the correct time to be rendered\n expect(page.root).toEqualHtml(`\n<six-timepicker open=\"\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"20:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"0\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"0\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render open timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render inline timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker inline value=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker inline=\"\" open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--hide\" errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup timepicker__popup--is-inline\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render open timepicker with default time', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open default-time=\"13:20:59\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker default-time=\"13:20:59\" open=\"\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render timepicker with different separator', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"11:59:20\" separator=\"-\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n <six-timepicker open=\"\" separator=\"-\" value=\"11:59:20\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"11:59:20\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"11\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n -\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n -\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n </six-timepicker>\n `);\n });\n\n it('should render timepicker with different format', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"03:45:20:PM\" format=\"hh:mm:ss:aa\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker format=\"hh:mm:ss:aa\" open=\"\" value=\"03:45:20:PM\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"03:45:20:PM\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"11\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"3\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"45\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <six-item-picker interval=\"35\" padded=\"\" timeout=\"300\" type=\"custom\" value=\"PM\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker with adjusted timeout and interval', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\" timeout=\"500\" interval=\"150\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker interval=\"150\" open=\"\" timeout=\"500\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"150\" max=\"23\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"150\" max=\"59\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"150\" max=\"59\" min=\"0\" padded=\"\" timeout=\"500\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker with placeholder', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker placeholder=\"HH:mm:ss\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker placeholder=\"HH:mm:ss\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" placeholder=\"HH:mm:ss\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render readonly timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker value=\"02:00:00\" readonly></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker readonly=\"\" value=\"02:00:00\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" readonly=\"\" size=\"medium\" value=\"02:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render disabled timepicker', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker value=\"02:00:00\" disabled></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker disabled=\"\" value=\"02:00:00\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input disabled=\"\" errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"02:00:00\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render timepicker in correct sizes', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker size=\"small\"></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" size=\"small\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"small\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n\n // when changing size\n if (page.root != null) {\n page.root.size = 'medium';\n }\n await page.waitForChanges();\n\n // then expect medium sized timepicker\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n\n // when changing size\n if (page.root != null) {\n page.root.size = 'large';\n }\n await page.waitForChanges();\n\n // then expect medium sized timepicker\n expect(page.root).toEqualHtml(`\n<six-timepicker size=\"small\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input class=\"input--empty\" errortext=\"\" label=\"\" part=\"input\" size=\"large\" value=\"\">\n <span class=\"prefix\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n </six-input>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n\n it('should render open timepicker with icon on the right', async () => {\n // given\n const config = {\n components: [SixTimepicker],\n html: `<six-timepicker open value=\"13:20:59\" icon-position=\"right\" clearable></six-timepicker>`,\n };\n\n // when\n const page = await newSpecPage(config);\n\n // then\n expect(page.root).toEqualHtml(`\n<six-timepicker clearable=\"\" icon-position=\"right\" open=\"\" value=\"13:20:59\">\n <mock:shadow-root>\n <div class=\"timepicker__container\" part=\"container\">\n <six-input errortext=\"\" label=\"\" part=\"input\" size=\"medium\" value=\"13:20:59\">\n <span class=\"prefix prefix--right\" part=\"icon\" slot=\"prefix\">\n <six-icon size=\"medium\">\n watch_later\n </six-icon>\n </span>\n <button class=\"timepicker_clear timepicker_clear--left\" slot=\"suffix\" tabindex=\"-1\" type=\"button\">\n <six-icon size=\"small\">\n clear\n </six-icon>\n </button>\n </six-input>\n <div class=\"timepicker__popup\" part=\"popup\">\n <six-item-picker interval=\"35\" max=\"23\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"13\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"20\"></six-item-picker>\n <div class=\"timepicker__separator\">\n <span>\n :\n </span>\n </div>\n <six-item-picker interval=\"35\" max=\"59\" min=\"0\" padded=\"\" timeout=\"300\" type=\"number\" value=\"59\"></six-item-picker>\n </div>\n </div>\n </mock:shadow-root>\n</six-timepicker>\n `);\n });\n});\n"]}
|
|
@@ -73,7 +73,7 @@ export class SixTooltip {
|
|
|
73
73
|
if (this.tooltipPositioner == null)
|
|
74
74
|
return;
|
|
75
75
|
this.target = this.getTarget();
|
|
76
|
-
this.popover = new Popover(this.target, this.tooltipPositioner);
|
|
76
|
+
this.popover = new Popover(this.target, this.tooltipPositioner, { strategy: 'fixed' });
|
|
77
77
|
this.syncOptions();
|
|
78
78
|
this.host.addEventListener('blur', this.handleBlur, true);
|
|
79
79
|
this.host.addEventListener('click', this.handleClick, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"six-tooltip.js","sourceRoot":"","sources":["../../../src/components/six-tooltip/six-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,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IAAI,EAAE;KAC5C,CAAC,CAAC;EACL,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,IAAI,CAAC,cAAc;MACrG,YAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI;MAC7C,WAAK,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC,EAAE,KAAK,EAAC,oBAAoB;QACzE,WACE,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,EAChC,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,IAAI,CAAC,IAAI;WAC3B,EACD,IAAI,EAAC,SAAS,iBACD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;UAEzC,YAAM,IAAI,EAAC,SAAS,IAAE,IAAI,CAAC,OAAO,CAAQ,CACtC,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core';\nimport Popover from '../../utils/popover';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tooltip's target element. Only the first element will be used as the target.\n * @slot content - The tooltip's content. Alternatively, you can use the content prop.\n *\n * @part base - The component's base wrapper.\n */\n\n@Component({\n tag: 'six-tooltip',\n styleUrl: 'six-tooltip.scss',\n shadow: true,\n})\nexport class SixTooltip {\n private componentId = `tooltip-${++id}`;\n private isVisible = false;\n private popover?: Popover;\n private tooltipPositioner?: HTMLElement;\n private target?: HTMLElement;\n private tooltip?: HTMLElement;\n\n @Element() host!: HTMLSixTooltipElement;\n\n /** The tooltip's content. Alternatively, you can use the content slot. */\n @Prop() content = '';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside the viewport.\n */\n @Prop() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Set to true to disable the tooltip, so it won't show when triggered. */\n @Prop() disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @Prop() distance = 10;\n\n /** Indicates whether the tooltip is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @Prop() skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @Prop() trigger = 'hover focus';\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the tooltip begins to show. Calling `event.preventDefault()` will prevent it from being shown. */\n @Event({ eventName: 'six-tooltip-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has shown and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the tooltip begins to hide. Calling `event.preventDefault()` will prevent it from being hidden. */\n @Event({ eventName: 'six-tooltip-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has hidden and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentDidLoad() {\n if (this.tooltipPositioner == null) return;\n this.target = this.getTarget();\n this.popover = new Popover(this.target, this.tooltipPositioner);\n this.syncOptions();\n\n this.host.addEventListener('blur', this.handleBlur, true);\n this.host.addEventListener('click', this.handleClick, true);\n this.host.addEventListener('focus', this.handleFocus, true);\n\n // Show on init if open\n this.tooltipPositioner.hidden = !this.open;\n if (this.open) {\n this.show();\n }\n }\n\n componentDidUpdate() {\n this.syncOptions();\n }\n\n disconnectedCallback() {\n if (this.popover != null) {\n this.popover.destroy();\n }\n\n this.host.removeEventListener('blur', this.handleBlur, true);\n this.host.removeEventListener('click', this.handleClick, true);\n this.host.removeEventListener('focus', this.handleFocus, true);\n }\n\n /** Shows the tooltip. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible || this.disabled) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n this.popover?.show();\n }\n\n /** Shows the tooltip. */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible || this.disabled) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.isVisible = false;\n this.open = false;\n this.popover?.hide();\n }\n\n private getTarget() {\n // Get the first child that isn't a <style> or content slot\n const target = [...this.host.children].find(\n (el) => el.tagName.toLowerCase() !== 'style' && el.getAttribute('slot') !== 'content'\n ) as HTMLElement;\n\n if (target == null) {\n throw new Error('Invalid tooltip target: no child element was found.');\n }\n\n return target;\n }\n\n private handleBlur = () => {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n };\n\n private handleClick = () => {\n if (this.hasTrigger('click')) {\n this.open ? this.hide() : this.show();\n }\n };\n\n private handleFocus = () => {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n };\n\n private handleMouseOver = () => {\n if (this.hasTrigger('hover')) {\n this.show();\n }\n };\n\n private handleMouseOut = () => {\n if (this.hasTrigger('hover')) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n const oldTarget = this.target;\n const newTarget = this.getTarget();\n\n if (newTarget !== oldTarget) {\n if (oldTarget != null) {\n oldTarget.removeAttribute('aria-describedby');\n }\n newTarget.setAttribute('aria-describedby', this.componentId);\n }\n };\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n private syncOptions() {\n if (this.popover == null) return;\n\n this.popover.setOptions({\n placement: this.placement,\n distance: this.distance,\n skidding: this.skidding,\n transitionElement: this.tooltip,\n onAfterHide: () => this.sixAfterHide.emit(),\n onAfterShow: () => this.sixAfterShow.emit(),\n });\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>\n <slot onSlotchange={this.handleSlotChange} />\n <div ref={(el) => (this.tooltipPositioner = el)} class=\"tooltip-positioner\">\n <div\n part=\"base\"\n ref={(el) => (this.tooltip = el)}\n id={this.componentId}\n class={{\n tooltip: true,\n 'tooltip--open': this.open,\n }}\n role=\"tooltip\"\n aria-hidden={this.open ? 'false' : 'true'}\n >\n <slot name=\"content\">{this.content}</slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core';\nimport Popover from '../../utils/popover';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tooltip's target element. Only the first element will be used as the target.\n * @slot content - The tooltip's content. Alternatively, you can use the content prop.\n *\n * @part base - The component's base wrapper.\n */\n\n@Component({\n tag: 'six-tooltip',\n styleUrl: 'six-tooltip.scss',\n shadow: true,\n})\nexport class SixTooltip {\n private componentId = `tooltip-${++id}`;\n private isVisible = false;\n private popover?: Popover;\n private tooltipPositioner?: HTMLElement;\n private target?: HTMLElement;\n private tooltip?: HTMLElement;\n\n @Element() host!: HTMLSixTooltipElement;\n\n /** The tooltip's content. Alternatively, you can use the content slot. */\n @Prop() content = '';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside the viewport.\n */\n @Prop() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Set to true to disable the tooltip, so it won't show when triggered. */\n @Prop() disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @Prop() distance = 10;\n\n /** Indicates whether the tooltip is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @Prop() skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @Prop() trigger = 'hover focus';\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the tooltip begins to show. Calling `event.preventDefault()` will prevent it from being shown. */\n @Event({ eventName: 'six-tooltip-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has shown and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the tooltip begins to hide. Calling `event.preventDefault()` will prevent it from being hidden. */\n @Event({ eventName: 'six-tooltip-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has hidden and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentDidLoad() {\n if (this.tooltipPositioner == null) return;\n this.target = this.getTarget();\n this.popover = new Popover(this.target, this.tooltipPositioner, { strategy: 'fixed' });\n this.syncOptions();\n\n this.host.addEventListener('blur', this.handleBlur, true);\n this.host.addEventListener('click', this.handleClick, true);\n this.host.addEventListener('focus', this.handleFocus, true);\n\n // Show on init if open\n this.tooltipPositioner.hidden = !this.open;\n if (this.open) {\n this.show();\n }\n }\n\n componentDidUpdate() {\n this.syncOptions();\n }\n\n disconnectedCallback() {\n if (this.popover != null) {\n this.popover.destroy();\n }\n\n this.host.removeEventListener('blur', this.handleBlur, true);\n this.host.removeEventListener('click', this.handleClick, true);\n this.host.removeEventListener('focus', this.handleFocus, true);\n }\n\n /** Shows the tooltip. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible || this.disabled) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n this.popover?.show();\n }\n\n /** Shows the tooltip. */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible || this.disabled) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.isVisible = false;\n this.open = false;\n this.popover?.hide();\n }\n\n private getTarget() {\n // Get the first child that isn't a <style> or content slot\n const target = [...this.host.children].find(\n (el) => el.tagName.toLowerCase() !== 'style' && el.getAttribute('slot') !== 'content'\n ) as HTMLElement;\n\n if (target == null) {\n throw new Error('Invalid tooltip target: no child element was found.');\n }\n\n return target;\n }\n\n private handleBlur = () => {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n };\n\n private handleClick = () => {\n if (this.hasTrigger('click')) {\n this.open ? this.hide() : this.show();\n }\n };\n\n private handleFocus = () => {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n };\n\n private handleMouseOver = () => {\n if (this.hasTrigger('hover')) {\n this.show();\n }\n };\n\n private handleMouseOut = () => {\n if (this.hasTrigger('hover')) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n const oldTarget = this.target;\n const newTarget = this.getTarget();\n\n if (newTarget !== oldTarget) {\n if (oldTarget != null) {\n oldTarget.removeAttribute('aria-describedby');\n }\n newTarget.setAttribute('aria-describedby', this.componentId);\n }\n };\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n private syncOptions() {\n if (this.popover == null) return;\n\n this.popover.setOptions({\n placement: this.placement,\n distance: this.distance,\n skidding: this.skidding,\n transitionElement: this.tooltip,\n onAfterHide: () => this.sixAfterHide.emit(),\n onAfterShow: () => this.sixAfterShow.emit(),\n });\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>\n <slot onSlotchange={this.handleSlotChange} />\n <div ref={(el) => (this.tooltipPositioner = el)} class=\"tooltip-positioner\">\n <div\n part=\"base\"\n ref={(el) => (this.tooltip = el)}\n id={this.componentId}\n class={{\n tooltip: true,\n 'tooltip--open': this.open,\n }}\n role=\"tooltip\"\n aria-hidden={this.open ? 'false' : 'true'}\n >\n <slot name=\"content\">{this.content}</slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
const FormControl = (props, children) => {
|
|
3
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4
|
+
const errorMessages = (Array.isArray(props.errorText) ? props.errorText : [props.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
4
5
|
const hasLabel = props.label != null && props.label.trim() !== '' ? true : (_a = props.hasLabelSlot) !== null && _a !== void 0 ? _a : false;
|
|
5
6
|
const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : (_b = props.hasHelpTextSlot) !== null && _b !== void 0 ? _b : false;
|
|
7
|
+
const hasErrorText = (errorMessages.length > 0 || ((_c = props.hasErrorTextSlot) !== null && _c !== void 0 ? _c : false)) && ((_d = props.displayError) !== null && _d !== void 0 ? _d : false);
|
|
6
8
|
return (h("div", { part: "form-control", class: {
|
|
7
9
|
'form-control': true,
|
|
8
10
|
'form-control--small': props.size === 'small',
|
|
@@ -10,13 +12,13 @@ const FormControl = (props, children) => {
|
|
|
10
12
|
'form-control--large': props.size === 'large',
|
|
11
13
|
'form-control--has-label': hasLabel,
|
|
12
14
|
'form-control--has-help-text': hasHelpText,
|
|
13
|
-
'form-control--has-error-text':
|
|
14
|
-
'form-control--disabled': (
|
|
15
|
-
'form-control--invalid': ((
|
|
15
|
+
'form-control--has-error-text': hasErrorText,
|
|
16
|
+
'form-control--disabled': (_e = props.disabled) !== null && _e !== void 0 ? _e : false,
|
|
17
|
+
'form-control--invalid': ((_f = props.displayError) !== null && _f !== void 0 ? _f : false) && !props.disabled,
|
|
16
18
|
} }, h("label", { part: "label", id: props.labelId, class: {
|
|
17
19
|
'form-control__label': true,
|
|
18
|
-
'form-control__label__required': (
|
|
19
|
-
}, htmlFor: props.inputId, "aria-hidden": hasLabel ? 'false' : 'true', onClick: props.onLabelClick }, h("slot", { name: "label" }, props.label)), h("div", { class: "form-control__input" }, children), h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden":
|
|
20
|
+
'form-control__label__required': (_g = props.required) !== null && _g !== void 0 ? _g : false,
|
|
21
|
+
}, htmlFor: props.inputId, "aria-hidden": hasLabel ? 'false' : 'true', onClick: props.onLabelClick }, h("slot", { name: "label" }, props.label)), h("div", { class: "form-control__input" }, children), h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden": hasErrorText ? 'false' : 'true' }, h("slot", { name: "error-text" }, errorMessages.slice(0, (_h = props.errorTextCount) !== null && _h !== void 0 ? _h : 1).map((text) => (h("six-error", null, text))))), h("div", { part: "help-text", id: props.helpTextId, class: "form-control__help-text", "aria-hidden": hasHelpText ? 'false' : 'true' }, h("slot", { name: "help-text" }, props.helpText))));
|
|
20
22
|
};
|
|
21
23
|
export default FormControl;
|
|
22
24
|
//# sourceMappingURL=form-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.js","sourceRoot":"","sources":["../../../src/functional-components/form-control/form-control.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"form-control.js","sourceRoot":"","sources":["../../../src/functional-components/form-control/form-control.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAS,MAAM,eAAe,CAAC;AAoDzC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,QAAiB,EAAE,EAAE;;EACjE,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,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AAY,mCAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;KAC1E;IAED,aACE,IAAI,EAAC,OAAO,EACZ,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,KAAK,EAAE;QACL,qBAAqB,EAAE,IAAI;QAC3B,+BAA+B,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,KAAK;OACzD,EACD,OAAO,EAAE,KAAK,CAAC,OAAO,iBACT,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EACxC,OAAO,EAAE,KAAK,CAAC,YAAY;MAE3B,YAAM,IAAI,EAAC,OAAO,IAAE,KAAK,CAAC,KAAK,CAAQ,CACjC;IAER,WAAK,KAAK,EAAC,qBAAqB,IAAE,QAAQ,CAAO;IAEjD,WACE,IAAI,EAAC,YAAY,EACjB,EAAE,EAAE,KAAK,CAAC,WAAW,EACrB,KAAK,EAAC,0BAA0B,iBACnB,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;MAE5C,YAAM,IAAI,EAAC,YAAY,IACpB,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,MAAA,KAAK,CAAC,cAAc,mCAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/D,qBAAY,IAAI,CAAa,CAC9B,CAAC,CACG,CACH;IAEN,WACE,IAAI,EAAC,WAAW,EAChB,EAAE,EAAE,KAAK,CAAC,UAAU,EACpB,KAAK,EAAC,yBAAyB,iBAClB,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;MAE3C,YAAM,IAAI,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,CAAQ,CAC1C,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { h, VNode } from '@stencil/core';\n\nexport interface FormControlProps {\n /** The input id, used to map the input to the label */\n inputId: string;\n\n /** The size of the form control */\n size: 'small' | 'medium' | 'large';\n\n /** The label id, used to map the label to the input */\n labelId?: string;\n\n /** The label text (if the label slot isn't used) */\n label?: string;\n\n /** Whether a label slot has been provided. */\n hasLabelSlot?: boolean;\n\n /** The help text id, used to map the input to the help text */\n helpTextId?: string;\n\n /** The help text (if the help-text slot isn't used) */\n helpText?: string;\n\n /** Whether a help text slot has been provided. */\n hasHelpTextSlot?: boolean;\n\n /** Whether an error text slot has been provided. */\n hasErrorTextSlot?: boolean;\n\n /** The error text id, used to map the input to the help text */\n errorTextId?: string;\n\n /** The error text (if the error-text slot isn't used) */\n errorText?: string | string[];\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n errorTextCount?: number;\n\n /** Set to true to disable the input. */\n disabled?: boolean;\n\n /** Set if the value is required. */\n required?: boolean;\n\n /** Set if the error text is displayed. */\n displayError?: boolean;\n\n /** A function that gets called when the label is clicked. */\n onLabelClick?: (event: MouseEvent) => void;\n}\n\nconst FormControl = (props: FormControlProps, children: VNode[]) => {\n const errorMessages = (Array.isArray(props.errorText) ? props.errorText : [props.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n const hasLabel = props.label != null && props.label.trim() !== '' ? true : props.hasLabelSlot ?? false;\n const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : props.hasHelpTextSlot ?? false;\n const hasErrorText = (errorMessages.length > 0 || (props.hasErrorTextSlot ?? false)) && (props.displayError ?? false);\n\n return (\n <div\n part=\"form-control\"\n class={{\n 'form-control': true,\n 'form-control--small': props.size === 'small',\n 'form-control--medium': props.size === 'medium',\n 'form-control--large': props.size === 'large',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'form-control--has-error-text': hasErrorText,\n 'form-control--disabled': props.disabled ?? false,\n 'form-control--invalid': (props.displayError ?? false) && !props.disabled,\n }}\n >\n <label\n part=\"label\"\n id={props.labelId}\n class={{\n 'form-control__label': true,\n 'form-control__label__required': props.required ?? false,\n }}\n htmlFor={props.inputId}\n aria-hidden={hasLabel ? 'false' : 'true'}\n onClick={props.onLabelClick}\n >\n <slot name=\"label\">{props.label}</slot>\n </label>\n\n <div class=\"form-control__input\">{children}</div>\n\n <div\n part=\"error-text\"\n id={props.errorTextId}\n class=\"form-control__error-text\"\n aria-hidden={hasErrorText ? 'false' : 'true'}\n >\n <slot name=\"error-text\">\n {errorMessages.slice(0, props.errorTextCount ?? 1).map((text) => (\n <six-error>{text}</six-error>\n ))}\n </slot>\n </div>\n\n <div\n part=\"help-text\"\n id={props.helpTextId}\n class=\"form-control__help-text\"\n aria-hidden={hasHelpText ? 'false' : 'true'}\n >\n <slot name=\"help-text\">{props.helpText}</slot>\n </div>\n </div>\n );\n};\n\nexport default FormControl;\n"]}
|