@pine-ds/core 4.3.0 → 4.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/components/closest.js +1 -1
- package/components/floating-ui.dom.js +1 -1
- package/components/i18n-format.js +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -1
- package/components/index2.js +1 -1
- package/components/mock-pds-modal.js +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +2 -2
- package/components/pds-container.js +1 -1
- package/components/pds-copytext.js +1 -1
- package/components/pds-datepicker.d.ts +11 -0
- package/components/pds-datepicker.js +1 -0
- package/components/pds-divider.js +1 -1
- package/components/pds-drawer-content.js +1 -1
- package/components/pds-drawer-footer.js +1 -1
- package/components/pds-drawer-header.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu-item.js +1 -1
- package/components/pds-dropdown-menu-separator.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-filter.js +1 -1
- package/components/pds-filters.js +1 -1
- package/components/pds-image.js +1 -1
- package/components/pds-input.js +1 -1
- package/components/pds-input2.js +1 -0
- package/components/pds-link2.js +1 -1
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.js +1 -1
- package/components/pds-modal-footer.js +1 -1
- package/components/pds-modal-header.js +1 -1
- package/components/pds-modal2.js +1 -1
- package/components/pds-multiselect.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-property.js +1 -1
- package/components/pds-radio-group.js +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +1 -1
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +2 -2
- package/components/pds-switch.js +1 -1
- package/components/pds-table-body.js +1 -1
- package/components/pds-table-cell2.js +1 -1
- package/components/pds-table-head-cell2.js +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text2.js +1 -1
- package/components/pds-textarea.js +1 -1
- package/components/pds-toast.js +1 -1
- package/components/pds-tooltip.js +1 -1
- package/components/utils.js +1 -1
- package/dist/cjs/closest-D0qyYtJ3.js +20 -0
- package/dist/cjs/{floating-ui.dom-BZk7Blsu.js → floating-ui.dom-Dc8Anyel.js} +79 -0
- package/dist/cjs/{i18n-format-CrpIhahc.js → i18n-format-BD0PmYzT.js} +1 -0
- package/dist/cjs/{index-CaLa1zy9.js → index-Bl5KnQay.js} +4 -1
- package/dist/cjs/{index-DYvijwA6.js → index-D-QQKB0y.js} +8 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mock-pds-modal.cjs.entry.js +3 -3
- package/dist/cjs/pds-accordion.cjs.entry.js +2 -2
- package/dist/cjs/pds-alert.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +2 -2
- package/dist/cjs/pds-box.cjs.entry.js +2 -2
- package/dist/cjs/pds-button.cjs.entry.js +53 -4
- package/dist/cjs/pds-checkbox.cjs.entry.js +14 -6
- package/dist/cjs/pds-chip.cjs.entry.js +6 -6
- package/dist/cjs/pds-combobox.cjs.entry.js +1225 -117
- package/dist/cjs/pds-container.cjs.entry.js +2 -2
- package/dist/cjs/pds-copytext.cjs.entry.js +5 -5
- package/dist/cjs/pds-datepicker.cjs.entry.js +1962 -0
- package/dist/cjs/pds-divider.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-content.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-header.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer.cjs.entry.js +11 -4
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +11 -4
- package/dist/cjs/pds-filter.cjs.entry.js +3 -3
- package/dist/cjs/pds-filters.cjs.entry.js +2 -2
- package/dist/cjs/pds-icon.cjs.entry.js +1 -1
- package/dist/cjs/pds-image.cjs.entry.js +3 -3
- package/dist/cjs/pds-input.cjs.entry.js +8 -5
- package/dist/cjs/pds-link.cjs.entry.js +5 -5
- package/dist/cjs/pds-loader.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-content.cjs.entry.js +3 -3
- package/dist/cjs/pds-modal-footer.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-header.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal.cjs.entry.js +12 -6
- package/dist/cjs/pds-multiselect.cjs.entry.js +264 -51
- package/dist/cjs/pds-popover.cjs.entry.js +30 -12
- package/dist/cjs/pds-progress.cjs.entry.js +3 -3
- package/dist/cjs/pds-property.cjs.entry.js +2 -2
- package/dist/cjs/pds-radio-group.cjs.entry.js +5 -5
- package/dist/cjs/pds-radio.cjs.entry.js +5 -5
- package/dist/cjs/pds-row.cjs.entry.js +2 -2
- package/dist/cjs/pds-select.cjs.entry.js +3 -3
- package/dist/cjs/pds-sortable-item.cjs.entry.js +3 -3
- package/dist/cjs/pds-sortable.cjs.entry.js +2 -2
- package/dist/cjs/pds-switch.cjs.entry.js +14 -6
- package/dist/cjs/pds-tab.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-cell.cjs.entry.js +5 -5
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +4 -4
- package/dist/cjs/pds-table-head.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +2 -2
- package/dist/cjs/pds-tabs.cjs.entry.js +2 -2
- package/dist/cjs/pds-text.cjs.entry.js +5 -5
- package/dist/cjs/pds-textarea.cjs.entry.js +14 -9
- package/dist/cjs/pds-toast.cjs.entry.js +4 -4
- package/dist/cjs/pds-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/pine-core.cjs.js +2 -2
- package/dist/cjs/{truncation-tooltip-Bps7_rUy.js → truncation-tooltip-CYgQfBLt.js} +1 -1
- package/dist/cjs/{utils-KWALOgy9.js → utils-BhRmyxT8.js} +35 -4
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/pds-button/pds-button.js +53 -2
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +7 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +19 -3
- package/dist/collection/components/pds-chip/pds-chip.js +1 -1
- package/dist/collection/components/pds-combobox/grouped-options-panel.js +262 -0
- package/dist/collection/components/pds-combobox/pds-combobox.css +242 -13
- package/dist/collection/components/pds-combobox/pds-combobox.js +1128 -114
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +240 -0
- package/dist/collection/components/pds-container/pds-container.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
- package/dist/collection/components/pds-datepicker/calendar-portal.js +136 -0
- package/dist/collection/components/pds-datepicker/date-utils.js +132 -0
- package/dist/collection/components/pds-datepicker/datepicker-interface.js +1 -0
- package/dist/collection/components/pds-datepicker/pds-datepicker.css +545 -0
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +2406 -0
- package/dist/collection/components/pds-datepicker/presets.js +96 -0
- package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +195 -0
- package/dist/collection/components/pds-datepicker/value.js +238 -0
- package/dist/collection/components/pds-divider/pds-divider.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer.css +4 -0
- package/dist/collection/components/pds-drawer/pds-drawer.js +9 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +9 -2
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +1 -1
- package/dist/collection/components/pds-filters/pds-filters.js +1 -1
- package/dist/collection/components/pds-image/pds-image.js +2 -2
- package/dist/collection/components/pds-input/pds-input.js +6 -3
- package/dist/collection/components/pds-link/pds-link.js +2 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +2 -2
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal.css +16 -0
- package/dist/collection/components/pds-modal/pds-modal.js +10 -4
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.css +19 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +390 -47
- package/dist/collection/components/pds-multiselect/stories/pds-multiselect.stories.js +136 -1
- package/dist/collection/components/pds-popover/pds-popover.js +29 -11
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-property/pds-property.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +3 -3
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +3 -3
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.css +3 -0
- package/dist/collection/components/pds-switch/pds-switch.js +20 -4
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +11 -6
- package/dist/collection/components/pds-toast/pds-toast.js +3 -3
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +2 -2
- package/dist/collection/utils/closest.js +8 -0
- package/dist/collection/utils/utils.js +33 -4
- package/dist/docs.json +1933 -59
- package/dist/esm/closest-DHPzKMVS.js +17 -0
- package/dist/esm/{floating-ui.dom-DDtwbwIl.js → floating-ui.dom-BPqJgIq6.js} +79 -1
- package/dist/esm/{i18n-format-BKsJZTyn.js → i18n-format-BJgZHCWe.js} +1 -1
- package/dist/esm/{index-DcT8--Dn.js → index-CB8Yh0Nt.js} +4 -1
- package/dist/esm/{index-BU1hN5Vy.js → index-DxI-61GK.js} +5 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mock-pds-modal.entry.js +3 -3
- package/dist/esm/pds-accordion.entry.js +2 -2
- package/dist/esm/pds-alert.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +2 -2
- package/dist/esm/pds-box.entry.js +2 -2
- package/dist/esm/pds-button.entry.js +53 -4
- package/dist/esm/pds-checkbox.entry.js +14 -6
- package/dist/esm/pds-chip.entry.js +6 -6
- package/dist/esm/pds-combobox.entry.js +1225 -117
- package/dist/esm/pds-container.entry.js +2 -2
- package/dist/esm/pds-copytext.entry.js +5 -5
- package/dist/esm/pds-datepicker.entry.js +1960 -0
- package/dist/esm/pds-divider.entry.js +2 -2
- package/dist/esm/pds-drawer-content.entry.js +2 -2
- package/dist/esm/pds-drawer-footer.entry.js +2 -2
- package/dist/esm/pds-drawer-header.entry.js +2 -2
- package/dist/esm/pds-drawer.entry.js +11 -4
- package/dist/esm/pds-dropdown-menu-item.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu.entry.js +11 -4
- package/dist/esm/pds-filter.entry.js +3 -3
- package/dist/esm/pds-filters.entry.js +2 -2
- package/dist/esm/pds-icon.entry.js +1 -1
- package/dist/esm/pds-image.entry.js +3 -3
- package/dist/esm/pds-input.entry.js +8 -5
- package/dist/esm/pds-link.entry.js +5 -5
- package/dist/esm/pds-loader.entry.js +2 -2
- package/dist/esm/pds-modal-content.entry.js +3 -3
- package/dist/esm/pds-modal-footer.entry.js +2 -2
- package/dist/esm/pds-modal-header.entry.js +2 -2
- package/dist/esm/pds-modal.entry.js +12 -6
- package/dist/esm/pds-multiselect.entry.js +264 -51
- package/dist/esm/pds-popover.entry.js +30 -12
- package/dist/esm/pds-progress.entry.js +3 -3
- package/dist/esm/pds-property.entry.js +2 -2
- package/dist/esm/pds-radio-group.entry.js +5 -5
- package/dist/esm/pds-radio.entry.js +5 -5
- package/dist/esm/pds-row.entry.js +2 -2
- package/dist/esm/pds-select.entry.js +3 -3
- package/dist/esm/pds-sortable-item.entry.js +3 -3
- package/dist/esm/pds-sortable.entry.js +2 -2
- package/dist/esm/pds-switch.entry.js +14 -6
- package/dist/esm/pds-tab.entry.js +1 -1
- package/dist/esm/pds-table-body.entry.js +2 -2
- package/dist/esm/pds-table-cell.entry.js +5 -5
- package/dist/esm/pds-table-head-cell.entry.js +4 -4
- package/dist/esm/pds-table-head.entry.js +3 -3
- package/dist/esm/pds-table-row.entry.js +3 -3
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-tabpanel.entry.js +2 -2
- package/dist/esm/pds-tabs.entry.js +2 -2
- package/dist/esm/pds-text.entry.js +5 -5
- package/dist/esm/pds-textarea.entry.js +14 -9
- package/dist/esm/pds-toast.entry.js +4 -4
- package/dist/esm/pds-tooltip.entry.js +4 -4
- package/dist/esm/pine-core.js +3 -3
- package/dist/esm/{truncation-tooltip-CdtEBn_5.js → truncation-tooltip-_902ENWC.js} +1 -1
- package/dist/esm/{utils-u_0lxWnH.js → utils-OYK5-nwe.js} +34 -5
- package/dist/esm-es5/closest-DHPzKMVS.js +1 -0
- package/dist/esm-es5/floating-ui.dom-BPqJgIq6.js +1 -0
- package/dist/esm-es5/{i18n-format-BKsJZTyn.js → i18n-format-BJgZHCWe.js} +1 -1
- package/dist/esm-es5/index-CB8Yh0Nt.js +2 -0
- package/dist/esm-es5/index-DxI-61GK.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +2 -2
- package/dist/esm-es5/pds-container.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-datepicker.entry.js +1 -0
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
- package/dist/esm-es5/pds-drawer.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-filters.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-image.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-property.entry.js +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +2 -2
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/{truncation-tooltip-CdtEBn_5.js → truncation-tooltip-_902ENWC.js} +1 -1
- package/dist/esm-es5/utils-OYK5-nwe.js +1 -0
- package/dist/pine-core/p-0414092a.system.entry.js +1 -0
- package/dist/pine-core/p-04807201.entry.js +1 -0
- package/dist/pine-core/{p-cfcb89d1.system.entry.js → p-07f0d168.system.entry.js} +1 -1
- package/dist/pine-core/p-08f5d19c.entry.js +1 -0
- package/dist/pine-core/{p-d70aa0c7.system.entry.js → p-0aaf8faa.system.entry.js} +1 -1
- package/dist/pine-core/p-0bad5955.entry.js +1 -0
- package/dist/pine-core/{p-99f300ef.system.entry.js → p-0c3bf377.system.entry.js} +1 -1
- package/dist/pine-core/p-0ce79cd0.entry.js +1 -0
- package/dist/pine-core/{p-f682f08a.system.entry.js → p-1057b8c3.system.entry.js} +1 -1
- package/dist/pine-core/{p-089606b8.system.entry.js → p-108c910a.system.entry.js} +1 -1
- package/dist/pine-core/{p-ea986474.system.entry.js → p-166f61a6.system.entry.js} +1 -1
- package/dist/pine-core/{p-95defb53.entry.js → p-16c8f5e3.entry.js} +1 -1
- package/dist/pine-core/p-16e258d1.entry.js +1 -0
- package/dist/pine-core/{p-a8f1a48d.entry.js → p-1be33c95.entry.js} +1 -1
- package/dist/pine-core/{p-70fb83d4.entry.js → p-1e3a31da.entry.js} +1 -1
- package/dist/pine-core/{p-12941e0d.entry.js → p-1f228db9.entry.js} +1 -1
- package/dist/pine-core/p-257c6ef9.entry.js +1 -0
- package/dist/pine-core/p-26415245.system.entry.js +1 -0
- package/dist/pine-core/p-26e1e5bb.entry.js +1 -0
- package/dist/pine-core/p-27c06bf8.entry.js +2 -0
- package/dist/pine-core/p-31aee437.entry.js +1 -0
- package/dist/pine-core/p-330a76f6.system.entry.js +1 -0
- package/dist/pine-core/{p-4ebdb90b.system.entry.js → p-33c63be6.system.entry.js} +1 -1
- package/dist/pine-core/{p-c5b6b545.entry.js → p-344609f9.entry.js} +2 -2
- package/dist/pine-core/{p-2dbc90ba.entry.js → p-3a1711c1.entry.js} +1 -1
- package/dist/pine-core/p-3a9c58bd.system.entry.js +1 -0
- package/dist/pine-core/{p-32fc82c2.entry.js → p-3ebd543f.entry.js} +1 -1
- package/dist/pine-core/p-3fbcb0c8.system.entry.js +1 -0
- package/dist/pine-core/{p-e08e4ca7.entry.js → p-427b4aeb.entry.js} +1 -1
- package/dist/pine-core/{p-f5cf98be.system.entry.js → p-42bd87ea.system.entry.js} +1 -1
- package/dist/pine-core/{p-8d1e7b3c.system.entry.js → p-43c691bf.system.entry.js} +1 -1
- package/dist/pine-core/p-4566d659.system.entry.js +1 -0
- package/dist/pine-core/{p-b9a857fc.system.entry.js → p-4b8cf04a.system.entry.js} +1 -1
- package/dist/pine-core/p-4d6f471c.entry.js +1 -0
- package/dist/pine-core/{p-ec04d4c3.entry.js → p-4e7580c4.entry.js} +1 -1
- package/dist/pine-core/{p-fbb72e66.system.entry.js → p-4f4a2d2a.system.entry.js} +1 -1
- package/dist/pine-core/{p-b8a5597d.entry.js → p-5211aba7.entry.js} +1 -1
- package/dist/pine-core/{p-7e4729e0.entry.js → p-524b7d3f.entry.js} +1 -1
- package/dist/pine-core/{p-c08b1697.entry.js → p-5613c64c.entry.js} +1 -1
- package/dist/pine-core/{p-5a8345e2.entry.js → p-5bb24cb4.entry.js} +1 -1
- package/dist/pine-core/{p-73c3a73f.entry.js → p-5bb80b3c.entry.js} +1 -1
- package/dist/pine-core/{p-e039ebb6.system.entry.js → p-5c6e0a26.system.entry.js} +1 -1
- package/dist/pine-core/{p-b53d9620.system.entry.js → p-5db57551.system.entry.js} +1 -1
- package/dist/pine-core/{p-6b260a97.entry.js → p-5eb00ba5.entry.js} +1 -1
- package/dist/pine-core/p-61756414.system.entry.js +1 -0
- package/dist/pine-core/{p-08196d6c.entry.js → p-682e9e8f.entry.js} +1 -1
- package/dist/pine-core/p-6965db1d.entry.js +1 -0
- package/dist/pine-core/{p-317337e4.entry.js → p-6b180ee2.entry.js} +1 -1
- package/dist/pine-core/{p-d33d65f6.entry.js → p-6c53962f.entry.js} +1 -1
- package/dist/pine-core/p-6da6520b.system.entry.js +3 -0
- package/dist/pine-core/{p-bd9b2931.system.entry.js → p-6e3bf862.system.entry.js} +1 -1
- package/dist/pine-core/{p-9d77f2f8.system.entry.js → p-71c9f866.system.entry.js} +1 -1
- package/dist/pine-core/{p-a616385b.system.entry.js → p-7265b94c.system.entry.js} +1 -1
- package/dist/pine-core/{p-55532d56.system.entry.js → p-74229b5e.system.entry.js} +1 -1
- package/dist/pine-core/p-7512c2d4.system.entry.js +1 -0
- package/dist/pine-core/p-76db406d.system.entry.js +1 -0
- package/dist/pine-core/{p-3b555f06.system.entry.js → p-79aa5f43.system.entry.js} +1 -1
- package/dist/pine-core/{p-77082557.system.entry.js → p-7bbcda0f.system.entry.js} +1 -1
- package/dist/pine-core/p-7c8946e6.entry.js +1 -0
- package/dist/pine-core/p-7c98c90a.system.entry.js +1 -0
- package/dist/pine-core/p-81292c03.system.entry.js +1 -0
- package/dist/pine-core/p-81300046.system.entry.js +1 -0
- package/dist/pine-core/{p-93c52e2b.system.entry.js → p-8252cd84.system.entry.js} +1 -1
- package/dist/pine-core/p-84ba0e6a.system.entry.js +1 -0
- package/dist/pine-core/{p-45d55983.entry.js → p-86fc0bfa.entry.js} +1 -1
- package/dist/pine-core/p-90692bb6.entry.js +1 -0
- package/dist/pine-core/{p-67fc26e5.system.entry.js → p-90ea812c.system.entry.js} +1 -1
- package/dist/pine-core/p-948826db.entry.js +1 -0
- package/dist/pine-core/{p-35edd8b0.entry.js → p-9b66642d.entry.js} +1 -1
- package/dist/pine-core/p-BJgZHCWe.js +1 -0
- package/dist/pine-core/p-BPqJgIq6.js +1 -0
- package/dist/pine-core/p-BSRFZB4I.system.js +1 -0
- package/dist/pine-core/p-BZsj6eAn.system.js +1 -0
- package/dist/pine-core/p-CB8Yh0Nt.js +2 -0
- package/dist/pine-core/{p-B2qvvB3q.system.js → p-CBu9UrXr.system.js} +1 -1
- package/dist/pine-core/p-COtCa1Md.system.js +1 -0
- package/dist/pine-core/p-CTQZ2fkv.system.js +1 -0
- package/dist/pine-core/{p-B2nn1gSd.js → p-CnM3cCof.js} +1 -1
- package/dist/pine-core/p-CnO10OxH.system.js +1 -0
- package/dist/pine-core/p-D-akEPIU.system.js +2 -0
- package/dist/pine-core/p-DHPzKMVS.js +1 -0
- package/dist/pine-core/p-Dx8tEj0U.system.js +1 -0
- package/dist/pine-core/p-DxI-61GK.js +1 -0
- package/dist/pine-core/p-OYK5-nwe.js +1 -0
- package/dist/pine-core/p-a10af84b.system.entry.js +1 -0
- package/dist/pine-core/p-a21b530a.system.entry.js +1 -0
- package/dist/pine-core/{p-b0becff3.system.entry.js → p-a85535a4.system.entry.js} +1 -1
- package/dist/pine-core/p-abc0fe2f.system.entry.js +1 -0
- package/dist/pine-core/p-ac6a5bf0.entry.js +1 -0
- package/dist/pine-core/{p-5f5339ab.entry.js → p-b0526f98.entry.js} +1 -1
- package/dist/pine-core/p-b130b716.entry.js +1 -0
- package/dist/pine-core/{p-4cbb691f.entry.js → p-b195d345.entry.js} +1 -1
- package/dist/pine-core/{p-5c5bd609.entry.js → p-b4923acf.entry.js} +1 -1
- package/dist/pine-core/{p-15a0fa0a.system.entry.js → p-b4e440e3.system.entry.js} +1 -1
- package/dist/pine-core/p-b8693a87.entry.js +1 -0
- package/dist/pine-core/{p-bf025e38.entry.js → p-b8ada1eb.entry.js} +1 -1
- package/dist/pine-core/{p-a6a269da.system.entry.js → p-bb85bbb5.system.entry.js} +1 -1
- package/dist/pine-core/{p-fa8d3155.system.entry.js → p-bbc539bc.system.entry.js} +2 -2
- package/dist/pine-core/{p-f26dcbc2.system.entry.js → p-bf833976.system.entry.js} +1 -1
- package/dist/pine-core/{p-e055c543.entry.js → p-c23097af.entry.js} +1 -1
- package/dist/pine-core/p-c2dd84bd.system.entry.js +1 -0
- package/dist/pine-core/{p-441682f4.system.entry.js → p-c4520b04.system.entry.js} +1 -1
- package/dist/pine-core/{p-f1365550.entry.js → p-c4f68dfc.entry.js} +1 -1
- package/dist/pine-core/{p-fa2a786d.system.entry.js → p-c6fa6744.system.entry.js} +1 -1
- package/dist/pine-core/p-c7dba815.entry.js +1 -0
- package/dist/pine-core/p-cb6f55ff.entry.js +1 -0
- package/dist/pine-core/p-cfb8fa7c.system.entry.js +1 -0
- package/dist/pine-core/{p-2bb101c2.entry.js → p-d0d7d1d4.entry.js} +1 -1
- package/dist/pine-core/{p-4f5aacd9.entry.js → p-d1112c8a.entry.js} +1 -1
- package/dist/pine-core/{p-5f3d0c86.system.entry.js → p-d4e91ad9.system.entry.js} +1 -1
- package/dist/pine-core/{p-44222439.entry.js → p-da018dcb.entry.js} +1 -1
- package/dist/pine-core/{p-57784f2f.system.entry.js → p-dc27abe6.system.entry.js} +1 -1
- package/dist/pine-core/{p-f9f7101e.entry.js → p-dc343b6d.entry.js} +1 -1
- package/dist/pine-core/{p-fb774f89.system.entry.js → p-dde753e7.system.entry.js} +1 -1
- package/dist/pine-core/{p-558ac401.entry.js → p-dea3a582.entry.js} +1 -1
- package/dist/pine-core/p-df29fd41.entry.js +1 -0
- package/dist/pine-core/{p-c6426e16.system.entry.js → p-e4e2eae2.system.entry.js} +1 -1
- package/dist/pine-core/{p-1abae35f.entry.js → p-e8668178.entry.js} +1 -1
- package/dist/pine-core/{p-20753e42.system.entry.js → p-eb28d21d.system.entry.js} +1 -1
- package/dist/pine-core/p-eb71a82d.system.entry.js +1 -0
- package/dist/pine-core/{p-13bb89ff.entry.js → p-ed63873c.entry.js} +1 -1
- package/dist/pine-core/{p-5d2f95bd.entry.js → p-f4f6dc36.entry.js} +1 -1
- package/dist/pine-core/{p-6b3d8c2b.system.entry.js → p-f67a0ca8.system.entry.js} +1 -1
- package/dist/pine-core/{p-003df3b3.entry.js → p-fc455968.entry.js} +1 -1
- package/dist/pine-core/{p-02452806.system.entry.js → p-fe3e2ebd.system.entry.js} +1 -1
- package/dist/pine-core/pine-core.css +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/pine-core/pine-core.js +1 -1
- package/dist/types/components/pds-button/pds-button.d.ts +10 -0
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +5 -0
- package/dist/types/components/pds-combobox/combobox-interface.d.ts +17 -0
- package/dist/types/components/pds-combobox/grouped-options-panel.d.ts +105 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +235 -3
- package/dist/types/components/pds-datepicker/calendar-portal.d.ts +43 -0
- package/dist/types/components/pds-datepicker/date-utils.d.ts +48 -0
- package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +30 -0
- package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +489 -0
- package/dist/types/components/pds-datepicker/presets.d.ts +23 -0
- package/dist/types/components/pds-datepicker/value.d.ts +47 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +1 -0
- package/dist/types/components/pds-multiselect/multiselect-interface.d.ts +19 -0
- package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +56 -1
- package/dist/types/components/pds-popover/pds-popover.d.ts +1 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +5 -0
- package/dist/types/components.d.ts +677 -4
- package/dist/types/utils/closest.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +9 -1
- package/dist/vscode.html-data.json +467 -3
- package/hydrate/index.js +3973 -362
- package/hydrate/index.mjs +3973 -362
- package/package.json +2 -2
- package/dist/cjs/closest-BZXvuB_Y.js +0 -11
- package/dist/esm/closest-DnUJodVd.js +0 -9
- package/dist/esm-es5/closest-DnUJodVd.js +0 -1
- package/dist/esm-es5/floating-ui.dom-DDtwbwIl.js +0 -1
- package/dist/esm-es5/index-BU1hN5Vy.js +0 -1
- package/dist/esm-es5/index-DcT8--Dn.js +0 -2
- package/dist/esm-es5/utils-u_0lxWnH.js +0 -1
- package/dist/pine-core/p-026ee6de.entry.js +0 -1
- package/dist/pine-core/p-03f3fc92.system.entry.js +0 -1
- package/dist/pine-core/p-06375326.system.entry.js +0 -1
- package/dist/pine-core/p-1df5e088.entry.js +0 -1
- package/dist/pine-core/p-24214ab9.system.entry.js +0 -1
- package/dist/pine-core/p-250011ba.entry.js +0 -1
- package/dist/pine-core/p-2b420257.entry.js +0 -1
- package/dist/pine-core/p-375eb7f4.entry.js +0 -1
- package/dist/pine-core/p-3b796898.entry.js +0 -1
- package/dist/pine-core/p-3c5489ce.entry.js +0 -1
- package/dist/pine-core/p-3e868906.system.entry.js +0 -1
- package/dist/pine-core/p-464f23e6.entry.js +0 -1
- package/dist/pine-core/p-49c6112a.entry.js +0 -1
- package/dist/pine-core/p-4bd57896.system.entry.js +0 -1
- package/dist/pine-core/p-6a6a767b.system.entry.js +0 -1
- package/dist/pine-core/p-6dabeebc.system.entry.js +0 -3
- package/dist/pine-core/p-70891202.entry.js +0 -1
- package/dist/pine-core/p-73fa955a.system.entry.js +0 -1
- package/dist/pine-core/p-755e0b3c.system.entry.js +0 -1
- package/dist/pine-core/p-8b051229.entry.js +0 -1
- package/dist/pine-core/p-8d8a8550.system.entry.js +0 -1
- package/dist/pine-core/p-93486f2e.entry.js +0 -1
- package/dist/pine-core/p-93ae562d.entry.js +0 -1
- package/dist/pine-core/p-95b8bece.system.entry.js +0 -1
- package/dist/pine-core/p-9d902000.system.entry.js +0 -1
- package/dist/pine-core/p-9ef355b7.entry.js +0 -1
- package/dist/pine-core/p-BI7Ml0VF.system.js +0 -1
- package/dist/pine-core/p-BKsJZTyn.js +0 -1
- package/dist/pine-core/p-BU1hN5Vy.js +0 -1
- package/dist/pine-core/p-BrLs99ML.system.js +0 -1
- package/dist/pine-core/p-CJ8t3EBJ.system.js +0 -2
- package/dist/pine-core/p-Cr7-rJtJ.system.js +0 -1
- package/dist/pine-core/p-DDtwbwIl.js +0 -1
- package/dist/pine-core/p-D_I-k33A.system.js +0 -1
- package/dist/pine-core/p-DcT8--Dn.js +0 -2
- package/dist/pine-core/p-DnUJodVd.js +0 -1
- package/dist/pine-core/p-a009ab10.system.entry.js +0 -1
- package/dist/pine-core/p-a8cd2ab5.entry.js +0 -1
- package/dist/pine-core/p-b45b8f8b.system.entry.js +0 -1
- package/dist/pine-core/p-b85bb61d.system.entry.js +0 -1
- package/dist/pine-core/p-bdded57a.system.entry.js +0 -1
- package/dist/pine-core/p-c1a65082.entry.js +0 -1
- package/dist/pine-core/p-c1d1befb.system.entry.js +0 -1
- package/dist/pine-core/p-ctdGub9B.system.js +0 -1
- package/dist/pine-core/p-d9c1ee36.system.entry.js +0 -1
- package/dist/pine-core/p-df285ece.system.entry.js +0 -1
- package/dist/pine-core/p-ee114aef.entry.js +0 -1
- package/dist/pine-core/p-ee997fbf.entry.js +0 -2
- package/dist/pine-core/p-f89197c9.entry.js +0 -1
- package/dist/pine-core/p-kYMYDfJY.system.js +0 -1
- package/dist/pine-core/p-u_0lxWnH.js +0 -1
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { computePosition, flip, offset, shift, size, autoUpdate } from "@floating-ui/dom";
|
|
3
|
-
import { debounceEvent } from "../../utils/utils";
|
|
3
|
+
import { cancelDebouncedEvent, debounceEvent, flushDebouncedEvent } from "../../utils/utils";
|
|
4
4
|
import { isSpecTest, messageId, assignDescription } from "../../utils/form";
|
|
5
5
|
import { danger, enlarge } from "@pine-ds/icons/icons";
|
|
6
6
|
import { formatMessage, pluralize } from "../../i18n";
|
|
7
|
+
// Names only: pds-icon's `icon` prop also fetches URLs and data: SVGs, unsanitized.
|
|
8
|
+
const PINE_ICON_NAME = /^[a-z0-9-]+$/i;
|
|
9
|
+
const TABBABLE_SELECTOR = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
7
10
|
/**
|
|
8
11
|
* @slot (default) - Static option elements for the multiselect
|
|
9
12
|
* @slot empty - Custom empty state message when no options match
|
|
10
13
|
* @slot loading - Custom loading indicator
|
|
14
|
+
* @slot trigger - Custom trigger element that replaces the built-in trigger. It opens the dropdown panel and receives `aria-expanded` and `aria-haspopup`; it supplies its own accessible name. Slot the focusable control itself, not a wrapper around it.
|
|
15
|
+
* @slot footer - Links or buttons displayed below the options inside the dropdown panel
|
|
11
16
|
* @part trigger - The trigger surface that opens the dropdown panel
|
|
12
17
|
* @part pill-toggle - The chevron button inside the inline pill trigger
|
|
13
18
|
*/
|
|
14
19
|
export class PdsMultiselect {
|
|
15
20
|
constructor() {
|
|
21
|
+
this.hasDisabledSlottedTrigger = false;
|
|
16
22
|
/**
|
|
17
23
|
* Placeholder text for the input field. Pass a translated string to localize it; defaults to English.
|
|
18
24
|
* @defaultValue 'Select...'
|
|
@@ -138,6 +144,13 @@ export class PdsMultiselect {
|
|
|
138
144
|
* @default 3
|
|
139
145
|
*/
|
|
140
146
|
this.maxInlinePills = 3;
|
|
147
|
+
/**
|
|
148
|
+
* Display mode for options in the dropdown panel.
|
|
149
|
+
* `'text'` shows each option's text (default). `'chip'` shows each option as a
|
|
150
|
+
* pds-chip, with a dot when the option has a `dotColor`.
|
|
151
|
+
* @defaultValue 'text'
|
|
152
|
+
*/
|
|
153
|
+
this.optionDisplay = 'text';
|
|
141
154
|
/**
|
|
142
155
|
* If true, the multiselect is required.
|
|
143
156
|
*/
|
|
@@ -150,6 +163,21 @@ export class PdsMultiselect {
|
|
|
150
163
|
* CSRF header name for authenticated requests. Defaults to `X-CSRF-Token`.
|
|
151
164
|
*/
|
|
152
165
|
this.csrfHeaderName = 'X-CSRF-Token';
|
|
166
|
+
/**
|
|
167
|
+
* Shows an action icon on each option that has an `actionIcon`, such as an edit pencil.
|
|
168
|
+
* The icon shows on the hovered or highlighted option; clicking it, or pressing Right Arrow on the highlighted option, emits `pdsMultiselectOptionAction`.
|
|
169
|
+
*/
|
|
170
|
+
this.optionActions = false;
|
|
171
|
+
/**
|
|
172
|
+
* Tooltip for an option's action icon when the option has no `actionLabel`. Pass a translated string to localize it; `{text}` is interpolated.
|
|
173
|
+
* @defaultValue 'Edit {text}'
|
|
174
|
+
*/
|
|
175
|
+
this.optionActionLabel = 'Edit {text}';
|
|
176
|
+
/**
|
|
177
|
+
* Screen-reader hint on each option that has an action, naming the key that runs it. Pass a translated string to localize it; `{action}` is interpolated with the option's action label.
|
|
178
|
+
* @defaultValue 'Press Right Arrow to {action}'
|
|
179
|
+
*/
|
|
180
|
+
this.optionActionDescription = 'Press Right Arrow to {action}';
|
|
153
181
|
// Internal state
|
|
154
182
|
this.isOpen = false;
|
|
155
183
|
this.searchQuery = '';
|
|
@@ -173,7 +201,7 @@ export class PdsMultiselect {
|
|
|
173
201
|
return;
|
|
174
202
|
// In inline-pill mode, ignore clicks that originated inside a pds-chip.
|
|
175
203
|
// Chip close-button clicks are handled by handlePillRemove; chip body clicks should not toggle the panel.
|
|
176
|
-
if (e && this.selectedDisplay === 'pill' && this.pillPosition === 'inline') {
|
|
204
|
+
if (e && !this.slottedTriggerEl && this.selectedDisplay === 'pill' && this.pillPosition === 'inline') {
|
|
177
205
|
const fromChip = e.composedPath().some(el => { var _a; return ((_a = el.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'pds-chip'; });
|
|
178
206
|
if (fromChip)
|
|
179
207
|
return;
|
|
@@ -186,9 +214,11 @@ export class PdsMultiselect {
|
|
|
186
214
|
}
|
|
187
215
|
};
|
|
188
216
|
this.handleTriggerKeyDown = (e) => {
|
|
217
|
+
if (this.disabled)
|
|
218
|
+
return;
|
|
189
219
|
// Ignore keydown events that bubbled from child elements (e.g. chip close buttons).
|
|
190
220
|
// Only handle keys when the trigger itself is the event target.
|
|
191
|
-
if (e.target !== this.
|
|
221
|
+
if (e.target !== this.activeTriggerEl)
|
|
192
222
|
return;
|
|
193
223
|
switch (e.key) {
|
|
194
224
|
case 'ArrowDown':
|
|
@@ -252,10 +282,43 @@ export class PdsMultiselect {
|
|
|
252
282
|
}
|
|
253
283
|
}
|
|
254
284
|
break;
|
|
285
|
+
// Right Arrow still moves the caret through typed text; a plain Right Arrow at the end runs the action.
|
|
286
|
+
case 'ArrowRight': {
|
|
287
|
+
const option = filteredOptions[this.highlightedIndex];
|
|
288
|
+
const isPlainKey = !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.isComposing;
|
|
289
|
+
if (isPlainKey && option && this.hasOptionAction(option) && this.isCaretAtEndOfSearch()) {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
this.runOptionAction(option);
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
255
295
|
// Escape is handled by the global @Listen('keydown') handler
|
|
256
|
-
case 'Tab':
|
|
257
|
-
this.
|
|
296
|
+
case 'Tab': {
|
|
297
|
+
const firstFooterTabbable = e.shiftKey ? undefined : this.getFooterTabbables()[0];
|
|
298
|
+
firstFooterTabbable === null || firstFooterTabbable === void 0 ? void 0 : firstFooterTabbable.focus();
|
|
299
|
+
if (firstFooterTabbable === null || firstFooterTabbable === void 0 ? void 0 : firstFooterTabbable.matches(':focus')) {
|
|
300
|
+
// Each option's checkbox is a tab stop, so jump past them to the footer.
|
|
301
|
+
e.preventDefault();
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
this.closeDropdown();
|
|
305
|
+
}
|
|
258
306
|
break;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
this.handleFooterKeyDown = (e) => {
|
|
311
|
+
var _a;
|
|
312
|
+
if (e.key !== 'Tab')
|
|
313
|
+
return;
|
|
314
|
+
const tabbables = this.getFooterTabbables();
|
|
315
|
+
const focused = e.composedPath()[0];
|
|
316
|
+
if (e.shiftKey && focused === tabbables[0]) {
|
|
317
|
+
e.preventDefault();
|
|
318
|
+
(_a = this.searchInputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
319
|
+
}
|
|
320
|
+
else if (!e.shiftKey && focused === tabbables[tabbables.length - 1]) {
|
|
321
|
+
this.closeDropdown();
|
|
259
322
|
}
|
|
260
323
|
};
|
|
261
324
|
this.handleContainerFocusOut = () => {
|
|
@@ -270,9 +333,9 @@ export class PdsMultiselect {
|
|
|
270
333
|
const activeElement = document.activeElement;
|
|
271
334
|
// Check if focus is within our component's shadow root
|
|
272
335
|
const isInShadowRoot = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(activeElement);
|
|
273
|
-
// Also check
|
|
274
|
-
const
|
|
275
|
-
if (!isInShadowRoot && !
|
|
336
|
+
// Also check the host itself and its light DOM, where slotted trigger and footer content live
|
|
337
|
+
const isInHost = this.el.contains(activeElement);
|
|
338
|
+
if (!isInShadowRoot && !isInHost) {
|
|
276
339
|
this.pdsMultiselectDismiss.emit();
|
|
277
340
|
this.closeDropdown();
|
|
278
341
|
}
|
|
@@ -287,6 +350,18 @@ export class PdsMultiselect {
|
|
|
287
350
|
return;
|
|
288
351
|
this.highlightedIndex = index;
|
|
289
352
|
};
|
|
353
|
+
this.handleOptionActionMouseDown = (e) => {
|
|
354
|
+
// Stops the row's mousedown from toggling the option, and keeps focus in the search input.
|
|
355
|
+
e.preventDefault();
|
|
356
|
+
e.stopPropagation();
|
|
357
|
+
};
|
|
358
|
+
this.handleOptionActionClick = (option) => () => {
|
|
359
|
+
this.runOptionAction(option);
|
|
360
|
+
};
|
|
361
|
+
// Keeps focus in the search input so the panel stays open until the footer's click lands.
|
|
362
|
+
this.handleFooterMouseDown = (e) => {
|
|
363
|
+
e.preventDefault();
|
|
364
|
+
};
|
|
290
365
|
this.handleScroll = (e) => {
|
|
291
366
|
if (!this.asyncUrl || !this.hasMore || this.loading)
|
|
292
367
|
return;
|
|
@@ -308,7 +383,7 @@ export class PdsMultiselect {
|
|
|
308
383
|
const optionId = String(item.id);
|
|
309
384
|
this.value = this.value.filter(v => v !== optionId);
|
|
310
385
|
this.syncSelectedItems();
|
|
311
|
-
this.
|
|
386
|
+
this.emitChange({ removed: [optionId] });
|
|
312
387
|
// Clear first so screen readers re-announce even when the same item is removed twice
|
|
313
388
|
this.removalAnnouncement = '';
|
|
314
389
|
queueMicrotask(() => { this.removalAnnouncement = formatMessage(this.itemRemovedLabel, { item: item.text }); });
|
|
@@ -317,7 +392,7 @@ export class PdsMultiselect {
|
|
|
317
392
|
(_a = this.searchInputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
318
393
|
}
|
|
319
394
|
else {
|
|
320
|
-
(_b = this.
|
|
395
|
+
(_b = this.activeTriggerEl) === null || _b === void 0 ? void 0 : _b.focus();
|
|
321
396
|
}
|
|
322
397
|
setTimeout(() => { this.isClosingViaSelection = false; }, 0);
|
|
323
398
|
};
|
|
@@ -331,6 +406,7 @@ export class PdsMultiselect {
|
|
|
331
406
|
componentWillLoad() {
|
|
332
407
|
this.originalSearchEmitter = this.pdsMultiselectSearch;
|
|
333
408
|
this.syncSelectedItems();
|
|
409
|
+
this.syncSlottedTrigger();
|
|
334
410
|
}
|
|
335
411
|
componentDidLoad() {
|
|
336
412
|
this.setupDebounce();
|
|
@@ -364,6 +440,7 @@ export class PdsMultiselect {
|
|
|
364
440
|
}
|
|
365
441
|
disconnectedCallback() {
|
|
366
442
|
var _a, _b;
|
|
443
|
+
cancelDebouncedEvent(this.pdsMultiselectSearch);
|
|
367
444
|
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
368
445
|
(_b = this.cleanupAutoUpdate) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
369
446
|
this.clearAsyncFetchState();
|
|
@@ -373,6 +450,8 @@ export class PdsMultiselect {
|
|
|
373
450
|
this.pdsMultiselectSearch = debounce === undefined
|
|
374
451
|
? originalSearchEmitter !== null && originalSearchEmitter !== void 0 ? originalSearchEmitter : pdsMultiselectSearch
|
|
375
452
|
: debounceEvent(pdsMultiselectSearch, debounce);
|
|
453
|
+
// After the swap, so an emit made while flushing goes to the new emitter, not the old one.
|
|
454
|
+
flushDebouncedEvent(pdsMultiselectSearch);
|
|
376
455
|
}
|
|
377
456
|
valueChanged(newValue) {
|
|
378
457
|
// Handle JSON string values (from HTML attributes)
|
|
@@ -418,26 +497,42 @@ export class PdsMultiselect {
|
|
|
418
497
|
// This handles the case where value is set before options are loaded (e.g., from slot)
|
|
419
498
|
this.syncSelectedItems();
|
|
420
499
|
}
|
|
500
|
+
isOpenChanged() {
|
|
501
|
+
var _a;
|
|
502
|
+
(_a = this.slottedTriggerEl) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', String(this.isOpen));
|
|
503
|
+
}
|
|
504
|
+
disabledChanged() {
|
|
505
|
+
this.syncSlottedTrigger();
|
|
506
|
+
}
|
|
421
507
|
/**
|
|
422
508
|
* Sets focus on the trigger button.
|
|
423
509
|
*/
|
|
424
510
|
async setFocus() {
|
|
425
511
|
var _a;
|
|
426
|
-
(_a = this.
|
|
512
|
+
(_a = this.activeTriggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
427
513
|
}
|
|
428
514
|
/**
|
|
429
515
|
* Clears all selected values and resets the component.
|
|
430
516
|
*/
|
|
431
517
|
async clear() {
|
|
432
518
|
const hadValues = this.value.length > 0 || this.searchQuery !== '';
|
|
519
|
+
const removed = this.ensureValueArray();
|
|
433
520
|
this.value = [];
|
|
434
521
|
this.searchQuery = '';
|
|
435
522
|
this.syncSelectedItems();
|
|
436
523
|
this.updateFormValue();
|
|
437
524
|
if (hadValues) {
|
|
438
|
-
this.
|
|
525
|
+
this.emitChange({ removed });
|
|
439
526
|
}
|
|
440
527
|
}
|
|
528
|
+
/**
|
|
529
|
+
* Refetches the first page of options from `asyncUrl` for the current search, such as after an option is renamed
|
|
530
|
+
* or recolored elsewhere. Selected items in that page pick up the new text and dot color without emitting a change;
|
|
531
|
+
* other selected items keep the text and dot color they were last loaded with. Does nothing without `asyncUrl`.
|
|
532
|
+
*/
|
|
533
|
+
async refreshOptions() {
|
|
534
|
+
await this.fetchOptions(this.searchQuery, 1);
|
|
535
|
+
}
|
|
441
536
|
/**
|
|
442
537
|
* Handle global keyboard events for accessibility.
|
|
443
538
|
* Closes dropdown on Escape key press regardless of focus location.
|
|
@@ -450,12 +545,70 @@ export class PdsMultiselect {
|
|
|
450
545
|
event.preventDefault();
|
|
451
546
|
this.pdsMultiselectDismiss.emit();
|
|
452
547
|
this.closeDropdown();
|
|
453
|
-
(_a = this.
|
|
548
|
+
(_a = this.activeTriggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
get activeTriggerEl() {
|
|
552
|
+
var _a;
|
|
553
|
+
return (_a = this.slottedTriggerEl) !== null && _a !== void 0 ? _a : this.triggerEl;
|
|
554
|
+
}
|
|
555
|
+
syncSlottedTrigger() {
|
|
556
|
+
const trigger = Array.from(this.el.children).find(child => child.getAttribute('slot') === 'trigger');
|
|
557
|
+
if (trigger !== this.slottedTriggerEl) {
|
|
558
|
+
const previous = this.slottedTriggerEl;
|
|
559
|
+
if (previous) {
|
|
560
|
+
previous.removeEventListener('click', this.handleTriggerClick);
|
|
561
|
+
previous.removeEventListener('keydown', this.handleTriggerKeyDown);
|
|
562
|
+
previous.removeAttribute('aria-expanded');
|
|
563
|
+
previous.removeAttribute('aria-haspopup');
|
|
564
|
+
previous.removeAttribute('aria-disabled');
|
|
565
|
+
this.setSlottedTriggerDisabled(previous, false);
|
|
566
|
+
}
|
|
567
|
+
trigger === null || trigger === void 0 ? void 0 : trigger.addEventListener('click', this.handleTriggerClick);
|
|
568
|
+
trigger === null || trigger === void 0 ? void 0 : trigger.addEventListener('keydown', this.handleTriggerKeyDown);
|
|
569
|
+
this.slottedTriggerEl = trigger;
|
|
570
|
+
}
|
|
571
|
+
if (!trigger)
|
|
572
|
+
return;
|
|
573
|
+
trigger.setAttribute('aria-haspopup', 'listbox');
|
|
574
|
+
trigger.setAttribute('aria-expanded', String(this.isOpen));
|
|
575
|
+
if (this.disabled) {
|
|
576
|
+
trigger.setAttribute('aria-disabled', 'true');
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
trigger.removeAttribute('aria-disabled');
|
|
580
|
+
}
|
|
581
|
+
this.setSlottedTriggerDisabled(trigger, this.disabled);
|
|
582
|
+
}
|
|
583
|
+
setSlottedTriggerDisabled(trigger, disabled) {
|
|
584
|
+
if (!('disabled' in trigger)) {
|
|
585
|
+
// A custom element gets its `disabled` property once it's defined, which can be after the multiselect loads.
|
|
586
|
+
if (disabled && trigger.localName.includes('-') && customElements.get(trigger.localName) === undefined) {
|
|
587
|
+
customElements.whenDefined(trigger.localName).then(() => this.syncSlottedTrigger());
|
|
588
|
+
}
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const control = trigger;
|
|
592
|
+
// Only re-enable a trigger the multiselect disabled, so one the consumer disabled stays disabled.
|
|
593
|
+
if (disabled && !control.disabled) {
|
|
594
|
+
control.disabled = true;
|
|
595
|
+
this.hasDisabledSlottedTrigger = true;
|
|
596
|
+
}
|
|
597
|
+
else if (!disabled && this.hasDisabledSlottedTrigger) {
|
|
598
|
+
control.disabled = false;
|
|
599
|
+
this.hasDisabledSlottedTrigger = false;
|
|
454
600
|
}
|
|
455
601
|
}
|
|
456
602
|
setupMutationObserver() {
|
|
457
|
-
this.observer = new MutationObserver(
|
|
458
|
-
this.
|
|
603
|
+
this.observer = new MutationObserver(records => {
|
|
604
|
+
if (records.some(record => record.target === this.el)) {
|
|
605
|
+
this.syncSlottedTrigger();
|
|
606
|
+
}
|
|
607
|
+
// Changes inside the slotted trigger, like re-rendered chips, can't change the options.
|
|
608
|
+
const trigger = this.slottedTriggerEl;
|
|
609
|
+
if (!trigger || records.some(record => !trigger.contains(record.target))) {
|
|
610
|
+
this.updateOptionsFromSlot();
|
|
611
|
+
}
|
|
459
612
|
});
|
|
460
613
|
this.observer.observe(this.el, {
|
|
461
614
|
childList: true,
|
|
@@ -469,18 +622,12 @@ export class PdsMultiselect {
|
|
|
469
622
|
return;
|
|
470
623
|
const options = [];
|
|
471
624
|
slot.assignedElements({ flatten: true }).forEach(el => {
|
|
472
|
-
var _a;
|
|
473
625
|
if (el.tagName === 'OPTGROUP') {
|
|
474
626
|
const optgroup = el;
|
|
475
627
|
const groupLabel = optgroup.label;
|
|
476
628
|
const groupDisabled = optgroup.disabled;
|
|
477
629
|
optgroup.querySelectorAll('option').forEach((opt) => {
|
|
478
|
-
|
|
479
|
-
const option = {
|
|
480
|
-
id: opt.value,
|
|
481
|
-
text: ((_a = opt.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || opt.value,
|
|
482
|
-
disabled: opt.disabled || groupDisabled || undefined,
|
|
483
|
-
};
|
|
630
|
+
const option = this.parseSlottedOption(opt, groupDisabled);
|
|
484
631
|
if (groupLabel) {
|
|
485
632
|
option.group = groupLabel;
|
|
486
633
|
}
|
|
@@ -488,12 +635,7 @@ export class PdsMultiselect {
|
|
|
488
635
|
});
|
|
489
636
|
}
|
|
490
637
|
else if (el.tagName === 'OPTION') {
|
|
491
|
-
|
|
492
|
-
options.push({
|
|
493
|
-
id: opt.value,
|
|
494
|
-
text: ((_a = opt.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || opt.value,
|
|
495
|
-
disabled: opt.disabled || undefined,
|
|
496
|
-
});
|
|
638
|
+
options.push(this.parseSlottedOption(el, false));
|
|
497
639
|
}
|
|
498
640
|
});
|
|
499
641
|
// Only update if we actually found options AND we're not using async/external options
|
|
@@ -502,6 +644,27 @@ export class PdsMultiselect {
|
|
|
502
644
|
this.internalOptions = options;
|
|
503
645
|
}
|
|
504
646
|
}
|
|
647
|
+
parseSlottedOption(opt, groupDisabled) {
|
|
648
|
+
var _a;
|
|
649
|
+
const option = {
|
|
650
|
+
id: opt.value,
|
|
651
|
+
text: ((_a = opt.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || opt.value,
|
|
652
|
+
disabled: opt.disabled || groupDisabled || undefined,
|
|
653
|
+
};
|
|
654
|
+
const dotColor = opt.getAttribute('data-dot-color');
|
|
655
|
+
if (dotColor) {
|
|
656
|
+
option.dotColor = dotColor;
|
|
657
|
+
}
|
|
658
|
+
const actionIcon = opt.getAttribute('data-action-icon');
|
|
659
|
+
if (actionIcon) {
|
|
660
|
+
option.actionIcon = actionIcon;
|
|
661
|
+
}
|
|
662
|
+
const actionLabel = opt.getAttribute('data-action-label');
|
|
663
|
+
if (actionLabel) {
|
|
664
|
+
option.actionLabel = actionLabel;
|
|
665
|
+
}
|
|
666
|
+
return option;
|
|
667
|
+
}
|
|
505
668
|
clearAsyncFetchState() {
|
|
506
669
|
var _a;
|
|
507
670
|
if (this.fetchDebounceTimer !== undefined) {
|
|
@@ -611,7 +774,7 @@ export class PdsMultiselect {
|
|
|
611
774
|
this.internals.setFormValue(formData);
|
|
612
775
|
// Update validity state for required validation
|
|
613
776
|
if (this.required && valueArray.length === 0) {
|
|
614
|
-
this.internals.setValidity({ valueMissing: true }, 'Please select at least one option.', this.
|
|
777
|
+
this.internals.setValidity({ valueMissing: true }, 'Please select at least one option.', this.activeTriggerEl);
|
|
615
778
|
}
|
|
616
779
|
else {
|
|
617
780
|
this.internals.setValidity({});
|
|
@@ -764,10 +927,7 @@ export class PdsMultiselect {
|
|
|
764
927
|
newOption,
|
|
765
928
|
});
|
|
766
929
|
// Emit change event with synced items
|
|
767
|
-
this.
|
|
768
|
-
values: this.value,
|
|
769
|
-
items: this.selectedItems,
|
|
770
|
-
});
|
|
930
|
+
this.emitChange({ added: [String(newOption.id)] });
|
|
771
931
|
// Clear search and keep dropdown open
|
|
772
932
|
this.searchQuery = '';
|
|
773
933
|
this.highlightedIndex = -1;
|
|
@@ -784,6 +944,44 @@ export class PdsMultiselect {
|
|
|
784
944
|
this.creating = false;
|
|
785
945
|
}
|
|
786
946
|
}
|
|
947
|
+
getFooterTabbables() {
|
|
948
|
+
const candidates = [];
|
|
949
|
+
Array.from(this.el.children)
|
|
950
|
+
.filter(child => child.getAttribute('slot') === 'footer')
|
|
951
|
+
.forEach(content => candidates.push(content, ...Array.from(content.querySelectorAll('*'))));
|
|
952
|
+
// Browsers without checkVisibility (Safari before 17.4) count every control as visible.
|
|
953
|
+
return candidates
|
|
954
|
+
.map(el => { var _a; return (el.matches(TABBABLE_SELECTOR) ? el : (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(TABBABLE_SELECTOR)); })
|
|
955
|
+
.filter((el) => { var _a, _b; return !!el && ((_b = (_a = el.checkVisibility) === null || _a === void 0 ? void 0 : _a.call(el)) !== null && _b !== void 0 ? _b : true); });
|
|
956
|
+
}
|
|
957
|
+
isCaretAtEndOfSearch() {
|
|
958
|
+
var _a, _b;
|
|
959
|
+
const input = this.searchInputEl;
|
|
960
|
+
if (!input)
|
|
961
|
+
return true;
|
|
962
|
+
const end = input.value.length;
|
|
963
|
+
return ((_a = input.selectionStart) !== null && _a !== void 0 ? _a : end) === end && ((_b = input.selectionEnd) !== null && _b !== void 0 ? _b : end) === end;
|
|
964
|
+
}
|
|
965
|
+
hasOptionAction(option) {
|
|
966
|
+
return (this.optionActions &&
|
|
967
|
+
typeof option.actionIcon === 'string' &&
|
|
968
|
+
PINE_ICON_NAME.test(option.actionIcon) &&
|
|
969
|
+
!option.isCreateOption &&
|
|
970
|
+
!option.disabled);
|
|
971
|
+
}
|
|
972
|
+
// Without hover, revealing the icon would take a tap that also toggles the option, so touch shows every icon.
|
|
973
|
+
get isHoverless() {
|
|
974
|
+
var _a, _b, _c;
|
|
975
|
+
(_a = this.hoverlessQuery) !== null && _a !== void 0 ? _a : (this.hoverlessQuery = (_b = window.matchMedia) === null || _b === void 0 ? void 0 : _b.call(window, '(hover: none)'));
|
|
976
|
+
return !!((_c = this.hoverlessQuery) === null || _c === void 0 ? void 0 : _c.matches);
|
|
977
|
+
}
|
|
978
|
+
runOptionAction(option) {
|
|
979
|
+
var _a;
|
|
980
|
+
this.isClosingViaSelection = true;
|
|
981
|
+
this.closeDropdown();
|
|
982
|
+
(_a = this.activeTriggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
983
|
+
this.pdsMultiselectOptionAction.emit({ option });
|
|
984
|
+
}
|
|
787
985
|
openDropdown() {
|
|
788
986
|
if (this.disabled)
|
|
789
987
|
return;
|
|
@@ -828,12 +1026,12 @@ export class PdsMultiselect {
|
|
|
828
1026
|
return;
|
|
829
1027
|
// In inline pill mode, triggerEl is the small chevron button — use the full-width
|
|
830
1028
|
// wrapper div as the Floating UI reference so the panel aligns with the whole trigger.
|
|
831
|
-
const referenceEl = this.pillInlineTriggerEl || this.triggerEl || this.containerEl;
|
|
1029
|
+
const referenceEl = this.slottedTriggerEl || this.pillInlineTriggerEl || this.triggerEl || this.containerEl;
|
|
832
1030
|
const { minWidth, panelWidth } = this;
|
|
833
1031
|
const updatePosition = () => {
|
|
834
1032
|
computePosition(referenceEl, this.panelEl, {
|
|
835
1033
|
placement: 'bottom-start',
|
|
836
|
-
strategy: '
|
|
1034
|
+
strategy: 'fixed',
|
|
837
1035
|
middleware: [
|
|
838
1036
|
offset(12),
|
|
839
1037
|
flip(),
|
|
@@ -870,6 +1068,9 @@ export class PdsMultiselect {
|
|
|
870
1068
|
highlighted === null || highlighted === void 0 ? void 0 : highlighted.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
871
1069
|
});
|
|
872
1070
|
}
|
|
1071
|
+
emitChange({ added = [], removed = [] }) {
|
|
1072
|
+
this.pdsMultiselectChange.emit({ values: this.value, items: this.selectedItems, added, removed });
|
|
1073
|
+
}
|
|
873
1074
|
toggleOption(option) {
|
|
874
1075
|
var _a, _b;
|
|
875
1076
|
if (option.disabled)
|
|
@@ -898,14 +1099,11 @@ export class PdsMultiselect {
|
|
|
898
1099
|
// Sync selected items to ensure no duplicates and accurate state
|
|
899
1100
|
this.syncSelectedItems();
|
|
900
1101
|
// Emit change event with synced items
|
|
901
|
-
this.
|
|
902
|
-
values: this.value,
|
|
903
|
-
items: this.selectedItems,
|
|
904
|
-
});
|
|
1102
|
+
this.emitChange(isSelected ? { removed: [optionId] } : { added: [optionId] });
|
|
905
1103
|
if (this.closePanelOnSelect) {
|
|
906
1104
|
this.isClosingViaSelection = true;
|
|
907
1105
|
this.closeDropdown();
|
|
908
|
-
(_a = this.
|
|
1106
|
+
(_a = this.activeTriggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
909
1107
|
}
|
|
910
1108
|
else {
|
|
911
1109
|
// Keep focus on search input, don't close dropdown
|
|
@@ -942,13 +1140,22 @@ export class PdsMultiselect {
|
|
|
942
1140
|
const isHighlighted = index === this.highlightedIndex && !isCreateOption;
|
|
943
1141
|
const optionId = `${this.componentId}-option-${index}`;
|
|
944
1142
|
const isCreateDisabled = isCreateOption && this.creating;
|
|
1143
|
+
const hasAction = this.hasOptionAction(option);
|
|
945
1144
|
return (h("li", { key: String(option.id), id: optionId, class: {
|
|
946
1145
|
'pds-multiselect__option': true,
|
|
947
1146
|
'pds-multiselect__option--highlighted': isHighlighted,
|
|
948
1147
|
'pds-multiselect__option--selected': isSelected,
|
|
949
1148
|
'pds-multiselect__option--create': isCreateOption,
|
|
950
1149
|
'pds-multiselect__option--disabled': isDisabled || isCreateDisabled,
|
|
951
|
-
}, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": isDisabled || isCreateDisabled ? 'true' : undefined, "aria-label": isCreateOption ? formatMessage(this.createOptionAriaLabel, { text: option.text }) : undefined, "data-index": index, onMouseDown: this.handleOptionMouseDown(option), onMouseEnter: this.handleOptionMouseEnter(index, option) }, isCreateOption ? (h("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, h("pds-icon", { name: "add", size: "small" }), h("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (h("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }))));
|
|
1150
|
+
}, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": isDisabled || isCreateDisabled ? 'true' : undefined, "aria-label": isCreateOption ? formatMessage(this.createOptionAriaLabel, { text: option.text }) : undefined, "aria-describedby": hasAction ? `${optionId}-action-description` : undefined, "data-index": index, onMouseDown: this.handleOptionMouseDown(option), onMouseEnter: this.handleOptionMouseEnter(index, option) }, isCreateOption ? (h("pds-box", { class: "pds-multiselect__create-option", "align-items": "center", gap: "xs" }, h("pds-icon", { name: "add", size: "small" }), h("pds-text", null, formatMessage(this.createOptionLabel, { text: option.text })))) : (h("pds-checkbox", { componentId: `${this.componentId}-checkbox-${index}`, checked: isSelected, label: option.text, disabled: isDisabled, style: { pointerEvents: 'none' } }, this.optionDisplay === 'chip' && (h("pds-chip", { slot: "label", sentiment: "subtle", dot: !!option.dotColor, "dot-color": option.dotColor }, option.text)))), hasAction && this.renderOptionAction(option, optionId, isHighlighted)));
|
|
1151
|
+
}
|
|
1152
|
+
renderOptionAction(option, optionId, isHighlighted) {
|
|
1153
|
+
var _a;
|
|
1154
|
+
const label = formatMessage((_a = option.actionLabel) !== null && _a !== void 0 ? _a : this.optionActionLabel, { text: option.text });
|
|
1155
|
+
return [
|
|
1156
|
+
h("span", { class: "pds-multiselect__option-action", title: label, "aria-hidden": "true", onMouseDown: this.handleOptionActionMouseDown, onClick: this.handleOptionActionClick(option) }, (isHighlighted || this.isHoverless) && h("pds-icon", { name: option.actionIcon })),
|
|
1157
|
+
h("span", { id: `${optionId}-action-description`, hidden: true }, formatMessage(this.optionActionDescription, { action: label })),
|
|
1158
|
+
];
|
|
952
1159
|
}
|
|
953
1160
|
renderSelectedItemsList() {
|
|
954
1161
|
if (this.hideSelectedItems || this.selectedItems.length === 0)
|
|
@@ -962,12 +1169,13 @@ export class PdsMultiselect {
|
|
|
962
1169
|
const valueArray = this.ensureValueArray();
|
|
963
1170
|
const hasSlottedEmpty = !!this.el.querySelector('[slot="empty"]');
|
|
964
1171
|
const hasSlottedLoading = !!this.el.querySelector('[slot="loading"]');
|
|
1172
|
+
const hasSlottedFooter = !!this.el.querySelector('[slot="footer"]');
|
|
965
1173
|
return (h("div", { class: "pds-multiselect__panel", ref: el => (this.panelEl = el), style: { minWidth: this.minWidth } }, h("div", { class: "pds-multiselect__search" }, h("pds-icon", { name: "search", size: "small" }), h("input", { ref: el => (this.searchInputEl = el), type: "text", class: "pds-multiselect__search-input", placeholder: this.searchPlaceholder, value: this.searchQuery, "aria-label": this.searchOptionsLabel, "aria-controls": `${this.componentId}-listbox`, "aria-activedescendant": this.highlightedIndex >= 0 ? `${this.componentId}-option-${this.highlightedIndex}` : undefined, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": "true", "aria-autocomplete": "list", autocomplete: "off", onInput: this.handleSearchInputChange, onKeyDown: this.handleSearchInputKeyDown })), this.renderSelectedItemsList(), h("ul", { class: "pds-multiselect__listbox", role: "listbox", "aria-multiselectable": "true", "aria-label": this.label || this.optionsLabel, id: `${this.componentId}-listbox`, ref: el => (this.listboxEl = el), style: { maxHeight: this.maxHeight }, onScroll: this.handleScroll }, this.loading && (h("li", { class: "pds-multiselect__loading", role: "presentation" }, hasSlottedLoading ? (h("slot", { name: "loading" })) : (h("pds-loader", { size: "small" })))), !this.loading && filteredOptions.length === 0 && (h("li", { class: "pds-multiselect__empty", role: "presentation" }, hasSlottedEmpty ? (h("slot", { name: "empty" })) : (h("span", null, this.noOptionsFoundLabel)))), this.getGroupedRenderItems(filteredOptions).map((item, itemIndex) => {
|
|
966
1174
|
if (item.type === 'group') {
|
|
967
1175
|
return (h("li", { key: `group-${itemIndex}`, role: "group", "aria-label": item.group, class: "pds-multiselect__group" }, h("span", { class: "pds-multiselect__group-header", "aria-hidden": "true" }, item.group), h("ul", { class: "pds-multiselect__group-list", role: "presentation" }, item.options.map(({ option, index }) => this.renderOption(option, index, valueArray)))));
|
|
968
1176
|
}
|
|
969
1177
|
return this.renderOption(item.option, item.index, valueArray);
|
|
970
|
-
}), this.hasMore && !this.loading && (h("li", { class: "pds-multiselect__load-more", role: "presentation" }, h("pds-loader", { size: "small" }))))));
|
|
1178
|
+
}), this.hasMore && !this.loading && (h("li", { class: "pds-multiselect__load-more", role: "presentation" }, h("pds-loader", { size: "small" })))), hasSlottedFooter && (h("div", { class: "pds-multiselect__footer", onMouseDown: this.handleFooterMouseDown, onKeyDown: this.handleFooterKeyDown }, h("slot", { name: "footer" })))));
|
|
971
1179
|
}
|
|
972
1180
|
renderInlinePills() {
|
|
973
1181
|
const hasSelections = this.selectedItems.length > 0;
|
|
@@ -1021,17 +1229,17 @@ export class PdsMultiselect {
|
|
|
1021
1229
|
}
|
|
1022
1230
|
render() {
|
|
1023
1231
|
const hasSelections = this.selectedItems.length > 0;
|
|
1024
|
-
return (h(Host, { key: '
|
|
1232
|
+
return (h(Host, { key: '295354c218d03a512ee87a9f19d2267a59731eb1', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '8696c02fad869239fa85dcec7f92a3efb402c963', class: "pds-multiselect", onFocusout: this.handleContainerFocusOut }, this.label && (h("label", { key: '2a9cc565c5dbcf78305eb65e94d795669fb0f93b', id: `${this.componentId}-label`, htmlFor: this.componentId, class: {
|
|
1025
1233
|
'pds-multiselect__label': true,
|
|
1026
1234
|
'visually-hidden': this.hideLabel,
|
|
1027
|
-
} }, this.label)), h("div", { key: '
|
|
1235
|
+
} }, this.label)), h("div", { key: '9358ebffb50e74fe4ceb9ca1c13cf819cc3e96e6', class: "pds-multiselect__wrapper", ref: el => (this.containerEl = el), style: { width: this.triggerWidth } }, this.slottedTriggerEl ? (h("slot", { name: "trigger" })) : this.selectedDisplay === 'pill' && this.pillPosition === 'inline' ? (h("div", { ref: el => (this.pillInlineTriggerEl = el || undefined), part: "trigger", class: {
|
|
1028
1236
|
'pds-multiselect__trigger': true,
|
|
1029
1237
|
'pds-multiselect__trigger--open': this.isOpen,
|
|
1030
1238
|
'pds-multiselect__trigger--disabled': this.disabled,
|
|
1031
1239
|
'pds-multiselect__trigger--invalid': this.invalid || !!this.errorMessage,
|
|
1032
1240
|
'pds-multiselect__trigger--has-value': hasSelections,
|
|
1033
1241
|
'pds-multiselect__trigger--pill-inline': true,
|
|
1034
|
-
}, onClick: this.handleTriggerClick }, this.renderInlinePills(), h("button", { ref: el => (this.triggerEl = el), type: "button", id: this.componentId, part: "pill-toggle", class: "pds-multiselect__pill-toggle", disabled: this.disabled, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-labelledby": this.label ? `${this.componentId}-label` : undefined, "aria-required": this.required ? 'true' : undefined, "aria-describedby": assignDescription(this.componentId, this.invalid || !!this.errorMessage, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid || !!this.errorMessage ? 'true' : undefined, onKeyDown: this.handleTriggerKeyDown }, h("pds-icon", { class: "pds-multiselect__icon", icon: enlarge })))) : (h("button", { ref: el => (this.triggerEl = el), type: "button", part: "trigger", class: {
|
|
1242
|
+
}, onClick: this.handleTriggerClick }, this.renderInlinePills(), h("button", { ref: el => (this.triggerEl = el), type: "button", id: this.componentId, part: "pill-toggle", class: "pds-multiselect__pill-toggle", disabled: this.disabled, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-labelledby": this.label ? `${this.componentId}-label` : undefined, "aria-required": this.required ? 'true' : undefined, "aria-describedby": assignDescription(this.componentId, this.invalid || !!this.errorMessage, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid || !!this.errorMessage ? 'true' : undefined, onKeyDown: this.handleTriggerKeyDown }, h("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge })))) : (h("button", { ref: el => (this.triggerEl = el), type: "button", part: "trigger", class: {
|
|
1035
1243
|
'pds-multiselect__trigger': true,
|
|
1036
1244
|
'pds-multiselect__trigger--open': this.isOpen,
|
|
1037
1245
|
'pds-multiselect__trigger--disabled': this.disabled,
|
|
@@ -1040,7 +1248,7 @@ export class PdsMultiselect {
|
|
|
1040
1248
|
}, id: this.componentId, disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-describedby": assignDescription(this.componentId, this.invalid || !!this.errorMessage, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid || !!this.errorMessage ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, h("span", { class: {
|
|
1041
1249
|
'pds-multiselect__trigger-text': true,
|
|
1042
1250
|
'pds-multiselect__trigger-text--placeholder': !hasSelections || (this.selectedDisplay === 'pill' && this.pillPosition === 'below'),
|
|
1043
|
-
} }, this.getTriggerText()), h("pds-icon", { class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), h("span", { key: '
|
|
1251
|
+
} }, this.getTriggerText()), h("pds-icon", { "aria-hidden": "true", class: "pds-multiselect__icon", icon: enlarge }))), this.renderDropdown()), this.selectedDisplay === 'pill' && this.pillPosition === 'below' && this.renderBelowPills(), h("span", { key: '722da251199792366dc72b6c7f016e24ae807b30', class: "visually-hidden", "aria-live": "polite", "aria-atomic": "true" }, this.removalAnnouncement), this.helperMessage && !(this.errorMessage && this.errorMessage.length > 0) && (h("p", { key: '7b4da9b2e04f53f3e8f245c119135f3b664897ec', class: "pds-multiselect__helper", id: messageId(this.componentId, 'helper') }, this.helperMessage)), this.errorMessage && (h("p", { key: '95a152f6a350eee2f67dbab2930f19e583ca3b85', class: "pds-multiselect__error", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: '7b9cded907054757a6f054d0d325811a2199e496', icon: danger, size: "small" }), this.errorMessage)), h("div", { key: '8b07974c8e2d838d76c17c3a52ba4282fb101968', style: { display: 'none' } }, h("slot", { key: '0a34d582bc4dd780072f00ac13bfdce7e297191e' })))));
|
|
1044
1252
|
}
|
|
1045
1253
|
static get is() { return "pds-multiselect"; }
|
|
1046
1254
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1763,6 +1971,29 @@ export class PdsMultiselect {
|
|
|
1763
1971
|
"attribute": "max-inline-pills",
|
|
1764
1972
|
"defaultValue": "3"
|
|
1765
1973
|
},
|
|
1974
|
+
"optionDisplay": {
|
|
1975
|
+
"type": "string",
|
|
1976
|
+
"mutable": false,
|
|
1977
|
+
"complexType": {
|
|
1978
|
+
"original": "'text' | 'chip'",
|
|
1979
|
+
"resolved": "\"chip\" | \"text\"",
|
|
1980
|
+
"references": {}
|
|
1981
|
+
},
|
|
1982
|
+
"required": false,
|
|
1983
|
+
"optional": false,
|
|
1984
|
+
"docs": {
|
|
1985
|
+
"tags": [{
|
|
1986
|
+
"name": "defaultValue",
|
|
1987
|
+
"text": "'text'"
|
|
1988
|
+
}],
|
|
1989
|
+
"text": "Display mode for options in the dropdown panel.\n`'text'` shows each option's text (default). `'chip'` shows each option as a\npds-chip, with a dot when the option has a `dotColor`."
|
|
1990
|
+
},
|
|
1991
|
+
"getter": false,
|
|
1992
|
+
"setter": false,
|
|
1993
|
+
"reflect": false,
|
|
1994
|
+
"attribute": "option-display",
|
|
1995
|
+
"defaultValue": "'text'"
|
|
1996
|
+
},
|
|
1766
1997
|
"errorMessage": {
|
|
1767
1998
|
"type": "string",
|
|
1768
1999
|
"mutable": false,
|
|
@@ -1965,6 +2196,72 @@ export class PdsMultiselect {
|
|
|
1965
2196
|
"reflect": false,
|
|
1966
2197
|
"attribute": "csrf-header-name",
|
|
1967
2198
|
"defaultValue": "'X-CSRF-Token'"
|
|
2199
|
+
},
|
|
2200
|
+
"optionActions": {
|
|
2201
|
+
"type": "boolean",
|
|
2202
|
+
"mutable": false,
|
|
2203
|
+
"complexType": {
|
|
2204
|
+
"original": "boolean",
|
|
2205
|
+
"resolved": "boolean",
|
|
2206
|
+
"references": {}
|
|
2207
|
+
},
|
|
2208
|
+
"required": false,
|
|
2209
|
+
"optional": false,
|
|
2210
|
+
"docs": {
|
|
2211
|
+
"tags": [],
|
|
2212
|
+
"text": "Shows an action icon on each option that has an `actionIcon`, such as an edit pencil.\nThe icon shows on the hovered or highlighted option; clicking it, or pressing Right Arrow on the highlighted option, emits `pdsMultiselectOptionAction`."
|
|
2213
|
+
},
|
|
2214
|
+
"getter": false,
|
|
2215
|
+
"setter": false,
|
|
2216
|
+
"reflect": false,
|
|
2217
|
+
"attribute": "option-actions",
|
|
2218
|
+
"defaultValue": "false"
|
|
2219
|
+
},
|
|
2220
|
+
"optionActionLabel": {
|
|
2221
|
+
"type": "string",
|
|
2222
|
+
"mutable": false,
|
|
2223
|
+
"complexType": {
|
|
2224
|
+
"original": "string",
|
|
2225
|
+
"resolved": "string",
|
|
2226
|
+
"references": {}
|
|
2227
|
+
},
|
|
2228
|
+
"required": false,
|
|
2229
|
+
"optional": false,
|
|
2230
|
+
"docs": {
|
|
2231
|
+
"tags": [{
|
|
2232
|
+
"name": "defaultValue",
|
|
2233
|
+
"text": "'Edit {text}'"
|
|
2234
|
+
}],
|
|
2235
|
+
"text": "Tooltip for an option's action icon when the option has no `actionLabel`. Pass a translated string to localize it; `{text}` is interpolated."
|
|
2236
|
+
},
|
|
2237
|
+
"getter": false,
|
|
2238
|
+
"setter": false,
|
|
2239
|
+
"reflect": false,
|
|
2240
|
+
"attribute": "option-action-label",
|
|
2241
|
+
"defaultValue": "'Edit {text}'"
|
|
2242
|
+
},
|
|
2243
|
+
"optionActionDescription": {
|
|
2244
|
+
"type": "string",
|
|
2245
|
+
"mutable": false,
|
|
2246
|
+
"complexType": {
|
|
2247
|
+
"original": "string",
|
|
2248
|
+
"resolved": "string",
|
|
2249
|
+
"references": {}
|
|
2250
|
+
},
|
|
2251
|
+
"required": false,
|
|
2252
|
+
"optional": false,
|
|
2253
|
+
"docs": {
|
|
2254
|
+
"tags": [{
|
|
2255
|
+
"name": "defaultValue",
|
|
2256
|
+
"text": "'Press Right Arrow to {action}'"
|
|
2257
|
+
}],
|
|
2258
|
+
"text": "Screen-reader hint on each option that has an action, naming the key that runs it. Pass a translated string to localize it; `{action}` is interpolated with the option's action label."
|
|
2259
|
+
},
|
|
2260
|
+
"getter": false,
|
|
2261
|
+
"setter": false,
|
|
2262
|
+
"reflect": false,
|
|
2263
|
+
"attribute": "option-action-description",
|
|
2264
|
+
"defaultValue": "'Press Right Arrow to {action}'"
|
|
1968
2265
|
}
|
|
1969
2266
|
};
|
|
1970
2267
|
}
|
|
@@ -1978,7 +2275,8 @@ export class PdsMultiselect {
|
|
|
1978
2275
|
"currentPage": {},
|
|
1979
2276
|
"hasMore": {},
|
|
1980
2277
|
"creating": {},
|
|
1981
|
-
"removalAnnouncement": {}
|
|
2278
|
+
"removalAnnouncement": {},
|
|
2279
|
+
"slottedTriggerEl": {}
|
|
1982
2280
|
};
|
|
1983
2281
|
}
|
|
1984
2282
|
static get events() {
|
|
@@ -2085,6 +2383,28 @@ export class PdsMultiselect {
|
|
|
2085
2383
|
"resolved": "void",
|
|
2086
2384
|
"references": {}
|
|
2087
2385
|
}
|
|
2386
|
+
}, {
|
|
2387
|
+
"method": "pdsMultiselectOptionAction",
|
|
2388
|
+
"name": "pdsMultiselectOptionAction",
|
|
2389
|
+
"bubbles": true,
|
|
2390
|
+
"cancelable": true,
|
|
2391
|
+
"composed": true,
|
|
2392
|
+
"docs": {
|
|
2393
|
+
"tags": [],
|
|
2394
|
+
"text": "Emitted when an option's action runs, from a click on its icon or Right Arrow on the highlighted option.\nThe panel closes and focus returns to the trigger first, so a modal opened from the handler restores focus to the trigger."
|
|
2395
|
+
},
|
|
2396
|
+
"complexType": {
|
|
2397
|
+
"original": "MultiselectOptionActionEventDetail",
|
|
2398
|
+
"resolved": "MultiselectOptionActionEventDetail",
|
|
2399
|
+
"references": {
|
|
2400
|
+
"MultiselectOptionActionEventDetail": {
|
|
2401
|
+
"location": "import",
|
|
2402
|
+
"path": "./multiselect-interface",
|
|
2403
|
+
"id": "src/components/pds-multiselect/multiselect-interface.ts::MultiselectOptionActionEventDetail",
|
|
2404
|
+
"referenceLocation": "MultiselectOptionActionEventDetail"
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2088
2408
|
}];
|
|
2089
2409
|
}
|
|
2090
2410
|
static get methods() {
|
|
@@ -2122,6 +2442,23 @@ export class PdsMultiselect {
|
|
|
2122
2442
|
"text": "Clears all selected values and resets the component.",
|
|
2123
2443
|
"tags": []
|
|
2124
2444
|
}
|
|
2445
|
+
},
|
|
2446
|
+
"refreshOptions": {
|
|
2447
|
+
"complexType": {
|
|
2448
|
+
"signature": "() => Promise<void>",
|
|
2449
|
+
"parameters": [],
|
|
2450
|
+
"references": {
|
|
2451
|
+
"Promise": {
|
|
2452
|
+
"location": "global",
|
|
2453
|
+
"id": "global::Promise"
|
|
2454
|
+
}
|
|
2455
|
+
},
|
|
2456
|
+
"return": "Promise<void>"
|
|
2457
|
+
},
|
|
2458
|
+
"docs": {
|
|
2459
|
+
"text": "Refetches the first page of options from `asyncUrl` for the current search, such as after an option is renamed\nor recolored elsewhere. Selected items in that page pick up the new text and dot color without emitting a change;\nother selected items keep the text and dot color they were last loaded with. Does nothing without `asyncUrl`.",
|
|
2460
|
+
"tags": []
|
|
2461
|
+
}
|
|
2125
2462
|
}
|
|
2126
2463
|
};
|
|
2127
2464
|
}
|
|
@@ -2139,6 +2476,12 @@ export class PdsMultiselect {
|
|
|
2139
2476
|
}, {
|
|
2140
2477
|
"propName": "internalOptions",
|
|
2141
2478
|
"methodName": "internalOptionsChanged"
|
|
2479
|
+
}, {
|
|
2480
|
+
"propName": "isOpen",
|
|
2481
|
+
"methodName": "isOpenChanged"
|
|
2482
|
+
}, {
|
|
2483
|
+
"propName": "disabled",
|
|
2484
|
+
"methodName": "disabledChanged"
|
|
2142
2485
|
}];
|
|
2143
2486
|
}
|
|
2144
2487
|
static get listeners() {
|