@six-group/ui-library 0.0.0-insider.e148618 → 0.0.0-insider.e5360cd
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 +6 -3
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +2 -7
- 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 +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-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 +8 -5
- 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 +22 -4
- 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 +25 -4
- 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 +22 -11
- 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-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-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 +26 -5
- 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 +45 -4
- 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 +14 -3
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-datepicker.js +10 -8
- 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-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-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 +35 -18
- 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 +30 -4
- 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 -56
- 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 +6 -3
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +2 -7
- 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 +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-range.entry.js +6 -3
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +8 -5
- 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 +22 -4
- 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 -1
- 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-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 -16
- 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-ed381ad9.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-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-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-99e24daf.entry.js → p-a2035543.entry.js} +2 -2
- 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-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-2451cfdc.entry.js +0 -2
- package/dist/ui-library/p-2451cfdc.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-3d9de119.entry.js +0 -2
- package/dist/ui-library/p-3d9de119.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-bf87464b.entry.js +0 -2
- package/dist/ui-library/p-bf87464b.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-ed381ad9.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-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-99e24daf.entry.js.map → p-a2035543.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.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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AAC;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6B9B,CAAC,CAAC;EACJ,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;IAC7C,QAAQ;IACR,MAAM,MAAM,GAAG;MACb,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,yDA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AQ,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,OAAO,MAAM,qBAAqB,CAAC;AAG1C,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;GAUG;AAOH,MAAM,OAAO,UAAU;;IACb,gBAAW,GAAG,WAAW,EAAE,EAAE,EAAE,CAAC;IAChC,cAAS,GAAG,KAAK,CAAC;IAmJlB,eAAU,GA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,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,"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,CAA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';\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,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CACjG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KA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C,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"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animates a given `element` from the position and dimension of `fromElement` to
|
|
3
|
+
* its current position and dimension. Can be useful to implement the FLIP animation technique.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://css-tricks.com/animating-layouts-with-the-flip-technique/} for details on the FLIP technique.
|
|
6
|
+
*
|
|
7
|
+
* @param {Element} element - The element to animate.
|
|
8
|
+
* @param {Element} fromElement - The element representing the initial position and dimensions.
|
|
9
|
+
* @param {KeyframeAnimationOptions} [options={ duration: 150, easing: 'ease', fill: 'both' }] - Optional animation parameters.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export function flipAnimate(element, fromElement, options = {
|
|
13
|
+
duration: 150,
|
|
14
|
+
easing: 'ease',
|
|
15
|
+
fill: 'both',
|
|
16
|
+
}) {
|
|
17
|
+
const dimensionsTo = fromElement.getBoundingClientRect();
|
|
18
|
+
const dimensionsFrom = element.getBoundingClientRect();
|
|
19
|
+
const deltaX = dimensionsTo.left - dimensionsFrom.left;
|
|
20
|
+
const deltaY = dimensionsTo.top - dimensionsFrom.top;
|
|
21
|
+
const deltaW = dimensionsTo.width / dimensionsFrom.width;
|
|
22
|
+
const deltaH = dimensionsTo.height / dimensionsFrom.height;
|
|
23
|
+
element.animate([
|
|
24
|
+
{
|
|
25
|
+
transformOrigin: 'top left',
|
|
26
|
+
transform: `translate(${deltaX}px, ${deltaY}px) scale(${deltaW}, ${deltaH})`,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
transformOrigin: 'top left',
|
|
30
|
+
transform: 'none',
|
|
31
|
+
},
|
|
32
|
+
], options);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/utils/animation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,WAAoB,EACpB,UAAoC;EAClC,QAAQ,EAAE,GAAG;EACb,MAAM,EAAE,MAAM;EACd,IAAI,EAAE,MAAM;CACb;EAED,MAAM,YAAY,GAAG,WAAW,CAAC,qBAAqB,EAAE,CAAC;EACzD,MAAM,cAAc,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;EAEvD,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;EACvD,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC;EACrD,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;EACzD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;EAE3D,OAAO,CAAC,OAAO,CACb;IACE;MACE,eAAe,EAAE,UAAU;MAC3B,SAAS,EAAE,aAAa,MAAM,OAAO,MAAM,aAAa,MAAM,KAAK,MAAM,GAAG;KAC7E;IACD;MACE,eAAe,EAAE,UAAU;MAC3B,SAAS,EAAE,MAAM;KAClB;GACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Animates a given `element` from the position and dimension of `fromElement` to\n * its current position and dimension. Can be useful to implement the FLIP animation technique.\n *\n * @see {@link https://css-tricks.com/animating-layouts-with-the-flip-technique/} for details on the FLIP technique.\n *\n * @param {Element} element - The element to animate.\n * @param {Element} fromElement - The element representing the initial position and dimensions.\n * @param {KeyframeAnimationOptions} [options={ duration: 150, easing: 'ease', fill: 'both' }] - Optional animation parameters.\n *\n */\nexport function flipAnimate(\n element: Element,\n fromElement: Element,\n options: KeyframeAnimationOptions = {\n duration: 150,\n easing: 'ease',\n fill: 'both',\n }\n) {\n const dimensionsTo = fromElement.getBoundingClientRect();\n const dimensionsFrom = element.getBoundingClientRect();\n\n const deltaX = dimensionsTo.left - dimensionsFrom.left;\n const deltaY = dimensionsTo.top - dimensionsFrom.top;\n const deltaW = dimensionsTo.width / dimensionsFrom.width;\n const deltaH = dimensionsTo.height / dimensionsFrom.height;\n\n element.animate(\n [\n {\n transformOrigin: 'top left',\n transform: `translate(${deltaX}px, ${deltaY}px) scale(${deltaW}, ${deltaH})`,\n },\n {\n transformOrigin: 'top left',\n transform: 'none',\n },\n ],\n options\n );\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const FormControl = (props, children) => {
|
|
4
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5
|
+
const errorMessages = (Array.isArray(props.errorText) ? props.errorText : [props.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
5
6
|
const hasLabel = props.label != null && props.label.trim() !== '' ? true : (_a = props.hasLabelSlot) !== null && _a !== void 0 ? _a : false;
|
|
6
7
|
const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : (_b = props.hasHelpTextSlot) !== null && _b !== void 0 ? _b : false;
|
|
8
|
+
const hasErrorText = (errorMessages.length > 0 || ((_c = props.hasErrorTextSlot) !== null && _c !== void 0 ? _c : false)) && ((_d = props.displayError) !== null && _d !== void 0 ? _d : false);
|
|
7
9
|
return (h("div", { part: "form-control", class: {
|
|
8
10
|
'form-control': true,
|
|
9
11
|
'form-control--small': props.size === 'small',
|
|
@@ -11,17 +13,18 @@ const FormControl = (props, children) => {
|
|
|
11
13
|
'form-control--large': props.size === 'large',
|
|
12
14
|
'form-control--has-label': hasLabel,
|
|
13
15
|
'form-control--has-help-text': hasHelpText,
|
|
14
|
-
'form-control--has-error-text':
|
|
15
|
-
'form-control--disabled': (
|
|
16
|
-
'form-control--invalid': ((
|
|
16
|
+
'form-control--has-error-text': hasErrorText,
|
|
17
|
+
'form-control--disabled': (_e = props.disabled) !== null && _e !== void 0 ? _e : false,
|
|
18
|
+
'form-control--invalid': ((_f = props.displayError) !== null && _f !== void 0 ? _f : false) && !props.disabled,
|
|
17
19
|
} },
|
|
18
20
|
h("label", { part: "label", id: props.labelId, class: {
|
|
19
21
|
'form-control__label': true,
|
|
20
|
-
'form-control__label__required': (
|
|
22
|
+
'form-control__label__required': (_g = props.required) !== null && _g !== void 0 ? _g : false,
|
|
21
23
|
}, htmlFor: props.inputId, "aria-hidden": hasLabel ? 'false' : 'true', onClick: props.onLabelClick },
|
|
22
24
|
h("slot", { name: "label" }, props.label)),
|
|
23
25
|
h("div", { class: "form-control__input" }, children),
|
|
24
|
-
h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden":
|
|
26
|
+
h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden": hasErrorText ? 'false' : 'true' },
|
|
27
|
+
h("slot", { name: "error-text" }, errorMessages.slice(0, (_h = props.errorTextCount) !== null && _h !== void 0 ? _h : 1).map((text) => (h("six-error", null, text))))),
|
|
25
28
|
h("div", { part: "help-text", id: props.helpTextId, class: "form-control__help-text", "aria-hidden": hasHelpText ? 'false' : 'true' },
|
|
26
29
|
h("slot", { name: "help-text" }, props.helpText))));
|
|
27
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"form-control.js","mappings":";;
|
|
1
|
+
{"file":"form-control.js","mappings":";;MAoDM,WAAW,GAAG,CAAC,KAAuB,EAAE,QAAiB;;EAC7D,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,GA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AAI;QAC3B,+BAA+B,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,KAAK;OACzD,EACD,OAAO,EAAE,KAAK,CAAC,OAAO,iBACT,QAAQ,GAAG,OAAO,GAAG,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,GAAG,OAAO,GAAG,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,MAC1D,qBAAY,IAAI,CAAa,CAC9B,CAAC,CACG,CACH;IAEN,WACE,IAAI,EAAC,WAAW,EAChB,EAAE,EAAE,KAAK,CAAC,UAAU,EACpB,KAAK,EAAC,yBAAyB,iBAClB,WAAW,GAAG,OAAO,GAAG,MAAM;MAE3C,YAAM,IAAI,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,CAAQ,CAC1C,CACF,EACN;AACJ;;;;","names":[],"sources":["src/functional-components/form-control/form-control.tsx"],"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"],"version":3}
|
package/dist/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { SixDetails } from './six-details.js';
|
|
|
10
10
|
import { SixDialog } from './six-dialog.js';
|
|
11
11
|
import { SixDrawer } from './six-drawer.js';
|
|
12
12
|
import { SixDropdown } from './six-dropdown.js';
|
|
13
|
+
import { SixError } from './six-error.js';
|
|
13
14
|
import { SixErrorPage } from './six-error-page.js';
|
|
14
15
|
import { SixFileList } from './six-file-list.js';
|
|
15
16
|
import { SixFileListItem } from './six-file-list-item.js';
|
|
@@ -158,6 +159,7 @@ const defineCustomElements = (opts) => {
|
|
|
158
159
|
SixDialog,
|
|
159
160
|
SixDrawer,
|
|
160
161
|
SixDropdown,
|
|
162
|
+
SixError,
|
|
161
163
|
SixErrorPage,
|
|
162
164
|
SixFileList,
|
|
163
165
|
SixFileListItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":"
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAgBpD;;;SAGgB,eAAe,CAAC,QAAkB,EAAE,KAAsB;EACxE,IAAI;IACF,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,QAAQ,KAAK,CAAC,GAAG;MACf,KAAK,UAAU,CAAC;MAChB,KAAK,cAAc,CAAC;MACpB,KAAK,OAAO;QACV,OAAO,OAAO,CAAC;MACjB,KAAK,WAAW,CAAC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E,4CAA4C;IACrD,OAAO,EAAE,6CAA6C;IACtD,WAAW,EAAE,4BAA4B;GAC1C;EACD,EAAE,EAAE;IACF,QAAQ,EAAE,4CAA4C;IACtD,SAAS,EAAE,uDAAuD;IAClE,SAAS,EAAE,yDAAyD;IACpE,OAAO,EAAE,kEAAkE;IAC3E,KAAK,EAAE,2CAA2C;IAClD,GAAG,EAAE,yDAAyD;IAC9D,GAAG,EAAE,yDAAyD;IAC9D,YAAY,EAAE,6CAA6C;IAC3D,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,iDAAiD;IAC1D,WAAW,EAAE,kCAAkC;GAChD;EACD,EAAE,EAAE;IACF,QAAQ,EAAE,mCAAmC;IAC7C,SAAS,EAAE,0DAA0D;IACrE,SAAS,EAAE,yDAAyD;IACpE,OAAO,EAAE,uEAAuE;IAChF,KAAK,EAAE,kDAAkD;IACzD,GAAG,EAAE,0DAA0D;IAC/D,GAAG,EAAE,2DAA2D;IAChE,YAAY,EAAE,mCAAmC;IACjD,OAAO,EAAE,2DAA2D;IACpE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,yCAAyC;GACvD;EACD,EAAE,EAAE;IACF,QAAQ,EAAE,qCAAqC;IAC/C,SAAS,EAAE,yDAAyD;IACpE,SAAS,EAAE,6DAA6D;IACxE,OAAO,EAAE,uEAAuE;IAChF,KAAK,EAAE,iDAAiD;IACxD,GAAG,EAAE,2DAA2D;IAChE,GAAG,EAAE,yDAAyD;IAC9D,YAAY,EAAE,oCAAoC;IAClD,OAAO,EAAE,0DAA0D;IACnE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,4BAA4B;GAC1C;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/error-messages.ts"],"sourcesContent":["export type Language = 'de' | 'fr' | 'it' | 'en';\n\nconst dateFormat = new Intl.DateTimeFormat('de-CH');\n\nexport type ValidationError =\n | { key: 'required' }\n | { key: 'requiredtrue' }\n | { key: 'email'; requiredPattern: string }\n | { key: 'minlength'; requiredLength: number }\n | { key: 'maxlength'; requiredLength: number }\n | { key: 'pattern'; requiredPattern: string }\n | { key: 'min'; min: number }\n | { key: 'max'; max: number }\n | { key: 'mindate'; mindate: Date; actual: Date }\n | { key: 'maxdate'; maxdate: Date; actual: Date }\n | { key: 'invaliddate'; actual: Date }\n | { key: 'custom'; text: string };\n\n/**\n * Returns an error message for the given language and error.\n */\nexport function getErrorMessage(language: Language, error: ValidationError): string | undefined {\n try {\n const message = translation[language][error.key];\n switch (error.key) {\n case 'required':\n case 'requiredtrue':\n case 'email':\n return message;\n case 'minlength':\n case 'maxlength':\n return message.replace('{requiredLength}', String(error.requiredLength));\n case 'pattern':\n return message.replace('{pattern}', String(error.requiredPattern));\n case 'min':\n return message.replace('{min}', String(error.min));\n case 'max':\n return message.replace('{max}', String(error.max));\n case 'mindate':\n return message.replace('{mindate}', dateFormat.format(error.mindate));\n case 'maxdate':\n return message.replace('{maxdate}', dateFormat.format(error.maxdate));\n case 'invaliddate':\n return message;\n case 'custom':\n return error.text;\n }\n } catch (e) {\n console.warn(`no error message in '${language}' for error:`, error);\n return undefined;\n }\n}\n\nconst translation: Record<Language, Record<string, string>> = {\n en: {\n required: 'Please fill out this field.',\n minlength: 'Please enter at least {requiredLength} characters.',\n maxlength: 'Please enter no more than {requiredLength} characters.',\n pattern: 'Please enter a value that matches the pattern: {pattern}.',\n email: 'Please enter a valid email address.',\n min: 'Please enter a value greater than or equal to {min}.',\n max: 'Please enter a value less than or equal to {max}.',\n requiredtrue: 'Please check this field.',\n mindate: 'Please enter a date on or after {mindate}.',\n maxdate: 'Please enter a date on or before {maxdate}.',\n invaliddate: 'Please enter a valid date.',\n },\n fr: {\n required: \"Veuillez remplir ce champ s'il vous plaît.\",\n minlength: 'Veuillez entrer au moins {requiredLength} caractères.',\n maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',\n pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',\n email: 'Veuillez entrer une adresse email valide.',\n min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',\n max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',\n requiredtrue: \"Veuillez cocher cette case s'il vous plaît.\",\n mindate: 'Veuillez entrer une date le {mindate} ou après.',\n maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',\n invaliddate: 'Veuillez entrer une date valide.',\n },\n de: {\n required: 'Bitte füllen Sie dieses Feld aus.',\n minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',\n maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',\n pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',\n email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',\n max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',\n requiredtrue: 'Bitte aktivieren Sie dieses Feld.',\n mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',\n maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',\n invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',\n },\n it: {\n required: 'Si prega di compilare questo campo.',\n minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',\n maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',\n pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',\n email: 'Si prega di inserire un indirizzo email valido.',\n min: 'Si prega di inserire un valore maggiore o uguale a {min}.',\n max: 'Si prega di inserire un valore minore o uguale a {max}.',\n requiredtrue: 'Si prega di spuntare questo campo.',\n mindate: 'Si prega di inserire una data il {mindate} o successiva.',\n maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',\n invaliddate: 'Inserisci una data valida.',\n },\n};\n"],"version":3}
|
|
@@ -59,6 +59,6 @@ function scrollIntoView(element, container, direction = 'vertical', behavior = '
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export {
|
|
62
|
+
export { lockBodyScrolling as l, scrollIntoView as s, unlockBodyScrolling as u };
|
|
63
63
|
|
|
64
64
|
//# sourceMappingURL=scroll.js.map
|
|
@@ -3,7 +3,7 @@ import { h as hasSlot } from './slot.js';
|
|
|
3
3
|
import { s as submitForm } from './form.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './six-spinner2.js';
|
|
5
5
|
|
|
6
|
-
const sixButtonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer}.button{display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--six-border-width);border-radius:0;font-family:var(--six-font-family);font-weight:var(--six-font-weight-semibold);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:inherit}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button.button--disabled{pointer-events:none}.button ::slotted(six-icon){pointer-events:none}.button-wrapper--disabled{cursor:not-allowed}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button.button--secondary{background-color:var(--six-color-white);border-color:var(--six-color-web-rock-900);color:var(--six-color-web-rock-900)}.button.button--secondary.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--secondary:hover:not(.button--disabled){background-color:var(--six-color-web-rock-100)}.button.button--secondary:focus:not(.button--disabled){background-color:var(--six-color-web-rock-100);border-color:var(--six-color-web-rock-400)
|
|
6
|
+
const sixButtonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer}.button{display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--six-border-width);border-radius:0;font-family:var(--six-font-family);font-weight:var(--six-font-weight-semibold);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:inherit}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button.button--disabled{pointer-events:none}.button ::slotted(six-icon){pointer-events:none}.button-wrapper--disabled{cursor:not-allowed}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button:focus-visible{outline:var(--six-focus-ring);outline-offset:var(--six-focus-ring-offset)}.button.button--secondary{background-color:var(--six-color-white);border-color:var(--six-color-web-rock-900);color:var(--six-color-web-rock-900)}.button.button--secondary.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--secondary:hover:not(.button--disabled){background-color:var(--six-color-web-rock-100)}.button.button--secondary:focus:not(.button--disabled){background-color:var(--six-color-web-rock-100);border-color:var(--six-color-web-rock-400)}.button.button--secondary:active:not(.button--disabled){background-color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-900);border-width:1px}.button.button--primary{background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900);color:var(--six-color-white)}.button.button--primary.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--primary:hover:not(.button--disabled){background-color:var(--six-color-web-rock-800);border-color:var(--six-color-web-rock-800)}.button.button--primary:active:not(.button--disabled){background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900);opacity:70%}.button.button--link{background-color:transparent;border-color:transparent;color:var(--six-color-action-500)}.button.button--link.button--disabled{color:var(--six-color-web-rock-400)}.button.button--link:hover:not(.button--disabled){color:var(--six-color-action-600)}.button.button--link:active:not(.button--disabled){color:var(--six-color-action-light-to-be-defined)}.button.button--danger{background-color:var(--six-color-danger-800);border-color:var(--six-color-danger-800);color:var(--six-color-white)}.button.button--danger.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--danger:hover:not(.button--disabled){background-color:var(--six-color-danger-900);border-color:var(--six-color-danger-900)}.button.button--danger:active:not(.button--disabled){background-color:var(--six-color-danger-800);border-color:var(--six-color-danger-800);opacity:70%}.button.button--warning{background-color:var(--six-color-warning-700);border-color:var(--six-color-warning-700);color:var(--six-color-web-rock-900)}.button.button--warning.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--warning:hover:not(.button--disabled){background-color:var(--six-color-warning-800);border-color:var(--six-color-warning-800)}.button.button--warning:active:not(.button--disabled){background-color:var(--six-color-warning-700);border-color:var(--six-color-warning-700);opacity:70%}.button.button--success{background-color:var(--six-color-success-500);border-color:var(--six-color-success-500);color:var(--six-color-web-rock-900)}.button.button--success.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--success:hover:not(.button--disabled){background-color:var(--six-color-success-600);border-color:var(--six-color-success-600)}.button.button--success:active:not(.button--disabled){background-color:var(--six-color-success-500);border-color:var(--six-color-success-500);opacity:70%}.button.button--action{background-color:var(--six-color-action-500);border-color:var(--six-color-action-500);color:var(--six-color-white)}.button.button--action.button--disabled{background-color:var(--six-color-web-rock-400);border-color:var(--six-color-web-rock-400);color:var(--six-color-web-rock-700)}.button.button--action:hover:not(.button--disabled){background-color:var(--six-color-action-600);border-color:var(--six-color-action-600)}.button.button--action:active:not(.button--disabled){background-color:var(--six-color-action-500);border-color:var(--six-color-action-500);opacity:70%}.button--small{font-size:var(--six-button-font-size-small);height:var(--six-height-small);line-height:calc(var(--six-height-small) - var(--six-border-width) * 2)}.button--medium{font-size:var(--six-button-font-size-medium);height:var(--six-height-medium);line-height:calc(var(--six-height-medium) - var(--six-border-width) * 2)}.button--large{font-size:var(--six-button-font-size-large);height:var(--six-height-large);line-height:calc(var(--six-height-large) - var(--six-border-width) * 2)}.button--pill.button--small{border-radius:var(--six-height-small)}.button--pill.button--medium{border-radius:var(--six-height-medium)}.button--pill.button--large{border-radius:var(--six-height-large)}.button--circle{padding-left:0;padding-right:0;font-size:revert}.button--circle.button--small{width:var(--six-height-small);border-radius:50%}.button--circle.button--medium{width:var(--six-height-medium);border-radius:50%}.button--circle.button--large{width:var(--six-height-large);border-radius:50%}.button--circle .button__prefix,.button--circle .button__suffix,.button--circle .button__caret{display:none}.button--circle .button__prefix svg,.button--circle .button__suffix svg,.button--circle .button__caret svg{color:var(--six-color-web-rock-900)}.button--caret .button__suffix{display:none}.button--caret .button__caret{display:flex;align-items:center}.button--caret .button__caret svg{color:var(--six-color-web-rock-900);width:1em;height:1em}.button--primary .button__caret svg,.button--action .button__caret svg,.button--danger .button__caret svg{color:var(--six-color-white)}.button--loading{position:relative;cursor:wait}.button--loading .button__prefix,.button--loading .button__label,.button--loading .button__suffix,.button--loading .button__caret{visibility:hidden}.button--loading six-spinner{--indicator-color:currentColor;position:absolute;height:1em;width:1em;top:calc(50% - 0.5em);left:calc(50% - 0.5em)}.button ::slotted(six-badge){position:absolute;top:0;right:0;transform:translateY(-50%) translateX(50%);pointer-events:none}.button--has-label.button--small .button__label{padding:0 var(--six-spacing-small)}.button--has-label.button--medium .button__label{padding:0 var(--six-spacing-medium)}.button--has-label.button--large .button__label{padding:0 var(--six-spacing-large)}.button--has-prefix.button--small{padding-left:var(--six-spacing-x-small)}.button--has-prefix.button--small .button__label{padding-left:var(--six-spacing-x-small)}.button--has-prefix.button--medium{padding-left:var(--six-spacing-small)}.button--has-prefix.button--medium .button__label{padding-left:var(--six-spacing-small)}.button--has-prefix.button--large{padding-left:var(--six-spacing-small)}.button--has-prefix.button--large .button__label{padding-left:var(--six-spacing-small)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--six-spacing-x-small)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--six-spacing-x-small)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--six-spacing-small)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--six-spacing-small)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--six-spacing-small)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--six-spacing-small)}";
|
|
7
7
|
|
|
8
8
|
const SixButton$1 = /*@__PURE__*/ proxyCustomElement(class SixButton extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
@@ -72,7 +72,7 @@ const SixButton$1 = /*@__PURE__*/ proxyCustomElement(class SixButton extends HTM
|
|
|
72
72
|
const isLink = this.href != null;
|
|
73
73
|
const isButton = !isLink;
|
|
74
74
|
const Button = isLink ? 'a' : 'button';
|
|
75
|
-
return (h("div", { class: { 'button-wrapper--disabled': this.disabled } }, h(Button, { ref: (el) => (this.nativeButton = el), part: "base", class: {
|
|
75
|
+
return (h("div", { onClick: this.handleClick, class: { 'button-wrapper--disabled': this.disabled } }, h(Button, { ref: (el) => (this.nativeButton = el), part: "base", class: {
|
|
76
76
|
button: true,
|
|
77
77
|
// Types
|
|
78
78
|
'button--secondary': this.type === 'secondary',
|
|
@@ -96,7 +96,7 @@ const SixButton$1 = /*@__PURE__*/ proxyCustomElement(class SixButton extends HTM
|
|
|
96
96
|
'button--has-label': this.hasLabel,
|
|
97
97
|
'button--has-prefix': this.hasPrefix,
|
|
98
98
|
'button--has-suffix': this.hasSuffix,
|
|
99
|
-
}, disabled: isButton ? this.disabled : undefined, type: isButton ? (this.submit ? 'submit' : this.reset ? 'reset' : 'button') : undefined, name: isButton ? this.name : undefined, value: isButton ? this.value : undefined, href: isLink ? this.href : undefined, target: isLink && this.target != null ? this.target : undefined, download: isLink && this.download != null ? this.download : undefined, rel: isLink && this.target != null ? 'noreferrer noopener' : undefined, onBlur: this.handleBlur, onFocus: this.handleFocus,
|
|
99
|
+
}, disabled: isButton ? this.disabled : undefined, tabindex: this.disabled ? '-1' : undefined, type: isButton ? (this.submit ? 'submit' : this.reset ? 'reset' : 'button') : undefined, name: isButton ? this.name : undefined, value: isButton ? this.value : undefined, href: isLink ? this.href : undefined, target: isLink && this.target != null ? this.target : undefined, download: isLink && this.download != null ? this.download : undefined, rel: isLink && this.target != null ? 'noreferrer noopener' : undefined, onBlur: this.handleBlur, onFocus: this.handleFocus, "data-testid": "button" }, h("span", { part: "prefix", class: "button__prefix" }, h("slot", { onSlotchange: this.handleSlotChange, name: "prefix" })), h("span", { part: "label", class: "button__label" }, h("slot", { onSlotchange: this.handleSlotChange })), h("span", { part: "suffix", class: "button__suffix" }, h("slot", { onSlotchange: this.handleSlotChange, name: "suffix" })), this.caret && (h("span", { part: "caret", class: "button__caret" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "6 9 12 15 18 9" })))), this.loading && h("six-spinner", null))));
|
|
100
100
|
}
|
|
101
101
|
get host() { return this; }
|
|
102
102
|
static get style() { return sixButtonCss; }
|