@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,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { setColor } from "../../utils/utils";
|
|
3
|
-
import { FOCUSABLE_WRAPPER, setupTruncationTooltip } from "../../utils/truncation-tooltip";
|
|
3
|
+
import { FOCUSABLE_WRAPPER, flattenedText, setupTruncationTooltip } from "../../utils/truncation-tooltip";
|
|
4
4
|
import { TEXT_SIZES } from "../../utils/types";
|
|
5
5
|
// Re-runs setup for each text bound to its wrapping control, keyed by host, so a truncated
|
|
6
6
|
// text that joins the same control later can take that control's focus away from it.
|
|
@@ -80,7 +80,9 @@ export class PdsText {
|
|
|
80
80
|
this.truncationCleanup = setupTruncationTooltip({
|
|
81
81
|
hostEl: this.el,
|
|
82
82
|
contentEl: this.contentEl,
|
|
83
|
-
|
|
83
|
+
// Not `textContent`: a consumer that wraps its own slot in this text, as `pds-alert` does, holds a
|
|
84
|
+
// `<slot>` here, which counts as empty and would leave the tooltip with nothing to show.
|
|
85
|
+
getTooltipText: () => flattenedText(this.el),
|
|
84
86
|
// A wrapping link or button already takes focus, so its focus reveals the text instead of a nested tab stop.
|
|
85
87
|
manageTabIndex: !usesWrapper,
|
|
86
88
|
focusEl: usesWrapper ? wrapper : this.el,
|
|
@@ -116,7 +118,7 @@ export class PdsText {
|
|
|
116
118
|
? `pds-text--decoration-${this.decoration}`
|
|
117
119
|
: ''}
|
|
118
120
|
`;
|
|
119
|
-
return (h(Tag, { key: '
|
|
121
|
+
return (h(Tag, { key: '3b9efbad7872410a7e07438801ec17382282ab16', ref: (el) => (this.contentEl = el), style: this.color && setColor(this.color), class: typeClasses, part: "content" }, h("slot", { key: '0784e6aee6ce23f93f0e3c077da5fa3ca944aebb' })));
|
|
120
122
|
}
|
|
121
123
|
static get is() { return "pds-text"; }
|
|
122
124
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,6 +6,7 @@ import { danger } from "@pine-ds/icons/icons";
|
|
|
6
6
|
import { formatMessage } from "../../i18n";
|
|
7
7
|
/**
|
|
8
8
|
* @slot action - Content to be displayed in the label area, typically for help icons or links
|
|
9
|
+
* @part action - Exposes the wrapper around the `action` slot for styling. Appears only when the `action` slot has content.
|
|
9
10
|
*/
|
|
10
11
|
export class PdsTextarea {
|
|
11
12
|
constructor() {
|
|
@@ -17,12 +18,13 @@ export class PdsTextarea {
|
|
|
17
18
|
*/
|
|
18
19
|
this.disabled = false;
|
|
19
20
|
/**
|
|
20
|
-
* Determines whether or not the textarea is invalid
|
|
21
|
+
* Determines whether or not the textarea is invalid. When `required` is set, the textarea sets it
|
|
22
|
+
* itself each time `pdsTextareaChange` fires, replacing a value you set.
|
|
21
23
|
* @defaultValue false
|
|
22
24
|
*/
|
|
23
25
|
this.invalid = false; // eslint-disable-line @stencil-community/strict-mutable
|
|
24
26
|
/**
|
|
25
|
-
* Specifies the name. Submitted with the form name/value pair.
|
|
27
|
+
* Specifies the name. Submitted with the form name/value pair.
|
|
26
28
|
*/
|
|
27
29
|
this.name = this.componentId;
|
|
28
30
|
/**
|
|
@@ -306,10 +308,10 @@ export class PdsTextarea {
|
|
|
306
308
|
}
|
|
307
309
|
render() {
|
|
308
310
|
const value = this.getValue();
|
|
309
|
-
return (h(Host, { key: '
|
|
310
|
-
h("div", { key: '
|
|
311
|
-
h("p", { key: '
|
|
312
|
-
h("p", { key: '
|
|
311
|
+
return (h(Host, { key: '96f8863a39579b421057fa9b2857753785d4c585', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null, "has-action": this.hasAction && !this.hideLabel ? 'true' : null }, h("div", { key: '89ae283a1674af03795c0443ee7fea2bac658c9e', class: "pds-textarea" }, this.label &&
|
|
312
|
+
h("div", { key: '7da482f50cfbf7361c457d79e9185bdf204d728d', class: "pds-textarea__label-wrapper" }, h("label", { key: '3c1a24beae7a190e11a686c4f15dbc175221db0b', htmlFor: this.componentId }, h("span", { key: '7d2f5618fe0893bca5926237adfc610adfaf7cc7', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), !this.hideLabel && this.renderAction()), h("div", { key: '371d16fe7e0446658316d4f2047776ef4429346c', class: "pds-textarea__field-wrapper" }, h("textarea", Object.assign({ key: '6e433b544a20b82d16ce8522196c41ca8b22411f', ref: (el) => this.nativeTextarea = el, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, class: this.textareaClassNames(), disabled: this.disabled, id: this.componentId, maxlength: this.maxLength, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, rows: this.rows, onBlur: this.onBlur, onChange: this.onTextareaChange, onFocus: this.onFocus, onInput: this.onInput, onKeyDown: this.onKeyDown }, this.inheritedAttributes), value), this.renderCharacterCounter()), this.helperMessage &&
|
|
313
|
+
h("p", { key: '7b7117493340f25be2c4d18b48e00add775155d3', class: "pds-textarea__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.invalid &&
|
|
314
|
+
h("p", { key: '79a604af17aa9a6735d44aa52a858881e053de43', "aria-live": "assertive", class: "pds-textarea__error-message", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: '765e5df4a34b583183f1ceeb92fb596067d4a212', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage))));
|
|
313
315
|
}
|
|
314
316
|
static get is() { return "pds-textarea"; }
|
|
315
317
|
static get encapsulation() { return "shadow"; }
|
|
@@ -399,7 +401,7 @@ export class PdsTextarea {
|
|
|
399
401
|
"optional": true,
|
|
400
402
|
"docs": {
|
|
401
403
|
"tags": [],
|
|
402
|
-
"text": "
|
|
404
|
+
"text": "Sets the number of milliseconds to wait after each input event before emitting `pdsInput`."
|
|
403
405
|
},
|
|
404
406
|
"getter": false,
|
|
405
407
|
"setter": false,
|
|
@@ -418,7 +420,7 @@ export class PdsTextarea {
|
|
|
418
420
|
"optional": true,
|
|
419
421
|
"docs": {
|
|
420
422
|
"tags": [],
|
|
421
|
-
"text": "Displays an error message below the textarea
|
|
423
|
+
"text": "Displays an error message below the textarea while `invalid` is set."
|
|
422
424
|
},
|
|
423
425
|
"getter": false,
|
|
424
426
|
"setter": false,
|
|
@@ -459,7 +461,7 @@ export class PdsTextarea {
|
|
|
459
461
|
"name": "defaultValue",
|
|
460
462
|
"text": "false"
|
|
461
463
|
}],
|
|
462
|
-
"text": "Determines whether or not the textarea is invalid
|
|
464
|
+
"text": "Determines whether or not the textarea is invalid. When `required` is set, the textarea sets it\nitself each time `pdsTextareaChange` fires, replacing a value you set."
|
|
463
465
|
},
|
|
464
466
|
"getter": false,
|
|
465
467
|
"setter": false,
|
|
@@ -517,7 +519,7 @@ export class PdsTextarea {
|
|
|
517
519
|
"optional": false,
|
|
518
520
|
"docs": {
|
|
519
521
|
"tags": [],
|
|
520
|
-
"text": "Specifies the name. Submitted with the form name/value pair.
|
|
522
|
+
"text": "Specifies the name. Submitted with the form name/value pair."
|
|
521
523
|
},
|
|
522
524
|
"getter": false,
|
|
523
525
|
"setter": false,
|
|
@@ -707,7 +709,7 @@ export class PdsTextarea {
|
|
|
707
709
|
"composed": true,
|
|
708
710
|
"docs": {
|
|
709
711
|
"tags": [],
|
|
710
|
-
"text": "Emitted when the
|
|
712
|
+
"text": "Emitted when the textarea loses focus."
|
|
711
713
|
},
|
|
712
714
|
"complexType": {
|
|
713
715
|
"original": "FocusEvent",
|
|
@@ -727,7 +729,7 @@ export class PdsTextarea {
|
|
|
727
729
|
"composed": true,
|
|
728
730
|
"docs": {
|
|
729
731
|
"tags": [],
|
|
730
|
-
"text": "Emitted when the
|
|
732
|
+
"text": "Emitted when the textarea has focus."
|
|
731
733
|
},
|
|
732
734
|
"complexType": {
|
|
733
735
|
"original": "FocusEvent",
|
|
@@ -747,7 +749,7 @@ export class PdsTextarea {
|
|
|
747
749
|
"composed": true,
|
|
748
750
|
"docs": {
|
|
749
751
|
"tags": [],
|
|
750
|
-
"text": "Emitted
|
|
752
|
+
"text": "Emitted after each `input` event, such as typing or pasting. With `debounce`, it waits until that many milliseconds have passed since the last one.\n`detail` has `value`, the current text, and `event`, the native `input` event.\n\nThis event will not emit when programmatically setting the `value` property."
|
|
751
753
|
},
|
|
752
754
|
"complexType": {
|
|
753
755
|
"original": "TextareaInputEventDetail",
|
|
@@ -769,7 +771,7 @@ export class PdsTextarea {
|
|
|
769
771
|
"composed": true,
|
|
770
772
|
"docs": {
|
|
771
773
|
"tags": [],
|
|
772
|
-
"text": "
|
|
774
|
+
"text": "Emitted when the user changes the value and then leaves the textarea. `Enter` adds a new line, so it doesn't emit this event.\n`detail` has `value`, the text, and `event`, the native event behind it, usually `change`.\n\nThis event will not emit when programmatically setting the `value` property, unless the field has focus at the time;\nthen it emits when the field loses focus."
|
|
773
775
|
},
|
|
774
776
|
"complexType": {
|
|
775
777
|
"original": "TextareaChangeEventDetail",
|
|
@@ -5,7 +5,6 @@ export default {
|
|
|
5
5
|
|
|
6
6
|
args: {
|
|
7
7
|
autocomplete: null,
|
|
8
|
-
clearOnEdit: false,
|
|
9
8
|
componentId: null,
|
|
10
9
|
debounce: null,
|
|
11
10
|
disabled: false,
|
|
@@ -29,7 +28,6 @@ export default {
|
|
|
29
28
|
|
|
30
29
|
const BaseTemplate = (args) => html`<pds-textarea
|
|
31
30
|
autocomplete="${args.autocomplete}"
|
|
32
|
-
?clear-on-edit=${args.clearOnEdit}
|
|
33
31
|
component-id="${args.componentId}"
|
|
34
32
|
?disabled=${args.disabled}
|
|
35
33
|
error-message="${args.errorMessage}"
|
|
@@ -40,14 +38,11 @@ const BaseTemplate = (args) => html`<pds-textarea
|
|
|
40
38
|
label="${args.label}"
|
|
41
39
|
max-length="${args.maxLength}"
|
|
42
40
|
name="${args.name}"
|
|
43
|
-
onChange="${args.onChange}"
|
|
44
41
|
placeholder="${args.placeholder}"
|
|
45
42
|
?readonly=${args.readonly}
|
|
46
43
|
?required=${args.required}
|
|
47
44
|
rows="${args.rows}"
|
|
48
45
|
value="${args.value}"
|
|
49
|
-
data-tooltip-id="foo"
|
|
50
|
-
title="bar"
|
|
51
46
|
>
|
|
52
47
|
${args.action || ''}
|
|
53
48
|
</pds-textarea>`;
|
|
@@ -138,7 +133,6 @@ Autocomplete.args = {
|
|
|
138
133
|
|
|
139
134
|
export const withActionLink = (args) => html`<pds-textarea
|
|
140
135
|
autocomplete="${args.autocomplete}"
|
|
141
|
-
?clear-on-edit=${args.clearOnEdit}
|
|
142
136
|
component-id="pds-textarea-action-link"
|
|
143
137
|
?disabled=${args.disabled}
|
|
144
138
|
error-message="${args.errorMessage}"
|
|
@@ -148,14 +142,12 @@ export const withActionLink = (args) => html`<pds-textarea
|
|
|
148
142
|
?invalid=${args.invalid}
|
|
149
143
|
label="Notes"
|
|
150
144
|
name="${args.name}"
|
|
151
|
-
onChange="${args.onChange}"
|
|
152
145
|
placeholder="${args.placeholder}"
|
|
153
146
|
?readonly=${args.readonly}
|
|
154
147
|
?required=${args.required}
|
|
155
148
|
rows="3"
|
|
156
149
|
value="${args.value}"
|
|
157
|
-
|
|
158
|
-
title="bar">
|
|
150
|
+
>
|
|
159
151
|
<pds-link href="#" slot="action">
|
|
160
152
|
View examples
|
|
161
153
|
</pds-link>
|
|
@@ -163,7 +155,6 @@ export const withActionLink = (args) => html`<pds-textarea
|
|
|
163
155
|
|
|
164
156
|
export const withActionButton = (args) => html`<pds-textarea
|
|
165
157
|
autocomplete="${args.autocomplete}"
|
|
166
|
-
?clear-on-edit=${args.clearOnEdit}
|
|
167
158
|
component-id="pds-textarea-action-button"
|
|
168
159
|
?disabled=${args.disabled}
|
|
169
160
|
error-message="${args.errorMessage}"
|
|
@@ -173,14 +164,12 @@ export const withActionButton = (args) => html`<pds-textarea
|
|
|
173
164
|
?invalid=${args.invalid}
|
|
174
165
|
label="Description"
|
|
175
166
|
name="${args.name}"
|
|
176
|
-
onChange="${args.onChange}"
|
|
177
167
|
placeholder="${args.placeholder}"
|
|
178
168
|
?readonly=${args.readonly}
|
|
179
169
|
?required=${args.required}
|
|
180
170
|
rows="4"
|
|
181
171
|
value="${args.value}"
|
|
182
|
-
|
|
183
|
-
title="bar">
|
|
172
|
+
>
|
|
184
173
|
<pds-button slot="action" variant="unstyled" aria-label="Help with description">
|
|
185
174
|
<pds-icon name="question-circle" aria-hidden="true"></pds-icon>
|
|
186
175
|
</pds-button>
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
background-color: var(--pine-color-primary);
|
|
19
19
|
border-radius: var(--pine-dimension-xs);
|
|
20
20
|
box-shadow: var(--pine-box-shadow);
|
|
21
|
+
box-sizing: border-box;
|
|
21
22
|
color: var(--pine-color-text-primary);
|
|
22
23
|
display: flex;
|
|
23
24
|
height: var(--sizing-height-default);
|
|
24
25
|
justify-content: flex-start;
|
|
25
26
|
margin-block-end: var(--pine-dimension-2xs);
|
|
26
|
-
max-width: 90vw;
|
|
27
|
-
min-width: var(--sizing-min-width);
|
|
27
|
+
max-width: calc(90vw + var(--padding-inline) * 2);
|
|
28
|
+
min-width: calc(var(--sizing-min-width) + var(--padding-inline) * 2);
|
|
28
29
|
padding: 0 var(--padding-inline);
|
|
29
30
|
position: relative;
|
|
30
31
|
width: fit-content;
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
@media screen and (max-width: 767px) {
|
|
33
34
|
.pds-toast {
|
|
34
35
|
height: 36px;
|
|
35
|
-
max-width:
|
|
36
|
+
max-width: 100vw;
|
|
36
37
|
min-width: auto;
|
|
37
38
|
padding-inline: var(--pine-dimension-2xs);
|
|
38
39
|
}
|
|
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
/** Fallback when computed `--animation-duration` is unavailable (matches `--pine-motion-duration-slow`). */
|
|
3
3
|
const TOAST_DISMISS_ANIMATION_MS = 300;
|
|
4
4
|
/**
|
|
5
|
-
* @part dismiss
|
|
5
|
+
* @part dismiss - Exposes the dismiss button for styling. Appears unless `dismissible` is `false`.
|
|
6
6
|
*/
|
|
7
7
|
export class PdsToast {
|
|
8
8
|
constructor() {
|
|
@@ -58,6 +58,10 @@ export class PdsToast {
|
|
|
58
58
|
this.startDismissTimer();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Dismisses the toast, as the dismiss button and `duration` do: plays the exit animation and emits `pdsToastDismissed`, and the toast
|
|
63
|
+
* gets `hidden` on the next render, after the event. Works even when `dismissible` is `false`. The toast stays in the DOM.
|
|
64
|
+
*/
|
|
61
65
|
async dismiss() {
|
|
62
66
|
// Start the animation out
|
|
63
67
|
this.isAnimatingOut = true;
|
|
@@ -127,13 +131,13 @@ export class PdsToast {
|
|
|
127
131
|
}
|
|
128
132
|
render() {
|
|
129
133
|
const severity = this.severityText();
|
|
130
|
-
return (h(Host, { key: '
|
|
134
|
+
return (h(Host, { key: '89a7a4a9105730769c83cbb39af3cec31d1a39da', hidden: !this.isVisible }, h("div", { key: '6543b52aea9ba5e956f894148e965619c8836432', class: {
|
|
131
135
|
'pds-toast': true,
|
|
132
136
|
[`pds-toast--${this.type}`]: this.type !== 'default',
|
|
133
137
|
'pds-toast--animating-out': this.isAnimatingOut
|
|
134
|
-
}, role: "alert", "aria-live": "polite" }, this.renderIcon(), severity && h("span", { key: '
|
|
138
|
+
}, role: "alert", "aria-live": "polite" }, this.renderIcon(), severity && h("span", { key: 'c2ec7185878dd0d00f0cf12c29080b716997f2c2', class: "visually-hidden" }, severity), h("span", { key: '0274afc2c23f43d7cd50a42fc999d82f91ad026d', class: "pds-toast__message" }, h("slot", { key: 'daba1b8fb461ffeb9c662d6c30f5cc93ca7c08f9' })), this.dismissible && (h("button", { key: '56cd7eb04c759acdaa850d230a5204eb2cae87f0', type: "button", part: "dismiss", class: "pds-toast__button", onClick: () => {
|
|
135
139
|
this.dismiss();
|
|
136
|
-
}, "aria-label": this.dismissLabel }, h("pds-icon", { key: '
|
|
140
|
+
}, "aria-label": this.dismissLabel }, h("pds-icon", { key: '95b08c3cbe0fb015515884484cf5ea28f7f0025c', name: "remove", "aria-hidden": "true" }))))));
|
|
137
141
|
}
|
|
138
142
|
static get is() { return "pds-toast"; }
|
|
139
143
|
static get encapsulation() { return "shadow"; }
|
|
@@ -342,7 +346,7 @@ export class PdsToast {
|
|
|
342
346
|
"return": "Promise<void>"
|
|
343
347
|
},
|
|
344
348
|
"docs": {
|
|
345
|
-
"text": "",
|
|
349
|
+
"text": "Dismisses the toast, as the dismiss button and `duration` do: plays the exit animation and emits `pdsToastDismissed`, and the toast\ngets `hidden` on the next render, after the event. Works even when `dismissible` is `false`. The toast stays in the DOM.",
|
|
346
350
|
"tags": []
|
|
347
351
|
}
|
|
348
352
|
}
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
|
|
12
12
|
const BaseTemplate = (args) => html`
|
|
13
13
|
<pds-toast
|
|
14
|
-
|
|
14
|
+
dismissible="${args.dismissible}"
|
|
15
15
|
component-id="${args.componentId}"
|
|
16
16
|
duration="${args.duration}"
|
|
17
17
|
icon="${args.icon || ''}"
|
|
@@ -23,7 +23,7 @@ const BaseTemplate = (args) => html`
|
|
|
23
23
|
|
|
24
24
|
const WithLinkTemplate = (args) => html`
|
|
25
25
|
<pds-toast
|
|
26
|
-
|
|
26
|
+
dismissible="${args.dismissible}"
|
|
27
27
|
component-id="${args.componentId}"
|
|
28
28
|
duration="${args.duration}"
|
|
29
29
|
icon="${args.icon || ''}"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--tooltip-border-width-arrow-up: 0 var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow);
|
|
6
6
|
--tooltip-sizing-arrow: 6px;
|
|
7
7
|
--tooltip-sizing-arrow-offset: 14px;
|
|
8
|
-
--tooltip-dimension-max-width:
|
|
8
|
+
--tooltip-dimension-max-width: 344px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
:is(dialog, [popover]) > .pds-tooltip {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
background-color: var(--pine-color-primary);
|
|
24
24
|
border-radius: calc(var(--pine-dimension-xs) * 1.25);
|
|
25
25
|
box-shadow: var(--pine-box-shadow);
|
|
26
|
+
box-sizing: border-box;
|
|
26
27
|
color: var(--pine-color-text-primary);
|
|
27
28
|
max-width: var(--tooltip-dimension-max-width);
|
|
28
29
|
opacity: 0;
|
|
@@ -9,10 +9,10 @@ export default {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const BaseTemplate = (args) => html`
|
|
12
|
-
<pds-tooltip content=${args.content} max-width=${args.maxWidth}
|
|
12
|
+
<pds-tooltip content=${args.content} max-width=${args.maxWidth} has-arrow="${args.hasArrow}" placement=${args.placement} ?opened=${args.opened}>${args.slot}</pds-tooltip>`;
|
|
13
13
|
|
|
14
14
|
const HTMLContentTemplate = (args) => html`
|
|
15
|
-
<pds-tooltip
|
|
15
|
+
<pds-tooltip has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement=${args.placement} ?html-content=${args.htmlContent} ?opened=${args.opened}>
|
|
16
16
|
<div slot="content">
|
|
17
17
|
<p><strong>This is a tooltip</strong></p>
|
|
18
18
|
<p>Tooltips are used to describe or identify an element. In most scenarios, tooltips help the user understand the meaning, function or alt-text of an element.</p>
|
|
@@ -25,7 +25,7 @@ const InModalTemplate = (args) => html`
|
|
|
25
25
|
<pds-modal id="tooltip-modal" component-id="tooltip-modal" size="sm">
|
|
26
26
|
<pds-modal-header>
|
|
27
27
|
<pds-box padding="md">
|
|
28
|
-
<pds-text tag="h2" size="h3">Publish changes</pds-text>
|
|
28
|
+
<pds-text tag="h2" size="h3" id="tooltip-modal-heading">Publish changes</pds-text>
|
|
29
29
|
</pds-box>
|
|
30
30
|
</pds-modal-header>
|
|
31
31
|
<pds-modal-content>
|
|
@@ -36,7 +36,7 @@ const InModalTemplate = (args) => html`
|
|
|
36
36
|
<pds-modal-footer>
|
|
37
37
|
<pds-box fit gap="sm" justify-content="end" padding="md">
|
|
38
38
|
<pds-button variant="secondary" onclick="document.querySelector('#tooltip-modal').open = false">Cancel</pds-button>
|
|
39
|
-
<pds-tooltip content=${args.content}
|
|
39
|
+
<pds-tooltip content=${args.content} has-arrow="${args.hasArrow}" placement=${args.placement}>
|
|
40
40
|
<pds-button variant="primary">Publish</pds-button>
|
|
41
41
|
</pds-tooltip>
|
|
42
42
|
</pds-box>
|
|
@@ -47,46 +47,46 @@ const PositionTemplate = (args) => html`
|
|
|
47
47
|
<div class="demo-container" style="min-height: 50vh; width: 100%; display: flex; align-items: center; justify-content: center;">
|
|
48
48
|
<div class="position-demo-grid">
|
|
49
49
|
<div class="position-demo-grid-item">
|
|
50
|
-
<pds-tooltip content="content 2"
|
|
50
|
+
<pds-tooltip content="content 2" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="top-start" ?opened=${args.opened}>
|
|
51
51
|
<pds-button variant="accent">t</pds-button>
|
|
52
52
|
</pds-tooltip>
|
|
53
|
-
<pds-tooltip content="content 2"
|
|
53
|
+
<pds-tooltip content="content 2" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="top" ?opened=${args.opened}>
|
|
54
54
|
<pds-button variant="accent">t</pds-button>
|
|
55
55
|
</pds-tooltip>
|
|
56
|
-
<pds-tooltip content="content 3"
|
|
56
|
+
<pds-tooltip content="content 3" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="top-end" ?opened=${args.opened}>
|
|
57
57
|
<pds-button variant="accent">te</pds-button>
|
|
58
58
|
</pds-tooltip>
|
|
59
59
|
</div>
|
|
60
60
|
<div class="position-demo-grid-item">
|
|
61
|
-
<pds-tooltip content="content 1"
|
|
61
|
+
<pds-tooltip content="content 1" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="left-start" ?opened=${args.opened}>
|
|
62
62
|
<pds-button variant="accent">ls</pds-button>
|
|
63
63
|
</pds-tooltip>
|
|
64
|
-
<pds-tooltip content="content 2"
|
|
64
|
+
<pds-tooltip content="content 2" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="left" ?opened=${args.opened}>
|
|
65
65
|
<pds-button variant="accent">l</pds-button>
|
|
66
66
|
</pds-tooltip>
|
|
67
|
-
<pds-tooltip content="content 3"
|
|
67
|
+
<pds-tooltip content="content 3" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="left-end" ?opened=${args.opened}>
|
|
68
68
|
<pds-button variant="accent">le</pds-button>
|
|
69
69
|
</pds-tooltip>
|
|
70
70
|
</div>
|
|
71
71
|
<div class="position-demo-grid-item">
|
|
72
|
-
<pds-tooltip content="content 1"
|
|
72
|
+
<pds-tooltip content="content 1" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="bottom-start" ?opened=${args.opened}>
|
|
73
73
|
<pds-button variant="accent">bs</pds-button>
|
|
74
74
|
</pds-tooltip>
|
|
75
|
-
<pds-tooltip content="content 2"
|
|
75
|
+
<pds-tooltip content="content 2" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="bottom" ?opened=${args.opened}>
|
|
76
76
|
<pds-button variant="accent">b</pds-button>
|
|
77
77
|
</pds-tooltip>
|
|
78
|
-
<pds-tooltip content="content 3"
|
|
78
|
+
<pds-tooltip content="content 3" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="bottom-end" ?opened=${args.opened}>
|
|
79
79
|
<pds-button variant="accent">be</pds-button>
|
|
80
80
|
</pds-tooltip>
|
|
81
81
|
</div>
|
|
82
82
|
<div class="position-demo-grid-item">
|
|
83
|
-
<pds-tooltip content="content 1"
|
|
83
|
+
<pds-tooltip content="content 1" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="right-start" ?opened=${args.opened}>
|
|
84
84
|
<pds-button variant="accent">rs</pds-button>
|
|
85
85
|
</pds-tooltip>
|
|
86
|
-
<pds-tooltip content="content 2"
|
|
86
|
+
<pds-tooltip content="content 2" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="right" ?opened=${args.opened}>
|
|
87
87
|
<pds-button variant="accent">r</pds-button>
|
|
88
88
|
</pds-tooltip>
|
|
89
|
-
<pds-tooltip content="content 3"
|
|
89
|
+
<pds-tooltip content="content 3" has-arrow="${args.hasArrow}" max-width=${args.maxWidth} placement="right-end" ?opened=${args.opened}>
|
|
90
90
|
<pds-button variant="accent">re</pds-button>
|
|
91
91
|
</pds-tooltip>
|
|
92
92
|
</div>
|
|
@@ -125,7 +125,7 @@ NoArrow.args = {
|
|
|
125
125
|
|
|
126
126
|
export const InModal = InModalTemplate.bind({});
|
|
127
127
|
InModal.args = {
|
|
128
|
-
content: "
|
|
128
|
+
content: "Makes your changes visible to everyone",
|
|
129
129
|
hasArrow: true,
|
|
130
130
|
placement: "top",
|
|
131
131
|
};
|
|
@@ -25,6 +25,14 @@ export const findInAncestorRoots = (host, id) => {
|
|
|
25
25
|
}
|
|
26
26
|
return root instanceof Document ? root.getElementById(id) : null;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* The elements an ID-reference attribute on the host names, skipping IDs that match nothing.
|
|
30
|
+
*/
|
|
31
|
+
export const referencedElements = (host, attribute) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const ids = (_b = (_a = host.getAttribute(attribute)) === null || _a === void 0 ? void 0 : _a.split(/\s+/).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
34
|
+
return ids.map((id) => findInAncestorRoots(host, id)).filter((el) => el !== null);
|
|
35
|
+
};
|
|
28
36
|
/**
|
|
29
37
|
* Points the target's reflected ARIA properties at the elements the host's ID-reference attributes
|
|
30
38
|
* name, or clears them. Run it again whenever the attributes or the referenced elements may have
|
|
@@ -32,11 +40,9 @@ export const findInAncestorRoots = (host, id) => {
|
|
|
32
40
|
*/
|
|
33
41
|
export const forwardAriaReferences = (host, target) => {
|
|
34
42
|
Object.entries(ARIA_REFERENCE_PROPERTIES).forEach(([attribute, property]) => {
|
|
35
|
-
var _a, _b;
|
|
36
43
|
if (!(property in target))
|
|
37
44
|
return;
|
|
38
|
-
const
|
|
39
|
-
const referenced = ids.map((id) => findInAncestorRoots(host, id)).filter((el) => el !== null);
|
|
45
|
+
const referenced = referencedElements(host, attribute);
|
|
40
46
|
target[property] = referenced.length > 0 ? referenced : null;
|
|
41
47
|
});
|
|
42
48
|
};
|
|
@@ -3,6 +3,40 @@ import { findPortalTarget, isTopLayerInDocument, onTopLayerClose } from "./porta
|
|
|
3
3
|
// Controls that clipped text can sit inside that already take focus, so the text adds no tab stop of its own.
|
|
4
4
|
// Not any `[tabindex]`: a focusable scroll region full of chips would show every chip's tooltip at once.
|
|
5
5
|
export const FOCUSABLE_WRAPPER = 'a[href], button, summary, pds-button, pds-link, pds-tab, pds-dropdown-menu-item, [role="option"], [role="treeitem"]';
|
|
6
|
+
const ELEMENT_NODE = 1;
|
|
7
|
+
const TEXT_NODE = 3;
|
|
8
|
+
/**
|
|
9
|
+
* The text `el` actually shows, with every `<slot>` it holds replaced by the
|
|
10
|
+
* nodes assigned to it.
|
|
11
|
+
*
|
|
12
|
+
* `textContent` counts a slot as empty, so a component that renders a clipped
|
|
13
|
+
* text around a slot of its own — `pds-alert` renders `<pds-text truncate><slot/></pds-text>` —
|
|
14
|
+
* would leave the tooltip with nothing to show and so no tooltip at all, even
|
|
15
|
+
* though the text is clipped and holds a tab stop.
|
|
16
|
+
*
|
|
17
|
+
* Text nodes only, as `textContent` counts too: Stencil leaves comment nodes
|
|
18
|
+
* among slotted content to mark where it was relocated from, and their data is
|
|
19
|
+
* not text anyone reads.
|
|
20
|
+
*/
|
|
21
|
+
export function flattenedText(el) {
|
|
22
|
+
let text = '';
|
|
23
|
+
const add = (node) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const slot = node;
|
|
26
|
+
// `flatten` returns the slot's own children when nothing is assigned, which is what renders then.
|
|
27
|
+
if (node.nodeName === 'SLOT' && typeof slot.assignedNodes === 'function') {
|
|
28
|
+
slot.assignedNodes({ flatten: true }).forEach(add);
|
|
29
|
+
}
|
|
30
|
+
else if (node.nodeType === ELEMENT_NODE) {
|
|
31
|
+
text += flattenedText(node);
|
|
32
|
+
}
|
|
33
|
+
else if (node.nodeType === TEXT_NODE) {
|
|
34
|
+
text += (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
el.childNodes.forEach(add);
|
|
38
|
+
return text;
|
|
39
|
+
}
|
|
6
40
|
/** CSS class prefix used for truncation tooltip portal elements */
|
|
7
41
|
const TOOLTIP_CLASS = 'pds-truncation-tooltip';
|
|
8
42
|
/**
|
|
@@ -353,3 +387,36 @@ export function setupTruncationTooltip(options) {
|
|
|
353
387
|
removePortal();
|
|
354
388
|
};
|
|
355
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Keeps tooltips bound to the elements a component's render clips, for a component
|
|
392
|
+
* that re-renders while those elements stay in place.
|
|
393
|
+
*
|
|
394
|
+
* Each tooltip holds listeners and an observer on its element, so it is rebound
|
|
395
|
+
* only when a different set of elements renders: rebinding on every render would
|
|
396
|
+
* tear down a tooltip the pointer is still inside, and a component can render
|
|
397
|
+
* again on every keystroke or when it opens its popover.
|
|
398
|
+
*
|
|
399
|
+
* Call `sync` from `componentDidRender`, and from `connectedCallback` too, since
|
|
400
|
+
* moving an element reconnects it without rendering it again. Call `destroy` from
|
|
401
|
+
* `disconnectedCallback`.
|
|
402
|
+
*
|
|
403
|
+
* @param getOptions - The options for one element, read when it is bound.
|
|
404
|
+
*/
|
|
405
|
+
export function bindTruncationTooltips(getOptions) {
|
|
406
|
+
let bound = [];
|
|
407
|
+
let cleanups = [];
|
|
408
|
+
const destroy = () => {
|
|
409
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
410
|
+
cleanups = [];
|
|
411
|
+
bound = [];
|
|
412
|
+
};
|
|
413
|
+
const sync = (els) => {
|
|
414
|
+
const next = Array.from(els).filter((el) => el != null);
|
|
415
|
+
if (next.length === bound.length && next.every((el, index) => el === bound[index]))
|
|
416
|
+
return;
|
|
417
|
+
destroy();
|
|
418
|
+
bound = next;
|
|
419
|
+
cleanups = next.map((el) => setupTruncationTooltip(getOptions(el)));
|
|
420
|
+
};
|
|
421
|
+
return { sync, destroy };
|
|
422
|
+
}
|