@pine-ds/core 4.11.0 → 4.12.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/aria-references.js +1 -0
- package/components/attributes.js +1 -1
- package/components/index2.js +1 -1
- package/components/pds-alert.js +1 -1
- package/components/pds-avatar.js +1 -1
- package/components/pds-box2.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-copytext.js +1 -1
- package/components/pds-datepicker.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-image.js +1 -1
- package/components/pds-input2.js +1 -1
- package/components/pds-link2.js +1 -1
- package/components/pds-loader2.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-radio-group.js +1 -1
- package/components/pds-radio.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-table.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/sortable-label.js +1 -0
- package/components/truncation-tooltip.js +1 -1
- package/dist/cjs/aria-references-CUmqibnO.js +54 -0
- package/dist/cjs/{attributes-CW49XqaL.js → attributes-Cgbkw6gO.js} +3 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-alert.cjs.entry.js +2 -2
- package/dist/cjs/pds-avatar.cjs.entry.js +3 -2
- package/dist/cjs/pds-box.cjs.entry.js +4 -3
- package/dist/cjs/pds-button.cjs.entry.js +25 -45
- package/dist/cjs/pds-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/pds-chip.cjs.entry.js +3 -3
- package/dist/cjs/pds-combobox.cjs.entry.js +246 -106
- package/dist/cjs/pds-copytext.cjs.entry.js +3 -3
- package/dist/cjs/pds-datepicker.cjs.entry.js +44 -9
- package/dist/cjs/pds-drawer-content.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer.cjs.entry.js +5 -7
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +85 -49
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +83 -10
- package/dist/cjs/pds-filter.cjs.entry.js +24 -2
- package/dist/cjs/pds-image.cjs.entry.js +148 -6
- package/dist/cjs/pds-input.cjs.entry.js +4 -4
- package/dist/cjs/pds-link.cjs.entry.js +4 -5
- package/dist/cjs/pds-loader.cjs.entry.js +4 -3
- package/dist/cjs/pds-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js +9 -12
- package/dist/cjs/pds-multiselect.cjs.entry.js +64 -18
- package/dist/cjs/pds-popover.cjs.entry.js +8 -6
- package/dist/cjs/pds-progress.cjs.entry.js +3 -3
- package/dist/cjs/pds-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/pds-radio.cjs.entry.js +6 -6
- package/dist/cjs/pds-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +2 -2
- package/dist/cjs/pds-sortable-item.cjs.entry.js +28 -5
- package/dist/cjs/pds-sortable.cjs.entry.js +356 -4
- package/dist/cjs/pds-switch.cjs.entry.js +92 -15
- package/dist/cjs/pds-tab.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +24 -5
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +59 -11
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +260 -5
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +3 -3
- package/dist/cjs/pds-text.cjs.entry.js +5 -3
- package/dist/cjs/pds-textarea.cjs.entry.js +8 -7
- package/dist/cjs/pds-toast.cjs.entry.js +8 -4
- package/dist/cjs/pds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/sortable-label-DOcJrHvA.js +37 -0
- package/dist/cjs/{truncation-tooltip-Bikp7n9I.js → truncation-tooltip-CM5HgRHh.js} +69 -0
- package/dist/collection/components/pds-alert/pds-alert.css +0 -3
- package/dist/collection/components/pds-alert/pds-alert.js +3 -2
- package/dist/collection/components/pds-avatar/pds-avatar.js +7 -6
- package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +1 -1
- package/dist/collection/components/pds-box/pds-box.css +1273 -1189
- package/dist/collection/components/pds-box/pds-box.js +180 -156
- package/dist/collection/components/pds-box/stories/pds-box.stories.js +79 -37
- package/dist/collection/components/pds-button/pds-button.js +26 -4
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +25 -11
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +10 -10
- package/dist/collection/components/pds-chip/pds-chip.js +3 -3
- package/dist/collection/components/pds-combobox/pds-combobox.css +162 -53
- package/dist/collection/components/pds-combobox/pds-combobox.js +261 -121
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +35 -4
- package/dist/collection/components/pds-copytext/pds-copytext.js +2 -2
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +3 -3
- package/dist/collection/components/pds-datepicker/presets.js +42 -7
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +2 -5
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +2 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +2 -1
- package/dist/collection/components/pds-drawer/pds-drawer.js +8 -10
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +17 -8
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +95 -62
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +3 -3
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +2 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +84 -9
- package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +24 -1
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.css +2 -1
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +24 -7
- package/dist/collection/components/pds-image/image-interface.js +1 -0
- package/dist/collection/components/pds-image/pds-image.css +11 -0
- package/dist/collection/components/pds-image/pds-image.js +249 -8
- package/dist/collection/components/pds-image/stories/pds-image.stories.js +117 -1
- package/dist/collection/components/pds-input/pds-input.js +14 -9
- package/dist/collection/components/pds-link/pds-link.js +10 -14
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +6 -2
- package/dist/collection/components/pds-loader/pds-loader.js +5 -4
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +2 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +2 -1
- package/dist/collection/components/pds-modal/pds-modal.js +11 -13
- package/dist/collection/components/pds-modal/stories/pds-modal.stories.js +7 -7
- package/dist/collection/components/pds-multiselect/pds-multiselect.css +2 -2
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +63 -18
- package/dist/collection/components/pds-popover/pds-popover.css +1 -1
- package/dist/collection/components/pds-popover/pds-popover.js +9 -7
- package/dist/collection/components/pds-progress/pds-progress.js +4 -4
- package/dist/collection/components/pds-radio/pds-radio.css +5 -1
- package/dist/collection/components/pds-radio/pds-radio.js +9 -9
- package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +9 -9
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +7 -7
- package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +3 -3
- package/dist/collection/components/pds-row/stories/pds-row.stories.js +15 -14
- package/dist/collection/components/pds-select/pds-select.js +7 -4
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +38 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +47 -5
- package/dist/collection/components/pds-sortable/pds-sortable.js +481 -5
- package/dist/collection/components/pds-sortable/sortable-label.js +33 -0
- package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +27 -0
- package/dist/collection/components/pds-switch/pds-switch.js +114 -17
- package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +79 -0
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +4 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +47 -4
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +6 -2
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +11 -0
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +98 -10
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +5 -1
- package/dist/collection/components/pds-table/pds-table.css +8 -0
- package/dist/collection/components/pds-table/pds-table.js +295 -7
- package/dist/collection/components/pds-table/stories/pds-table.stories.js +131 -6
- package/dist/collection/components/pds-tabs/pds-tabs.js +3 -3
- package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +5 -3
- package/dist/collection/components/pds-textarea/pds-textarea.js +16 -14
- package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +2 -13
- package/dist/collection/components/pds-toast/pds-toast.css +4 -3
- package/dist/collection/components/pds-toast/pds-toast.js +9 -5
- package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +2 -2
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +2 -1
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +17 -17
- package/dist/collection/utils/aria-references.js +9 -3
- package/dist/collection/utils/truncation-tooltip.js +67 -0
- package/dist/docs.json +1124 -374
- package/dist/esm/aria-references-CNn1lObg.js +50 -0
- package/dist/esm/{attributes-DkeVeN0g.js → attributes-CD8knu3a.js} +3 -0
- package/dist/esm/{index-DvN3tyZp.js → index-B0DXTeeV.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-alert.entry.js +2 -2
- package/dist/esm/pds-avatar.entry.js +4 -3
- package/dist/esm/pds-box.entry.js +4 -3
- package/dist/esm/pds-button.entry.js +24 -44
- package/dist/esm/pds-checkbox.entry.js +5 -5
- package/dist/esm/pds-chip.entry.js +4 -4
- package/dist/esm/pds-combobox.entry.js +246 -106
- package/dist/esm/pds-copytext.entry.js +4 -4
- package/dist/esm/pds-datepicker.entry.js +45 -10
- package/dist/esm/pds-drawer-content.entry.js +1 -1
- package/dist/esm/pds-drawer-footer.entry.js +1 -1
- package/dist/esm/pds-drawer-header.entry.js +1 -1
- package/dist/esm/pds-drawer.entry.js +5 -7
- package/dist/esm/pds-dropdown-menu-item.entry.js +85 -49
- package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu.entry.js +84 -11
- package/dist/esm/pds-filter.entry.js +25 -3
- package/dist/esm/pds-image.entry.js +149 -7
- package/dist/esm/pds-input.entry.js +5 -5
- package/dist/esm/pds-link.entry.js +5 -6
- package/dist/esm/pds-loader.entry.js +4 -3
- package/dist/esm/pds-modal-footer.entry.js +1 -1
- package/dist/esm/pds-modal-header.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js +9 -12
- package/dist/esm/pds-multiselect.entry.js +65 -19
- package/dist/esm/pds-popover.entry.js +8 -6
- package/dist/esm/pds-progress.entry.js +3 -3
- package/dist/esm/pds-radio-group.entry.js +5 -5
- package/dist/esm/pds-radio.entry.js +7 -7
- package/dist/esm/pds-row.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +3 -3
- package/dist/esm/pds-sortable-item.entry.js +29 -6
- package/dist/esm/pds-sortable.entry.js +357 -5
- package/dist/esm/pds-switch.entry.js +94 -17
- package/dist/esm/pds-tab.entry.js +1 -1
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +24 -5
- package/dist/esm/pds-table-head-cell.entry.js +60 -12
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table.entry.js +261 -6
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +3 -3
- package/dist/esm/pds-text.entry.js +5 -3
- package/dist/esm/pds-textarea.entry.js +9 -8
- package/dist/esm/pds-toast.entry.js +8 -4
- package/dist/esm/pds-tooltip.entry.js +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/sortable-label-PItnzVVR.js +35 -0
- package/dist/esm/{truncation-tooltip-DBcPipr9.js → truncation-tooltip-CkIWm6Z-.js} +68 -1
- package/dist/esm-es5/aria-references-CNn1lObg.js +1 -0
- package/dist/esm-es5/{attributes-DkeVeN0g.js → attributes-CD8knu3a.js} +1 -1
- package/dist/esm-es5/{index-DvN3tyZp.js → index-B0DXTeeV.js} +1 -1
- package/dist/esm-es5/loader.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 +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-datepicker.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-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-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-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/sortable-label-PItnzVVR.js +1 -0
- package/dist/esm-es5/truncation-tooltip-CkIWm6Z-.js +1 -0
- package/dist/pine-core/{p-f834cb07.system.entry.js → p-00891b8d.system.entry.js} +1 -1
- package/dist/pine-core/{p-3f8bd3fb.system.entry.js → p-053ff8eb.system.entry.js} +1 -1
- package/dist/pine-core/p-08b9e3ad.entry.js +1 -0
- package/dist/pine-core/{p-4d98bc0c.system.entry.js → p-0a7570dd.system.entry.js} +1 -1
- package/dist/pine-core/{p-d018dc60.system.entry.js → p-0ac4262e.system.entry.js} +1 -1
- package/dist/pine-core/{p-89d38a82.system.entry.js → p-0e1b8bd1.system.entry.js} +1 -1
- package/dist/pine-core/{p-e1d1b5d8.entry.js → p-12fdc65f.entry.js} +1 -1
- package/dist/pine-core/{p-d48fe5a0.system.entry.js → p-16fceef6.system.entry.js} +1 -1
- package/dist/pine-core/p-1765a41b.system.entry.js +1 -0
- package/dist/pine-core/{p-a594c41f.entry.js → p-18524c25.entry.js} +1 -1
- package/dist/pine-core/p-1a013a5c.system.entry.js +1 -0
- package/dist/pine-core/{p-2b9622c1.system.entry.js → p-1ab52531.system.entry.js} +1 -1
- package/dist/pine-core/p-1c584a20.entry.js +1 -0
- package/dist/pine-core/p-1edef412.entry.js +1 -0
- package/dist/pine-core/{p-5946203c.entry.js → p-1f998e3e.entry.js} +1 -1
- package/dist/pine-core/{p-39e57657.entry.js → p-1fb1ca3d.entry.js} +1 -1
- package/dist/pine-core/p-2b6becc2.entry.js +1 -0
- package/dist/pine-core/p-2cc7c682.entry.js +1 -0
- package/dist/pine-core/{p-639acef8.system.entry.js → p-2ddcd845.system.entry.js} +1 -1
- package/dist/pine-core/{p-6a1aa8d3.entry.js → p-2f15e85f.entry.js} +1 -1
- package/dist/pine-core/{p-67f795d5.system.entry.js → p-33da254f.system.entry.js} +1 -1
- package/dist/pine-core/{p-c6a9e62c.system.entry.js → p-3fc9ef80.system.entry.js} +1 -1
- package/dist/pine-core/p-4125a4a6.system.entry.js +1 -0
- package/dist/pine-core/p-47df9e9f.system.entry.js +3 -0
- package/dist/pine-core/p-51680c9c.system.entry.js +1 -0
- package/dist/pine-core/p-55535481.system.entry.js +1 -0
- package/dist/pine-core/p-55a4659a.system.entry.js +1 -0
- package/dist/pine-core/{p-c5e1eb3c.system.entry.js → p-57af5c29.system.entry.js} +1 -1
- package/dist/pine-core/p-57edd301.system.entry.js +1 -0
- package/dist/pine-core/{p-bfa34194.entry.js → p-5d582798.entry.js} +1 -1
- package/dist/pine-core/p-5db87fda.system.entry.js +1 -0
- package/dist/pine-core/{p-19cf1d91.system.entry.js → p-5eb0c78c.system.entry.js} +1 -1
- package/dist/pine-core/{p-42f70f93.system.entry.js → p-6017afb5.system.entry.js} +1 -1
- package/dist/pine-core/{p-63f85859.system.entry.js → p-60e65fe0.system.entry.js} +1 -1
- package/dist/pine-core/{p-973c3ac0.entry.js → p-627a94da.entry.js} +1 -1
- package/dist/pine-core/{p-a9d96e22.entry.js → p-68328afc.entry.js} +1 -1
- package/dist/pine-core/{p-bd7dc317.system.entry.js → p-72668673.system.entry.js} +1 -1
- package/dist/pine-core/p-72ff5ad2.system.entry.js +1 -0
- package/dist/pine-core/p-736ea7dd.entry.js +7 -0
- package/dist/pine-core/p-765f4207.entry.js +1 -0
- package/dist/pine-core/{p-2a18852f.entry.js → p-77530cf2.entry.js} +1 -1
- package/dist/pine-core/p-77a22399.entry.js +1 -0
- package/dist/pine-core/p-783127bf.entry.js +1 -0
- package/dist/pine-core/{p-d9719e37.entry.js → p-82f7eed1.entry.js} +1 -1
- package/dist/pine-core/{p-124a0a24.entry.js → p-84d4ae26.entry.js} +1 -1
- package/dist/pine-core/p-8deeda07.entry.js +1 -0
- package/dist/pine-core/{p-849ec281.system.entry.js → p-8e17a6d8.system.entry.js} +1 -1
- package/dist/pine-core/p-8e7e7bba.entry.js +1 -0
- package/dist/pine-core/{p-e82f758f.system.entry.js → p-907c69e9.system.entry.js} +1 -1
- package/dist/pine-core/{p-1415c988.system.entry.js → p-90f83a5b.system.entry.js} +1 -1
- package/dist/pine-core/p-97145eee.system.entry.js +1 -0
- package/dist/pine-core/{p-a09c9c5e.system.entry.js → p-9d983e09.system.entry.js} +1 -1
- package/dist/pine-core/{p-1e3ef425.entry.js → p-9e005996.entry.js} +1 -1
- package/dist/pine-core/{p-DvN3tyZp.js → p-B0DXTeeV.js} +1 -1
- package/dist/pine-core/{p-CNXspDYs.system.js → p-BlJQebvG.system.js} +1 -1
- package/dist/pine-core/p-C35-349-.system.js +1 -0
- package/dist/pine-core/{p-vFsJv75D.system.js → p-CIe1DGXa.system.js} +1 -1
- package/dist/pine-core/p-CNn1lObg.js +1 -0
- package/dist/pine-core/p-CQJ44c6o.system.js +1 -0
- package/dist/pine-core/p-Dv9QBmIF.js +1 -0
- package/dist/pine-core/p-PItnzVVR.js +1 -0
- package/dist/pine-core/p-VPGVqK3P.system.js +1 -0
- package/dist/pine-core/p-XK45dzWR.system.js +1 -1
- package/dist/pine-core/p-a149af29.entry.js +1 -0
- package/dist/pine-core/p-a20d9eca.system.entry.js +1 -0
- package/dist/pine-core/{p-f6f4fd42.entry.js → p-a5782d99.entry.js} +1 -1
- package/dist/pine-core/p-a5e9c583.entry.js +1 -0
- package/dist/pine-core/{p-4d47023c.system.entry.js → p-a9eaf160.system.entry.js} +1 -1
- package/dist/pine-core/{p-143b33a6.entry.js → p-b00b07e3.entry.js} +1 -1
- package/dist/pine-core/{p-c7a53c4f.entry.js → p-b7b29392.entry.js} +1 -1
- package/dist/pine-core/p-b96bdff6.entry.js +1 -0
- package/dist/pine-core/{p-f71d71ca.entry.js → p-bbd9ab75.entry.js} +1 -1
- package/dist/pine-core/p-bdab6c9f.entry.js +1 -0
- package/dist/pine-core/p-biShcgLI.js +1 -0
- package/dist/pine-core/{p-548bce53.system.entry.js → p-c12b5cd7.system.entry.js} +1 -1
- package/dist/pine-core/p-c1dc7692.entry.js +1 -0
- package/dist/pine-core/p-c76d8b9e.system.entry.js +1 -0
- package/dist/pine-core/{p-590df41a.entry.js → p-c89ea2d3.entry.js} +1 -1
- package/dist/pine-core/{p-d920d759.system.entry.js → p-c9630934.system.entry.js} +1 -1
- package/dist/pine-core/{p-6f4ab1ea.system.entry.js → p-cb9227f6.system.entry.js} +1 -1
- package/dist/pine-core/p-ceef0eb1.entry.js +1 -0
- package/dist/pine-core/p-d1283e8d.entry.js +1 -0
- package/dist/pine-core/p-d676926d.system.entry.js +1 -0
- package/dist/pine-core/{p-61cfdbb2.entry.js → p-d7d7a4e1.entry.js} +1 -1
- package/dist/pine-core/p-d85d50cb.entry.js +1 -0
- package/dist/pine-core/p-daa802f1.entry.js +2 -0
- package/dist/pine-core/p-ddf4b9b5.system.entry.js +1 -0
- package/dist/pine-core/p-de3b319e.system.entry.js +8 -0
- package/dist/pine-core/{p-cb9baf78.system.entry.js → p-e00777da.system.entry.js} +1 -1
- package/dist/pine-core/p-e2541eeb.entry.js +1 -0
- package/dist/pine-core/{p-01f1cdaf.system.entry.js → p-e2a1a49a.system.entry.js} +1 -1
- package/dist/pine-core/p-e4ebea88.system.entry.js +1 -0
- package/dist/pine-core/{p-947582e1.entry.js → p-e554bd64.entry.js} +1 -1
- package/dist/pine-core/{p-dd7ded84.entry.js → p-e6427c87.entry.js} +1 -1
- package/dist/pine-core/{p-50ddadbf.entry.js → p-e72e8b8f.entry.js} +1 -1
- package/dist/pine-core/p-e92d0f0f.system.entry.js +1 -0
- package/dist/pine-core/{p-9b32727a.system.entry.js → p-eab165b9.system.entry.js} +1 -1
- package/dist/pine-core/p-eabc4bd8.entry.js +1 -0
- package/dist/pine-core/p-ef9f84f2.system.entry.js +1 -0
- package/dist/pine-core/{p-c9ae7964.entry.js → p-f026af73.entry.js} +1 -1
- package/dist/pine-core/{p-99530cb5.entry.js → p-f0509c8e.entry.js} +1 -1
- package/dist/pine-core/p-f1252e72.system.entry.js +1 -0
- package/dist/pine-core/p-f3496fd1.entry.js +1 -0
- package/dist/pine-core/{p-eecd9ad8.system.entry.js → p-f90f4be7.system.entry.js} +1 -1
- package/dist/pine-core/p-f9bdaadd.system.entry.js +1 -0
- package/dist/pine-core/{p-128c04e7.entry.js → p-fda791df.entry.js} +1 -1
- package/dist/pine-core/p-fea4296d.entry.js +1 -0
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-alert/pds-alert.d.ts +2 -1
- package/dist/types/components/pds-avatar/pds-avatar.d.ts +5 -4
- package/dist/types/components/pds-box/pds-box.d.ts +68 -57
- package/dist/types/components/pds-button/pds-button.d.ts +14 -3
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +15 -8
- package/dist/types/components/pds-chip/pds-chip.d.ts +2 -2
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +48 -11
- package/dist/types/components/pds-copytext/pds-copytext.d.ts +3 -1
- package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +20 -4
- package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +3 -2
- package/dist/types/components/pds-datepicker/presets.d.ts +3 -2
- package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +1 -4
- package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +1 -0
- package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +1 -0
- package/dist/types/components/pds-drawer/pds-drawer.d.ts +4 -6
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +20 -16
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.d.ts +1 -1
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +7 -0
- package/dist/types/components/pds-filters/pds-filter/pds-filter.d.ts +6 -5
- package/dist/types/components/pds-image/image-interface.d.ts +12 -0
- package/dist/types/components/pds-image/pds-image.d.ts +69 -9
- package/dist/types/components/pds-input/pds-input.d.ts +17 -7
- package/dist/types/components/pds-link/pds-link.d.ts +8 -8
- package/dist/types/components/pds-loader/pds-loader.d.ts +3 -2
- package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +1 -0
- package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +1 -0
- package/dist/types/components/pds-modal/pds-modal.d.ts +7 -9
- package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +14 -8
- package/dist/types/components/pds-popover/pds-popover.d.ts +2 -2
- package/dist/types/components/pds-progress/pds-progress.d.ts +2 -2
- package/dist/types/components/pds-radio/pds-radio.d.ts +6 -5
- package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +5 -4
- package/dist/types/components/pds-select/pds-select.d.ts +9 -3
- package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +8 -2
- package/dist/types/components/pds-sortable/pds-sortable.d.ts +82 -1
- package/dist/types/components/pds-sortable/sortable-label.d.ts +7 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +17 -2
- package/dist/types/components/pds-table/pds-table-body/pds-table-body.d.ts +3 -0
- package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +10 -0
- package/dist/types/components/pds-table/pds-table-head/pds-table-head.d.ts +5 -1
- package/dist/types/components/pds-table/pds-table-head-cell/pds-table-head-cell.d.ts +21 -0
- package/dist/types/components/pds-table/pds-table-row/pds-table-row.d.ts +4 -0
- package/dist/types/components/pds-table/pds-table.d.ts +76 -2
- package/dist/types/components/pds-tabs/pds-tabs.d.ts +1 -1
- package/dist/types/components/pds-textarea/pds-textarea.d.ts +15 -13
- package/dist/types/components/pds-toast/pds-toast.d.ts +5 -1
- package/dist/types/components.d.ts +480 -325
- package/dist/types/utils/aria-references.d.ts +4 -0
- package/dist/types/utils/truncation-tooltip.d.ts +39 -0
- package/dist/types/utils/types.d.ts +3 -0
- package/dist/vscode.html-data.json +340 -134
- package/hydrate/index.js +1800 -353
- package/hydrate/index.mjs +1800 -353
- package/package.json +3 -3
- package/readme.md +26 -55
- package/dist/esm-es5/truncation-tooltip-DBcPipr9.js +0 -1
- package/dist/pine-core/p-07323107.entry.js +0 -1
- package/dist/pine-core/p-08b8e941.entry.js +0 -1
- package/dist/pine-core/p-0b7b3fc2.system.entry.js +0 -3
- package/dist/pine-core/p-0d5f0ab5.system.entry.js +0 -1
- package/dist/pine-core/p-14dedf01.system.entry.js +0 -1
- package/dist/pine-core/p-1ca8d183.entry.js +0 -1
- package/dist/pine-core/p-1f62bb71.entry.js +0 -7
- package/dist/pine-core/p-2dd30d12.entry.js +0 -1
- package/dist/pine-core/p-3359a935.entry.js +0 -1
- package/dist/pine-core/p-35s7h-dk.js +0 -1
- package/dist/pine-core/p-3610cb3b.entry.js +0 -1
- package/dist/pine-core/p-39276663.entry.js +0 -1
- package/dist/pine-core/p-3a1dc752.system.entry.js +0 -1
- package/dist/pine-core/p-42d43c3f.system.entry.js +0 -1
- package/dist/pine-core/p-4a90b9c8.system.entry.js +0 -1
- package/dist/pine-core/p-4cfe922b.entry.js +0 -1
- package/dist/pine-core/p-5f181694.system.entry.js +0 -1
- package/dist/pine-core/p-60a30975.system.entry.js +0 -1
- package/dist/pine-core/p-62aa6a78.system.entry.js +0 -1
- package/dist/pine-core/p-64bcb378.entry.js +0 -1
- package/dist/pine-core/p-724baba3.system.entry.js +0 -1
- package/dist/pine-core/p-72659a0e.system.entry.js +0 -1
- package/dist/pine-core/p-8ade17ce.entry.js +0 -1
- package/dist/pine-core/p-8e7f75e6.entry.js +0 -1
- package/dist/pine-core/p-8fb520df.entry.js +0 -1
- package/dist/pine-core/p-92115e88.entry.js +0 -1
- package/dist/pine-core/p-94c9b7d1.system.entry.js +0 -1
- package/dist/pine-core/p-97356d4b.entry.js +0 -1
- package/dist/pine-core/p-97653e60.entry.js +0 -1
- package/dist/pine-core/p-97b73359.entry.js +0 -1
- package/dist/pine-core/p-BZVUD2on.js +0 -1
- package/dist/pine-core/p-Dj-z_ugg.system.js +0 -1
- package/dist/pine-core/p-ad5208a4.system.entry.js +0 -1
- package/dist/pine-core/p-afc2f165.entry.js +0 -1
- package/dist/pine-core/p-bcc378ba.system.entry.js +0 -8
- package/dist/pine-core/p-c8a0b562.system.entry.js +0 -1
- package/dist/pine-core/p-d4968f9d.system.entry.js +0 -1
- package/dist/pine-core/p-d6f338e0.entry.js +0 -1
- package/dist/pine-core/p-da8b864a.entry.js +0 -2
- package/dist/pine-core/p-db7fb5a3.entry.js +0 -1
- package/dist/pine-core/p-de455073.system.entry.js +0 -1
- package/dist/pine-core/p-e3de6a1d.entry.js +0 -1
- package/dist/pine-core/p-e84fa9ed.entry.js +0 -1
- package/dist/pine-core/p-eb4f0daa.system.entry.js +0 -1
- package/dist/pine-core/p-eb56af4a.system.entry.js +0 -1
- package/dist/pine-core/p-ef0eba9b.system.entry.js +0 -1
- package/dist/pine-core/p-f11cce27.system.entry.js +0 -1
- package/dist/pine-core/p-f354dbac.entry.js +0 -1
|
@@ -1,39 +1,71 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
|
+
* @slot (default) - The item's label.
|
|
4
|
+
* @slot start - Content to display before the item's label, such as a `pds-icon`. A `pds-icon` without an `aria-label` or `aria-labelledby` is decorative; a named one is announced before the label, so leave decorative icons unnamed.
|
|
3
5
|
* @part button - Exposes the item's inner element for styling. Appears on button and informational items, not on links.
|
|
4
6
|
*/
|
|
5
7
|
export class PdsDropdownMenuItem {
|
|
6
8
|
constructor() {
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* Determines whether or not the dropdown menu item is destructive.
|
|
9
11
|
* @defaultValue false
|
|
10
12
|
*/
|
|
11
13
|
this.destructive = false;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Determines whether or not the dropdown menu item is disabled.
|
|
14
16
|
* @defaultValue false
|
|
15
17
|
*/
|
|
16
18
|
this.disabled = false;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* Determines whether or not the dropdown menu item is informational: text that the arrow keys
|
|
19
21
|
* reach but that can't be activated. Takes precedence over `href` and `destructive`.
|
|
20
22
|
* Screen readers announce it as dimmed or unavailable, the same way as a disabled item.
|
|
21
23
|
* @defaultValue false
|
|
22
24
|
*/
|
|
23
25
|
this.informational = false;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Ignored when `informational` is set.
|
|
27
|
+
* Shows the external-link (launch) icon. Opens in a new tab unless `target` says otherwise.
|
|
28
|
+
* Only applies when href is set. Ignored when `informational` is set.
|
|
28
29
|
* @defaultValue false
|
|
29
30
|
*/
|
|
30
31
|
this.external = false;
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
this.
|
|
32
|
+
this.handleClick = () => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
if (this.disabled || this.informational)
|
|
35
|
+
return;
|
|
36
|
+
// Filter only pds-dropdown-menu-item elements and find the index of the current item
|
|
37
|
+
const menuItems = Array.from((_b = (_a = this.host.parentElement) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []).filter((child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item');
|
|
38
|
+
const itemIndex = menuItems.indexOf(this.host);
|
|
39
|
+
// The label's text: default-slot content only, so start-slot content stays out of it
|
|
40
|
+
const content = Array.from(this.host.childNodes)
|
|
41
|
+
.filter((node) => node.nodeType === Node.TEXT_NODE ||
|
|
42
|
+
(node.nodeType === Node.ELEMENT_NODE && !node.getAttribute('slot')))
|
|
43
|
+
.map((node) => node.textContent)
|
|
44
|
+
.join('')
|
|
45
|
+
.trim();
|
|
46
|
+
this.pdsClick.emit({
|
|
47
|
+
itemIndex,
|
|
48
|
+
item: this.host,
|
|
49
|
+
content
|
|
50
|
+
});
|
|
34
51
|
};
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
// Checked directly against the light DOM rather than kept in @State: Stencil's JSX doesn't
|
|
53
|
+
// type a `class` prop for `<slot>`, and a ref callback only fires once, on creation, so it
|
|
54
|
+
// can't push a later @State change back onto the element either way. Called once up front
|
|
55
|
+
// (from the ref, since nothing's assigned at componentWillLoad's point) and again on every
|
|
56
|
+
// native slotchange after that, both calling classList directly. add/remove, not the two-argument
|
|
57
|
+
// form of toggle(): Stencil's mock-doc (used by spec tests) implements toggle() as a plain flip
|
|
58
|
+
// and silently ignores a force argument, so a toggle() call that'd be correct against a real
|
|
59
|
+
// DOM can still fail there.
|
|
60
|
+
this.updateStartSlotEmpty = () => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const hasContent = Array.from(this.host.children).some((child) => child.getAttribute('slot') === 'start');
|
|
63
|
+
if (hasContent) {
|
|
64
|
+
(_a = this.startSlotEl) === null || _a === void 0 ? void 0 : _a.classList.remove('pds-dropdown-menu-item__start--empty');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
(_b = this.startSlotEl) === null || _b === void 0 ? void 0 : _b.classList.add('pds-dropdown-menu-item__start--empty');
|
|
68
|
+
}
|
|
37
69
|
};
|
|
38
70
|
// Space would otherwise scroll the page, since nothing in the item takes the key.
|
|
39
71
|
this.handleInformationalKeyDown = (event) => {
|
|
@@ -42,63 +74,69 @@ export class PdsDropdownMenuItem {
|
|
|
42
74
|
}
|
|
43
75
|
};
|
|
44
76
|
this.handleKeyDown = (event) => {
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
77
|
+
var _a;
|
|
78
|
+
if (this.disabled || event.key !== 'Enter')
|
|
79
|
+
return;
|
|
80
|
+
if (this.href != null) {
|
|
81
|
+
// Enter on the inner <a> itself follows the link, and its native click reaches the host's
|
|
82
|
+
// click handler below, which emits pdsClick -- returning early here leaves that alone.
|
|
83
|
+
// Safari leaves focus on the pds-link host after a mouse click, not its inner <a>, where
|
|
84
|
+
// Enter would otherwise do nothing: an anchor only activates on Enter when it is itself the
|
|
85
|
+
// focused element, not an ancestor of it. Forwarding the click to the real anchor instead
|
|
86
|
+
// runs the browser's own navigation (hash, download, target), and still reaches the same
|
|
87
|
+
// host click handler, so pdsClick still isn't emitted twice.
|
|
88
|
+
if (event.composedPath()[0] !== this.innerAnchor())
|
|
89
|
+
(_a = this.innerAnchor()) === null || _a === void 0 ? void 0 : _a.click();
|
|
90
|
+
return;
|
|
53
91
|
}
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
this.handleClick();
|
|
54
94
|
};
|
|
55
95
|
}
|
|
56
96
|
/**
|
|
57
|
-
* Trigger the click event
|
|
97
|
+
* Trigger the click event. Does nothing when the item is disabled or informational.
|
|
58
98
|
*/
|
|
59
99
|
async clickItem() {
|
|
60
100
|
this.handleClick();
|
|
61
101
|
}
|
|
62
102
|
;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
103
|
+
// Always render the start slot so slotted content is projected reliably, with nothing wrapping
|
|
104
|
+
// it: a wrapper would sit between the slotted content and this host, leaving it without an
|
|
105
|
+
// assignedSlot, which breaks a click-target walk that follows assignedSlot up to find a link
|
|
106
|
+
// (Turbo's link lookup works this way). The --empty class hides it when nothing is slotted, so
|
|
107
|
+
// it adds no gap.
|
|
108
|
+
renderContent() {
|
|
109
|
+
return [
|
|
110
|
+
h("slot", { name: "start", onSlotchange: this.updateStartSlotEmpty, ref: (el) => {
|
|
111
|
+
this.startSlotEl = el;
|
|
112
|
+
if (el) {
|
|
113
|
+
el.classList.add('pds-dropdown-menu-item__start');
|
|
114
|
+
this.updateStartSlotEmpty();
|
|
115
|
+
}
|
|
116
|
+
} }),
|
|
117
|
+
h("slot", null)
|
|
118
|
+
];
|
|
77
119
|
}
|
|
78
120
|
renderElement() {
|
|
79
121
|
if (this.informational) {
|
|
80
|
-
return (h("div", { class:
|
|
81
|
-
'pds-dropdown-menu-item__content': true,
|
|
82
|
-
'has-focus': this.hasFocus
|
|
83
|
-
}, role: "menuitem", "aria-disabled": "true", part: "button", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleInformationalKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("slot", null)));
|
|
122
|
+
return (h("div", { class: "pds-dropdown-menu-item__content", role: "menuitem", "aria-disabled": "true", part: "button", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleInformationalKeyDown }, this.renderContent()));
|
|
84
123
|
}
|
|
85
124
|
if (this.href != null) {
|
|
86
|
-
return (h("pds-link", { download: this.download, href: this.disabled ? null : this.href, external: this.external, externalLabel: this.externalLabel, target: this.target, class:
|
|
87
|
-
'pds-dropdown-menu-item__content': true,
|
|
88
|
-
'has-focus': this.hasFocus
|
|
89
|
-
}, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-disabled": this.disabled ? 'true' : null }, h("slot", null)));
|
|
125
|
+
return (h("pds-link", { download: this.download, href: this.disabled ? null : this.href, external: this.external, externalLabel: this.externalLabel, target: this.target, class: "pds-dropdown-menu-item__content", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, "aria-disabled": this.disabled ? 'true' : null }, this.renderContent()));
|
|
90
126
|
}
|
|
91
|
-
return (h("button", { class:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
127
|
+
return (h("button", { class: "pds-dropdown-menu-item__content", tabIndex: this.disabled ? -1 : 0, type: "button", part: "button", onKeyDown: this.handleKeyDown, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null }, this.renderContent()));
|
|
128
|
+
}
|
|
129
|
+
// pds-link's own shadow root, one level in from its host.
|
|
130
|
+
innerAnchor() {
|
|
131
|
+
var _a, _b, _c, _d;
|
|
132
|
+
return (_d = (_c = (_b = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-link')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('a')) !== null && _d !== void 0 ? _d : null;
|
|
95
133
|
}
|
|
96
134
|
render() {
|
|
97
|
-
return (h(Host, { key: '
|
|
135
|
+
return (h(Host, { key: '139943faad1c0047bb0363e0eaa0cde9efb2f957', id: this.componentId, class: {
|
|
98
136
|
'is-disabled': this.disabled,
|
|
99
137
|
'is-informational': this.informational,
|
|
100
138
|
'destructive': !this.disabled && !this.informational && this.destructive
|
|
101
|
-
}, onClick:
|
|
139
|
+
}, onClick: this.handleClick, role: "none",
|
|
102
140
|
// ARIA ignores role="none" on focusable elements, so a focusable host would sit between
|
|
103
141
|
// the menu and the informational menuitem as an unexpected child.
|
|
104
142
|
tabIndex: this.informational ? null : -1, "aria-disabled": this.disabled && !this.informational ? 'true' : null }, this.renderElement()));
|
|
@@ -151,7 +189,7 @@ export class PdsDropdownMenuItem {
|
|
|
151
189
|
"name": "defaultValue",
|
|
152
190
|
"text": "false"
|
|
153
191
|
}],
|
|
154
|
-
"text": "
|
|
192
|
+
"text": "Determines whether or not the dropdown menu item is destructive."
|
|
155
193
|
},
|
|
156
194
|
"getter": false,
|
|
157
195
|
"setter": false,
|
|
@@ -174,7 +212,7 @@ export class PdsDropdownMenuItem {
|
|
|
174
212
|
"name": "defaultValue",
|
|
175
213
|
"text": "false"
|
|
176
214
|
}],
|
|
177
|
-
"text": "
|
|
215
|
+
"text": "Determines whether or not the dropdown menu item is disabled."
|
|
178
216
|
},
|
|
179
217
|
"getter": false,
|
|
180
218
|
"setter": false,
|
|
@@ -213,7 +251,7 @@ export class PdsDropdownMenuItem {
|
|
|
213
251
|
"optional": false,
|
|
214
252
|
"docs": {
|
|
215
253
|
"tags": [],
|
|
216
|
-
"text": "If provided, renders the dropdown
|
|
254
|
+
"text": "If provided, renders the dropdown menu item as an anchor (`<a>`) element instead of a button.\nIgnored when `informational` is set."
|
|
217
255
|
},
|
|
218
256
|
"getter": false,
|
|
219
257
|
"setter": false,
|
|
@@ -235,7 +273,7 @@ export class PdsDropdownMenuItem {
|
|
|
235
273
|
"name": "defaultValue",
|
|
236
274
|
"text": "false"
|
|
237
275
|
}],
|
|
238
|
-
"text": "
|
|
276
|
+
"text": "Determines whether or not the dropdown menu item is informational: text that the arrow keys\nreach but that can't be activated. Takes precedence over `href` and `destructive`.\nScreen readers announce it as dimmed or unavailable, the same way as a disabled item."
|
|
239
277
|
},
|
|
240
278
|
"getter": false,
|
|
241
279
|
"setter": false,
|
|
@@ -258,7 +296,7 @@ export class PdsDropdownMenuItem {
|
|
|
258
296
|
"name": "defaultValue",
|
|
259
297
|
"text": "false"
|
|
260
298
|
}],
|
|
261
|
-
"text": "
|
|
299
|
+
"text": "Shows the external-link (launch) icon. Opens in a new tab unless `target` says otherwise.\nOnly applies when href is set. Ignored when `informational` is set."
|
|
262
300
|
},
|
|
263
301
|
"getter": false,
|
|
264
302
|
"setter": false,
|
|
@@ -281,7 +319,7 @@ export class PdsDropdownMenuItem {
|
|
|
281
319
|
"name": "defaultValue",
|
|
282
320
|
"text": "'(opens in a new tab)'"
|
|
283
321
|
}],
|
|
284
|
-
"text": "Accessible label for the external
|
|
322
|
+
"text": "Accessible label for the icon that `external` shows, passed to the inner\n`pds-link` and appended to the item's name. It isn't announced when\n`target` is anything other than `_blank`. Pass a translated string to\nlocalize it; defaults to English. Pass an empty string to make the icon\ndecorative."
|
|
285
323
|
},
|
|
286
324
|
"getter": false,
|
|
287
325
|
"setter": false,
|
|
@@ -303,7 +341,7 @@ export class PdsDropdownMenuItem {
|
|
|
303
341
|
"name": "defaultValue",
|
|
304
342
|
"text": "undefined"
|
|
305
343
|
}],
|
|
306
|
-
"text": "Specifies where to open the linked document when href is provided.\
|
|
344
|
+
"text": "Specifies where to open the linked document when href is provided.\nOverrides the new-tab default of `external`; the icon still shows.\nOnly applies when href is set. Ignored when `informational` is set."
|
|
307
345
|
},
|
|
308
346
|
"getter": false,
|
|
309
347
|
"setter": false,
|
|
@@ -312,11 +350,6 @@ export class PdsDropdownMenuItem {
|
|
|
312
350
|
}
|
|
313
351
|
};
|
|
314
352
|
}
|
|
315
|
-
static get states() {
|
|
316
|
-
return {
|
|
317
|
-
"hasFocus": {}
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
353
|
static get events() {
|
|
321
354
|
return [{
|
|
322
355
|
"method": "pdsClick",
|
|
@@ -326,7 +359,7 @@ export class PdsDropdownMenuItem {
|
|
|
326
359
|
"composed": true,
|
|
327
360
|
"docs": {
|
|
328
361
|
"tags": [],
|
|
329
|
-
"text": "Emitted when the dropdown
|
|
362
|
+
"text": "Emitted when the dropdown menu item is clicked."
|
|
330
363
|
},
|
|
331
364
|
"complexType": {
|
|
332
365
|
"original": "{itemIndex: number, item: HTMLPdsDropdownMenuItemElement, content: string}",
|
|
@@ -355,7 +388,7 @@ export class PdsDropdownMenuItem {
|
|
|
355
388
|
"return": "Promise<void>"
|
|
356
389
|
},
|
|
357
390
|
"docs": {
|
|
358
|
-
"text": "Trigger the click event",
|
|
391
|
+
"text": "Trigger the click event. Does nothing when the item is disabled or informational.",
|
|
359
392
|
"tags": []
|
|
360
393
|
}
|
|
361
394
|
}
|
|
@@ -2,13 +2,13 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
export class PdsDropdownMenuSeparator {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Has no effect. A separator can't be focused or activated.
|
|
6
6
|
* @defaultValue false
|
|
7
7
|
*/
|
|
8
8
|
this.disabled = false;
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '74a214d61042d5759af5aef9d6410ed1a267083c', id: this.componentId }, h("hr", { key: 'c521eda51523fce09bd408af2586645fc9a9cd03' })));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "pds-dropdown-menu-separator"; }
|
|
14
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -58,7 +58,7 @@ export class PdsDropdownMenuSeparator {
|
|
|
58
58
|
"name": "defaultValue",
|
|
59
59
|
"text": "false"
|
|
60
60
|
}],
|
|
61
|
-
"text": "
|
|
61
|
+
"text": "Has no effect. A separator can't be focused or activated."
|
|
62
62
|
},
|
|
63
63
|
"getter": false,
|
|
64
64
|
"setter": false,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { setAttributesIfChanged } from "../../utils/attributes";
|
|
3
3
|
import { limitRestores } from "../../utils/keep-hydrated";
|
|
4
|
-
import { computePosition, flip, offset, shift, autoUpdate, } from "@floating-ui/dom";
|
|
4
|
+
import { computePosition, flip, offset, shift, size, autoUpdate, } from "@floating-ui/dom";
|
|
5
5
|
/**
|
|
6
|
+
* @slot trigger - The trigger element for the dropdown menu. It receives `aria-expanded` and `aria-haspopup`, so slot the focusable control itself, such as a `pds-button`, not a wrapper around it.
|
|
7
|
+
* @slot (default) - The menu items: `pds-dropdown-menu-item` and `pds-dropdown-menu-separator` elements, or raw `<a>` and `<button>` elements.
|
|
6
8
|
* @slot header - Non-interactive content displayed above the menu items inside the dropdown panel. It renders outside the menu role, so assistive tech reads it as plain content rather than as a menu item.
|
|
7
9
|
* @part menu-panel - Exposes the dropdown menu container for styling.
|
|
8
10
|
*/
|
|
@@ -11,7 +13,10 @@ export class PdsDropdownMenu {
|
|
|
11
13
|
this.isOpen = false;
|
|
12
14
|
this.menuItems = [];
|
|
13
15
|
this.cleanupAutoUpdate = null;
|
|
16
|
+
// Counts each opening, so a position worked out for an earlier opening is ignored.
|
|
17
|
+
this.openCount = 0;
|
|
14
18
|
this.triggerObserver = null;
|
|
19
|
+
this.triggerVisibility = null;
|
|
15
20
|
this.currentFocusIndex = -1;
|
|
16
21
|
this.hasHeader = false;
|
|
17
22
|
/**
|
|
@@ -72,12 +77,20 @@ export class PdsDropdownMenu {
|
|
|
72
77
|
// Open the dropdown and position it
|
|
73
78
|
this.openDropdown = () => {
|
|
74
79
|
var _a;
|
|
80
|
+
const opening = ++this.openCount;
|
|
75
81
|
const updatePosition = () => {
|
|
76
82
|
computePosition(this.triggerEl, this.panelEl, {
|
|
77
83
|
placement: this.placement,
|
|
78
84
|
strategy: 'fixed',
|
|
79
|
-
middleware: [
|
|
85
|
+
middleware: [
|
|
86
|
+
offset(6),
|
|
87
|
+
flip(),
|
|
88
|
+
shift({ padding: 5 }),
|
|
89
|
+
size({ padding: 5, apply: ({ availableHeight, elements }) => this.capPanelHeight(elements.floating, availableHeight) }),
|
|
90
|
+
],
|
|
80
91
|
}).then(({ x, y }) => {
|
|
92
|
+
if (!this.isOpen || opening !== this.openCount)
|
|
93
|
+
return;
|
|
81
94
|
Object.assign(this.panelEl.style, {
|
|
82
95
|
left: `${x}px`,
|
|
83
96
|
top: `${y}px`,
|
|
@@ -88,12 +101,15 @@ export class PdsDropdownMenu {
|
|
|
88
101
|
updatePosition();
|
|
89
102
|
// Set up auto-update for window resize and scroll
|
|
90
103
|
this.cleanupAutoUpdate = autoUpdate(this.triggerEl, this.panelEl, updatePosition);
|
|
104
|
+
this.watchTriggerVisibility();
|
|
91
105
|
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-box').classList.remove('is-hidden');
|
|
92
106
|
this.isOpen = true;
|
|
93
107
|
this.syncTriggerAria();
|
|
94
108
|
};
|
|
95
|
-
// Close the dropdown
|
|
96
|
-
|
|
109
|
+
// Close the dropdown. Closed because its trigger left the view, focus from the menu still goes back
|
|
110
|
+
// to the trigger, so it isn't lost, but without scrolling the trigger back into view. The next Tab
|
|
111
|
+
// carries on from there.
|
|
112
|
+
this.closeDropdown = ({ preventScroll = false } = {}) => {
|
|
97
113
|
var _a;
|
|
98
114
|
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-box').classList.add('is-hidden');
|
|
99
115
|
this.isOpen = false;
|
|
@@ -102,12 +118,13 @@ export class PdsDropdownMenu {
|
|
|
102
118
|
this.cleanupAutoUpdate();
|
|
103
119
|
this.cleanupAutoUpdate = null;
|
|
104
120
|
}
|
|
121
|
+
this.stopWatchingTriggerVisibility();
|
|
105
122
|
this.syncTriggerAria();
|
|
106
123
|
// Reset focus index
|
|
107
124
|
this.currentFocusIndex = -1;
|
|
108
125
|
// Return focus to trigger
|
|
109
126
|
if (this.isFocusInMenu()) {
|
|
110
|
-
this.focusTrigger();
|
|
127
|
+
this.focusTrigger(preventScroll);
|
|
111
128
|
}
|
|
112
129
|
};
|
|
113
130
|
// Handle click on the trigger element
|
|
@@ -137,6 +154,10 @@ export class PdsDropdownMenu {
|
|
|
137
154
|
}
|
|
138
155
|
(_a = this.triggerObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
139
156
|
this.triggerObserver = null;
|
|
157
|
+
this.stopWatchingTriggerVisibility();
|
|
158
|
+
// The menu was detached, so a position still being worked out for it is dropped. The menu
|
|
159
|
+
// itself stays open.
|
|
160
|
+
this.openCount++;
|
|
140
161
|
}
|
|
141
162
|
// The trigger is the consumer's element, so anything can rewrite its attributes (a Turbo morph
|
|
142
163
|
// matches it to server HTML that has no ARIA). Put Pine's values back when that happens.
|
|
@@ -153,18 +174,72 @@ export class PdsDropdownMenu {
|
|
|
153
174
|
attributeFilter: ['aria-haspopup', 'aria-expanded'],
|
|
154
175
|
});
|
|
155
176
|
}
|
|
177
|
+
// The panel is fixed, so a menu taller than the room beside its trigger would run off the window
|
|
178
|
+
// with no way to reach its last items. It's capped to that room and scrolls inside itself. A
|
|
179
|
+
// smaller max-height set through the menu-panel part is kept. The cap is important, as a
|
|
180
|
+
// ::part() rule outside the shadow root otherwise beats the panel's own inline style.
|
|
181
|
+
//
|
|
182
|
+
// Removing `max-height` lifts the panel's own scroll constraint, so a layout read in between
|
|
183
|
+
// (`getComputedStyle`) can commit a frame with nothing left to scroll, and the browser resets
|
|
184
|
+
// `scrollTop` to 0. This runs on every `autoUpdate` pass, including a small ancestor scroll that
|
|
185
|
+
// leaves the trigger in view, so a menu scrolled partway down would otherwise jump back to the
|
|
186
|
+
// top on its own. Restoring `scrollTop` afterward keeps the user's place; the browser clamps it
|
|
187
|
+
// automatically if the new max-height is shorter than before.
|
|
188
|
+
capPanelHeight(panel, availableHeight) {
|
|
189
|
+
const { scrollTop } = panel;
|
|
190
|
+
panel.style.removeProperty('max-height');
|
|
191
|
+
const partMaxHeight = getComputedStyle(panel).maxHeight;
|
|
192
|
+
const room = `${Math.max(0, availableHeight)}px`;
|
|
193
|
+
panel.style.setProperty('max-height', partMaxHeight === 'none' ? room : `min(${partMaxHeight}, ${room})`, 'important');
|
|
194
|
+
panel.scrollTop = scrollTop;
|
|
195
|
+
}
|
|
196
|
+
// Once the trigger is fully out of view, scrolled or clipped by any container or the window, the
|
|
197
|
+
// menu closes rather than float away from it, much as a native select's list does. An
|
|
198
|
+
// IntersectionObserver measures against the layout viewport, so panning a pinch-zoomed page
|
|
199
|
+
// doesn't close it, as Floating UI's hide() would.
|
|
200
|
+
watchTriggerVisibility() {
|
|
201
|
+
this.stopWatchingTriggerVisibility();
|
|
202
|
+
if (typeof IntersectionObserver === 'undefined')
|
|
203
|
+
return;
|
|
204
|
+
// Only a trigger seen in view this opening closes the menu when it leaves.
|
|
205
|
+
let triggerSeen = false;
|
|
206
|
+
let broughtIntoView = false;
|
|
207
|
+
this.triggerVisibility = new IntersectionObserver((entries) => {
|
|
208
|
+
if (!this.isOpen)
|
|
209
|
+
return;
|
|
210
|
+
if (entries[entries.length - 1].isIntersecting) {
|
|
211
|
+
triggerSeen = true;
|
|
212
|
+
}
|
|
213
|
+
else if (triggerSeen) {
|
|
214
|
+
this.closeDropdown({ preventScroll: true });
|
|
215
|
+
}
|
|
216
|
+
else if (!broughtIntoView) {
|
|
217
|
+
// Opened with its trigger out of view, from the keyboard after an earlier close or from a
|
|
218
|
+
// script, the trigger is scrolled into view so the menu opens beside it. A trigger that
|
|
219
|
+
// still can't be seen leaves the menu open.
|
|
220
|
+
broughtIntoView = true;
|
|
221
|
+
this.triggerEl.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
this.triggerVisibility.observe(this.triggerEl);
|
|
225
|
+
}
|
|
226
|
+
stopWatchingTriggerVisibility() {
|
|
227
|
+
var _a;
|
|
228
|
+
(_a = this.triggerVisibility) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
229
|
+
this.triggerVisibility = null;
|
|
230
|
+
}
|
|
156
231
|
// Outside clicks and scripted closes leave focus where it is; only focus in the menu or on its trigger returns.
|
|
157
232
|
isFocusInMenu() {
|
|
158
233
|
const focused = this.host.getRootNode().activeElement;
|
|
159
234
|
return focused != null && this.host.contains(focused);
|
|
160
235
|
}
|
|
161
236
|
// A trigger whose host can't take focus itself, such as pds-chip, passes it to the control inside.
|
|
162
|
-
focusTrigger() {
|
|
237
|
+
focusTrigger(preventScroll = false) {
|
|
163
238
|
var _a, _b;
|
|
164
|
-
this.triggerEl.focus();
|
|
239
|
+
this.triggerEl.focus({ preventScroll });
|
|
165
240
|
if (this.host.getRootNode().activeElement === this.triggerEl)
|
|
166
241
|
return;
|
|
167
|
-
(_b = (_a = this.triggerEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button, [href], [tabindex]:not([tabindex="-1"])')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
242
|
+
(_b = (_a = this.triggerEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button, [href], [tabindex]:not([tabindex="-1"])')) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll });
|
|
168
243
|
}
|
|
169
244
|
// Check if a menu item is disabled (handles both component and raw elements)
|
|
170
245
|
isItemDisabled(item) {
|
|
@@ -369,7 +444,7 @@ export class PdsDropdownMenu {
|
|
|
369
444
|
}
|
|
370
445
|
}
|
|
371
446
|
render() {
|
|
372
|
-
return (h(Host, { key: '
|
|
447
|
+
return (h(Host, { key: '1776921b263178df0de2cdf07a9fb81c668381b6', id: this.componentId }, h("slot", { key: '952fdc2b6bb3f1fca5a17dc1962af0e4c38f92e2', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), h("pds-box", { key: 'f5f95cebdcf4a4d78d0e4bc47b99c681045f8d38', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", part: "menu-panel" }, h("div", { key: '8bff8a8dd06fe1f433bc512bc0ac9030fc9714e7', class: { 'pds-dropdown-menu__header': true, 'is-hidden': !this.hasHeader } }, h("slot", { key: '1c248f137414dd00037d333b1e07c6b04a7b079d', name: "header", onSlotchange: this.handleHeaderSlotChange })), h("div", { key: 'db9954f26762a65e762f8c7b3dfd60e363ff8573', class: "pds-dropdown-menu__items", role: "menu", "aria-orientation": "vertical" }, h("slot", { key: 'd5cb929db03966d673b23de150970744936cf26d', onSlotchange: this.handleSlotChange })))));
|
|
373
448
|
}
|
|
374
449
|
static get is() { return "pds-dropdown-menu"; }
|
|
375
450
|
static get encapsulation() { return "shadow"; }
|
|
@@ -25,7 +25,7 @@ const BaseTemplate = (args) => html`
|
|
|
25
25
|
<pds-dropdown-menu-separator></pds-dropdown-menu-separator>
|
|
26
26
|
<pds-dropdown-menu-item disabled>disabled</pds-dropdown-menu-item>
|
|
27
27
|
<pds-dropdown-menu-separator></pds-dropdown-menu-separator>
|
|
28
|
-
<pds-dropdown-menu-item destructive><pds-icon name="trash"></pds-icon>
|
|
28
|
+
<pds-dropdown-menu-item destructive><pds-icon slot="start" name="trash"></pds-icon>Delete</pds-dropdown-menu-item>
|
|
29
29
|
<pds-dropdown-menu-item href="https://wwww.google.com">Go to Google</pds-dropdown-menu-item>
|
|
30
30
|
<pds-dropdown-menu-item href="https://wwww.google.com" disabled>Go to Google</pds-dropdown-menu-item>
|
|
31
31
|
</pds-dropdown-menu></div>`;
|
|
@@ -75,3 +75,26 @@ InformationalOnly.args = {
|
|
|
75
75
|
componentId: 'informational-only-dropdown',
|
|
76
76
|
placement: 'bottom-start',
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
const WithIconsTemplate = (args) => html`
|
|
80
|
+
<div style="height: 250px">
|
|
81
|
+
<pds-dropdown-menu
|
|
82
|
+
component-id=${args.componentId}
|
|
83
|
+
placement=${args.placement}
|
|
84
|
+
>
|
|
85
|
+
<pds-button slot="trigger">Actions</pds-button>
|
|
86
|
+
<pds-dropdown-menu-item><pds-icon slot="start" name="pen"></pds-icon>Edit</pds-dropdown-menu-item>
|
|
87
|
+
<pds-dropdown-menu-item><pds-icon slot="start" name="duplicate"></pds-icon>Duplicate</pds-dropdown-menu-item>
|
|
88
|
+
<pds-dropdown-menu-item href="#export"><pds-icon slot="start" name="download"></pds-icon>Download</pds-dropdown-menu-item>
|
|
89
|
+
<pds-dropdown-menu-item disabled><pds-icon slot="start" name="archive"></pds-icon>Archive</pds-dropdown-menu-item>
|
|
90
|
+
<pds-dropdown-menu-item informational><pds-icon slot="start" name="gear"></pds-icon>Managed in settings</pds-dropdown-menu-item>
|
|
91
|
+
<pds-dropdown-menu-separator></pds-dropdown-menu-separator>
|
|
92
|
+
<pds-dropdown-menu-item destructive><pds-icon slot="start" name="trash"></pds-icon>Delete</pds-dropdown-menu-item>
|
|
93
|
+
</pds-dropdown-menu>
|
|
94
|
+
</div>`;
|
|
95
|
+
|
|
96
|
+
export const WithIcons = WithIconsTemplate.bind();
|
|
97
|
+
WithIcons.args = {
|
|
98
|
+
componentId: 'icons-dropdown',
|
|
99
|
+
placement: 'bottom-start',
|
|
100
|
+
}
|
|
@@ -142,8 +142,9 @@
|
|
|
142
142
|
border: 0;
|
|
143
143
|
border-radius: var(--pine-dimension-100);
|
|
144
144
|
box-shadow: var(--pine-box-shadow-100);
|
|
145
|
+
box-sizing: border-box;
|
|
145
146
|
display: none;
|
|
146
|
-
inline-size:
|
|
147
|
+
inline-size: 244px;
|
|
147
148
|
inset: unset;
|
|
148
149
|
padding: var(--pine-dimension-100);
|
|
149
150
|
z-index: var(--pine-z-index-overlay);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { isRtlDirection } from "../../../utils/scroll";
|
|
3
3
|
import { enlarge, trash } from "@pine-ds/icons/icons";
|
|
4
|
+
import { bindTruncationTooltips } from "../../../utils/truncation-tooltip";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Uses a hybrid approach for optimal cross-browser compatibility:
|
|
8
|
-
* - Modern browsers: CSS anchor positioning + JavaScript flip classes
|
|
9
|
-
* - Fallback browsers: JavaScript positioning with viewport boundary detection
|
|
6
|
+
* A single filter in `pds-filters`: a trigger button that opens a popover holding the filter controls.
|
|
7
|
+
* The `clear` variant has no popover and emits `pdsFilterClear` instead.
|
|
10
8
|
*
|
|
11
9
|
* @part button - Exposes the trigger button element for styling.
|
|
12
10
|
* @part button-content - Exposes the button content container for styling.
|
|
@@ -19,6 +17,16 @@ export class PdsFilter {
|
|
|
19
17
|
constructor() {
|
|
20
18
|
this.scrollRAF = null;
|
|
21
19
|
this.lastScrollTime = 0;
|
|
20
|
+
this.truncationTooltip = bindTruncationTooltips((textEl) => {
|
|
21
|
+
var _a;
|
|
22
|
+
return ({
|
|
23
|
+
// The trigger, not the host, whose child the popover is; `__button-content` holds the max width, so the text overflows.
|
|
24
|
+
hostEl: (_a = textEl.closest('button')) !== null && _a !== void 0 ? _a : textEl,
|
|
25
|
+
contentEl: textEl,
|
|
26
|
+
getTooltipText: () => { var _a; return (_a = this.text) !== null && _a !== void 0 ? _a : ''; },
|
|
27
|
+
manageTabIndex: false,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
22
30
|
/**
|
|
23
31
|
* The variant style of the filter trigger.
|
|
24
32
|
* @defaultValue 'default'
|
|
@@ -122,11 +130,15 @@ export class PdsFilter {
|
|
|
122
130
|
// The toggle event listener will capture the state change and emit events
|
|
123
131
|
};
|
|
124
132
|
}
|
|
133
|
+
connectedCallback() {
|
|
134
|
+
this.syncTruncationTooltip();
|
|
135
|
+
}
|
|
125
136
|
/**
|
|
126
137
|
* Component lifecycle: Clean up when disconnected from DOM.
|
|
127
138
|
* Prevents memory leaks by canceling pending operations and closing popovers.
|
|
128
139
|
*/
|
|
129
140
|
disconnectedCallback() {
|
|
141
|
+
this.truncationTooltip.destroy();
|
|
130
142
|
// Cancel pending animation frames
|
|
131
143
|
if (this.scrollRAF) {
|
|
132
144
|
cancelAnimationFrame(this.scrollRAF);
|
|
@@ -152,6 +164,7 @@ export class PdsFilter {
|
|
|
152
164
|
}
|
|
153
165
|
}
|
|
154
166
|
componentDidRender() {
|
|
167
|
+
this.syncTruncationTooltip();
|
|
155
168
|
// Note: popoverEl is set via ref callback in render method
|
|
156
169
|
// For browsers with native popover API, we need direct element listeners
|
|
157
170
|
// since the document listener may not capture native popover toggle events
|
|
@@ -165,6 +178,10 @@ export class PdsFilter {
|
|
|
165
178
|
}
|
|
166
179
|
}
|
|
167
180
|
}
|
|
181
|
+
syncTruncationTooltip() {
|
|
182
|
+
var _a;
|
|
183
|
+
this.truncationTooltip.sync([(_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.pds-filter__button-text')]);
|
|
184
|
+
}
|
|
168
185
|
/**
|
|
169
186
|
* Reposition popovers on window resize.
|
|
170
187
|
*/
|
|
@@ -485,7 +502,7 @@ export class PdsFilter {
|
|
|
485
502
|
return null;
|
|
486
503
|
}
|
|
487
504
|
render() {
|
|
488
|
-
return (h(Host, { key: '
|
|
505
|
+
return (h(Host, { key: '0876855dacf0172f83a6e1afcc8b9b1b6acf1251', id: this.componentId }, h("button", { key: 'e20b93644a520ed3351fb5802d1e6f0cb2465248', class: this.getTriggerClasses(), type: "button", popoverTarget: this.variant !== 'clear' ? `${this.componentId}-popover` : undefined, popoverTargetAction: this.variant !== 'clear' ? 'toggle' : undefined, onKeyDown: this.variant === 'clear' ? this.handleKeyDown : undefined, onClick: (event) => this.handleClick(event), part: "button", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": this.variant !== 'clear' ? 'true' : undefined, "aria-controls": this.variant !== 'clear' ? `${this.componentId}-popover` : undefined }, h("span", { key: '075e2f221d297ede0a52185853acbd3e74b99339', class: "pds-filter__button-content", part: "button-content" }, this.renderIcon(), this.text && (h("span", { key: 'cd1d3a15e0969c3d960786a7fd7fd7b3195dd4de', class: "pds-filter__button-text", part: "button-text" }, this.text)), this.renderDropdownIcon())), this.variant !== 'clear' && (h("div", { key: '6524cb11b96f03ef5c528325a950c9f80f5ae9fa', ref: el => this.popoverEl = el, id: `${this.componentId}-popover`, class: "pds-filter__popover", popover: "auto", part: "popover" }, h("slot", { key: '06cc2ca22068ccedbddf3ff69ce4a352fd01d142' })))));
|
|
489
506
|
}
|
|
490
507
|
static get is() { return "pds-filter"; }
|
|
491
508
|
static get encapsulation() { return "shadow"; }
|
|
@@ -581,7 +598,7 @@ export class PdsFilter {
|
|
|
581
598
|
"optional": true,
|
|
582
599
|
"docs": {
|
|
583
600
|
"tags": [],
|
|
584
|
-
"text": "The text content displayed in the trigger button."
|
|
601
|
+
"text": "The text content displayed in the trigger button.\nWhen text overflows, a tooltip showing the full text will appear on hover/focus."
|
|
585
602
|
},
|
|
586
603
|
"getter": false,
|
|
587
604
|
"setter": false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|