@helixui/library 3.3.1 → 3.4.0
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/custom-elements.json +340 -71
- package/dist/components/hx-accordion/hx-accordion-item.d.ts +35 -0
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- package/dist/components/hx-alert/hx-alert.d.ts +11 -0
- package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
- package/dist/components/hx-alert/hx-alert.styles.d.ts.map +1 -1
- package/dist/components/hx-alert/index.js +1 -1
- package/dist/components/hx-badge/hx-badge.styles.d.ts.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-banner/hx-banner.d.ts +9 -1
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
- package/dist/components/hx-banner/index.js +1 -1
- package/dist/components/hx-button/hx-button.d.ts +11 -1
- package/dist/components/hx-button/hx-button.d.ts.map +1 -1
- package/dist/components/hx-button/index.js +1 -1
- package/dist/components/hx-button-group/hx-button-group.d.ts +13 -0
- package/dist/components/hx-button-group/hx-button-group.d.ts.map +1 -1
- package/dist/components/hx-button-group/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts +153 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +151 -2
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
- package/dist/components/hx-checkbox-group/index.js +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts +163 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-color-picker/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts +311 -2
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-combobox/index.js +1 -1
- package/dist/components/hx-data-table/hx-data-table.d.ts.map +1 -1
- package/dist/components/hx-data-table/index.js +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.d.ts +182 -56
- package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-dialog/hx-dialog.d.ts +240 -0
- package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
- package/dist/components/hx-dialog/index.js +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts +201 -0
- package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
- package/dist/components/hx-drawer/hx-drawer.styles.d.ts.map +1 -1
- package/dist/components/hx-drawer/index.js +1 -1
- package/dist/components/hx-dropdown/hx-dropdown.d.ts +168 -0
- package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
- package/dist/components/hx-dropdown/index.js +1 -1
- package/dist/components/hx-field/hx-field.d.ts +109 -0
- package/dist/components/hx-field/hx-field.d.ts.map +1 -1
- package/dist/components/hx-field/index.js +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.d.ts +16 -3
- package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -1
- package/dist/components/hx-icon-button/index.js +1 -1
- package/dist/components/hx-link/hx-link.d.ts +10 -1
- package/dist/components/hx-link/hx-link.d.ts.map +1 -1
- package/dist/components/hx-link/index.js +1 -1
- package/dist/components/hx-list/hx-list-item.d.ts +27 -1
- package/dist/components/hx-list/hx-list-item.d.ts.map +1 -1
- package/dist/components/hx-list/hx-list.d.ts +28 -0
- package/dist/components/hx-list/hx-list.d.ts.map +1 -1
- package/dist/components/hx-list/index.js +1 -1
- package/dist/components/hx-menu/hx-menu-divider.d.ts +10 -0
- package/dist/components/hx-menu/hx-menu-divider.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu-item.d.ts +99 -2
- package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu-item.styles.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu.d.ts +117 -2
- package/dist/components/hx-menu/hx-menu.d.ts.map +1 -1
- package/dist/components/hx-menu/index.js +1 -1
- package/dist/components/hx-meter/hx-meter.d.ts +39 -0
- package/dist/components/hx-meter/hx-meter.d.ts.map +1 -1
- package/dist/components/hx-meter/hx-meter.styles.d.ts.map +1 -1
- package/dist/components/hx-meter/index.js +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +132 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/index.js +1 -1
- package/dist/components/hx-phi-field/hx-phi-field.d.ts +0 -1
- package/dist/components/hx-phi-field/hx-phi-field.d.ts.map +1 -1
- package/dist/components/hx-popover/hx-popover.d.ts +91 -0
- package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
- package/dist/components/hx-popover/index.js +1 -1
- package/dist/components/hx-progress-bar/hx-progress-bar.d.ts +33 -0
- package/dist/components/hx-progress-bar/hx-progress-bar.d.ts.map +1 -1
- package/dist/components/hx-progress-bar/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts +152 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
- package/dist/components/hx-radio-group/hx-radio.d.ts +14 -0
- package/dist/components/hx-radio-group/hx-radio.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-select/hx-select.d.ts +304 -2
- package/dist/components/hx-select/hx-select.d.ts.map +1 -1
- package/dist/components/hx-select/hx-select.styles.d.ts.map +1 -1
- package/dist/components/hx-select/index.js +1 -1
- package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-spinner/hx-spinner.d.ts +14 -0
- package/dist/components/hx-spinner/hx-spinner.d.ts.map +1 -1
- package/dist/components/hx-spinner/index.js +1 -1
- package/dist/components/hx-split-button/hx-split-button.d.ts +94 -7
- package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
- package/dist/components/hx-split-button/index.js +1 -1
- package/dist/components/hx-stat/hx-stat.d.ts +28 -0
- package/dist/components/hx-stat/hx-stat.d.ts.map +1 -1
- package/dist/components/hx-stat/index.js +1 -1
- package/dist/components/hx-switch/hx-switch.d.ts +78 -1
- package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
- package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
- package/dist/components/hx-switch/index.js +1 -1
- package/dist/components/hx-table/hx-td.d.ts +30 -3
- package/dist/components/hx-table/hx-td.d.ts.map +1 -1
- package/dist/components/hx-table/hx-th.d.ts +39 -3
- package/dist/components/hx-table/hx-th.d.ts.map +1 -1
- package/dist/components/hx-table/hx-tr.d.ts +26 -0
- package/dist/components/hx-table/hx-tr.d.ts.map +1 -1
- package/dist/components/hx-table/index.js +1 -1
- package/dist/components/hx-tabs/hx-tab-panel.d.ts +34 -0
- package/dist/components/hx-tabs/hx-tab-panel.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tab.d.ts +45 -2
- package/dist/components/hx-tabs/hx-tab.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tab.styles.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tabs.d.ts +32 -2
- package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
- package/dist/components/hx-tabs/index.js +1 -1
- package/dist/components/hx-tag/hx-tag.styles.d.ts.map +1 -1
- package/dist/components/hx-tag/index.js +1 -1
- package/dist/components/hx-theme/hx-theme.d.ts +10 -5
- package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.d.ts +210 -2
- package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-time-picker/index.js +1 -1
- package/dist/components/hx-toast/hx-toast-stack.d.ts +14 -0
- package/dist/components/hx-toast/hx-toast-stack.d.ts.map +1 -1
- package/dist/components/hx-toast/hx-toast.d.ts +22 -3
- package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
- package/dist/components/hx-toast/index.js +1 -1
- package/dist/components/hx-toast/toast-factory.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +110 -0
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/index.js +1 -1
- package/dist/components/hx-tooltip/hx-tooltip.d.ts +52 -0
- package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
- package/dist/components/hx-tooltip/index.js +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.d.ts +117 -12
- package/dist/components/hx-tree-view/hx-tree-item.d.ts.map +1 -1
- package/dist/components/hx-tree-view/hx-tree-view.d.ts +87 -7
- package/dist/components/hx-tree-view/hx-tree-view.d.ts.map +1 -1
- package/dist/components/hx-tree-view/index.js +1 -1
- package/dist/css/helix-all.css +221 -1
- package/dist/css/helix-core.css +81 -0
- package/dist/css/helix-feedback.css +14 -0
- package/dist/css/helix-forms.css +109 -1
- package/dist/css/helix-overlay.css +17 -0
- package/dist/css/hx-alert.css +9 -0
- package/dist/css/hx-badge.css +28 -0
- package/dist/css/hx-checkbox.css +18 -0
- package/dist/css/hx-color-picker.css +25 -0
- package/dist/css/hx-date-picker.css +2 -1
- package/dist/css/hx-drawer.css +17 -0
- package/dist/css/hx-icon-button.css +30 -0
- package/dist/css/hx-meter.css +5 -0
- package/dist/css/hx-select.css +19 -0
- package/dist/css/hx-switch.css +17 -0
- package/dist/css/hx-tag.css +23 -0
- package/dist/css/hx-time-picker.css +11 -0
- package/dist/css/hx-toggle-button.css +17 -0
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +4 -1
- package/dist/index.js +38 -38
- package/dist/shared/aria-flatten-DY6v2vah.js +22 -0
- package/dist/shared/aria-flatten-DY6v2vah.js.map +1 -0
- package/dist/shared/aria-idref-CxvyzfQS.js +126 -0
- package/dist/shared/aria-idref-CxvyzfQS.js.map +1 -0
- package/dist/shared/hx-accordion-ZVzgDzTG.js.map +1 -1
- package/dist/shared/{hx-alert-CLn7CstP.js → hx-alert-Bto8-TIi.js} +55 -37
- package/dist/shared/hx-alert-Bto8-TIi.js.map +1 -0
- package/dist/shared/{hx-badge-CQXgOXJM.js → hx-badge-JlFtAdxS.js} +37 -9
- package/dist/shared/hx-badge-JlFtAdxS.js.map +1 -0
- package/dist/shared/{hx-banner-D3DzpfcP.js → hx-banner-fpRnciIO.js} +13 -5
- package/dist/shared/hx-banner-fpRnciIO.js.map +1 -0
- package/dist/shared/{hx-button-DPY6SPVT.js → hx-button-BOwAEcF1.js} +108 -85
- package/dist/shared/{hx-button-DPY6SPVT.js.map → hx-button-BOwAEcF1.js.map} +1 -1
- package/dist/shared/{hx-button-group-BI-QBqmO.js → hx-button-group-DcHP5MBv.js} +15 -16
- package/dist/shared/{hx-button-group-BI-QBqmO.js.map → hx-button-group-DcHP5MBv.js.map} +1 -1
- package/dist/shared/hx-checkbox-C48KYKFq.js +696 -0
- package/dist/shared/hx-checkbox-C48KYKFq.js.map +1 -0
- package/dist/shared/hx-checkbox-group-BJIAX3zU.js +496 -0
- package/dist/shared/hx-checkbox-group-BJIAX3zU.js.map +1 -0
- package/dist/shared/hx-color-picker-Dk4cBwYQ.js +1221 -0
- package/dist/shared/hx-color-picker-Dk4cBwYQ.js.map +1 -0
- package/dist/shared/hx-combobox-BTLO9qiK.js +1359 -0
- package/dist/shared/hx-combobox-BTLO9qiK.js.map +1 -0
- package/dist/shared/{hx-data-table-CLqVqdxr.js → hx-data-table-Ct3gQ6ya.js} +3 -2
- package/dist/shared/{hx-data-table-CLqVqdxr.js.map → hx-data-table-Ct3gQ6ya.js.map} +1 -1
- package/dist/shared/{hx-date-picker-2iRG1p74.js → hx-date-picker-CiR7FVnR.js} +542 -206
- package/dist/shared/hx-date-picker-CiR7FVnR.js.map +1 -0
- package/dist/shared/hx-dialog-AOZpHSuF.js +717 -0
- package/dist/shared/hx-dialog-AOZpHSuF.js.map +1 -0
- package/dist/shared/{hx-drawer-Y1Ui2IWJ.js → hx-drawer-DH6CdAN1.js} +300 -98
- package/dist/shared/hx-drawer-DH6CdAN1.js.map +1 -0
- package/dist/shared/hx-dropdown-DiLd40Lm.js +401 -0
- package/dist/shared/hx-dropdown-DiLd40Lm.js.map +1 -0
- package/dist/shared/{hx-field-B3Qo8OLS.js → hx-field-zw0U1KVi.js} +99 -38
- package/dist/shared/hx-field-zw0U1KVi.js.map +1 -0
- package/dist/shared/{hx-icon-button-CGNdQSFM.js → hx-icon-button-a6OpeQz5.js} +149 -68
- package/dist/shared/hx-icon-button-a6OpeQz5.js.map +1 -0
- package/dist/shared/{hx-link-C-O6vq0Q.js → hx-link-CMnZRUtQ.js} +55 -43
- package/dist/shared/hx-link-CMnZRUtQ.js.map +1 -0
- package/dist/shared/{hx-list-MyEhh8c7.js → hx-list-De66EtAP.js} +163 -107
- package/dist/shared/hx-list-De66EtAP.js.map +1 -0
- package/dist/shared/hx-menu-divider-BjiRIWKq.js +797 -0
- package/dist/shared/hx-menu-divider-BjiRIWKq.js.map +1 -0
- package/dist/shared/{hx-meter-BPscsw5t.js → hx-meter-BJdh6nrF.js} +105 -64
- package/dist/shared/hx-meter-BJdh6nrF.js.map +1 -0
- package/dist/shared/{hx-nav-item-xqRPOCWX.js → hx-nav-item-CODtUlew.js} +13 -9
- package/dist/shared/{hx-nav-item-xqRPOCWX.js.map → hx-nav-item-CODtUlew.js.map} +1 -1
- package/dist/shared/hx-overflow-menu-BQ4fiMYu.js +492 -0
- package/dist/shared/hx-overflow-menu-BQ4fiMYu.js.map +1 -0
- package/dist/shared/hx-phi-field-C19oxlrr.js.map +1 -1
- package/dist/shared/{hx-popover-B-FP3-wW.js → hx-popover-B9W8-tC0.js} +123 -66
- package/dist/shared/hx-popover-B9W8-tC0.js.map +1 -0
- package/dist/shared/hx-progress-bar-C8nDMdYa.js +290 -0
- package/dist/shared/hx-progress-bar-C8nDMdYa.js.map +1 -0
- package/dist/shared/hx-radio-Z1lV1zTO.js +822 -0
- package/dist/shared/hx-radio-Z1lV1zTO.js.map +1 -0
- package/dist/shared/hx-select-D18CnJ0e.js +1089 -0
- package/dist/shared/hx-select-D18CnJ0e.js.map +1 -0
- package/dist/shared/{hx-spinner-DL5AYr16.js → hx-spinner-BB0h2hKZ.js} +62 -34
- package/dist/shared/hx-spinner-BB0h2hKZ.js.map +1 -0
- package/dist/shared/{hx-split-button-Djnc5Aeg.js → hx-split-button-BoABoEm5.js} +153 -82
- package/dist/shared/hx-split-button-BoABoEm5.js.map +1 -0
- package/dist/shared/{hx-stat-WOcNV1Ry.js → hx-stat-Dtf9lz-O.js} +77 -47
- package/dist/shared/hx-stat-Dtf9lz-O.js.map +1 -0
- package/dist/shared/hx-switch-B6kr-EwE.js +540 -0
- package/dist/shared/hx-switch-B6kr-EwE.js.map +1 -0
- package/dist/shared/{hx-tab-panel-DspCrKqo.js → hx-tab-panel-BQtBXKLD.js} +255 -131
- package/dist/shared/hx-tab-panel-BQtBXKLD.js.map +1 -0
- package/dist/shared/{hx-tag-CNSmdyaK.js → hx-tag-C5aCUpVi.js} +63 -40
- package/dist/shared/hx-tag-C5aCUpVi.js.map +1 -0
- package/dist/shared/{hx-td-DnnEMIuA.js → hx-td-BGkFOJEK.js} +267 -123
- package/dist/shared/hx-td-BGkFOJEK.js.map +1 -0
- package/dist/shared/hx-theme-BsefFWTO.js.map +1 -1
- package/dist/shared/hx-time-picker-iwCD7rzW.js +1038 -0
- package/dist/shared/hx-time-picker-iwCD7rzW.js.map +1 -0
- package/dist/shared/{hx-toggle-button-iLiYrMbD.js → hx-toggle-button-BQ81EDkl.js} +226 -65
- package/dist/shared/hx-toggle-button-BQ81EDkl.js.map +1 -0
- package/dist/shared/{hx-tooltip-nYOv9OLu.js → hx-tooltip-DVqtKPCD.js} +68 -46
- package/dist/shared/hx-tooltip-DVqtKPCD.js.map +1 -0
- package/dist/shared/hx-tree-item-CHrUhuZL.js +925 -0
- package/dist/shared/hx-tree-item-CHrUhuZL.js.map +1 -0
- package/dist/shared/menu-roving-DmMnzJhn.js +14 -0
- package/dist/shared/menu-roving-DmMnzJhn.js.map +1 -0
- package/dist/shared/menu-tree-BNM0SYYq.js +42 -0
- package/dist/shared/menu-tree-BNM0SYYq.js.map +1 -0
- package/dist/shared/{toast-factory-YSznocIV.js → toast-factory-CL2BzdSB.js} +128 -77
- package/dist/shared/toast-factory-CL2BzdSB.js.map +1 -0
- package/dist/utils/aria-flatten.d.ts +56 -0
- package/dist/utils/aria-flatten.d.ts.map +1 -0
- package/dist/utils/aria-idref.d.ts +127 -0
- package/dist/utils/aria-idref.d.ts.map +1 -0
- package/dist/utils/menu-label.d.ts +18 -0
- package/dist/utils/menu-label.d.ts.map +1 -0
- package/dist/utils/menu-roving.d.ts +28 -0
- package/dist/utils/menu-roving.d.ts.map +1 -0
- package/dist/utils/menu-tree.d.ts +41 -0
- package/dist/utils/menu-tree.d.ts.map +1 -0
- package/dist/utils/tree-walk.d.ts +53 -0
- package/dist/utils/tree-walk.d.ts.map +1 -0
- package/figma-inventory.json +132 -20
- package/package.json +1 -1
- package/dist/shared/hx-alert-CLn7CstP.js.map +0 -1
- package/dist/shared/hx-badge-CQXgOXJM.js.map +0 -1
- package/dist/shared/hx-banner-D3DzpfcP.js.map +0 -1
- package/dist/shared/hx-checkbox-D7xma9YH.js +0 -524
- package/dist/shared/hx-checkbox-D7xma9YH.js.map +0 -1
- package/dist/shared/hx-checkbox-group-C9n315Ju.js +0 -323
- package/dist/shared/hx-checkbox-group-C9n315Ju.js.map +0 -1
- package/dist/shared/hx-color-picker-uRc865FJ.js +0 -882
- package/dist/shared/hx-color-picker-uRc865FJ.js.map +0 -1
- package/dist/shared/hx-combobox-DDzqNKEW.js +0 -924
- package/dist/shared/hx-combobox-DDzqNKEW.js.map +0 -1
- package/dist/shared/hx-date-picker-2iRG1p74.js.map +0 -1
- package/dist/shared/hx-dialog-DRN_1-Y-.js +0 -514
- package/dist/shared/hx-dialog-DRN_1-Y-.js.map +0 -1
- package/dist/shared/hx-drawer-Y1Ui2IWJ.js.map +0 -1
- package/dist/shared/hx-dropdown-LyaRc8Rf.js +0 -263
- package/dist/shared/hx-dropdown-LyaRc8Rf.js.map +0 -1
- package/dist/shared/hx-field-B3Qo8OLS.js.map +0 -1
- package/dist/shared/hx-icon-button-CGNdQSFM.js.map +0 -1
- package/dist/shared/hx-link-C-O6vq0Q.js.map +0 -1
- package/dist/shared/hx-list-MyEhh8c7.js.map +0 -1
- package/dist/shared/hx-menu-divider-C2omnPtj.js +0 -558
- package/dist/shared/hx-menu-divider-C2omnPtj.js.map +0 -1
- package/dist/shared/hx-meter-BPscsw5t.js.map +0 -1
- package/dist/shared/hx-overflow-menu-DCLsdIBy.js +0 -374
- package/dist/shared/hx-overflow-menu-DCLsdIBy.js.map +0 -1
- package/dist/shared/hx-popover-B-FP3-wW.js.map +0 -1
- package/dist/shared/hx-progress-bar-Bn3JEPUf.js +0 -258
- package/dist/shared/hx-progress-bar-Bn3JEPUf.js.map +0 -1
- package/dist/shared/hx-radio-CJvNU2yP.js +0 -621
- package/dist/shared/hx-radio-CJvNU2yP.js.map +0 -1
- package/dist/shared/hx-select-C8fEHQhC.js +0 -807
- package/dist/shared/hx-select-C8fEHQhC.js.map +0 -1
- package/dist/shared/hx-spinner-DL5AYr16.js.map +0 -1
- package/dist/shared/hx-split-button-Djnc5Aeg.js.map +0 -1
- package/dist/shared/hx-stat-WOcNV1Ry.js.map +0 -1
- package/dist/shared/hx-switch-BrZFaRue.js +0 -420
- package/dist/shared/hx-switch-BrZFaRue.js.map +0 -1
- package/dist/shared/hx-tab-panel-DspCrKqo.js.map +0 -1
- package/dist/shared/hx-tag-CNSmdyaK.js.map +0 -1
- package/dist/shared/hx-td-DnnEMIuA.js.map +0 -1
- package/dist/shared/hx-time-picker-BoEIZwzv.js +0 -688
- package/dist/shared/hx-time-picker-BoEIZwzv.js.map +0 -1
- package/dist/shared/hx-toggle-button-iLiYrMbD.js.map +0 -1
- package/dist/shared/hx-tooltip-nYOv9OLu.js.map +0 -1
- package/dist/shared/hx-tree-item-C2CiWuDE.js +0 -703
- package/dist/shared/hx-tree-item-C2CiWuDE.js.map +0 -1
- package/dist/shared/toast-factory-YSznocIV.js.map +0 -1
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
import { css as W, nothing as A, html as $ } from "lit";
|
|
2
|
+
import { property as d, state as u, query as K, customElement as X } from "lit/decorators.js";
|
|
3
|
+
import { F as J } from "./FormMixin-B8PXk5RQ.js";
|
|
4
|
+
import { classMap as z } from "lit/directives/class-map.js";
|
|
5
|
+
import { ifDefined as U } from "lit/directives/if-defined.js";
|
|
6
|
+
import { live as Y } from "lit/directives/live.js";
|
|
7
|
+
import { repeat as G } from "lit/directives/repeat.js";
|
|
8
|
+
import { b as Q } from "./forced-colors-CTEDFRGa.js";
|
|
9
|
+
import { s as Z, i as ee, r as j } from "./aria-idref-CxvyzfQS.js";
|
|
10
|
+
import { H as te } from "./helix-element-BNEYeiys.js";
|
|
11
|
+
import { c as re } from "./id-counter-DuX8vsui.js";
|
|
12
|
+
const ie = W`
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
:host([disabled]) {
|
|
18
|
+
opacity: var(--hx-opacity-disabled, 0.5);
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
* {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
.field {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--hx-space-1, 0.25rem);
|
|
28
|
+
font-family: var(--hx-time-picker-font-family, var(--hx-font-family-sans, sans-serif));
|
|
29
|
+
}
|
|
30
|
+
.field__label {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: baseline;
|
|
33
|
+
gap: var(--hx-space-1, 0.25rem);
|
|
34
|
+
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
35
|
+
font-weight: var(--hx-font-weight-medium, 500);
|
|
36
|
+
color: var(--hx-time-picker-label-color, var(--hx-color-text-strong, #202b39));
|
|
37
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
38
|
+
}
|
|
39
|
+
.field__required-marker {
|
|
40
|
+
color: var(--hx-time-picker-error-color, var(--hx-color-error-text, #c92a2a));
|
|
41
|
+
font-weight: var(--hx-font-weight-bold, 700);
|
|
42
|
+
}
|
|
43
|
+
.field__combobox {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
border: var(--hx-border-width-thin, 1px) solid
|
|
48
|
+
var(--hx-time-picker-border-color, var(--hx-color-border-strong, #66787b));
|
|
49
|
+
border-radius: var(--hx-time-picker-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
50
|
+
background-color: var(--hx-time-picker-bg, var(--hx-color-surface-default, #ffffff));
|
|
51
|
+
transition:
|
|
52
|
+
border-color var(--hx-transition-fast, 150ms ease),
|
|
53
|
+
box-shadow var(--hx-transition-fast, 150ms ease);
|
|
54
|
+
overflow: visible;
|
|
55
|
+
}
|
|
56
|
+
.field__combobox:focus-within {
|
|
57
|
+
border-color: var(--hx-time-picker-focus-ring-color, var(--hx-focus-ring-color));
|
|
58
|
+
box-shadow: 0 0 0 var(--hx-focus-ring-width, 2px)
|
|
59
|
+
color-mix(
|
|
60
|
+
in srgb,
|
|
61
|
+
var(--hx-time-picker-focus-ring-color, var(--hx-focus-ring-color))
|
|
62
|
+
calc(var(--hx-focus-ring-opacity, 0.25) * 100%),
|
|
63
|
+
transparent
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
.field--error .field__combobox {
|
|
67
|
+
border-color: var(--hx-time-picker-error-color, var(--hx-color-error-500, #e5493e));
|
|
68
|
+
}
|
|
69
|
+
.field--error .field__combobox:focus-within {
|
|
70
|
+
border-color: var(--hx-time-picker-error-color, var(--hx-color-error-500, #e5493e));
|
|
71
|
+
box-shadow: 0 0 0 var(--hx-focus-ring-width, 2px)
|
|
72
|
+
color-mix(
|
|
73
|
+
in srgb,
|
|
74
|
+
var(--hx-time-picker-error-color, var(--hx-color-error-500, #e5493e))
|
|
75
|
+
calc(var(--hx-focus-ring-opacity, 0.25) * 100%),
|
|
76
|
+
transparent
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
.field__input {
|
|
80
|
+
flex: 1;
|
|
81
|
+
border: none;
|
|
82
|
+
outline: none;
|
|
83
|
+
background: transparent;
|
|
84
|
+
padding: var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem);
|
|
85
|
+
font-family: inherit;
|
|
86
|
+
font-size: var(--hx-font-size-md, 1rem);
|
|
87
|
+
color: var(--hx-time-picker-color, var(--hx-color-text-strong, #202b39));
|
|
88
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
89
|
+
min-height: var(--hx-size-10, 2.5rem);
|
|
90
|
+
width: 100%;
|
|
91
|
+
cursor: text;
|
|
92
|
+
}
|
|
93
|
+
.field__input::placeholder {
|
|
94
|
+
color: var(--hx-color-text-placeholder, #66787b);
|
|
95
|
+
}
|
|
96
|
+
.field__input:disabled {
|
|
97
|
+
cursor: not-allowed;
|
|
98
|
+
}
|
|
99
|
+
.field__toggle {
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
border: none;
|
|
104
|
+
background: transparent;
|
|
105
|
+
padding: 0 var(--hx-space-3, 0.75rem);
|
|
106
|
+
color: var(--hx-time-picker-chevron-color, var(--hx-color-text-muted, #4a5362));
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
height: 100%;
|
|
109
|
+
min-height: var(--hx-size-10, 2.5rem);
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
border-inline-start: var(--hx-border-width-thin, 1px) solid
|
|
112
|
+
var(--hx-time-picker-border-color, var(--hx-color-border-strong, #66787b));
|
|
113
|
+
}
|
|
114
|
+
.field__toggle:focus-visible {
|
|
115
|
+
outline: var(--hx-focus-ring-width, 2px) solid
|
|
116
|
+
var(--hx-time-picker-focus-ring-color, var(--hx-focus-ring-color));
|
|
117
|
+
outline-offset: -2px;
|
|
118
|
+
border-radius: 0 var(--hx-time-picker-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
119
|
+
}
|
|
120
|
+
.field__listbox {
|
|
121
|
+
position: absolute;
|
|
122
|
+
top: calc(100% + var(--hx-space-1, 0.25rem));
|
|
123
|
+
inset-inline-start: 0;
|
|
124
|
+
inset-inline-end: 0;
|
|
125
|
+
z-index: var(--hx-z-index-dropdown, 1000);
|
|
126
|
+
background-color: var(--hx-time-picker-listbox-bg, var(--hx-color-surface-default, #ffffff));
|
|
127
|
+
border: var(--hx-border-width-thin, 1px) solid
|
|
128
|
+
var(--hx-time-picker-border-color, var(--hx-color-border-strong, #66787b));
|
|
129
|
+
border-radius: var(--hx-time-picker-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
130
|
+
box-shadow: var(
|
|
131
|
+
--hx-time-picker-listbox-shadow,
|
|
132
|
+
0 4px 16px color-mix(in srgb, var(--hx-color-neutral-900) 12%, transparent)
|
|
133
|
+
);
|
|
134
|
+
max-height: var(--hx-time-picker-listbox-max-height, 16rem);
|
|
135
|
+
overflow-y: auto;
|
|
136
|
+
padding: var(--hx-space-1, 0.25rem) 0;
|
|
137
|
+
list-style: none;
|
|
138
|
+
margin: 0;
|
|
139
|
+
}
|
|
140
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
141
|
+
.field__listbox {
|
|
142
|
+
animation: hx-listbox-enter var(--hx-transition-fast, 150ms ease) forwards;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
@keyframes hx-listbox-enter {
|
|
146
|
+
0% {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
transform: translateY(-0.25rem);
|
|
149
|
+
}
|
|
150
|
+
to {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
transform: translateY(0);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
.field__option {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
padding: var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem);
|
|
159
|
+
font-size: var(--hx-font-size-md, 1rem);
|
|
160
|
+
font-family: inherit;
|
|
161
|
+
color: var(--hx-time-picker-option-color, var(--hx-color-text-strong, #202b39));
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
transition: background-color var(--hx-transition-fast, 150ms ease);
|
|
164
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
165
|
+
}
|
|
166
|
+
.field__option:hover,
|
|
167
|
+
.field__option--active {
|
|
168
|
+
background-color: var(--hx-time-picker-option-hover-bg, var(--hx-color-primary-50, #ebf8f8));
|
|
169
|
+
color: var(--hx-time-picker-option-hover-color, var(--hx-color-primary-700, #0f6363));
|
|
170
|
+
}
|
|
171
|
+
.field__option--selected {
|
|
172
|
+
background-color: var(
|
|
173
|
+
--hx-time-picker-option-selected-bg,
|
|
174
|
+
var(--hx-color-primary-100, #dbf0f0)
|
|
175
|
+
);
|
|
176
|
+
color: var(--hx-time-picker-option-selected-color, var(--hx-color-primary-800, #07494a));
|
|
177
|
+
font-weight: var(--hx-font-weight-medium, 500);
|
|
178
|
+
}
|
|
179
|
+
.field__option--selected.field__option--active {
|
|
180
|
+
background-color: var(
|
|
181
|
+
--hx-time-picker-option-selected-bg,
|
|
182
|
+
var(--hx-color-primary-100, #dbf0f0)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
@media (prefers-reduced-motion: reduce) {
|
|
186
|
+
.field__combobox,
|
|
187
|
+
.field__option {
|
|
188
|
+
transition: none;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
.field__help-text,
|
|
192
|
+
.field__error {
|
|
193
|
+
font-size: var(--hx-font-size-xs, 0.75rem);
|
|
194
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
195
|
+
}
|
|
196
|
+
.field__help-text {
|
|
197
|
+
color: var(--hx-color-text-muted, #4a5362);
|
|
198
|
+
}
|
|
199
|
+
.field__error {
|
|
200
|
+
color: var(--hx-time-picker-error-color, var(--hx-color-error-text, #c92a2a));
|
|
201
|
+
}
|
|
202
|
+
.field__sr-only {
|
|
203
|
+
position: absolute;
|
|
204
|
+
width: 1px;
|
|
205
|
+
height: 1px;
|
|
206
|
+
padding: 0;
|
|
207
|
+
margin: -1px;
|
|
208
|
+
overflow: hidden;
|
|
209
|
+
clip: rect(0, 0, 0, 0);
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
border: 0;
|
|
212
|
+
}
|
|
213
|
+
@media (forced-colors: active) {
|
|
214
|
+
.field__combobox {
|
|
215
|
+
border-color: ButtonText;
|
|
216
|
+
background-color: Canvas;
|
|
217
|
+
}
|
|
218
|
+
.field__combobox:focus-within {
|
|
219
|
+
outline: 3px solid Highlight;
|
|
220
|
+
outline-offset: 0;
|
|
221
|
+
box-shadow: none;
|
|
222
|
+
}
|
|
223
|
+
.field--error .field__combobox {
|
|
224
|
+
border-color: LinkText;
|
|
225
|
+
}
|
|
226
|
+
.field--error .field__combobox:focus-within {
|
|
227
|
+
outline-color: Highlight;
|
|
228
|
+
box-shadow: none;
|
|
229
|
+
}
|
|
230
|
+
.field__toggle:focus-visible {
|
|
231
|
+
outline: 3px solid Highlight;
|
|
232
|
+
outline-offset: 0;
|
|
233
|
+
}
|
|
234
|
+
.field__listbox {
|
|
235
|
+
border-color: ButtonText;
|
|
236
|
+
background-color: Canvas;
|
|
237
|
+
box-shadow: none;
|
|
238
|
+
}
|
|
239
|
+
.field__option:hover,
|
|
240
|
+
.field__option--active {
|
|
241
|
+
background-color: Highlight;
|
|
242
|
+
color: HighlightText;
|
|
243
|
+
forced-color-adjust: none;
|
|
244
|
+
}
|
|
245
|
+
.field__option--selected {
|
|
246
|
+
background-color: Highlight;
|
|
247
|
+
color: HighlightText;
|
|
248
|
+
forced-color-adjust: none;
|
|
249
|
+
}
|
|
250
|
+
.field__error {
|
|
251
|
+
color: LinkText;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
`;
|
|
255
|
+
var se = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, n = (e, t, r, i) => {
|
|
256
|
+
for (var s = i > 1 ? void 0 : i ? oe(t, r) : t, o = e.length - 1, l; o >= 0; o--)
|
|
257
|
+
(l = e[o]) && (s = (i ? l(t, r, s) : l(s)) || s);
|
|
258
|
+
return i && s && se(t, r, s), s;
|
|
259
|
+
};
|
|
260
|
+
function m(e) {
|
|
261
|
+
const t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
262
|
+
if (!t) return null;
|
|
263
|
+
const r = parseInt(t[1] ?? "0", 10), i = parseInt(t[2] ?? "0", 10);
|
|
264
|
+
return r < 0 || r > 23 || i < 0 || i > 59 ? null : { hours: r, minutes: i };
|
|
265
|
+
}
|
|
266
|
+
function v(e, t) {
|
|
267
|
+
return `${String(e).padStart(2, "0")}:${String(t).padStart(2, "0")}`;
|
|
268
|
+
}
|
|
269
|
+
function R(e) {
|
|
270
|
+
const t = m(e);
|
|
271
|
+
if (!t) return e;
|
|
272
|
+
const { hours: r, minutes: i } = t, s = r < 12 ? "AM" : "PM", o = r % 12 === 0 ? 12 : r % 12;
|
|
273
|
+
return `${String(o).padStart(2, "0")}:${String(i).padStart(2, "0")} ${s}`;
|
|
274
|
+
}
|
|
275
|
+
function le(e, t, r, i) {
|
|
276
|
+
const s = m(e) ?? { hours: 0, minutes: 0 }, o = m(t) ?? { hours: 23, minutes: 59 }, l = s.hours * 60 + s.minutes, c = o.hours * 60 + o.minutes, f = Math.max(1, Math.round(r)), I = [];
|
|
277
|
+
for (let p = l; p <= c; p += f) {
|
|
278
|
+
const T = Math.floor(p / 60) % 24, g = p % 60, b = v(T, g);
|
|
279
|
+
I.push({
|
|
280
|
+
value: b,
|
|
281
|
+
label: i === "12h" ? R(b) : b
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return I;
|
|
285
|
+
}
|
|
286
|
+
function M(e, t, r) {
|
|
287
|
+
if (!e) return "";
|
|
288
|
+
const i = m(e);
|
|
289
|
+
if (!i) return "";
|
|
290
|
+
const s = i.hours * 60 + i.minutes, o = m(t) ?? { hours: 0, minutes: 0 }, l = m(r) ?? { hours: 23, minutes: 59 }, c = o.hours * 60 + o.minutes, f = l.hours * 60 + l.minutes;
|
|
291
|
+
return s < c ? v(o.hours, o.minutes) : s > f ? v(l.hours, l.minutes) : v(i.hours, i.minutes);
|
|
292
|
+
}
|
|
293
|
+
function ae(e) {
|
|
294
|
+
const t = e.trim().toUpperCase(), r = m(t);
|
|
295
|
+
if (r) return v(r.hours, r.minutes);
|
|
296
|
+
const i = /^(\d{1,2})(?::(\d{2}))?\s*(AM|PM)$/.exec(t) ?? /^(\d{1,2})(\d{2})\s*(AM|PM)$/.exec(t);
|
|
297
|
+
if (i) {
|
|
298
|
+
let s = parseInt(i[1] ?? "0", 10);
|
|
299
|
+
const o = i[2] !== void 0 ? parseInt(i[2], 10) : 0, l = i[3] ?? "";
|
|
300
|
+
return s < 1 || s > 12 || o < 0 || o > 59 ? null : (l === "AM" ? s = s === 12 ? 0 : s : s = s === 12 ? 12 : s + 12, v(s, o));
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
function E(e) {
|
|
305
|
+
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden"))
|
|
306
|
+
return "";
|
|
307
|
+
let t = "";
|
|
308
|
+
const r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, {
|
|
309
|
+
acceptNode(s) {
|
|
310
|
+
if (s.nodeType === Node.ELEMENT_NODE) {
|
|
311
|
+
const o = s;
|
|
312
|
+
return o.getAttribute("aria-hidden") === "true" || o.hasAttribute("hidden") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_SKIP;
|
|
313
|
+
}
|
|
314
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
let i = r.nextNode();
|
|
318
|
+
for (; i; )
|
|
319
|
+
t += i.textContent ?? "", i = r.nextNode();
|
|
320
|
+
return t.replace(/\s+/g, " ").trim();
|
|
321
|
+
}
|
|
322
|
+
const ne = re("hx-time-picker");
|
|
323
|
+
let a = class extends J(te) {
|
|
324
|
+
constructor() {
|
|
325
|
+
super(...arguments), this.name = "", this.value = "", this.min = "00:00", this.max = "23:59", this.step = 30, this.label = "", this.required = !1, this.disabled = !1, this.error = "", this.format = "12h", this.accessibleLabel = null, this._open = !1, this._activeIndex = -1, this._inputDisplayValue = "", this._hasLabelSlot = !1, this._hasErrorSlot = !1, this._hasHelpSlot = !1, this._labelSource = "none", this._labelSlotText = "", this._supportsIdrefRefs = !0, this._invalid = !1, this._announcedError = "", this._id = ne(), this._listboxId = `${this._id}-listbox`, this._errorId = `${this._id}-error`, this._helpId = `${this._id}-help`, this._labelId = `${this._id}-label`, this._consumerDescId = `${this._id}-consumer-desc`, this._cachedSlots = null, this._slotsKey = "", this._ariaMirror = null, this._helpSlotTextObserver = null, this._errorSlotTextObserver = null, this._hostDescribedByObserver = null, this._consumerLabelledBy = null, this._consumerDescribedBy = null, this._slottedLabelEls = [], this._labelSlotTextObserver = null, this._externalRefsObserver = null, this._handleOutsideClick = (e) => {
|
|
326
|
+
var t;
|
|
327
|
+
this.isConnected && !this.contains(e.target) && !((t = this.shadowRoot) != null && t.contains(e.target)) && this._closeListbox();
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Lazily generates and caches the list of time slots based on current min, max, step, and format.
|
|
332
|
+
* @internal
|
|
333
|
+
*/
|
|
334
|
+
get _slots() {
|
|
335
|
+
const e = `${this.min}|${this.max}|${this.step}|${this.format}`;
|
|
336
|
+
return (this._cachedSlots === null || e !== this._slotsKey) && (this._slotsKey = e, this._cachedSlots = le(this.min, this.max, this.step, this.format)), this._cachedSlots;
|
|
337
|
+
}
|
|
338
|
+
// ─── Lifecycle ───
|
|
339
|
+
connectedCallback() {
|
|
340
|
+
super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick);
|
|
341
|
+
const e = this.constructor;
|
|
342
|
+
this._supportsIdrefRefs = e.__testSupportsIdrefRefsOverride !== null ? e.__testSupportsIdrefRefsOverride : Z(this._internals), this._hostDescribedByObserver = new MutationObserver((t) => {
|
|
343
|
+
let r = !1;
|
|
344
|
+
for (const i of t) {
|
|
345
|
+
if (i.attributeName !== "aria-describedby") continue;
|
|
346
|
+
const s = i.oldValue, o = this.getAttribute("aria-describedby");
|
|
347
|
+
s !== null && o === null && (this._consumerDescribedBy = null, r = !0);
|
|
348
|
+
}
|
|
349
|
+
r && this._syncHostAriaSemantics();
|
|
350
|
+
}), this._hostDescribedByObserver.observe(this, {
|
|
351
|
+
attributes: !0,
|
|
352
|
+
attributeFilter: ["aria-describedby"],
|
|
353
|
+
attributeOldValue: !0
|
|
354
|
+
}), this._syncHostAriaSemantics(), this._ariaMirror = ee(this, () => {
|
|
355
|
+
this._syncHostAriaSemantics();
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
disconnectedCallback() {
|
|
359
|
+
var e, t, r, i, s, o;
|
|
360
|
+
super.disconnectedCallback(), document.removeEventListener("click", this._handleOutsideClick), (e = this._ariaMirror) == null || e.disconnect(), this._ariaMirror = null, (t = this._helpSlotTextObserver) == null || t.disconnect(), this._helpSlotTextObserver = null, (r = this._errorSlotTextObserver) == null || r.disconnect(), this._errorSlotTextObserver = null, (i = this._labelSlotTextObserver) == null || i.disconnect(), this._labelSlotTextObserver = null, (s = this._hostDescribedByObserver) == null || s.disconnect(), this._hostDescribedByObserver = null, (o = this._externalRefsObserver) == null || o.disconnect(), this._externalRefsObserver = null;
|
|
361
|
+
}
|
|
362
|
+
willUpdate(e) {
|
|
363
|
+
super.willUpdate(e), (e.has("value") || e.has("format")) && (this._inputDisplayValue = this.value ? this.format === "12h" ? R(this.value) : this.value : ""), (e.has("error") || !this.hasUpdated) && (this._announcedError = this.error ?? ""), e.has("label") && this._refreshLabelSource();
|
|
364
|
+
}
|
|
365
|
+
updated(e) {
|
|
366
|
+
super.updated(e), e.has("value") && this._internals.setFormValue(this.value || null), e.has("_open") && this._open && this._scrollActiveOptionIntoView(), this._syncHostAriaSemantics(), e.has("error") && (e.get("error") && this.error ? (this._announcedError = "", requestAnimationFrame(() => {
|
|
367
|
+
this._announcedError = this.error;
|
|
368
|
+
})) : this._announcedError = this.error);
|
|
369
|
+
}
|
|
370
|
+
firstUpdated(e) {
|
|
371
|
+
super.firstUpdated(e), this._seedSlotStateSync(), this._syncHostAriaSemantics(), !this.label && !this.accessibleLabel && !this._hasLabelSlot && !this.getAttribute("aria-label") && this.getAttribute("aria-labelledby");
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Synchronous slot-state seed. Mirrors the side effects of the three
|
|
375
|
+
* `_handle*SlotChange` handlers (label / help-text / error) but is driven by
|
|
376
|
+
* direct `slot.assignedNodes()` reads so we can populate state BEFORE the
|
|
377
|
+
* microtask `slotchange` events fire after the first render.
|
|
378
|
+
* @internal
|
|
379
|
+
*/
|
|
380
|
+
_seedSlotStateSync() {
|
|
381
|
+
const e = this.shadowRoot;
|
|
382
|
+
if (!e) return;
|
|
383
|
+
const t = e.querySelector('slot[name="label"]');
|
|
384
|
+
if (t) {
|
|
385
|
+
const s = this._readLabelSlotState(t);
|
|
386
|
+
this._hasLabelSlot = s.hasUsefulName, this._slottedLabelEls = s.elements, this._labelSlotText = s.text, this._installLabelSlotTextObserver(s.elements), this._refreshLabelSource();
|
|
387
|
+
}
|
|
388
|
+
const r = e.querySelector('slot[name="help-text"]');
|
|
389
|
+
r && (this._hasHelpSlot = this._readHelpSlotStateSync(r), this._installHelpSlotTextObserver(r));
|
|
390
|
+
const i = e.querySelector('slot[name="error"]');
|
|
391
|
+
i && (this._hasErrorSlot = this._readErrorSlotStateSync(i), this._installErrorSlotTextObserver(i));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Reads the label slot's assigned nodes and computes the discriminated
|
|
395
|
+
* naming state. An empty whitespace-only slot does NOT count as a useful
|
|
396
|
+
* name. Aggregates ALL assigned elements (not just the first); per AccName
|
|
397
|
+
* 1.2 §4.3.10, `aria-hidden="true"` and `[hidden]` elements contribute zero
|
|
398
|
+
* to the accessible name (their text is skipped during flattening).
|
|
399
|
+
* @internal
|
|
400
|
+
*/
|
|
401
|
+
_readLabelSlotState(e) {
|
|
402
|
+
const t = e.assignedNodes({ flatten: !0 }), r = [], i = [];
|
|
403
|
+
for (const o of t)
|
|
404
|
+
if (o.nodeType === Node.ELEMENT_NODE) {
|
|
405
|
+
const l = o;
|
|
406
|
+
if (r.push(l), l.getAttribute("aria-hidden") === "true") continue;
|
|
407
|
+
const c = E(l);
|
|
408
|
+
c && i.push(c);
|
|
409
|
+
} else if (o.nodeType === Node.TEXT_NODE) {
|
|
410
|
+
const l = (o.textContent ?? "").trim();
|
|
411
|
+
l && i.push(l);
|
|
412
|
+
}
|
|
413
|
+
const s = i.join(" ").replace(/\s+/g, " ").trim();
|
|
414
|
+
return {
|
|
415
|
+
hasUsefulName: s.length > 0,
|
|
416
|
+
elements: r,
|
|
417
|
+
text: s
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Re-evaluate the help-text slot's "has meaningful content" state from its
|
|
422
|
+
* current effective text. Mirrors the slotchange-handler logic but is
|
|
423
|
+
* invocable from the in-place mutation observer so that clearing
|
|
424
|
+
* `textContent` on the same slotted node flips `_hasHelpSlot` back to
|
|
425
|
+
* `false`. Uses AccName-aware flatten so descendants carrying
|
|
426
|
+
* `aria-hidden="true"` or `hidden` do NOT count toward "has meaningful
|
|
427
|
+
* content".
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
_readHelpSlotStateSync(e) {
|
|
431
|
+
const t = e.assignedNodes({ flatten: !0 });
|
|
432
|
+
for (const r of t)
|
|
433
|
+
if (r.nodeType === Node.TEXT_NODE) {
|
|
434
|
+
if ((r.textContent ?? "").trim().length > 0) return !0;
|
|
435
|
+
} else if (r.nodeType === Node.ELEMENT_NODE && E(r).length > 0)
|
|
436
|
+
return !0;
|
|
437
|
+
return !1;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Re-evaluate the error slot's "has meaningful content" state from its
|
|
441
|
+
* current effective text. AccName-aware so visibility-suppressed roots /
|
|
442
|
+
* descendants don't keep the field stuck in error state.
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
_readErrorSlotStateSync(e) {
|
|
446
|
+
const t = e.assignedNodes({ flatten: !0 });
|
|
447
|
+
for (const r of t)
|
|
448
|
+
if (r.nodeType === Node.TEXT_NODE) {
|
|
449
|
+
if ((r.textContent ?? "").trim().length > 0) return !0;
|
|
450
|
+
} else if (r.nodeType === Node.ELEMENT_NODE && E(r).length > 0)
|
|
451
|
+
return !0;
|
|
452
|
+
return !1;
|
|
453
|
+
}
|
|
454
|
+
// ─── Inner-input ARIA sync (W3C APG editable combobox) ───
|
|
455
|
+
/**
|
|
456
|
+
* (Re-)installs a `MutationObserver` against the deduped union of
|
|
457
|
+
* consumer-resolved label/description elements. Watches `characterData`,
|
|
458
|
+
* `childList`, `subtree`, and aria-hidden/hidden attribute toggles so any
|
|
459
|
+
* in-place text or visibility mutation triggers a fresh sync.
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
462
|
+
_installExternalRefsObserver(e) {
|
|
463
|
+
if (this._externalRefsObserver && (this._externalRefsObserver.disconnect(), this._externalRefsObserver = null), e.length === 0) return;
|
|
464
|
+
const t = new Set(e), r = new MutationObserver(() => {
|
|
465
|
+
this._syncHostAriaSemantics();
|
|
466
|
+
});
|
|
467
|
+
for (const i of t)
|
|
468
|
+
r.observe(i, {
|
|
469
|
+
characterData: !0,
|
|
470
|
+
subtree: !0,
|
|
471
|
+
childList: !0,
|
|
472
|
+
attributes: !0,
|
|
473
|
+
attributeFilter: ["aria-hidden", "hidden"]
|
|
474
|
+
});
|
|
475
|
+
this._externalRefsObserver = r;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Resolves consumer-supplied label/description IDREFs on the host and writes
|
|
479
|
+
* the canonical combobox ARIA onto the **inner `<input>`** per W3C APG
|
|
480
|
+
* editable combobox pattern. The inner input owns `role="combobox"`
|
|
481
|
+
* (replacing its implicit textbox role) and all combobox state ARIA so AT
|
|
482
|
+
* sees a single announced + focused surface.
|
|
483
|
+
*
|
|
484
|
+
* Cross-shadow naming uses a belt-and-suspenders strategy:
|
|
485
|
+
*
|
|
486
|
+
* 1. **Modern path** (`_supportsIdrefRefs === true`): consumer-resolved
|
|
487
|
+
* label/description elements are written onto
|
|
488
|
+
* `internals.ariaLabelledByElements` / `internals.ariaDescribedByElements`
|
|
489
|
+
* on the host. Host-level `aria-labelledby` / `aria-describedby`
|
|
490
|
+
* attributes are LEFT IN PLACE so AT walking up the DOM also sees them.
|
|
491
|
+
* The text content of the resolved elements is also flattened onto the
|
|
492
|
+
* inner input as `aria-label` so AT that does not walk up still
|
|
493
|
+
* announces the right name.
|
|
494
|
+
*
|
|
495
|
+
* 2. **Legacy fallback** (`_supportsIdrefRefs === false`): the resolved-
|
|
496
|
+
* element text is flattened onto the inner input as `aria-label` and
|
|
497
|
+
* mirrored into a synthesized in-shadow span pointed at by the inner
|
|
498
|
+
* input's `aria-describedby`.
|
|
499
|
+
*
|
|
500
|
+
* Writing `aria-labelledby="<light-DOM id>"` directly on the shadow-DOM
|
|
501
|
+
* inner input is INTENTIONALLY avoided: light-DOM ids do not resolve from
|
|
502
|
+
* inside a shadow root.
|
|
503
|
+
* @internal
|
|
504
|
+
*/
|
|
505
|
+
_syncHostAriaSemantics() {
|
|
506
|
+
var F, V, P, q;
|
|
507
|
+
const e = this._internals, t = this._inputEl;
|
|
508
|
+
if (!t) {
|
|
509
|
+
const h = !e.validity.valid || !!(this.error || this._hasErrorSlot);
|
|
510
|
+
this._invalid !== h && (this._invalid = h);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const r = this.getAttribute("aria-label"), i = r !== null && r.trim() || "", s = ((F = this.shadowRoot) == null ? void 0 : F.getElementById(this._labelId)) ?? null, o = this._slottedLabelEls, l = ((V = this.shadowRoot) == null ? void 0 : V.getElementById(this._helpId)) ?? null, c = ((P = this.shadowRoot) == null ? void 0 : P.getElementById(this._errorId)) ?? null, f = this.getAttribute("aria-labelledby");
|
|
514
|
+
this._consumerLabelledBy = f;
|
|
515
|
+
const I = this.getAttribute("aria-describedby");
|
|
516
|
+
this._consumerDescribedBy = I;
|
|
517
|
+
const p = j(this, this._consumerLabelledBy), T = p.length > 0, g = j(this, this._consumerDescribedBy);
|
|
518
|
+
this._installExternalRefsObserver([...p, ...g]);
|
|
519
|
+
const b = !!(this.error || this._hasErrorSlot), B = !e.validity.valid || b;
|
|
520
|
+
this._invalid !== B && (this._invalid = B);
|
|
521
|
+
const x = typeof this.accessibleLabel == "string" && this.accessibleLabel.trim().length > 0 ? this.accessibleLabel : null, k = (h) => h.getAttribute("aria-hidden") !== "true" && !h.hasAttribute("hidden"), y = [];
|
|
522
|
+
x || (y.push(...p.filter(k)), !T && !i && (this._labelSource === "slot" && o.length > 0 ? y.push(...o.filter(k)) : this._labelSource === "string" && s && y.push(s)));
|
|
523
|
+
const w = [...g.filter(k)];
|
|
524
|
+
if (l && !b && this._hasHelpSlot && w.push(l), c && b && w.push(c), this._supportsIdrefRefs) {
|
|
525
|
+
const h = e;
|
|
526
|
+
h.ariaLabelledByElements = y.length > 0 ? y : null, h.ariaDescribedByElements = w.length > 0 ? w : null, x ? e.ariaLabel = x : e.ariaLabel = null;
|
|
527
|
+
}
|
|
528
|
+
const D = (h) => h.filter(k).map((N) => E(N)).filter((N) => N.length > 0).join(" ");
|
|
529
|
+
let _ = null, L = null, H = "";
|
|
530
|
+
if (!x && T && (H = D(p)), x)
|
|
531
|
+
_ = x;
|
|
532
|
+
else if (H)
|
|
533
|
+
_ = H;
|
|
534
|
+
else if (i)
|
|
535
|
+
_ = i;
|
|
536
|
+
else if (this._labelSource === "slot") {
|
|
537
|
+
if (this._labelSlotText)
|
|
538
|
+
_ = this._labelSlotText;
|
|
539
|
+
else if (o.length > 0) {
|
|
540
|
+
const h = D(o);
|
|
541
|
+
h && (_ = h);
|
|
542
|
+
}
|
|
543
|
+
} else this._labelSource === "string" && (s != null && s.id ? L = s.id : this.label && (_ = this.label));
|
|
544
|
+
L ? (t.getAttribute("aria-labelledby") !== L && t.setAttribute("aria-labelledby", L), t.hasAttribute("aria-label") && t.removeAttribute("aria-label")) : _ ? (t.getAttribute("aria-label") !== _ && t.setAttribute("aria-label", _), t.hasAttribute("aria-labelledby") && t.removeAttribute("aria-labelledby")) : (t.hasAttribute("aria-label") && t.removeAttribute("aria-label"), t.hasAttribute("aria-labelledby") && t.removeAttribute("aria-labelledby"));
|
|
545
|
+
const O = ((q = this.shadowRoot) == null ? void 0 : q.getElementById(this._consumerDescId)) ?? null, C = D(g);
|
|
546
|
+
O && O.textContent !== C && (O.textContent = C);
|
|
547
|
+
const S = [];
|
|
548
|
+
if (C && O && S.push(this._consumerDescId), l && !b && this._hasHelpSlot && S.push(this._helpId), c && b && S.push(this._errorId), S.length > 0) {
|
|
549
|
+
const h = S.join(" ");
|
|
550
|
+
t.getAttribute("aria-describedby") !== h && t.setAttribute("aria-describedby", h);
|
|
551
|
+
} else t.hasAttribute("aria-describedby") && t.removeAttribute("aria-describedby");
|
|
552
|
+
t.hasAttribute("aria-description") && t.removeAttribute("aria-description");
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* (Re-)installs the help-text slot text/visibility observer.
|
|
556
|
+
* @internal
|
|
557
|
+
*/
|
|
558
|
+
_installHelpSlotTextObserver(e) {
|
|
559
|
+
var r;
|
|
560
|
+
if ((r = this._helpSlotTextObserver) == null || r.disconnect(), !e) {
|
|
561
|
+
this._helpSlotTextObserver = null;
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
const t = new MutationObserver(() => {
|
|
565
|
+
this._hasHelpSlot = this._readHelpSlotStateSync(e), this._syncHostAriaSemantics();
|
|
566
|
+
});
|
|
567
|
+
e.assignedNodes().forEach((i) => {
|
|
568
|
+
if (i.nodeType !== Node.ELEMENT_NODE) {
|
|
569
|
+
t.observe(i, {
|
|
570
|
+
characterData: !0,
|
|
571
|
+
childList: !0,
|
|
572
|
+
subtree: !0
|
|
573
|
+
});
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
t.observe(i, {
|
|
577
|
+
characterData: !0,
|
|
578
|
+
childList: !0,
|
|
579
|
+
subtree: !0,
|
|
580
|
+
attributes: !0,
|
|
581
|
+
attributeFilter: ["aria-hidden", "hidden"]
|
|
582
|
+
});
|
|
583
|
+
}), this._helpSlotTextObserver = t;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* (Re-)installs the error slot text/visibility observer.
|
|
587
|
+
* @internal
|
|
588
|
+
*/
|
|
589
|
+
_installErrorSlotTextObserver(e) {
|
|
590
|
+
var r;
|
|
591
|
+
if ((r = this._errorSlotTextObserver) == null || r.disconnect(), !e) {
|
|
592
|
+
this._errorSlotTextObserver = null;
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const t = new MutationObserver(() => {
|
|
596
|
+
this._hasErrorSlot = this._readErrorSlotStateSync(e), this._syncHostAriaSemantics();
|
|
597
|
+
});
|
|
598
|
+
e.assignedNodes().forEach((i) => {
|
|
599
|
+
if (i.nodeType !== Node.ELEMENT_NODE) {
|
|
600
|
+
t.observe(i, {
|
|
601
|
+
characterData: !0,
|
|
602
|
+
childList: !0,
|
|
603
|
+
subtree: !0
|
|
604
|
+
});
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
t.observe(i, {
|
|
608
|
+
characterData: !0,
|
|
609
|
+
childList: !0,
|
|
610
|
+
subtree: !0,
|
|
611
|
+
attributes: !0,
|
|
612
|
+
attributeFilter: ["aria-hidden", "hidden"]
|
|
613
|
+
});
|
|
614
|
+
}), this._errorSlotTextObserver = t;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* (Re-)installs the label slot text/visibility observer over the current
|
|
618
|
+
* set of slotted label elements.
|
|
619
|
+
* @internal
|
|
620
|
+
*/
|
|
621
|
+
_installLabelSlotTextObserver(e) {
|
|
622
|
+
var r;
|
|
623
|
+
if ((r = this._labelSlotTextObserver) == null || r.disconnect(), e.length === 0) {
|
|
624
|
+
this._labelSlotTextObserver = null;
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
const t = new MutationObserver(() => {
|
|
628
|
+
const i = [];
|
|
629
|
+
for (const o of e) {
|
|
630
|
+
if (o.getAttribute("aria-hidden") === "true") continue;
|
|
631
|
+
const l = E(o);
|
|
632
|
+
l && i.push(l);
|
|
633
|
+
}
|
|
634
|
+
const s = i.join(" ").replace(/\s+/g, " ").trim();
|
|
635
|
+
this._labelSlotText = s, this._hasLabelSlot = s.length > 0, this._refreshLabelSource(), this._syncHostAriaSemantics();
|
|
636
|
+
});
|
|
637
|
+
for (const i of e)
|
|
638
|
+
t.observe(i, {
|
|
639
|
+
characterData: !0,
|
|
640
|
+
childList: !0,
|
|
641
|
+
subtree: !0,
|
|
642
|
+
attributes: !0,
|
|
643
|
+
attributeFilter: ["aria-hidden", "hidden"]
|
|
644
|
+
});
|
|
645
|
+
this._labelSlotTextObserver = t;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Recomputes the discriminated label source. @internal
|
|
649
|
+
*/
|
|
650
|
+
_refreshLabelSource() {
|
|
651
|
+
this.label ? this._labelSource = "string" : this._hasLabelSlot ? this._labelSource = "slot" : this._labelSource = "none";
|
|
652
|
+
}
|
|
653
|
+
// ─── Form Integration ───
|
|
654
|
+
/** @internal */
|
|
655
|
+
_updateValidity() {
|
|
656
|
+
this.required && !this.value ? this._internals.setValidity(
|
|
657
|
+
{ valueMissing: !0 },
|
|
658
|
+
this.error || "Please select a time.",
|
|
659
|
+
this._inputEl ?? void 0
|
|
660
|
+
) : this._internals.setValidity({}), this._syncHostAriaSemantics();
|
|
661
|
+
}
|
|
662
|
+
/** @internal */
|
|
663
|
+
_onFormReset() {
|
|
664
|
+
this.value = "", this._inputDisplayValue = "", this._internals.setFormValue(null), this._closeListbox(), this._resetInteractionState();
|
|
665
|
+
}
|
|
666
|
+
/** @internal */
|
|
667
|
+
_onFormStateRestore(e, t) {
|
|
668
|
+
if (typeof e != "string") return;
|
|
669
|
+
const r = M(e, this.min, this.max);
|
|
670
|
+
this.value = r;
|
|
671
|
+
}
|
|
672
|
+
/** @internal */
|
|
673
|
+
_onFormDisabled(e) {
|
|
674
|
+
this.disabled = e;
|
|
675
|
+
}
|
|
676
|
+
// ─── Listbox helpers ───
|
|
677
|
+
/** @internal */
|
|
678
|
+
_openListbox() {
|
|
679
|
+
if (this._open) return;
|
|
680
|
+
const e = this._slots.findIndex((t) => t.value === this.value);
|
|
681
|
+
this._activeIndex = e >= 0 ? e : 0, this._open = !0;
|
|
682
|
+
}
|
|
683
|
+
/** @internal */
|
|
684
|
+
_closeListbox() {
|
|
685
|
+
this._open && (this._open = !1, this._activeIndex = -1, this._handleInteractionBlur());
|
|
686
|
+
}
|
|
687
|
+
/** @internal */
|
|
688
|
+
_scrollActiveOptionIntoView() {
|
|
689
|
+
if (!this._listboxEl) return;
|
|
690
|
+
const e = this._listboxEl.querySelector(".field__option--active");
|
|
691
|
+
e == null || e.scrollIntoView({ block: "nearest" });
|
|
692
|
+
}
|
|
693
|
+
/** @internal */
|
|
694
|
+
_selectSlot(e) {
|
|
695
|
+
const t = M(e.value, this.min, this.max);
|
|
696
|
+
this.value = t, this._handleInteractionInput(), this._closeListbox(), this._dispatchChange(t);
|
|
697
|
+
}
|
|
698
|
+
// ─── Slot tracking ───
|
|
699
|
+
/** @internal */
|
|
700
|
+
_handleLabelSlotChange(e) {
|
|
701
|
+
if (!(e.target instanceof HTMLSlotElement)) return;
|
|
702
|
+
const t = this._readLabelSlotState(e.target);
|
|
703
|
+
this._hasLabelSlot = t.hasUsefulName, this._slottedLabelEls = t.elements, this._labelSlotText = t.text, this._installLabelSlotTextObserver(t.elements), this._refreshLabelSource(), this._syncHostAriaSemantics();
|
|
704
|
+
}
|
|
705
|
+
/** @internal */
|
|
706
|
+
_handleErrorSlotChange(e) {
|
|
707
|
+
e.target instanceof HTMLSlotElement && (this._hasErrorSlot = this._readErrorSlotStateSync(e.target), this._installErrorSlotTextObserver(e.target), this._syncHostAriaSemantics());
|
|
708
|
+
}
|
|
709
|
+
/** @internal */
|
|
710
|
+
_handleHelpSlotChange(e) {
|
|
711
|
+
e.target instanceof HTMLSlotElement && (this._hasHelpSlot = this._readHelpSlotStateSync(e.target), this._installHelpSlotTextObserver(e.target), this._syncHostAriaSemantics());
|
|
712
|
+
}
|
|
713
|
+
// ─── Event Dispatch ───
|
|
714
|
+
/** @internal */
|
|
715
|
+
_dispatchChange(e) {
|
|
716
|
+
this.dispatchEvent(
|
|
717
|
+
new CustomEvent("hx-change", {
|
|
718
|
+
bubbles: !0,
|
|
719
|
+
composed: !0,
|
|
720
|
+
detail: { value: e }
|
|
721
|
+
})
|
|
722
|
+
);
|
|
723
|
+
}
|
|
724
|
+
// ─── Input Handlers ───
|
|
725
|
+
/** @internal */
|
|
726
|
+
_handleInputClick() {
|
|
727
|
+
this.disabled || this._openListbox();
|
|
728
|
+
}
|
|
729
|
+
/** @internal */
|
|
730
|
+
_handleToggleClick(e) {
|
|
731
|
+
var t;
|
|
732
|
+
e.stopPropagation(), !this.disabled && (this._open ? this._closeListbox() : (this._openListbox(), (t = this._inputEl) == null || t.focus()));
|
|
733
|
+
}
|
|
734
|
+
/** @internal */
|
|
735
|
+
_handleInputInput(e) {
|
|
736
|
+
const t = e.target;
|
|
737
|
+
this._inputDisplayValue = t.value, this._open || this._openListbox();
|
|
738
|
+
}
|
|
739
|
+
/** @internal */
|
|
740
|
+
_handleInputChange(e) {
|
|
741
|
+
const r = e.target.value.trim();
|
|
742
|
+
if (!r) {
|
|
743
|
+
this.value = "", this._handleInteractionInput(), this._handleInteractionBlur(), this._internals.setFormValue(null), this._dispatchChange("");
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
const i = ae(r);
|
|
747
|
+
if (i) {
|
|
748
|
+
const s = M(i, this.min, this.max);
|
|
749
|
+
this.value = s, this._handleInteractionInput(), this._handleInteractionBlur(), this._dispatchChange(s);
|
|
750
|
+
} else
|
|
751
|
+
this._inputDisplayValue = this.value ? this.format === "12h" ? R(this.value) : this.value : "";
|
|
752
|
+
}
|
|
753
|
+
/** @internal */
|
|
754
|
+
_handleInputKeyDown(e) {
|
|
755
|
+
switch (e.key) {
|
|
756
|
+
case "ArrowDown":
|
|
757
|
+
e.preventDefault(), this._open ? (this._activeIndex = Math.min(this._activeIndex + 1, this._slots.length - 1), this._scrollActiveOptionIntoView()) : this._openListbox();
|
|
758
|
+
break;
|
|
759
|
+
case "ArrowUp":
|
|
760
|
+
e.preventDefault(), this._open && (this._activeIndex = Math.max(this._activeIndex - 1, 0), this._scrollActiveOptionIntoView());
|
|
761
|
+
break;
|
|
762
|
+
case "Enter":
|
|
763
|
+
if (this._open && this._activeIndex >= 0) {
|
|
764
|
+
e.preventDefault();
|
|
765
|
+
const t = this._slots[this._activeIndex];
|
|
766
|
+
t && this._selectSlot(t);
|
|
767
|
+
}
|
|
768
|
+
break;
|
|
769
|
+
case "Escape":
|
|
770
|
+
e.preventDefault(), this._closeListbox();
|
|
771
|
+
break;
|
|
772
|
+
case "Home":
|
|
773
|
+
this._open && (e.preventDefault(), this._activeIndex = 0, this._scrollActiveOptionIntoView());
|
|
774
|
+
break;
|
|
775
|
+
case "End":
|
|
776
|
+
this._open && (e.preventDefault(), this._activeIndex = this._slots.length - 1, this._scrollActiveOptionIntoView());
|
|
777
|
+
break;
|
|
778
|
+
case "Tab":
|
|
779
|
+
this._closeListbox();
|
|
780
|
+
break;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
/** @internal */
|
|
784
|
+
_handleOptionPointerDown(e) {
|
|
785
|
+
e.preventDefault();
|
|
786
|
+
}
|
|
787
|
+
/** @internal */
|
|
788
|
+
_handleOptionClick(e) {
|
|
789
|
+
var t;
|
|
790
|
+
this._selectSlot(e), (t = this._inputEl) == null || t.focus();
|
|
791
|
+
}
|
|
792
|
+
/** @internal */
|
|
793
|
+
_handleOptionMouseEnter(e) {
|
|
794
|
+
this._activeIndex = e;
|
|
795
|
+
}
|
|
796
|
+
// ─── Public API ───
|
|
797
|
+
/** Moves focus to the time input element. */
|
|
798
|
+
focus(e) {
|
|
799
|
+
var t;
|
|
800
|
+
(t = this._inputEl) == null || t.focus(e);
|
|
801
|
+
}
|
|
802
|
+
// ─── Render ───
|
|
803
|
+
render() {
|
|
804
|
+
const e = !!this.error || this._hasErrorSlot, t = this._slots, r = {
|
|
805
|
+
field: !0,
|
|
806
|
+
"field--error": e,
|
|
807
|
+
"field--disabled": this.disabled,
|
|
808
|
+
"field--required": this.required
|
|
809
|
+
}, i = this._open && this._activeIndex >= 0 ? `${this._listboxId}-option-${this._activeIndex}` : void 0, s = this.format === "12h" ? "hh:mm AM" : "hh:mm";
|
|
810
|
+
return $`
|
|
811
|
+
<div part="field" class=${z(r)}>
|
|
812
|
+
<!-- Label -->
|
|
813
|
+
<slot name="label" @slotchange=${this._handleLabelSlotChange}>
|
|
814
|
+
${this.label ? $`
|
|
815
|
+
<label part="label" id=${this._labelId} class="field__label" for=${this._id}>
|
|
816
|
+
${this.label}
|
|
817
|
+
${this.required ? $`<span class="field__required-marker" aria-hidden="true">*</span>` : A}
|
|
818
|
+
</label>
|
|
819
|
+
` : A}
|
|
820
|
+
</slot>
|
|
821
|
+
|
|
822
|
+
<!-- Combobox wrapper; role="combobox" lives on the input per ARIA 1.2 -->
|
|
823
|
+
<div class="field__combobox">
|
|
824
|
+
<input
|
|
825
|
+
part="input"
|
|
826
|
+
class="field__input"
|
|
827
|
+
id=${this._id}
|
|
828
|
+
type="text"
|
|
829
|
+
inputmode="text"
|
|
830
|
+
autocomplete="off"
|
|
831
|
+
spellcheck="false"
|
|
832
|
+
role="combobox"
|
|
833
|
+
aria-expanded=${this._open ? "true" : "false"}
|
|
834
|
+
aria-haspopup="listbox"
|
|
835
|
+
.value=${Y(this._inputDisplayValue)}
|
|
836
|
+
placeholder=${s}
|
|
837
|
+
?required=${this.required}
|
|
838
|
+
?disabled=${this.disabled}
|
|
839
|
+
name=${U(this.name || void 0)}
|
|
840
|
+
aria-autocomplete="list"
|
|
841
|
+
aria-controls=${this._listboxId}
|
|
842
|
+
aria-activedescendant=${U(i)}
|
|
843
|
+
aria-invalid=${this._invalid ? "true" : "false"}
|
|
844
|
+
aria-required=${this.required ? "true" : "false"}
|
|
845
|
+
aria-disabled=${this.disabled ? "true" : A}
|
|
846
|
+
@click=${this._handleInputClick}
|
|
847
|
+
@input=${this._handleInputInput}
|
|
848
|
+
@change=${this._handleInputChange}
|
|
849
|
+
@keydown=${this._handleInputKeyDown}
|
|
850
|
+
/>
|
|
851
|
+
|
|
852
|
+
<!-- Toggle button -->
|
|
853
|
+
<button
|
|
854
|
+
part="toggle"
|
|
855
|
+
type="button"
|
|
856
|
+
class="field__toggle"
|
|
857
|
+
tabindex="-1"
|
|
858
|
+
aria-label=${this._open ? "Close time picker" : "Open time picker"}
|
|
859
|
+
?disabled=${this.disabled}
|
|
860
|
+
@click=${this._handleToggleClick}
|
|
861
|
+
>
|
|
862
|
+
<!-- Clock icon -->
|
|
863
|
+
<svg
|
|
864
|
+
width="16"
|
|
865
|
+
height="16"
|
|
866
|
+
viewBox="0 0 16 16"
|
|
867
|
+
fill="none"
|
|
868
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
869
|
+
aria-hidden="true"
|
|
870
|
+
>
|
|
871
|
+
<circle cx="8" cy="8" r="6.5" stroke="currentColor" stroke-width="1.25" />
|
|
872
|
+
<path
|
|
873
|
+
d="M8 4.5V8L10.5 10"
|
|
874
|
+
stroke="currentColor"
|
|
875
|
+
stroke-width="1.25"
|
|
876
|
+
stroke-linecap="round"
|
|
877
|
+
stroke-linejoin="round"
|
|
878
|
+
/>
|
|
879
|
+
</svg>
|
|
880
|
+
</button>
|
|
881
|
+
|
|
882
|
+
<!-- Dropdown listbox: always in DOM so aria-controls is never a dangling reference (WCAG 4.1.2). Hidden via the boolean hidden attribute when closed. -->
|
|
883
|
+
<ul
|
|
884
|
+
part="listbox"
|
|
885
|
+
class="field__listbox"
|
|
886
|
+
id=${this._listboxId}
|
|
887
|
+
role="listbox"
|
|
888
|
+
aria-label=${this.label || this.accessibleLabel || "Time options"}
|
|
889
|
+
?hidden=${!this._open}
|
|
890
|
+
>
|
|
891
|
+
${this._open ? G(
|
|
892
|
+
t,
|
|
893
|
+
(o) => o.value,
|
|
894
|
+
(o, l) => {
|
|
895
|
+
const c = o.value === this.value, f = l === this._activeIndex;
|
|
896
|
+
return $`
|
|
897
|
+
<li
|
|
898
|
+
part="option"
|
|
899
|
+
class=${z({
|
|
900
|
+
field__option: !0,
|
|
901
|
+
"field__option--selected": c,
|
|
902
|
+
"field__option--active": f
|
|
903
|
+
})}
|
|
904
|
+
id="${this._listboxId}-option-${l}"
|
|
905
|
+
role="option"
|
|
906
|
+
aria-selected=${c ? "true" : "false"}
|
|
907
|
+
@pointerdown=${this._handleOptionPointerDown}
|
|
908
|
+
@click=${() => this._handleOptionClick(o)}
|
|
909
|
+
@mouseenter=${() => this._handleOptionMouseEnter(l)}
|
|
910
|
+
>
|
|
911
|
+
${o.label}
|
|
912
|
+
</li>
|
|
913
|
+
`;
|
|
914
|
+
}
|
|
915
|
+
) : A}
|
|
916
|
+
</ul>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<!--
|
|
920
|
+
Persistent error live region. role="alert" is set from first paint
|
|
921
|
+
so the WAI-ARIA contract for live updates is honoured.
|
|
922
|
+
-->
|
|
923
|
+
<div
|
|
924
|
+
part="error"
|
|
925
|
+
class="field__error"
|
|
926
|
+
id=${this._errorId}
|
|
927
|
+
role="alert"
|
|
928
|
+
?hidden=${!e}
|
|
929
|
+
>
|
|
930
|
+
<slot name="error" @slotchange=${this._handleErrorSlotChange}
|
|
931
|
+
>${this._announcedError}</slot
|
|
932
|
+
>
|
|
933
|
+
</div>
|
|
934
|
+
|
|
935
|
+
<!-- Help slot -->
|
|
936
|
+
<div
|
|
937
|
+
part="help-text"
|
|
938
|
+
class="field__help-text"
|
|
939
|
+
id=${this._helpId}
|
|
940
|
+
?hidden=${!this._hasHelpSlot || e}
|
|
941
|
+
>
|
|
942
|
+
<slot name="help-text" @slotchange=${this._handleHelpSlotChange}></slot>
|
|
943
|
+
</div>
|
|
944
|
+
|
|
945
|
+
<!--
|
|
946
|
+
Synthesized in-shadow mirror of the consumer-resolved description
|
|
947
|
+
text. Its id is appended to the inner input's aria-describedby chain
|
|
948
|
+
so AT picks the consumer description up through the standard
|
|
949
|
+
described-by channel without needing aria-description (which W3C
|
|
950
|
+
AccName drops whenever aria-describedby is also present).
|
|
951
|
+
-->
|
|
952
|
+
<span id=${this._consumerDescId} class="field__sr-only" aria-hidden="false"></span>
|
|
953
|
+
</div>
|
|
954
|
+
`;
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
a.styles = [ie, Q];
|
|
958
|
+
a.formAssociated = !0;
|
|
959
|
+
a.__testSupportsIdrefRefsOverride = null;
|
|
960
|
+
n([
|
|
961
|
+
d({ type: String, reflect: !0 })
|
|
962
|
+
], a.prototype, "name", 2);
|
|
963
|
+
n([
|
|
964
|
+
d({ type: String, reflect: !0 })
|
|
965
|
+
], a.prototype, "value", 2);
|
|
966
|
+
n([
|
|
967
|
+
d({ type: String })
|
|
968
|
+
], a.prototype, "min", 2);
|
|
969
|
+
n([
|
|
970
|
+
d({ type: String })
|
|
971
|
+
], a.prototype, "max", 2);
|
|
972
|
+
n([
|
|
973
|
+
d({ type: Number })
|
|
974
|
+
], a.prototype, "step", 2);
|
|
975
|
+
n([
|
|
976
|
+
d({ type: String })
|
|
977
|
+
], a.prototype, "label", 2);
|
|
978
|
+
n([
|
|
979
|
+
d({ type: Boolean, reflect: !0 })
|
|
980
|
+
], a.prototype, "required", 2);
|
|
981
|
+
n([
|
|
982
|
+
d({ type: Boolean, reflect: !0 })
|
|
983
|
+
], a.prototype, "disabled", 2);
|
|
984
|
+
n([
|
|
985
|
+
d({ type: String })
|
|
986
|
+
], a.prototype, "error", 2);
|
|
987
|
+
n([
|
|
988
|
+
d({ type: String, reflect: !0 })
|
|
989
|
+
], a.prototype, "format", 2);
|
|
990
|
+
n([
|
|
991
|
+
d({ type: String, attribute: "accessible-label" })
|
|
992
|
+
], a.prototype, "accessibleLabel", 2);
|
|
993
|
+
n([
|
|
994
|
+
u()
|
|
995
|
+
], a.prototype, "_open", 2);
|
|
996
|
+
n([
|
|
997
|
+
u()
|
|
998
|
+
], a.prototype, "_activeIndex", 2);
|
|
999
|
+
n([
|
|
1000
|
+
u()
|
|
1001
|
+
], a.prototype, "_inputDisplayValue", 2);
|
|
1002
|
+
n([
|
|
1003
|
+
u()
|
|
1004
|
+
], a.prototype, "_hasLabelSlot", 2);
|
|
1005
|
+
n([
|
|
1006
|
+
u()
|
|
1007
|
+
], a.prototype, "_hasErrorSlot", 2);
|
|
1008
|
+
n([
|
|
1009
|
+
u()
|
|
1010
|
+
], a.prototype, "_hasHelpSlot", 2);
|
|
1011
|
+
n([
|
|
1012
|
+
u()
|
|
1013
|
+
], a.prototype, "_labelSource", 2);
|
|
1014
|
+
n([
|
|
1015
|
+
u()
|
|
1016
|
+
], a.prototype, "_labelSlotText", 2);
|
|
1017
|
+
n([
|
|
1018
|
+
u()
|
|
1019
|
+
], a.prototype, "_supportsIdrefRefs", 2);
|
|
1020
|
+
n([
|
|
1021
|
+
u()
|
|
1022
|
+
], a.prototype, "_invalid", 2);
|
|
1023
|
+
n([
|
|
1024
|
+
u()
|
|
1025
|
+
], a.prototype, "_announcedError", 2);
|
|
1026
|
+
n([
|
|
1027
|
+
K(".field__input")
|
|
1028
|
+
], a.prototype, "_inputEl", 2);
|
|
1029
|
+
n([
|
|
1030
|
+
K(".field__listbox")
|
|
1031
|
+
], a.prototype, "_listboxEl", 2);
|
|
1032
|
+
a = n([
|
|
1033
|
+
X("hx-time-picker")
|
|
1034
|
+
], a);
|
|
1035
|
+
export {
|
|
1036
|
+
a as H
|
|
1037
|
+
};
|
|
1038
|
+
//# sourceMappingURL=hx-time-picker-iwCD7rzW.js.map
|