@verbb/plugin-kit-web 2.0.15 → 2.0.17
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/CHANGELOG.md +80 -0
- package/README.md +3 -3
- package/custom-elements.json +39781 -0
- package/dist/base/pk-form-associated-element.d.ts +17 -1
- package/dist/base/pk-form-associated-element.d.ts.map +1 -1
- package/dist/chunks/{animate-with-class-ZJeCOKB3.js → animate-with-class-CsDwYnXL.js} +1 -1
- package/dist/chunks/{animate-with-class-ZJeCOKB3.js.map → animate-with-class-CsDwYnXL.js.map} +1 -1
- package/dist/chunks/{autoloader-DPX9YYZs.js → autoloader-dJO3tYOX.js} +2 -2
- package/dist/chunks/{autoloader-DPX9YYZs.js.map → autoloader-dJO3tYOX.js.map} +1 -1
- package/dist/chunks/{component-registry-CNB8PbP_.js → component-registry-D34fm8xW.js} +5 -1
- package/dist/chunks/component-registry-D34fm8xW.js.map +1 -0
- package/dist/chunks/{field-labels-CoU9dnNq.js → field-labels-CmuAW8Cl.js} +1 -1
- package/dist/chunks/{field-labels-CoU9dnNq.js.map → field-labels-CmuAW8Cl.js.map} +1 -1
- package/dist/chunks/option-filter-BQqr8Z21.js +121 -0
- package/dist/chunks/option-filter-BQqr8Z21.js.map +1 -0
- package/dist/chunks/pk-autocomplete-IFL-u-RF.js +992 -0
- package/dist/chunks/pk-autocomplete-IFL-u-RF.js.map +1 -0
- package/dist/chunks/{pk-button-BWGDkuzc.js → pk-button-BrH4u4Qr.js} +8 -4
- package/dist/chunks/{pk-button-BWGDkuzc.js.map → pk-button-BrH4u4Qr.js.map} +1 -1
- package/dist/chunks/{pk-calendar-enTOUCRD.js → pk-calendar-Z7Y0PjeY.js} +1 -1
- package/dist/chunks/{pk-calendar-enTOUCRD.js.map → pk-calendar-Z7Y0PjeY.js.map} +1 -1
- package/dist/chunks/{pk-checkbox-CvZwJZn_.js → pk-checkbox-CfV1uDdC.js} +2 -2
- package/dist/chunks/{pk-checkbox-CvZwJZn_.js.map → pk-checkbox-CfV1uDdC.js.map} +1 -1
- package/dist/chunks/{pk-checkbox-select-DclPoyDM.js → pk-checkbox-select-DeCaI3a0.js} +2 -2
- package/dist/chunks/{pk-checkbox-select-DclPoyDM.js.map → pk-checkbox-select-DeCaI3a0.js.map} +1 -1
- package/dist/chunks/{pk-code-editor-CrKnJUyi.js → pk-code-editor-BG9sG_Fy.js} +2 -2
- package/dist/chunks/{pk-code-editor-CrKnJUyi.js.map → pk-code-editor-BG9sG_Fy.js.map} +1 -1
- package/dist/chunks/{pk-color-input-DXdqNCK7.js → pk-color-input-CncNce1C.js} +2 -2
- package/dist/chunks/{pk-color-input-DXdqNCK7.js.map → pk-color-input-CncNce1C.js.map} +1 -1
- package/dist/chunks/{pk-combobox-BLft8AXy.js → pk-combobox-CL9En0J-.js} +49 -92
- package/dist/chunks/pk-combobox-CL9En0J-.js.map +1 -0
- package/dist/chunks/{pk-connect.styles-DshgIW2n.js → pk-connect.styles-BhW406jt.js} +1 -1
- package/dist/chunks/{pk-connect.styles-DshgIW2n.js.map → pk-connect.styles-BhW406jt.js.map} +1 -1
- package/dist/chunks/{pk-copy-button-asOLQkqk.js → pk-copy-button-BVaOLtYG.js} +46 -5
- package/dist/chunks/pk-copy-button-BVaOLtYG.js.map +1 -0
- package/dist/chunks/{pk-date-picker-Bri3kZ6x.js → pk-date-picker-BEAd4Ngl.js} +6 -6
- package/dist/chunks/{pk-date-picker-Bri3kZ6x.js.map → pk-date-picker-BEAd4Ngl.js.map} +1 -1
- package/dist/chunks/{pk-dialog-BbEfvb0g.js → pk-dialog-VMQqLW1f.js} +2 -2
- package/dist/chunks/{pk-dialog-BbEfvb0g.js.map → pk-dialog-VMQqLW1f.js.map} +1 -1
- package/dist/chunks/{pk-dropdown-item-BoZTGWMU.js → pk-dropdown-item-D9OaG5o-.js} +9 -5
- package/dist/chunks/pk-dropdown-item-D9OaG5o-.js.map +1 -0
- package/dist/chunks/{pk-dropdown-label-Da28F917.js → pk-dropdown-label-CRNWMWQd.js} +1 -1
- package/dist/chunks/{pk-dropdown-label-Da28F917.js.map → pk-dropdown-label-CRNWMWQd.js.map} +1 -1
- package/dist/chunks/{pk-dropdown-menu-CfZc7dIz.js → pk-dropdown-menu-DW1wI8xQ.js} +6 -4
- package/dist/chunks/pk-dropdown-menu-DW1wI8xQ.js.map +1 -0
- package/dist/chunks/{pk-editable-table-Cn4WXqAo.js → pk-editable-table-BoqfveXO.js} +17 -19
- package/dist/chunks/pk-editable-table-BoqfveXO.js.map +1 -0
- package/dist/chunks/{pk-field-NL4KdFZC.js → pk-field-UAlMq6mQ.js} +2 -2
- package/dist/chunks/{pk-field-NL4KdFZC.js.map → pk-field-UAlMq6mQ.js.map} +1 -1
- package/dist/chunks/{pk-form-associated-element-9M2NzOE2.js → pk-form-associated-element-CCQALRGB.js} +14 -2
- package/dist/chunks/pk-form-associated-element-CCQALRGB.js.map +1 -0
- package/dist/chunks/pk-image-browser-DwiCFOIG.js +1364 -0
- package/dist/chunks/pk-image-browser-DwiCFOIG.js.map +1 -0
- package/dist/chunks/{pk-input-DDkIXOkt.js → pk-input-CF_icEtR.js} +76 -30
- package/dist/chunks/pk-input-CF_icEtR.js.map +1 -0
- package/dist/chunks/{pk-input-group-CRPSBFhX.js → pk-input-group-BLqKPnfc.js} +2 -2
- package/dist/chunks/{pk-input-group-CRPSBFhX.js.map → pk-input-group-BLqKPnfc.js.map} +1 -1
- package/dist/chunks/{pk-input-group-addon-B0StOmTJ.js → pk-input-group-addon-ClBkGmAw.js} +1 -1
- package/dist/chunks/{pk-input-group-addon-B0StOmTJ.js.map → pk-input-group-addon-ClBkGmAw.js.map} +1 -1
- package/dist/chunks/{pk-input-group-button-CnKajvsP.js → pk-input-group-button-CHQHsWd4.js} +1 -1
- package/dist/chunks/{pk-input-group-button-CnKajvsP.js.map → pk-input-group-button-CHQHsWd4.js.map} +1 -1
- package/dist/chunks/{pk-input-group-input-mllffsjQ.js → pk-input-group-input-oNnqMBGU.js} +1 -1
- package/dist/chunks/{pk-input-group-input-mllffsjQ.js.map → pk-input-group-input-oNnqMBGU.js.map} +1 -1
- package/dist/chunks/{pk-input-group-text-DvaPJvh2.js → pk-input-group-text-HUxlXROB.js} +1 -1
- package/dist/chunks/{pk-input-group-text-DvaPJvh2.js.map → pk-input-group-text-HUxlXROB.js.map} +1 -1
- package/dist/chunks/{pk-input-group-textarea-CqYv8tUQ.js → pk-input-group-textarea-Cl2FNuw-.js} +1 -1
- package/dist/chunks/{pk-input-group-textarea-CqYv8tUQ.js.map → pk-input-group-textarea-Cl2FNuw-.js.map} +1 -1
- package/dist/chunks/{pk-lightswitch-DI1BeCmA.js → pk-lightswitch-D1qEFRxK.js} +3 -3
- package/dist/chunks/{pk-lightswitch-DI1BeCmA.js.map → pk-lightswitch-D1qEFRxK.js.map} +1 -1
- package/dist/chunks/{pk-option-MGj9SKOK.js → pk-option-DQZHV9jL.js} +3 -2
- package/dist/chunks/pk-option-DQZHV9jL.js.map +1 -0
- package/dist/chunks/{pk-option-group-Cs6N7mlP.js → pk-option-group-CCzJkBFp.js} +1 -1
- package/dist/chunks/{pk-option-group-Cs6N7mlP.js.map → pk-option-group-CCzJkBFp.js.map} +1 -1
- package/dist/chunks/{pk-popover-duyNosk2.js → pk-popover-D3jkHfwB.js} +4 -4
- package/dist/chunks/pk-popover-D3jkHfwB.js.map +1 -0
- package/dist/chunks/{pk-popup-B9AgBC2V.js → pk-popup-B65tZMQH.js} +23 -1
- package/dist/chunks/pk-popup-B65tZMQH.js.map +1 -0
- package/dist/chunks/{pk-radio-BK4D2Htu.js → pk-radio-B5XkMHy3.js} +1 -1
- package/dist/chunks/{pk-radio-BK4D2Htu.js.map → pk-radio-B5XkMHy3.js.map} +1 -1
- package/dist/chunks/{pk-radio-group-BRJIjOsR.js → pk-radio-group-ByrxGLdX.js} +3 -3
- package/dist/chunks/{pk-radio-group-BRJIjOsR.js.map → pk-radio-group-ByrxGLdX.js.map} +1 -1
- package/dist/chunks/{pk-scroll-area-BR6ckorh.js → pk-scroll-area-CdfNxYz8.js} +1 -1
- package/dist/chunks/{pk-scroll-area-BR6ckorh.js.map → pk-scroll-area-CdfNxYz8.js.map} +1 -1
- package/dist/chunks/{pk-select-C1s0OJr0.js → pk-select-CdQdhnZN.js} +7 -5
- package/dist/chunks/pk-select-CdQdhnZN.js.map +1 -0
- package/dist/chunks/{pk-separator-CHij3vEG.js → pk-separator-N-VyjYE6.js} +1 -1
- package/dist/chunks/{pk-separator-CHij3vEG.js.map → pk-separator-N-VyjYE6.js.map} +1 -1
- package/dist/chunks/{pk-status-D1IzTSI2.js → pk-status-BehQARDv.js} +1 -1
- package/dist/chunks/{pk-status-D1IzTSI2.js.map → pk-status-BehQARDv.js.map} +1 -1
- package/dist/chunks/{pk-tab-2MHunhlF.js → pk-tab-CTloD18e.js} +1 -1
- package/dist/chunks/{pk-tab-2MHunhlF.js.map → pk-tab-CTloD18e.js.map} +1 -1
- package/dist/chunks/{pk-tab-heading-BV6m_sT-.js → pk-tab-heading-Cjcgebxn.js} +1 -1
- package/dist/chunks/{pk-tab-heading-BV6m_sT-.js.map → pk-tab-heading-Cjcgebxn.js.map} +1 -1
- package/dist/chunks/{pk-tab-panel-C6FxQw9q.js → pk-tab-panel-CkKU5-Ah.js} +1 -1
- package/dist/chunks/{pk-tab-panel-C6FxQw9q.js.map → pk-tab-panel-CkKU5-Ah.js.map} +1 -1
- package/dist/chunks/{pk-tabs-BTE63uK9.js → pk-tabs-BgEBki1q.js} +1 -1
- package/dist/chunks/{pk-tabs-BTE63uK9.js.map → pk-tabs-BgEBki1q.js.map} +1 -1
- package/dist/chunks/{pk-textarea-BcAyZYC-.js → pk-textarea-CYM2tK88.js} +3 -3
- package/dist/chunks/{pk-textarea-BcAyZYC-.js.map → pk-textarea-CYM2tK88.js.map} +1 -1
- package/dist/chunks/{pk-time-picker-5D4nmig2.js → pk-time-picker-CebRqydV.js} +3 -3
- package/dist/chunks/{pk-time-picker-5D4nmig2.js.map → pk-time-picker-CebRqydV.js.map} +1 -1
- package/dist/chunks/{pk-tiptap-content-BPd4GO6c.js → pk-tiptap-content-CL8smjGi.js} +6 -3
- package/dist/chunks/{pk-tiptap-content-BPd4GO6c.js.map → pk-tiptap-content-CL8smjGi.js.map} +1 -1
- package/dist/chunks/{pk-tiptap-editor-tG67Vegc.js → pk-tiptap-editor-CTz-yfHL.js} +335 -19
- package/dist/chunks/pk-tiptap-editor-CTz-yfHL.js.map +1 -0
- package/dist/chunks/{pk-tiptap-input-CtefNnaK.js → pk-tiptap-input-Y9eog9Zn.js} +3 -3
- package/dist/chunks/{pk-tiptap-input-CtefNnaK.js.map → pk-tiptap-input-Y9eog9Zn.js.map} +1 -1
- package/dist/chunks/{pk-toggle-CW-lflrh.js → pk-toggle-BthhH7vl.js} +1 -1
- package/dist/chunks/{pk-toggle-CW-lflrh.js.map → pk-toggle-BthhH7vl.js.map} +1 -1
- package/dist/chunks/{pk-toggle-group-BKymefo3.js → pk-toggle-group-D2Quux8D.js} +1 -1
- package/dist/chunks/{pk-toggle-group-BKymefo3.js.map → pk-toggle-group-D2Quux8D.js.map} +1 -1
- package/dist/chunks/{pk-tooltip-BoDq8YVe.js → pk-tooltip--QBV6puX.js} +2 -2
- package/dist/chunks/{pk-tooltip-BoDq8YVe.js.map → pk-tooltip--QBV6puX.js.map} +1 -1
- package/dist/chunks/{popup-content-animation.styles-Dc6d9quJ.js → popup-content-animation.styles-BnNiguJo.js} +1 -1
- package/dist/chunks/{popup-content-animation.styles-Dc6d9quJ.js.map → popup-content-animation.styles-BnNiguJo.js.map} +1 -1
- package/dist/chunks/{popup-pointer-DMnuZDQl.js → popup-pointer-CuLjk1th.js} +1 -1
- package/dist/chunks/{popup-pointer-DMnuZDQl.js.map → popup-pointer-CuLjk1th.js.map} +1 -1
- package/dist/chunks/{register-CQodpTWT.js → register-aJw-9RWi.js} +46 -46
- package/dist/chunks/{register-CQodpTWT.js.map → register-aJw-9RWi.js.map} +1 -1
- package/dist/chunks/{register-components-B-qCPFFh.js → register-components-BT9THgdh.js} +1 -1
- package/dist/chunks/{register-components-B-qCPFFh.js.map → register-components-BT9THgdh.js.map} +1 -1
- package/dist/chunks/{tiptap.styles-ChAfyVi9.js → tiptap.styles-CPRows--.js} +4 -3
- package/dist/chunks/tiptap.styles-CPRows--.js.map +1 -0
- package/dist/component-registry.d.ts.map +1 -1
- package/dist/components/autocomplete/index.d.ts +2 -0
- package/dist/components/autocomplete/index.d.ts.map +1 -0
- package/dist/components/autocomplete/pk-autocomplete.d.ts +150 -0
- package/dist/components/autocomplete/pk-autocomplete.d.ts.map +1 -0
- package/dist/components/autocomplete/pk-autocomplete.js +2 -0
- package/dist/components/autocomplete/pk-autocomplete.styles.d.ts +7 -0
- package/dist/components/autocomplete/pk-autocomplete.styles.d.ts.map +1 -0
- package/dist/components/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete.js +2 -0
- package/dist/components/button/pk-button.d.ts +37 -1
- package/dist/components/button/pk-button.d.ts.map +1 -1
- package/dist/components/button/pk-button.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar/pk-calendar.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/checkbox/pk-checkbox.js +1 -1
- package/dist/components/checkbox-select/pk-checkbox-select.js +1 -1
- package/dist/components/checkbox-select.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-editor/pk-code-editor.js +1 -1
- package/dist/components/code-editor.js +1 -1
- package/dist/components/color-input/pk-color-input.js +1 -1
- package/dist/components/color-input.js +1 -1
- package/dist/components/combobox/pk-combobox.d.ts +8 -14
- package/dist/components/combobox/pk-combobox.d.ts.map +1 -1
- package/dist/components/combobox/pk-combobox.js +1 -1
- package/dist/components/combobox/pk-combobox.styles.d.ts.map +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/connect/pk-connect-oauth.d.ts +1 -1
- package/dist/components/connect/pk-connect-oauth.js +3 -3
- package/dist/components/connect/pk-connect-oauth.js.map +1 -1
- package/dist/components/connect/pk-connect.js +4 -4
- package/dist/components/copy-button/pk-copy-button.d.ts +3 -0
- package/dist/components/copy-button/pk-copy-button.d.ts.map +1 -1
- package/dist/components/copy-button/pk-copy-button.js +1 -1
- package/dist/components/copy-button/pk-copy-button.styles.d.ts.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/date-picker/pk-date-picker.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/dialog/pk-dialog.d.ts +1 -1
- package/dist/components/dialog/pk-dialog.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-item.d.ts +3 -1
- package/dist/components/dropdown-menu/pk-dropdown-item.d.ts.map +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-item.js +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-item.styles.d.ts.map +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-label.js +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu/pk-dropdown-menu.styles.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +3 -3
- package/dist/components/editable-table/editable-table-model.d.ts +4 -1
- package/dist/components/editable-table/editable-table-model.d.ts.map +1 -1
- package/dist/components/editable-table/pk-editable-table.d.ts +1 -1
- package/dist/components/editable-table/pk-editable-table.d.ts.map +1 -1
- package/dist/components/editable-table/pk-editable-table.js +1 -1
- package/dist/components/editable-table.js +1 -1
- package/dist/components/field/pk-field.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/icon/pk-icon.d.ts +3 -2
- package/dist/components/icon/pk-icon.d.ts.map +1 -1
- package/dist/components/icon/pk-icon.js.map +1 -1
- package/dist/components/image-browser/index.d.ts +2 -0
- package/dist/components/image-browser/index.d.ts.map +1 -0
- package/dist/components/image-browser/pk-image-browser.d.ts +190 -0
- package/dist/components/image-browser/pk-image-browser.d.ts.map +1 -0
- package/dist/components/image-browser/pk-image-browser.js +2 -0
- package/dist/components/image-browser/pk-image-browser.styles.d.ts +6 -0
- package/dist/components/image-browser/pk-image-browser.styles.d.ts.map +1 -0
- package/dist/components/image-browser.d.ts +2 -0
- package/dist/components/image-browser.js +2 -0
- package/dist/components/input/pk-input.d.ts +3 -2
- package/dist/components/input/pk-input.d.ts.map +1 -1
- package/dist/components/input/pk-input.js +1 -1
- package/dist/components/input/pk-input.styles.d.ts.map +1 -1
- package/dist/components/input-group/pk-input-group-addon.js +1 -1
- package/dist/components/input-group/pk-input-group-button.js +1 -1
- package/dist/components/input-group/pk-input-group-input.js +1 -1
- package/dist/components/input-group/pk-input-group-text.js +1 -1
- package/dist/components/input-group/pk-input-group-textarea.js +1 -1
- package/dist/components/input-group/pk-input-group.d.ts +2 -2
- package/dist/components/input-group/pk-input-group.d.ts.map +1 -1
- package/dist/components/input-group/pk-input-group.js +1 -1
- package/dist/components/input-group.js +6 -6
- package/dist/components/input.js +1 -1
- package/dist/components/lightswitch/pk-lightswitch.js +1 -1
- package/dist/components/lightswitch.js +1 -1
- package/dist/components/popover/pk-popover.d.ts +2 -2
- package/dist/components/popover/pk-popover.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popup/pk-popup.d.ts +4 -0
- package/dist/components/popup/pk-popup.d.ts.map +1 -1
- package/dist/components/popup/pk-popup.js +1 -1
- package/dist/components/popup.js +1 -1
- package/dist/components/radio-group/pk-radio-group.js +1 -1
- package/dist/components/radio-group/pk-radio.js +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/scroll-area/pk-scroll-area.js +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select/pk-option-group.d.ts +3 -1
- package/dist/components/select/pk-option-group.d.ts.map +1 -1
- package/dist/components/select/pk-option-group.js +1 -1
- package/dist/components/select/pk-option.d.ts +10 -1
- package/dist/components/select/pk-option.d.ts.map +1 -1
- package/dist/components/select/pk-option.js +1 -1
- package/dist/components/select/pk-select.d.ts +42 -3
- package/dist/components/select/pk-select.d.ts.map +1 -1
- package/dist/components/select/pk-select.js +1 -1
- package/dist/components/select.js +3 -3
- package/dist/components/separator/pk-separator.js +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/status/pk-status.js +1 -1
- package/dist/components/status.js +1 -1
- package/dist/components/tabs/pk-tab-heading.js +1 -1
- package/dist/components/tabs/pk-tab-panel.js +1 -1
- package/dist/components/tabs/pk-tab.js +1 -1
- package/dist/components/tabs/pk-tabs.js +1 -1
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea/pk-textarea.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/time-picker/pk-time-picker.js +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/tiptap/pk-tiptap-content.d.ts.map +1 -1
- package/dist/components/tiptap/pk-tiptap-content.js +1 -1
- package/dist/components/tiptap/pk-tiptap-editor.d.ts +11 -1
- package/dist/components/tiptap/pk-tiptap-editor.d.ts.map +1 -1
- package/dist/components/tiptap/pk-tiptap-editor.js +1 -1
- package/dist/components/tiptap/pk-tiptap-editor.styles.d.ts.map +1 -1
- package/dist/components/tiptap/pk-tiptap-input.js +1 -1
- package/dist/components/tiptap/tiptap-toolbar.d.ts +1 -0
- package/dist/components/tiptap/tiptap-toolbar.d.ts.map +1 -1
- package/dist/components/tiptap/variable-tag-node-view.d.ts.map +1 -1
- package/dist/components/tiptap-content.js +1 -1
- package/dist/components/tiptap-editor.js +1 -1
- package/dist/components/tiptap-input.js +1 -1
- package/dist/components/toggle/pk-toggle.js +1 -1
- package/dist/components/toggle-group/pk-toggle-group.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip/pk-tooltip.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/connect/register-cp-connect.js +3 -3
- package/dist/index.js +50 -50
- package/dist/internal/sync-filtered-options.d.ts +23 -0
- package/dist/internal/sync-filtered-options.d.ts.map +1 -0
- package/dist/plugin-kit.css +2 -0
- package/dist/plugin-kit.js +2 -2
- package/dist/register-components.js +1 -1
- package/dist/register-pk.generated.d.ts +4 -0
- package/dist/register-pk.generated.d.ts.map +1 -1
- package/dist/register.js +48 -48
- package/dist/utilities/fouce.css +2 -0
- package/dist/utils/async-option-fetch.d.ts +38 -0
- package/dist/utils/async-option-fetch.d.ts.map +1 -0
- package/dist/utils/option-filter.d.ts +11 -0
- package/dist/utils/option-filter.d.ts.map +1 -0
- package/dist/utils/popup-content-exit.d.ts +6 -0
- package/dist/utils/popup-content-exit.d.ts.map +1 -0
- package/dist-loader/chunks/option-filter-Bc5aNNT0.js +119 -0
- package/dist-loader/chunks/{pk-base-B21zXxSo.js → pk-base-CyzwylQ7.js} +13 -1
- package/dist-loader/chunks/{pk-button-Dh4gjLHw.js → pk-button-saBDszJV.js} +10 -6
- package/dist-loader/chunks/{pk-calendar-n1bwSO7X.js → pk-calendar-BrF8i3dW.js} +3 -3
- package/dist-loader/chunks/{pk-checkbox-BrZQB816.js → pk-checkbox-B3d4nkBx.js} +1 -1
- package/dist-loader/chunks/{pk-color-input-sS05YOwT.js → pk-color-input-CD-r_sfG.js} +1 -1
- package/dist-loader/chunks/{pk-combobox-B7q6alzE.js → pk-combobox-Cpx0w1KV.js} +49 -92
- package/dist-loader/chunks/{pk-date-picker-Dni5ty79.js → pk-date-picker-DEoiTOxN.js} +6 -6
- package/dist-loader/chunks/{pk-dialog-BpPRqFMm.js → pk-dialog-C6aaPokv.js} +3 -3
- package/dist-loader/chunks/{pk-dropdown-item-CHkFNlA9.js → pk-dropdown-item-D8RrwjxL.js} +10 -6
- package/dist-loader/chunks/pk-dropdown-label-Cg32UgRe.js +51 -0
- package/dist-loader/chunks/{pk-dropdown-menu-BHVOMNV1.js → pk-dropdown-menu-CAHCltlX.js} +5 -3
- package/dist-loader/chunks/{pk-field-CJ09ll1S.js → pk-field-V7JOy26T.js} +4 -4
- package/dist-loader/chunks/{pk-icon-WHUu7wxk.js → pk-icon-Bph-EBqp.js} +2 -2
- package/dist-loader/chunks/{pk-input-CEw3AdYt.js → pk-input-BhU0PiCk.js} +74 -28
- package/dist-loader/chunks/{pk-lightswitch-DJEUScgo.js → pk-lightswitch-m23Cy3_D.js} +1 -1
- package/dist-loader/chunks/{pk-option-CunPIei0.js → pk-option-BrDMERSl.js} +5 -4
- package/dist-loader/chunks/{pk-popup-FDdBxb4k.js → pk-popup-CrxxR-Hb.js} +24 -2
- package/dist-loader/chunks/{pk-select-CbAaQ7uE.js → pk-select-Dok-JdSe.js} +8 -6
- package/dist-loader/chunks/{pk-spinner-CIbXjDnp.js → pk-spinner-BKU9Rf2R.js} +1 -1
- package/dist-loader/chunks/{pk-status-BRIVW7EH.js → pk-status-D2g_77m_.js} +1 -1
- package/dist-loader/chunks/{pk-textarea-C_rOUtFS.js → pk-textarea-CC7rA5A7.js} +1 -1
- package/dist-loader/chunks/{pk-time-picker-Dr3uvbvc.js → pk-time-picker-h5Wgd4a_.js} +5 -5
- package/dist-loader/chunks/{pk-tooltip-HwZ0zRd2.js → pk-tooltip-Dd_Q0Bn5.js} +2 -2
- package/dist-loader/chunks/{render-Niz5wYRa.js → render-Bnzcxfss.js} +1 -1
- package/dist-loader/chunks/{svg-_Mtb7CHx.js → svg-Bz-bXZn7.js} +12 -4
- package/dist-loader/chunks/{tiptap-Db7MTUH1.js → tiptap-CgXkiK8d.js} +283 -13
- package/dist-loader/chunks/{tiptap.styles-BIRIMP7I.js → tiptap.styles-C0E1NpSx.js} +225 -5
- package/dist-loader/components/autocomplete/autocomplete.js +984 -0
- package/dist-loader/components/button/button.js +1 -1
- package/dist-loader/components/button-group/button-group-separator.js +1 -1
- package/dist-loader/components/button-group/button-group-text.js +1 -1
- package/dist-loader/components/button-group/button-group.js +1 -1
- package/dist-loader/components/calendar/calendar.js +1 -1
- package/dist-loader/components/checkbox/checkbox.js +1 -1
- package/dist-loader/components/checkbox-select/checkbox-select.js +2 -2
- package/dist-loader/components/code-editor/code-editor.js +6 -6
- package/dist-loader/components/color-input/color-input.js +1 -1
- package/dist-loader/components/combobox/combobox.js +1 -1
- package/dist-loader/components/connect/connect-oauth.js +4 -4
- package/dist-loader/components/connect/connect.js +6 -6
- package/dist-loader/components/copy-button/copy-button.js +48 -7
- package/dist-loader/components/date-picker/date-picker.js +1 -1
- package/dist-loader/components/dialog/dialog.js +1 -1
- package/dist-loader/components/dropdown-menu/dropdown-item.js +1 -1
- package/dist-loader/components/dropdown-menu/dropdown-label.js +1 -50
- package/dist-loader/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist-loader/components/dropdown-menu/dropdown-separator.js +1 -1
- package/dist-loader/components/editable-table/editable-table.js +18 -20
- package/dist-loader/components/field/field.js +1 -1
- package/dist-loader/components/icon/icon.js +2 -2
- package/dist-loader/components/image-browser/image-browser.js +1356 -0
- package/dist-loader/components/input/input.js +1 -1
- package/dist-loader/components/input-group/input-group-addon.js +1 -1
- package/dist-loader/components/input-group/input-group-button.js +1 -1
- package/dist-loader/components/input-group/input-group-input.js +1 -1
- package/dist-loader/components/input-group/input-group-text.js +1 -1
- package/dist-loader/components/input-group/input-group-textarea.js +1 -1
- package/dist-loader/components/input-group/input-group.js +2 -2
- package/dist-loader/components/lightswitch/lightswitch.js +1 -1
- package/dist-loader/components/popover/popover.js +3 -3
- package/dist-loader/components/popup/popup.js +1 -1
- package/dist-loader/components/radio-group/radio-group.js +1 -1
- package/dist-loader/components/radio-group/radio.js +1 -1
- package/dist-loader/components/scroll-area/scroll-area.js +1 -1
- package/dist-loader/components/select/option-group.js +1 -1
- package/dist-loader/components/select/option.js +1 -1
- package/dist-loader/components/select/select.js +1 -1
- package/dist-loader/components/separator/separator.js +1 -1
- package/dist-loader/components/spinner/spinner.js +1 -1
- package/dist-loader/components/status/status.js +1 -1
- package/dist-loader/components/tabs/tab-heading.js +1 -1
- package/dist-loader/components/tabs/tab-panel.js +1 -1
- package/dist-loader/components/tabs/tab.js +1 -1
- package/dist-loader/components/tabs/tabs.js +1 -1
- package/dist-loader/components/textarea/textarea.js +1 -1
- package/dist-loader/components/time-picker/time-picker.js +1 -1
- package/dist-loader/components/tiptap/tiptap-content.js +7 -4
- package/dist-loader/components/tiptap/tiptap-editor.js +336 -20
- package/dist-loader/components/tiptap/tiptap-input.js +3 -3
- package/dist-loader/components/toggle/toggle.js +1 -1
- package/dist-loader/components/toggle-group/toggle-group.js +1 -1
- package/dist-loader/components/tooltip/tooltip.js +1 -1
- package/dist-loader/plugin-kit.css +2 -0
- package/dist-loader/plugin-kit.loader.js +4 -0
- package/dist-loader/utilities/fouce.css +2 -0
- package/package.json +57 -10
- package/dist/chunks/component-registry-CNB8PbP_.js.map +0 -1
- package/dist/chunks/pk-combobox-BLft8AXy.js.map +0 -1
- package/dist/chunks/pk-copy-button-asOLQkqk.js.map +0 -1
- package/dist/chunks/pk-dropdown-item-BoZTGWMU.js.map +0 -1
- package/dist/chunks/pk-dropdown-menu-CfZc7dIz.js.map +0 -1
- package/dist/chunks/pk-editable-table-Cn4WXqAo.js.map +0 -1
- package/dist/chunks/pk-form-associated-element-9M2NzOE2.js.map +0 -1
- package/dist/chunks/pk-input-DDkIXOkt.js.map +0 -1
- package/dist/chunks/pk-option-MGj9SKOK.js.map +0 -1
- package/dist/chunks/pk-popover-duyNosk2.js.map +0 -1
- package/dist/chunks/pk-popup-B9AgBC2V.js.map +0 -1
- package/dist/chunks/pk-select-C1s0OJr0.js.map +0 -1
- package/dist/chunks/pk-tiptap-editor-tG67Vegc.js.map +0 -1
- package/dist/chunks/tiptap.styles-ChAfyVi9.js.map +0 -1
- /package/dist-loader/chunks/{floating-ui-DU6GNott.js → floating-ui-Cj0imr6d.js} +0 -0
- /package/dist-loader/chunks/{pk-connect.styles-Bfgwu0VH.js → pk-connect.styles-k61snd3X.js} +0 -0
- /package/dist-loader/chunks/{popup-pointer-caPc8kwB.js → popup-pointer-Ck28WdVP.js} +0 -0
- /package/dist-loader/chunks/{sync-listbox-separators-Dk_E_IVa.js → sync-listbox-separators-Ch5krDUs.js} +0 -0
|
@@ -0,0 +1,984 @@
|
|
|
1
|
+
import { d as registerDismissible, f as unregisterDismissible, n as uniqueId, s as scrollIntoView, t as LiveRegion, u as isTopDismissible } from "../../chunks/pk-a11y-CjB4-U-R.js";
|
|
2
|
+
import { a as o, c as r, f as A, i as e, l as n, m as i, p as b, s as e$1, u as customElement } from "../../chunks/lit-DpLik9Rf.js";
|
|
3
|
+
import { c as __decorate, i as PkFormAssociatedElement, s as iconStyles } from "../../chunks/pk-base-CyzwylQ7.js";
|
|
4
|
+
import { X as xmark } from "../../chunks/svg-Bz-bXZn7.js";
|
|
5
|
+
import { t as MirrorValidator } from "../../chunks/mirror-validator-C5XrXPaq.js";
|
|
6
|
+
import { t as HasSlotController } from "../../chunks/has-slot-BGJeJdHr.js";
|
|
7
|
+
import { t as PkClearEvent } from "../../chunks/pk-clear-BMZUzwDt.js";
|
|
8
|
+
import { n as renderIconHtml } from "../../chunks/render-Bnzcxfss.js";
|
|
9
|
+
import { i as PkShowEvent, n as PkAfterShowEvent, r as PkHideEvent, t as PkAfterHideEvent } from "../../chunks/overlay-lifecycle-C3tSQ3UR.js";
|
|
10
|
+
import { i as waitForPopupReposition, r as syncPopupPlacementAnimation } from "../../chunks/popup-placement-animation-WlEXnS85.js";
|
|
11
|
+
import { t as popupContentAnimationStyles } from "../../chunks/popup-content-animation.styles-duCg9-CH.js";
|
|
12
|
+
import "../../chunks/pk-popup-CrxxR-Hb.js";
|
|
13
|
+
import { n as isPointerInsideOverlay, t as isEventInsideOverlay } from "../../chunks/popup-pointer-Ck28WdVP.js";
|
|
14
|
+
import { a as isListboxTypeToSelectKey, i as handleListboxKeyDown, n as LISTBOX_NAVIGATION_KEYS } from "../../chunks/sync-listbox-separators-Ch5krDUs.js";
|
|
15
|
+
import { i as waitForPopupContentExitAnimation, n as AsyncOptionFetcher, r as syncFilteredOptions, t as matchesOptionFilter } from "../../chunks/option-filter-Bc5aNNT0.js";
|
|
16
|
+
//#region src/components/autocomplete/pk-autocomplete.styles.ts
|
|
17
|
+
/**
|
|
18
|
+
* Autocomplete chrome matches `pk-input` (text field), not Combobox’s slate
|
|
19
|
+
* select fill / chevron affordance. Panel / listbox tokens stay shared with
|
|
20
|
+
* Combobox so suggestion rows look the same.
|
|
21
|
+
*/
|
|
22
|
+
var pkAutocompleteStyles = [popupContentAnimationStyles, i`
|
|
23
|
+
${iconStyles}
|
|
24
|
+
@layer pk-component {
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
position: relative;
|
|
28
|
+
width: 100%;
|
|
29
|
+
color: var(--pk-color-gray-700);
|
|
30
|
+
font-family: var(--pk-font-family);
|
|
31
|
+
font-size: var(--pk-font-size-base);
|
|
32
|
+
line-height: var(--pk-line-height);
|
|
33
|
+
/* Match pk-input control tokens — not Combobox slate fill. */
|
|
34
|
+
--pk-autocomplete-padding-block: 6px;
|
|
35
|
+
--pk-autocomplete-padding-inline: 8px;
|
|
36
|
+
--pk-autocomplete-control-gap: 6px;
|
|
37
|
+
--pk-autocomplete-decoration-size: 0.75rem;
|
|
38
|
+
--pk-autocomplete-font-size: var(--pk-font-size-base);
|
|
39
|
+
--pk-select-item-min-height: 0;
|
|
40
|
+
--pk-select-item-padding-block: 6px;
|
|
41
|
+
--pk-select-item-padding-inline: 10px;
|
|
42
|
+
--pk-select-item-padding-inline-end: 2rem;
|
|
43
|
+
--pk-select-item-font-size: 14px;
|
|
44
|
+
--pk-select-item-line-height: 1.4;
|
|
45
|
+
--pk-select-item-indicator-size: 0.75rem;
|
|
46
|
+
--pk-select-item-indicator-inset: 0.5rem;
|
|
47
|
+
--pk-select-group-label-font-size: 12px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* width="full" is the documented stretch opt-in; host already fills by default. */
|
|
51
|
+
:host([width='full']) {
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.control {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--pk-autocomplete-control-gap);
|
|
60
|
+
width: 100%;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
margin: 0;
|
|
64
|
+
padding-block: var(--pk-autocomplete-padding-block);
|
|
65
|
+
padding-inline: var(--pk-autocomplete-padding-inline);
|
|
66
|
+
border: var(--pk-input-border);
|
|
67
|
+
border-radius: var(--pk-input-border-radius, var(--pk-radius-sm));
|
|
68
|
+
background: var(--pk-input-bg);
|
|
69
|
+
background-clip: padding-box;
|
|
70
|
+
color: var(--pk-color-gray-700);
|
|
71
|
+
font: inherit;
|
|
72
|
+
font-size: var(--pk-autocomplete-font-size);
|
|
73
|
+
line-height: var(--pk-input-control-line-height, 1.25rem);
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
cursor: text;
|
|
76
|
+
outline: none;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
transition: border-color 0.12s ease, box-shadow 0.12s ease;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* Craft text focus: resting border stays; ring is box-shadow only
|
|
83
|
+
* (--pk-input-focus-shadow already includes the 1px edge). Same when the
|
|
84
|
+
* suggestion panel is open — still a text field, not a select trigger.
|
|
85
|
+
*/
|
|
86
|
+
:host(:not([invalid]):not(:state(user-invalid))) .control:focus-within,
|
|
87
|
+
:host(:not([invalid]):not(:state(user-invalid))[data-state='focus-visible']) .control,
|
|
88
|
+
:host(:not([invalid]):not(:state(user-invalid))) .control[data-popup-open] {
|
|
89
|
+
box-shadow: var(--pk-input-focus-shadow);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.control.is-disabled {
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
opacity: 0.5;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.control-start,
|
|
98
|
+
.control-end {
|
|
99
|
+
display: inline-flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
line-height: 0;
|
|
103
|
+
color: var(--pk-color-gray-400);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
slot[name='start']::slotted(svg),
|
|
107
|
+
slot[name='end']::slotted(svg) {
|
|
108
|
+
width: var(--pk-autocomplete-decoration-size);
|
|
109
|
+
height: var(--pk-autocomplete-decoration-size);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.autocomplete-input {
|
|
113
|
+
flex: 1 1 auto;
|
|
114
|
+
width: 100%;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
margin: 0;
|
|
117
|
+
padding: 0;
|
|
118
|
+
border: 0;
|
|
119
|
+
background: transparent;
|
|
120
|
+
color: inherit;
|
|
121
|
+
font: inherit;
|
|
122
|
+
line-height: var(--pk-input-control-line-height, 1.25rem);
|
|
123
|
+
outline: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.autocomplete-input::placeholder {
|
|
127
|
+
color: var(--pk-input-placeholder-color, var(--pk-color-gray-400));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Clear: flex trailing action — same contract as pk-input / Combobox clear. */
|
|
131
|
+
.clear-button {
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
flex-shrink: 0;
|
|
136
|
+
align-self: stretch;
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
width: calc(var(--pk-autocomplete-decoration-size) + var(--pk-autocomplete-padding-inline));
|
|
139
|
+
height: auto;
|
|
140
|
+
min-height: var(--pk-autocomplete-decoration-size);
|
|
141
|
+
margin-block: calc(-1 * var(--pk-autocomplete-padding-block));
|
|
142
|
+
/* Match pk-copy-button[slot=end]: pull into padding but leave a 4px glyph inset. */
|
|
143
|
+
margin-inline-end: calc(-1 * var(--pk-autocomplete-padding-inline) + 4px);
|
|
144
|
+
margin-inline-start: 0;
|
|
145
|
+
padding: 0;
|
|
146
|
+
border: 0;
|
|
147
|
+
border-radius: 0;
|
|
148
|
+
background: transparent;
|
|
149
|
+
color: var(--pk-color-gray-600);
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
outline: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.clear-button:disabled {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
opacity: 0.5;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.clear-button-icon {
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
line-height: 0;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.clear-button-icon svg {
|
|
168
|
+
display: block;
|
|
169
|
+
width: 0.75rem;
|
|
170
|
+
height: 0.75rem;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.value-input {
|
|
174
|
+
position: absolute;
|
|
175
|
+
width: 1px;
|
|
176
|
+
height: 1px;
|
|
177
|
+
padding: 0;
|
|
178
|
+
margin: -1px;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
clip: rect(0, 0, 0, 0);
|
|
181
|
+
white-space: nowrap;
|
|
182
|
+
border: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.panel ::slotted(pk-separator) {
|
|
186
|
+
margin: 4px 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.panel {
|
|
190
|
+
width: max-content;
|
|
191
|
+
min-width: var(--pk-autocomplete-anchor-width, 8rem);
|
|
192
|
+
padding: 0;
|
|
193
|
+
border: 0;
|
|
194
|
+
border-radius: var(--pk-radius-md);
|
|
195
|
+
background: var(--pk-color-white);
|
|
196
|
+
box-shadow: var(--pk-shadow-popup);
|
|
197
|
+
color: var(--pk-color-gray-700);
|
|
198
|
+
outline: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.panel-body {
|
|
202
|
+
max-height: 16rem;
|
|
203
|
+
overflow: auto;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.panel:not([data-open]):not(.closing) {
|
|
207
|
+
opacity: 0;
|
|
208
|
+
pointer-events: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.panel[data-open]:not(.closing) {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
pointer-events: auto;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.panel[hidden] {
|
|
217
|
+
display: none !important;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.empty,
|
|
221
|
+
.async-status {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
margin: 0;
|
|
225
|
+
min-height: var(--pk-select-item-min-height, var(--pk-input-height));
|
|
226
|
+
padding-block: var(--pk-select-item-padding-block);
|
|
227
|
+
padding-inline: var(--pk-select-item-padding-inline);
|
|
228
|
+
border: var(--pk-select-trigger-border-width, 1px) solid transparent;
|
|
229
|
+
box-sizing: border-box;
|
|
230
|
+
color: var(--pk-color-gray-500);
|
|
231
|
+
font-size: var(--pk-select-item-font-size);
|
|
232
|
+
line-height: var(--pk-select-item-line-height);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
:host([invalid]) .control,
|
|
236
|
+
:host(:state(user-invalid)) .control {
|
|
237
|
+
border-color: var(--pk-color-rose-600);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host([invalid]) .control:focus-within,
|
|
241
|
+
:host([invalid][data-state='focus-visible']) .control,
|
|
242
|
+
:host(:state(user-invalid)) .control:focus-within,
|
|
243
|
+
:host(:state(user-invalid)[data-state='focus-visible']) .control {
|
|
244
|
+
box-shadow: var(--pk-input-invalid-focus-shadow);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:host([size='xs']) {
|
|
248
|
+
--pk-autocomplete-padding-block: 4px;
|
|
249
|
+
--pk-autocomplete-padding-inline: 6px;
|
|
250
|
+
--pk-autocomplete-control-gap: 4px;
|
|
251
|
+
--pk-autocomplete-decoration-size: 0.625rem;
|
|
252
|
+
--pk-autocomplete-font-size: 11px;
|
|
253
|
+
--pk-select-item-padding-block: 4px;
|
|
254
|
+
--pk-select-item-padding-inline: 8px;
|
|
255
|
+
--pk-select-item-padding-inline-end: 1.75rem;
|
|
256
|
+
--pk-select-item-font-size: 11px;
|
|
257
|
+
--pk-select-group-label-font-size: 11px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host([size='xs']) .clear-button-icon svg {
|
|
261
|
+
width: 0.625rem;
|
|
262
|
+
height: 0.625rem;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:host([size='sm']) {
|
|
266
|
+
--pk-autocomplete-padding-block: 4px;
|
|
267
|
+
--pk-autocomplete-padding-inline: 8px;
|
|
268
|
+
--pk-autocomplete-control-gap: 4px;
|
|
269
|
+
--pk-autocomplete-decoration-size: 0.6875rem;
|
|
270
|
+
--pk-autocomplete-font-size: 12px;
|
|
271
|
+
--pk-select-item-padding-block: 6px;
|
|
272
|
+
--pk-select-item-padding-inline: 10px;
|
|
273
|
+
--pk-select-item-padding-inline-end: 1.75rem;
|
|
274
|
+
--pk-select-item-font-size: 12px;
|
|
275
|
+
--pk-select-group-label-font-size: 12px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
:host([size='sm']) .clear-button-icon svg {
|
|
279
|
+
width: 0.6875rem;
|
|
280
|
+
height: 0.6875rem;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:host([size='lg']) {
|
|
284
|
+
--pk-autocomplete-padding-block: 8px;
|
|
285
|
+
--pk-autocomplete-padding-inline: 12px;
|
|
286
|
+
--pk-autocomplete-control-gap: 8px;
|
|
287
|
+
--pk-autocomplete-decoration-size: 0.875rem;
|
|
288
|
+
--pk-autocomplete-font-size: var(--pk-font-size-base);
|
|
289
|
+
--pk-select-item-padding-block: 8px;
|
|
290
|
+
--pk-select-item-padding-inline: 12px;
|
|
291
|
+
--pk-select-item-font-size: 14px;
|
|
292
|
+
--pk-select-group-label-font-size: 14px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
:host([size='xl']) {
|
|
296
|
+
--pk-autocomplete-padding-block: 10px;
|
|
297
|
+
--pk-autocomplete-padding-inline: 16px;
|
|
298
|
+
--pk-autocomplete-control-gap: 8px;
|
|
299
|
+
--pk-autocomplete-decoration-size: 1rem;
|
|
300
|
+
--pk-autocomplete-font-size: 16px;
|
|
301
|
+
--pk-select-item-padding-block: 10px;
|
|
302
|
+
--pk-select-item-padding-inline: 14px;
|
|
303
|
+
--pk-select-item-padding-inline-end: 2.25rem;
|
|
304
|
+
--pk-select-item-font-size: 14px;
|
|
305
|
+
--pk-select-group-label-font-size: 16px;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
:host([size='xl']) .clear-button-icon svg {
|
|
309
|
+
width: 0.875rem;
|
|
310
|
+
height: 0.875rem;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
`];
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/components/autocomplete/pk-autocomplete.ts
|
|
316
|
+
var XMARK_ICON = renderIconHtml(xmark);
|
|
317
|
+
var PkAutocomplete = class PkAutocomplete extends PkFormAssociatedElement {
|
|
318
|
+
constructor(..._args) {
|
|
319
|
+
super(..._args);
|
|
320
|
+
this.assumeInteractionOn = ["blur", "input"];
|
|
321
|
+
this.open = false;
|
|
322
|
+
this.placement = "bottom-start";
|
|
323
|
+
this.sideOffset = 6;
|
|
324
|
+
this.clearable = false;
|
|
325
|
+
this.withClear = false;
|
|
326
|
+
this.autoHighlight = false;
|
|
327
|
+
this.invalid = false;
|
|
328
|
+
this.size = "default";
|
|
329
|
+
this.placeholder = "";
|
|
330
|
+
this.emptyMessage = "No options found.";
|
|
331
|
+
this.value = "";
|
|
332
|
+
this.defaultValue = "";
|
|
333
|
+
this.label = "";
|
|
334
|
+
this.instructions = "";
|
|
335
|
+
this.ariaLabel = null;
|
|
336
|
+
this.loopFocus = true;
|
|
337
|
+
this.filter = null;
|
|
338
|
+
this.async = false;
|
|
339
|
+
this.loadingMessage = "Searching…";
|
|
340
|
+
this.startTypingMessage = "Start typing to search…";
|
|
341
|
+
this.fetchOptions = null;
|
|
342
|
+
this.hasSlotController = new HasSlotController(this, "start", "end");
|
|
343
|
+
this.listboxId = uniqueId("pk-autocomplete-listbox");
|
|
344
|
+
this.inputId = uniqueId("pk-autocomplete-input");
|
|
345
|
+
this.options = [];
|
|
346
|
+
this.highlightedIndex = -1;
|
|
347
|
+
this.closing = false;
|
|
348
|
+
this.panelAnimated = false;
|
|
349
|
+
this.dismissRegistered = false;
|
|
350
|
+
this.panelEventTarget = null;
|
|
351
|
+
this.asyncFetcher = null;
|
|
352
|
+
this.asyncLoading = false;
|
|
353
|
+
this.asyncError = null;
|
|
354
|
+
this.onDocumentPointerDown = (event) => {
|
|
355
|
+
if (isPointerInsideOverlay(event, {
|
|
356
|
+
anchor: this.controlElement,
|
|
357
|
+
panel: this.panelElement
|
|
358
|
+
})) return;
|
|
359
|
+
this.closePanel("light-dismiss");
|
|
360
|
+
};
|
|
361
|
+
this.onDocumentKeyDown = (event) => {
|
|
362
|
+
if (!this.open) return;
|
|
363
|
+
if (event.key === "Escape") {
|
|
364
|
+
if (!isTopDismissible(this)) return;
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
event.stopPropagation();
|
|
367
|
+
this.closePanel("escape");
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
if (!(LISTBOX_NAVIGATION_KEYS.has(event.key) || isListboxTypeToSelectKey(event))) return;
|
|
371
|
+
const panel = this.panelElement;
|
|
372
|
+
const path = event.composedPath();
|
|
373
|
+
if (!Boolean(panel && path.includes(panel))) return;
|
|
374
|
+
if (!isEventInsideOverlay(event, {
|
|
375
|
+
anchor: this.controlElement,
|
|
376
|
+
panel
|
|
377
|
+
})) return;
|
|
378
|
+
event.preventDefault();
|
|
379
|
+
event.stopPropagation();
|
|
380
|
+
this.onListboxKeyDown(event);
|
|
381
|
+
};
|
|
382
|
+
this.handleOptionSelect = (event) => {
|
|
383
|
+
const { value } = event.detail;
|
|
384
|
+
this.commitValue(value, { close: true });
|
|
385
|
+
};
|
|
386
|
+
this.handleOptionHighlight = (event) => {
|
|
387
|
+
if (!this.open) return;
|
|
388
|
+
const index = this.getEnabledVisibleOptions().findIndex((option) => option.value === event.detail.value);
|
|
389
|
+
if (index === -1 || index === this.highlightedIndex) return;
|
|
390
|
+
this.highlightedIndex = index;
|
|
391
|
+
this.syncHighlight();
|
|
392
|
+
};
|
|
393
|
+
this.handleControlMouseDown = (event) => {
|
|
394
|
+
if (this.disabled) return;
|
|
395
|
+
if (event.composedPath().some((node) => {
|
|
396
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
397
|
+
return node.classList.contains("clear-button");
|
|
398
|
+
})) return;
|
|
399
|
+
const isInput = event.target === this.controlInput;
|
|
400
|
+
if (!this.open && !this.closing) {
|
|
401
|
+
if (!isInput) event.preventDefault();
|
|
402
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
403
|
+
this.openPanel();
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (!isInput) {
|
|
407
|
+
event.preventDefault();
|
|
408
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
this.handleListboxKeyDownEvent = (event) => {
|
|
412
|
+
this.onListboxKeyDown(event.detail.keyboardEvent);
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
static {
|
|
416
|
+
this.styles = pkAutocompleteStyles;
|
|
417
|
+
}
|
|
418
|
+
static get validators() {
|
|
419
|
+
return [
|
|
420
|
+
...super.validators,
|
|
421
|
+
MirrorValidator(),
|
|
422
|
+
{
|
|
423
|
+
observedAttributes: ["required"],
|
|
424
|
+
checkValidity: (element) => {
|
|
425
|
+
const field = element;
|
|
426
|
+
const result = {
|
|
427
|
+
message: "Please fill out this field.",
|
|
428
|
+
isValid: true,
|
|
429
|
+
invalidKeys: []
|
|
430
|
+
};
|
|
431
|
+
if (!field.required || field.value.trim()) return result;
|
|
432
|
+
result.isValid = false;
|
|
433
|
+
result.invalidKeys.push("valueMissing");
|
|
434
|
+
return result;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
];
|
|
438
|
+
}
|
|
439
|
+
get panelElement() {
|
|
440
|
+
return this.popupElement?.getContentElement() ?? null;
|
|
441
|
+
}
|
|
442
|
+
get panelBodyElement() {
|
|
443
|
+
return this.panelElement?.querySelector(".panel-body");
|
|
444
|
+
}
|
|
445
|
+
get listScrollContainer() {
|
|
446
|
+
return this.panelBodyElement ?? this.panelElement ?? this;
|
|
447
|
+
}
|
|
448
|
+
connectedCallback() {
|
|
449
|
+
this.instructions = this.getAttribute("hint") ?? this.instructions;
|
|
450
|
+
this.refreshOptions();
|
|
451
|
+
super.connectedCallback();
|
|
452
|
+
this.syncHasValueAttribute();
|
|
453
|
+
this.addEventListener("pk-listbox-keydown", this.handleListboxKeyDownEvent);
|
|
454
|
+
this.optionsObserver = new MutationObserver(() => {
|
|
455
|
+
this.handleOptionsMutation({ render: true });
|
|
456
|
+
});
|
|
457
|
+
this.optionsObserver.observe(this, {
|
|
458
|
+
childList: true,
|
|
459
|
+
subtree: true
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
disconnectedCallback() {
|
|
463
|
+
this.unbindPanelEvents();
|
|
464
|
+
this.removeEventListener("pk-listbox-keydown", this.handleListboxKeyDownEvent);
|
|
465
|
+
this.optionsObserver?.disconnect();
|
|
466
|
+
this.liveRegion?.destroy();
|
|
467
|
+
this.liveRegion = void 0;
|
|
468
|
+
this.asyncFetcher?.cancel();
|
|
469
|
+
this.closePanel("api");
|
|
470
|
+
super.disconnectedCallback();
|
|
471
|
+
}
|
|
472
|
+
firstUpdated(changed) {
|
|
473
|
+
super.firstUpdated(changed);
|
|
474
|
+
if (!this.value && this.defaultValue) this.value = this.defaultValue;
|
|
475
|
+
this.applyOptionState();
|
|
476
|
+
}
|
|
477
|
+
updated(changed) {
|
|
478
|
+
if (changed.has("value")) {
|
|
479
|
+
this.syncHasValueAttribute();
|
|
480
|
+
this.applyOptionState();
|
|
481
|
+
}
|
|
482
|
+
super.updated(changed);
|
|
483
|
+
}
|
|
484
|
+
get validationTarget() {
|
|
485
|
+
return this.controlInput ?? this.controlElement;
|
|
486
|
+
}
|
|
487
|
+
getAriaMirrorTarget() {
|
|
488
|
+
return this.controlInput ?? this.controlElement ?? null;
|
|
489
|
+
}
|
|
490
|
+
syncFormValue() {
|
|
491
|
+
if (!this.name) {
|
|
492
|
+
this.setFormValue(null);
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
this.setFormValue(this.value);
|
|
496
|
+
}
|
|
497
|
+
syncHasValueAttribute() {
|
|
498
|
+
this.toggleAttribute("data-has-value", Boolean(this.value));
|
|
499
|
+
}
|
|
500
|
+
refreshOptions() {
|
|
501
|
+
this.options = [...this.querySelectorAll("pk-option")];
|
|
502
|
+
}
|
|
503
|
+
handleOptionsMutation(options = {}) {
|
|
504
|
+
this.refreshOptions();
|
|
505
|
+
this.applyOptionState();
|
|
506
|
+
if (options.render) this.requestUpdate();
|
|
507
|
+
}
|
|
508
|
+
bindPanelEvents() {
|
|
509
|
+
const panel = this.panelElement;
|
|
510
|
+
if (!panel || this.panelEventTarget === panel) return;
|
|
511
|
+
this.unbindPanelEvents();
|
|
512
|
+
this.panelEventTarget = panel;
|
|
513
|
+
panel.addEventListener("pk-option-select", this.handleOptionSelect);
|
|
514
|
+
panel.addEventListener("pk-option-highlight", this.handleOptionHighlight);
|
|
515
|
+
panel.addEventListener("pk-listbox-keydown", this.handleListboxKeyDownEvent);
|
|
516
|
+
}
|
|
517
|
+
unbindPanelEvents() {
|
|
518
|
+
if (!this.panelEventTarget) return;
|
|
519
|
+
this.panelEventTarget.removeEventListener("pk-option-select", this.handleOptionSelect);
|
|
520
|
+
this.panelEventTarget.removeEventListener("pk-option-highlight", this.handleOptionHighlight);
|
|
521
|
+
this.panelEventTarget.removeEventListener("pk-listbox-keydown", this.handleListboxKeyDownEvent);
|
|
522
|
+
this.panelEventTarget = null;
|
|
523
|
+
}
|
|
524
|
+
isOptionInHiddenGroup(option) {
|
|
525
|
+
const group = option.closest("pk-option-group");
|
|
526
|
+
return Boolean(group?.hidden);
|
|
527
|
+
}
|
|
528
|
+
getFilterQuery() {
|
|
529
|
+
if (!this.open) return "";
|
|
530
|
+
return this.value.trim().toLowerCase();
|
|
531
|
+
}
|
|
532
|
+
get usesAsyncSearch() {
|
|
533
|
+
return this.async && Boolean(this.fetchOptions);
|
|
534
|
+
}
|
|
535
|
+
getVisibleOptions() {
|
|
536
|
+
if (this.usesAsyncSearch) return this.options.filter((option) => !this.isOptionInHiddenGroup(option));
|
|
537
|
+
const filter = this.getFilterQuery();
|
|
538
|
+
return this.options.filter((option) => {
|
|
539
|
+
if (this.isOptionInHiddenGroup(option)) return false;
|
|
540
|
+
if (!filter) return true;
|
|
541
|
+
return matchesOptionFilter(option, filter, this.filter);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
getEnabledVisibleOptions() {
|
|
545
|
+
return this.getVisibleOptions().filter((option) => !option.disabled);
|
|
546
|
+
}
|
|
547
|
+
clearAsyncOptionNodes() {
|
|
548
|
+
this.querySelectorAll(":scope > pk-option, :scope > pk-option-group, :scope > pk-separator").forEach((node) => node.remove());
|
|
549
|
+
}
|
|
550
|
+
renderAsyncOptionNodes(items) {
|
|
551
|
+
this.clearAsyncOptionNodes();
|
|
552
|
+
for (const item of items) {
|
|
553
|
+
const option = document.createElement("pk-option");
|
|
554
|
+
option.value = item.value;
|
|
555
|
+
option.textContent = item.label;
|
|
556
|
+
this.append(option);
|
|
557
|
+
}
|
|
558
|
+
this.handleOptionsMutation({ render: true });
|
|
559
|
+
}
|
|
560
|
+
scheduleAsyncFetch(query) {
|
|
561
|
+
this.ensureAsyncFetcher().schedule(query);
|
|
562
|
+
}
|
|
563
|
+
ensureAsyncFetcher() {
|
|
564
|
+
if (!this.asyncFetcher) this.asyncFetcher = new AsyncOptionFetcher(() => this.fetchOptions, {
|
|
565
|
+
errorLabel: "autocomplete options",
|
|
566
|
+
onLoading: () => {
|
|
567
|
+
this.asyncLoading = true;
|
|
568
|
+
this.asyncError = null;
|
|
569
|
+
this.renderAsyncOptionNodes([]);
|
|
570
|
+
},
|
|
571
|
+
onResults: (results) => {
|
|
572
|
+
this.renderAsyncOptionNodes(results);
|
|
573
|
+
},
|
|
574
|
+
onError: (message) => {
|
|
575
|
+
this.asyncError = message;
|
|
576
|
+
},
|
|
577
|
+
onSettled: () => {
|
|
578
|
+
this.asyncLoading = false;
|
|
579
|
+
},
|
|
580
|
+
onEmptyQuery: () => {
|
|
581
|
+
this.asyncLoading = false;
|
|
582
|
+
this.asyncError = null;
|
|
583
|
+
this.renderAsyncOptionNodes([]);
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
return this.asyncFetcher;
|
|
587
|
+
}
|
|
588
|
+
getAsyncStatusMessage() {
|
|
589
|
+
if (!this.usesAsyncSearch || !this.open) return null;
|
|
590
|
+
if (this.asyncLoading) return this.loadingMessage;
|
|
591
|
+
if (this.asyncError) return this.asyncError;
|
|
592
|
+
const query = this.value.trim();
|
|
593
|
+
if (!query) return this.startTypingMessage;
|
|
594
|
+
if (this.getEnabledVisibleOptions().length === 0) return `No matches for "${query}".`;
|
|
595
|
+
return null;
|
|
596
|
+
}
|
|
597
|
+
applyOptionState() {
|
|
598
|
+
const visible = this.getVisibleOptions();
|
|
599
|
+
const filterQuery = this.open ? this.getFilterQuery() : "";
|
|
600
|
+
syncFilteredOptions({
|
|
601
|
+
host: this,
|
|
602
|
+
options: this.options,
|
|
603
|
+
visible,
|
|
604
|
+
listboxId: this.listboxId,
|
|
605
|
+
filterQuery,
|
|
606
|
+
isSelected: () => false
|
|
607
|
+
});
|
|
608
|
+
this.syncValueInput();
|
|
609
|
+
if (this.open) {
|
|
610
|
+
this.syncHighlight();
|
|
611
|
+
this.announceFilterResults();
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
syncValueInput() {
|
|
615
|
+
if (!this.input) return;
|
|
616
|
+
this.input.value = this.value;
|
|
617
|
+
this.input.required = this.required;
|
|
618
|
+
}
|
|
619
|
+
resetHighlightedIndexOnOpen() {
|
|
620
|
+
this.highlightedIndex = this.autoHighlight ? 0 : -1;
|
|
621
|
+
}
|
|
622
|
+
syncHighlight() {
|
|
623
|
+
const enabled = this.getEnabledVisibleOptions();
|
|
624
|
+
for (const option of this.options) {
|
|
625
|
+
option.highlighted = false;
|
|
626
|
+
option.focusIndex = -1;
|
|
627
|
+
}
|
|
628
|
+
if (enabled.length === 0 || this.highlightedIndex < 0) return;
|
|
629
|
+
if (this.highlightedIndex >= enabled.length) this.highlightedIndex = enabled.length - 1;
|
|
630
|
+
const highlighted = enabled[this.highlightedIndex];
|
|
631
|
+
if (highlighted) {
|
|
632
|
+
highlighted.highlighted = true;
|
|
633
|
+
highlighted.focusIndex = -1;
|
|
634
|
+
scrollIntoView(highlighted, this.listScrollContainer, "vertical", "auto");
|
|
635
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
getActiveDescendantId() {
|
|
639
|
+
return this.getEnabledVisibleOptions()[this.highlightedIndex]?.optionId || null;
|
|
640
|
+
}
|
|
641
|
+
announceFilterResults() {
|
|
642
|
+
if (!this.liveRegion) this.liveRegion = new LiveRegion("polite");
|
|
643
|
+
const count = this.getEnabledVisibleOptions().length;
|
|
644
|
+
if (!this.getFilterQuery()) return;
|
|
645
|
+
this.liveRegion.announce(count === 0 ? `${this.emptyMessage}` : `${count} ${count === 1 ? "result" : "results"} available`);
|
|
646
|
+
}
|
|
647
|
+
openPanel() {
|
|
648
|
+
const anchor = this.controlElement;
|
|
649
|
+
if (!anchor) return Promise.resolve();
|
|
650
|
+
if (this.open) {
|
|
651
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
652
|
+
return Promise.resolve();
|
|
653
|
+
}
|
|
654
|
+
if (this.closing) return Promise.resolve();
|
|
655
|
+
this.dispatchEvent(new PkShowEvent());
|
|
656
|
+
this.closing = false;
|
|
657
|
+
this.panelAnimated = false;
|
|
658
|
+
this.open = true;
|
|
659
|
+
this.applyOptionState();
|
|
660
|
+
this.resetHighlightedIndexOnOpen();
|
|
661
|
+
if (this.usesAsyncSearch) {
|
|
662
|
+
this.asyncError = null;
|
|
663
|
+
this.renderAsyncOptionNodes([]);
|
|
664
|
+
const query = this.value.trim();
|
|
665
|
+
this.asyncLoading = Boolean(query);
|
|
666
|
+
this.scheduleAsyncFetch(query);
|
|
667
|
+
}
|
|
668
|
+
this.style.setProperty("--pk-autocomplete-anchor-width", `${anchor.getBoundingClientRect().width}px`);
|
|
669
|
+
this.popupElement.active = true;
|
|
670
|
+
if (this.panelElement) {
|
|
671
|
+
this.panelElement.hidden = false;
|
|
672
|
+
syncPopupPlacementAnimation(this.panelElement, this.placement);
|
|
673
|
+
}
|
|
674
|
+
this.registerDismissHandlers();
|
|
675
|
+
this.syncHighlight();
|
|
676
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
677
|
+
return this.updateComplete.then(async () => {
|
|
678
|
+
const placement = await waitForPopupReposition(this.popupElement, this.placement, 300, { requireEvent: true });
|
|
679
|
+
if (this.panelElement) syncPopupPlacementAnimation(this.panelElement, placement);
|
|
680
|
+
this.panelAnimated = true;
|
|
681
|
+
this.bindPanelEvents();
|
|
682
|
+
this.refreshOptions();
|
|
683
|
+
this.controlInput?.focus({ preventScroll: true });
|
|
684
|
+
this.dispatchEvent(new PkAfterShowEvent());
|
|
685
|
+
this.dispatchEvent(new CustomEvent("pk-open-change", {
|
|
686
|
+
detail: { open: true },
|
|
687
|
+
bubbles: true,
|
|
688
|
+
composed: true
|
|
689
|
+
}));
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
async closePanel(source = "unknown") {
|
|
693
|
+
if (!this.open || this.closing) return;
|
|
694
|
+
const hideEvent = new PkHideEvent(source);
|
|
695
|
+
if (!this.dispatchEvent(hideEvent)) return;
|
|
696
|
+
this.unbindPanelEvents();
|
|
697
|
+
this.closing = true;
|
|
698
|
+
this.panelAnimated = false;
|
|
699
|
+
await waitForPopupContentExitAnimation(this.panelElement);
|
|
700
|
+
this.open = false;
|
|
701
|
+
this.closing = false;
|
|
702
|
+
this.panelAnimated = false;
|
|
703
|
+
if (this.panelElement) {
|
|
704
|
+
this.panelElement.hidden = true;
|
|
705
|
+
this.panelElement.removeAttribute("data-side");
|
|
706
|
+
}
|
|
707
|
+
this.popupElement.active = false;
|
|
708
|
+
this.unregisterDismissHandlers();
|
|
709
|
+
this.applyOptionState();
|
|
710
|
+
if (this.usesAsyncSearch) {
|
|
711
|
+
this.asyncFetcher?.cancel();
|
|
712
|
+
this.asyncLoading = false;
|
|
713
|
+
this.asyncError = null;
|
|
714
|
+
this.renderAsyncOptionNodes([]);
|
|
715
|
+
}
|
|
716
|
+
if (source !== "light-dismiss" && source !== "pointer-dismiss") this.controlInput?.focus({ preventScroll: true });
|
|
717
|
+
else this.controlInput?.blur();
|
|
718
|
+
this.dispatchEvent(new PkAfterHideEvent());
|
|
719
|
+
this.dispatchEvent(new CustomEvent("pk-open-change", {
|
|
720
|
+
detail: { open: false },
|
|
721
|
+
bubbles: true,
|
|
722
|
+
composed: true
|
|
723
|
+
}));
|
|
724
|
+
}
|
|
725
|
+
registerDismissHandlers() {
|
|
726
|
+
registerDismissible(this);
|
|
727
|
+
this.dismissRegistered = true;
|
|
728
|
+
document.addEventListener("pointerdown", this.onDocumentPointerDown, true);
|
|
729
|
+
document.addEventListener("keydown", this.onDocumentKeyDown, true);
|
|
730
|
+
}
|
|
731
|
+
unregisterDismissHandlers() {
|
|
732
|
+
if (this.dismissRegistered) {
|
|
733
|
+
unregisterDismissible(this);
|
|
734
|
+
this.dismissRegistered = false;
|
|
735
|
+
}
|
|
736
|
+
document.removeEventListener("pointerdown", this.onDocumentPointerDown, true);
|
|
737
|
+
document.removeEventListener("keydown", this.onDocumentKeyDown, true);
|
|
738
|
+
}
|
|
739
|
+
commitValue(next, { close = false, emit = true } = {}) {
|
|
740
|
+
const changed = this.value !== next;
|
|
741
|
+
this.value = next;
|
|
742
|
+
this.syncHasValueAttribute();
|
|
743
|
+
this.applyOptionState();
|
|
744
|
+
if (close) this.closePanel("api");
|
|
745
|
+
if (changed && emit) this.emitValueChange();
|
|
746
|
+
}
|
|
747
|
+
handleClear(event) {
|
|
748
|
+
event.preventDefault();
|
|
749
|
+
event.stopPropagation();
|
|
750
|
+
this.commitValue("");
|
|
751
|
+
this.dispatchEvent(new PkClearEvent());
|
|
752
|
+
this.controlInput?.focus();
|
|
753
|
+
}
|
|
754
|
+
emitValueChange() {
|
|
755
|
+
this.dispatchEvent(new CustomEvent("pk-change", {
|
|
756
|
+
detail: { value: this.value },
|
|
757
|
+
bubbles: true,
|
|
758
|
+
composed: true
|
|
759
|
+
}));
|
|
760
|
+
this.dispatchEvent(new Event("input", {
|
|
761
|
+
bubbles: true,
|
|
762
|
+
composed: true
|
|
763
|
+
}));
|
|
764
|
+
this.dispatchEvent(new Event("change", {
|
|
765
|
+
bubbles: true,
|
|
766
|
+
composed: true
|
|
767
|
+
}));
|
|
768
|
+
}
|
|
769
|
+
handleInput(event) {
|
|
770
|
+
const next = event.target.value;
|
|
771
|
+
this.value = next;
|
|
772
|
+
this.syncHasValueAttribute();
|
|
773
|
+
this.highlightedIndex = this.autoHighlight ? 0 : -1;
|
|
774
|
+
this.applyOptionState();
|
|
775
|
+
this.emitValueChange();
|
|
776
|
+
if (this.usesAsyncSearch) {
|
|
777
|
+
this.asyncError = null;
|
|
778
|
+
this.scheduleAsyncFetch(next.trim());
|
|
779
|
+
}
|
|
780
|
+
if (!this.open) this.openPanel();
|
|
781
|
+
}
|
|
782
|
+
handleInputKeyDown(event) {
|
|
783
|
+
if (event.key === "Escape" && this.open) {
|
|
784
|
+
event.preventDefault();
|
|
785
|
+
this.closePanel("escape");
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
if (event.key === "ArrowDown" && !this.open) {
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
this.openPanel();
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (!this.open) return;
|
|
794
|
+
if (event.key === "Enter") {
|
|
795
|
+
const enabled = this.getEnabledVisibleOptions();
|
|
796
|
+
if (this.highlightedIndex >= 0 && enabled[this.highlightedIndex]) {
|
|
797
|
+
event.preventDefault();
|
|
798
|
+
this.commitValue(enabled[this.highlightedIndex].value, { close: true });
|
|
799
|
+
} else this.closePanel("api");
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
if (LISTBOX_NAVIGATION_KEYS.has(event.key) && event.key !== "Enter" && event.key !== "Escape") this.onListboxKeyDown(event);
|
|
803
|
+
}
|
|
804
|
+
onListboxKeyDown(event) {
|
|
805
|
+
const enabled = this.getEnabledVisibleOptions();
|
|
806
|
+
this.highlightedIndex = handleListboxKeyDown(event, {
|
|
807
|
+
items: enabled,
|
|
808
|
+
currentIndex: this.highlightedIndex,
|
|
809
|
+
loop: this.loopFocus,
|
|
810
|
+
onSelect: (index) => {
|
|
811
|
+
const option = this.getEnabledVisibleOptions()[index];
|
|
812
|
+
if (option) this.commitValue(option.value, { close: true });
|
|
813
|
+
},
|
|
814
|
+
onClose: () => {
|
|
815
|
+
this.closePanel("escape");
|
|
816
|
+
},
|
|
817
|
+
focusItem: (index) => {
|
|
818
|
+
this.highlightedIndex = index;
|
|
819
|
+
this.syncHighlight();
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
async hide(source = "api") {
|
|
824
|
+
await this.closePanel(source);
|
|
825
|
+
}
|
|
826
|
+
renderHostDecorationSlot(name) {
|
|
827
|
+
if (!this.hasSlotController.test(name)) return A;
|
|
828
|
+
return b`<slot name=${name} part=${name} class=${name === "start" ? "control-start" : "control-end"}></slot>`;
|
|
829
|
+
}
|
|
830
|
+
render() {
|
|
831
|
+
const visibleOptions = this.getEnabledVisibleOptions();
|
|
832
|
+
const showEmpty = this.open && !this.usesAsyncSearch && visibleOptions.length === 0;
|
|
833
|
+
const asyncStatus = this.getAsyncStatusMessage();
|
|
834
|
+
const showClear = (this.clearable || this.withClear) && Boolean(this.value) && !this.disabled;
|
|
835
|
+
const activeDescendant = this.open ? this.getActiveDescendantId() : null;
|
|
836
|
+
return b`
|
|
837
|
+
<input
|
|
838
|
+
class="value-input"
|
|
839
|
+
part="value-input"
|
|
840
|
+
tabindex="-1"
|
|
841
|
+
aria-hidden="true"
|
|
842
|
+
.value=${this.value}
|
|
843
|
+
?required=${this.required}
|
|
844
|
+
@input=${() => this.updateValidity()}
|
|
845
|
+
/>
|
|
846
|
+
<div
|
|
847
|
+
part="control"
|
|
848
|
+
class=${e({
|
|
849
|
+
control: true,
|
|
850
|
+
"is-disabled": this.disabled
|
|
851
|
+
})}
|
|
852
|
+
data-popup-open=${this.open || this.closing ? "" : A}
|
|
853
|
+
@mousedown=${this.handleControlMouseDown}
|
|
854
|
+
>
|
|
855
|
+
${this.renderHostDecorationSlot("start")}
|
|
856
|
+
<input
|
|
857
|
+
part="input"
|
|
858
|
+
class="autocomplete-input control-input"
|
|
859
|
+
type="text"
|
|
860
|
+
role="combobox"
|
|
861
|
+
id=${this.inputId}
|
|
862
|
+
.value=${this.value}
|
|
863
|
+
placeholder=${this.placeholder || A}
|
|
864
|
+
?disabled=${this.disabled}
|
|
865
|
+
aria-label=${this.ariaLabel ?? A}
|
|
866
|
+
aria-expanded=${this.open ? "true" : "false"}
|
|
867
|
+
aria-controls=${this.listboxId}
|
|
868
|
+
aria-autocomplete="both"
|
|
869
|
+
aria-activedescendant=${activeDescendant ?? A}
|
|
870
|
+
@input=${this.handleInput}
|
|
871
|
+
@keydown=${this.handleInputKeyDown}
|
|
872
|
+
/>
|
|
873
|
+
${this.renderHostDecorationSlot("end")}
|
|
874
|
+
${showClear ? b`
|
|
875
|
+
<button
|
|
876
|
+
type="button"
|
|
877
|
+
class="clear-button"
|
|
878
|
+
part="clear-button"
|
|
879
|
+
aria-label="Clear"
|
|
880
|
+
?disabled=${this.disabled}
|
|
881
|
+
@click=${this.handleClear}
|
|
882
|
+
>
|
|
883
|
+
<span class="clear-button-icon" aria-hidden="true">${o(XMARK_ICON)}</span>
|
|
884
|
+
</button>
|
|
885
|
+
` : A}
|
|
886
|
+
</div>
|
|
887
|
+
<pk-popup
|
|
888
|
+
.active=${this.open || this.closing}
|
|
889
|
+
.anchor=${this.controlElement ?? ""}
|
|
890
|
+
.placement=${this.placement}
|
|
891
|
+
.distance=${this.sideOffset}
|
|
892
|
+
.sync=${"width"}
|
|
893
|
+
flip
|
|
894
|
+
shift
|
|
895
|
+
>
|
|
896
|
+
<div
|
|
897
|
+
part="panel"
|
|
898
|
+
class=${e({
|
|
899
|
+
panel: true,
|
|
900
|
+
"pk-popup-content": true,
|
|
901
|
+
closing: this.closing
|
|
902
|
+
})}
|
|
903
|
+
tabindex="-1"
|
|
904
|
+
?hidden=${!this.open && !this.closing}
|
|
905
|
+
data-open=${this.panelAnimated && !this.closing ? "" : A}
|
|
906
|
+
>
|
|
907
|
+
<div
|
|
908
|
+
part="panel-body"
|
|
909
|
+
class="panel-body"
|
|
910
|
+
id=${this.listboxId}
|
|
911
|
+
role="listbox"
|
|
912
|
+
aria-busy=${this.usesAsyncSearch && this.asyncLoading ? "true" : A}
|
|
913
|
+
>
|
|
914
|
+
<slot></slot>
|
|
915
|
+
${asyncStatus ? b`
|
|
916
|
+
<div part="async-status" class="async-status" role="status">${asyncStatus}</div>
|
|
917
|
+
` : A}
|
|
918
|
+
${showEmpty ? b`
|
|
919
|
+
<div part="empty" class="empty">${this.emptyMessage}</div>
|
|
920
|
+
` : A}
|
|
921
|
+
</div>
|
|
922
|
+
</div>
|
|
923
|
+
</pk-popup>
|
|
924
|
+
`;
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
__decorate([n({
|
|
928
|
+
type: Boolean,
|
|
929
|
+
reflect: true
|
|
930
|
+
})], PkAutocomplete.prototype, "open", void 0);
|
|
931
|
+
__decorate([n({ reflect: true })], PkAutocomplete.prototype, "placement", void 0);
|
|
932
|
+
__decorate([n({
|
|
933
|
+
attribute: "side-offset",
|
|
934
|
+
type: Number
|
|
935
|
+
})], PkAutocomplete.prototype, "sideOffset", void 0);
|
|
936
|
+
__decorate([n({
|
|
937
|
+
type: Boolean,
|
|
938
|
+
reflect: true
|
|
939
|
+
})], PkAutocomplete.prototype, "clearable", void 0);
|
|
940
|
+
__decorate([n({
|
|
941
|
+
attribute: "with-clear",
|
|
942
|
+
type: Boolean
|
|
943
|
+
})], PkAutocomplete.prototype, "withClear", void 0);
|
|
944
|
+
__decorate([n({
|
|
945
|
+
attribute: "auto-highlight",
|
|
946
|
+
type: Boolean
|
|
947
|
+
})], PkAutocomplete.prototype, "autoHighlight", void 0);
|
|
948
|
+
__decorate([n({
|
|
949
|
+
type: Boolean,
|
|
950
|
+
reflect: true
|
|
951
|
+
})], PkAutocomplete.prototype, "invalid", void 0);
|
|
952
|
+
__decorate([n({ reflect: true })], PkAutocomplete.prototype, "size", void 0);
|
|
953
|
+
__decorate([n({ reflect: true })], PkAutocomplete.prototype, "width", void 0);
|
|
954
|
+
__decorate([n()], PkAutocomplete.prototype, "placeholder", void 0);
|
|
955
|
+
__decorate([n({ attribute: "empty-message" })], PkAutocomplete.prototype, "emptyMessage", void 0);
|
|
956
|
+
__decorate([n()], PkAutocomplete.prototype, "value", void 0);
|
|
957
|
+
__decorate([n({ attribute: "default-value" })], PkAutocomplete.prototype, "defaultValue", void 0);
|
|
958
|
+
__decorate([n()], PkAutocomplete.prototype, "label", void 0);
|
|
959
|
+
__decorate([n()], PkAutocomplete.prototype, "instructions", void 0);
|
|
960
|
+
__decorate([n({ attribute: "aria-label" })], PkAutocomplete.prototype, "ariaLabel", void 0);
|
|
961
|
+
__decorate([n({
|
|
962
|
+
attribute: "loop-focus",
|
|
963
|
+
type: Boolean
|
|
964
|
+
})], PkAutocomplete.prototype, "loopFocus", void 0);
|
|
965
|
+
__decorate([n({ attribute: false })], PkAutocomplete.prototype, "filter", void 0);
|
|
966
|
+
__decorate([n({
|
|
967
|
+
type: Boolean,
|
|
968
|
+
reflect: true
|
|
969
|
+
})], PkAutocomplete.prototype, "async", void 0);
|
|
970
|
+
__decorate([n({ attribute: "loading-message" })], PkAutocomplete.prototype, "loadingMessage", void 0);
|
|
971
|
+
__decorate([n({ attribute: "start-typing-message" })], PkAutocomplete.prototype, "startTypingMessage", void 0);
|
|
972
|
+
__decorate([n({ attribute: false })], PkAutocomplete.prototype, "fetchOptions", void 0);
|
|
973
|
+
__decorate([e$1("pk-popup")], PkAutocomplete.prototype, "popupElement", void 0);
|
|
974
|
+
__decorate([e$1(".control")], PkAutocomplete.prototype, "controlElement", void 0);
|
|
975
|
+
__decorate([e$1(".control-input")], PkAutocomplete.prototype, "controlInput", void 0);
|
|
976
|
+
__decorate([e$1(".value-input")], PkAutocomplete.prototype, "input", void 0);
|
|
977
|
+
__decorate([r()], PkAutocomplete.prototype, "highlightedIndex", void 0);
|
|
978
|
+
__decorate([r()], PkAutocomplete.prototype, "closing", void 0);
|
|
979
|
+
__decorate([r()], PkAutocomplete.prototype, "panelAnimated", void 0);
|
|
980
|
+
__decorate([r()], PkAutocomplete.prototype, "asyncLoading", void 0);
|
|
981
|
+
__decorate([r()], PkAutocomplete.prototype, "asyncError", void 0);
|
|
982
|
+
PkAutocomplete = __decorate([customElement("pk-autocomplete")], PkAutocomplete);
|
|
983
|
+
//#endregion
|
|
984
|
+
export { PkAutocomplete };
|