@pine-ds/core 4.10.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 +295 -82
- 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/date-utils.js +42 -0
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +164 -65
- package/dist/collection/components/pds-datepicker/presets.js +42 -7
- package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +11 -0
- package/dist/collection/components/pds-datepicker/value.js +76 -18
- 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 +1150 -371
- 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 +296 -83
- 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/date-utils.d.ts +19 -0
- package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +22 -5
- package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +33 -7
- package/dist/types/components/pds-datepicker/presets.d.ts +3 -2
- package/dist/types/components/pds-datepicker/value.d.ts +14 -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 +505 -335
- 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 +350 -137
- package/hydrate/index.js +2054 -427
- package/hydrate/index.mjs +2054 -427
- 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-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-8436cbfb.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-d47b2a6a.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
|
@@ -2,6 +2,7 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
import { assignDescription, isSpecTest, messageId, exposeTypeProperty } from "../../utils/form";
|
|
3
3
|
import { danger } from "@pine-ds/icons/icons";
|
|
4
4
|
import { inheritAriaAttributes, HostStylingKeeper } from "../../utils/attributes";
|
|
5
|
+
import { referencedElements } from "../../utils/aria-references";
|
|
5
6
|
/**
|
|
6
7
|
* @slot label - Content displayed as the switch label in place of the `label` text. Clicking it toggles the switch.
|
|
7
8
|
*/
|
|
@@ -9,8 +10,11 @@ export class PdsSwitch {
|
|
|
9
10
|
constructor() {
|
|
10
11
|
this.inheritedAttributes = {};
|
|
11
12
|
this._type = 'checkbox';
|
|
13
|
+
this.forwardsDescription = false;
|
|
12
14
|
this.hostKeeper = new HostStylingKeeper();
|
|
13
15
|
this.hasLabelSlot = false;
|
|
16
|
+
// Kept apart from the `disabled` prop so a fieldset never overwrites what the consumer set.
|
|
17
|
+
this.fieldsetDisabled = false;
|
|
14
18
|
/**
|
|
15
19
|
* Determines the input 'checked' state.
|
|
16
20
|
*/
|
|
@@ -28,7 +32,7 @@ export class PdsSwitch {
|
|
|
28
32
|
*/
|
|
29
33
|
this.required = false;
|
|
30
34
|
this.onSwitchUpdate = (e) => {
|
|
31
|
-
if (this.
|
|
35
|
+
if (this.isDisabled())
|
|
32
36
|
return;
|
|
33
37
|
const input = e.target;
|
|
34
38
|
this.checked = input.checked;
|
|
@@ -48,10 +52,40 @@ export class PdsSwitch {
|
|
|
48
52
|
}
|
|
49
53
|
return switchClasses;
|
|
50
54
|
};
|
|
55
|
+
// An ID on the host can't reach into the shadow root, so the input is pointed at the elements the host's
|
|
56
|
+
// aria-describedby names, followed by its own helper or error message. A browser without ARIA element
|
|
57
|
+
// reflection keeps the input's own message only.
|
|
58
|
+
this.forwardDescription = () => {
|
|
59
|
+
var _a;
|
|
60
|
+
const input = this.inputEl;
|
|
61
|
+
if (input === undefined || !('ariaDescribedByElements' in input))
|
|
62
|
+
return;
|
|
63
|
+
const ownId = this.ownDescriptionId();
|
|
64
|
+
const referenced = referencedElements(this.el, 'aria-describedby');
|
|
65
|
+
if (referenced.length === 0) {
|
|
66
|
+
if (!this.forwardsDescription)
|
|
67
|
+
return;
|
|
68
|
+
this.forwardsDescription = false;
|
|
69
|
+
// Setting the element property cleared the attribute render wrote, so put that back.
|
|
70
|
+
if (ownId !== undefined) {
|
|
71
|
+
input.setAttribute('aria-describedby', ownId);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
input.removeAttribute('aria-describedby');
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const own = ownId === undefined ? null : (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById(ownId);
|
|
79
|
+
input.ariaDescribedByElements = own == null ? referenced : [...referenced, own];
|
|
80
|
+
this.forwardsDescription = true;
|
|
81
|
+
};
|
|
51
82
|
this.updateHasLabelSlot = () => {
|
|
52
83
|
this.hasLabelSlot = Array.from(this.el.children).some((child) => child.getAttribute('slot') === 'label');
|
|
53
84
|
};
|
|
54
85
|
}
|
|
86
|
+
isDisabled() {
|
|
87
|
+
return this.disabled || this.fieldsetDisabled;
|
|
88
|
+
}
|
|
55
89
|
connectedCallback() {
|
|
56
90
|
this.hostKeeper.connect(this.el);
|
|
57
91
|
// Initialize ElementInternals for form association (only once per element instance)
|
|
@@ -60,28 +94,58 @@ export class PdsSwitch {
|
|
|
60
94
|
}
|
|
61
95
|
// Expose type property on the element instance to match native form element behavior
|
|
62
96
|
exposeTypeProperty(this.el, () => this._type);
|
|
97
|
+
// A reconnected switch may sit in a different tree, where its description IDs name other elements.
|
|
98
|
+
this.forwardDescription();
|
|
99
|
+
if (typeof MutationObserver === 'undefined')
|
|
100
|
+
return;
|
|
101
|
+
// Consumers set aria-describedby on the host, sometimes after render, but only the inner input is announced.
|
|
102
|
+
this.hostDescriptionObserver = new MutationObserver(this.forwardDescription);
|
|
103
|
+
this.hostDescriptionObserver.observe(this.el, { attributeFilter: ['aria-describedby'] });
|
|
63
104
|
}
|
|
64
105
|
disconnectedCallback() {
|
|
106
|
+
var _a;
|
|
65
107
|
this.hostKeeper.disconnect();
|
|
108
|
+
(_a = this.hostDescriptionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
109
|
+
this.hostDescriptionObserver = undefined;
|
|
110
|
+
}
|
|
111
|
+
componentDidRender() {
|
|
112
|
+
this.forwardDescription();
|
|
66
113
|
}
|
|
67
114
|
componentDidLoad() {
|
|
68
115
|
this.updateFormValue();
|
|
69
116
|
}
|
|
70
|
-
|
|
117
|
+
syncFormValue() {
|
|
71
118
|
this.updateFormValue();
|
|
72
119
|
}
|
|
73
120
|
updateFormValue() {
|
|
74
121
|
if (isSpecTest())
|
|
75
122
|
return;
|
|
76
123
|
if (this.internals && this.internals.setFormValue) {
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
this.internals.setFormValue(formValue);
|
|
124
|
+
// The restoration state always carries the checked value, even while disabled, so a bfcache or
|
|
125
|
+
// back-forward restore can bring back a checked-then-disabled switch instead of losing it to a null state.
|
|
126
|
+
this.internals.setFormValue(this.formValue(), this.checkedValue());
|
|
80
127
|
}
|
|
81
128
|
if (this.internals && this.internals.setValidity) {
|
|
82
129
|
this.internals.setValidity({});
|
|
83
130
|
}
|
|
84
131
|
}
|
|
132
|
+
// Unchecked sends uncheckedValue when set, even an empty string, otherwise nothing. Disabled sends nothing, like a
|
|
133
|
+
// native checkbox: the platform only leaves out a host with the disabled attribute present, which is also how
|
|
134
|
+
// React's own custom-element attribute serialization writes it.
|
|
135
|
+
formValue() {
|
|
136
|
+
if (this.isDisabled())
|
|
137
|
+
return null;
|
|
138
|
+
return this.checkedValue();
|
|
139
|
+
}
|
|
140
|
+
checkedValue() {
|
|
141
|
+
var _a;
|
|
142
|
+
if (this.checked)
|
|
143
|
+
return this.value || 'on';
|
|
144
|
+
return (_a = this.uncheckedValue) !== null && _a !== void 0 ? _a : null;
|
|
145
|
+
}
|
|
146
|
+
ownDescriptionId() {
|
|
147
|
+
return assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage);
|
|
148
|
+
}
|
|
85
149
|
formStateRestoreCallback(state) {
|
|
86
150
|
if (state instanceof FormData) {
|
|
87
151
|
// For switches, restore if the value exists in FormData
|
|
@@ -101,21 +165,22 @@ export class PdsSwitch {
|
|
|
101
165
|
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
102
166
|
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
103
167
|
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
this.disabled = disabled;
|
|
168
|
+
this.fieldsetDisabled = disabled && this.el.closest('fieldset[disabled]') !== null;
|
|
107
169
|
}
|
|
108
170
|
componentWillLoad() {
|
|
109
|
-
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
171
|
+
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el, ['aria-describedby']));
|
|
110
172
|
this.updateHasLabelSlot();
|
|
111
173
|
}
|
|
112
174
|
render() {
|
|
113
175
|
const hostClass = this.switchClassNames();
|
|
114
|
-
const ariaDisabled = this.
|
|
176
|
+
const ariaDisabled = this.isDisabled() ? 'true' : null;
|
|
115
177
|
this.hostKeeper.record(hostClass, {}, { 'aria-disabled': ariaDisabled });
|
|
116
|
-
return (h(Host, { key: '
|
|
117
|
-
|
|
118
|
-
|
|
178
|
+
return (h(Host, { key: 'e5100ae3ecfac3bb556582507cc628b2455ae6cc', class: hostClass, "aria-disabled": ariaDisabled }, h("label", { key: 'c337b8c4dc381c3a745100c707792c11711c01a1', htmlFor: this.componentId }, h("input", Object.assign({ key: 'f18ae27e7c91ef4d54b0192a04130420b991c9ff', "aria-describedby": this.ownDescriptionId(), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.isDisabled(), id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate,
|
|
179
|
+
// A description added after the switch, or replaced by a framework or a DOM morph, is picked up by the
|
|
180
|
+
// time focus reaches the switch and it's announced.
|
|
181
|
+
onFocus: this.forwardDescription, ref: (el) => (this.inputEl = el), required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), h("span", { key: '4bddfc080db7fee6fa8080e890918757dacde3fb', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: 'c9302409719113e12f6debb426c78dd0caaee88a', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
182
|
+
h("div", { key: '60785b9779cb2d50e6f0f2b32179106256f55ebf', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
183
|
+
h("div", { key: '9b258e9302c5ef959e8c06bee780d7d43144359b', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'f8df779a8c65a6f0b6ea139ff3c31cca76eb48fa', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage)));
|
|
119
184
|
}
|
|
120
185
|
static get is() { return "pds-switch"; }
|
|
121
186
|
static get encapsulation() { return "shadow"; }
|
|
@@ -299,11 +364,11 @@ export class PdsSwitch {
|
|
|
299
364
|
"optional": false,
|
|
300
365
|
"docs": {
|
|
301
366
|
"tags": [],
|
|
302
|
-
"text": "
|
|
367
|
+
"text": "Specifies the name. Submitted with the form name/value pair when checked, or with `unchecked-value` while unchecked."
|
|
303
368
|
},
|
|
304
369
|
"getter": false,
|
|
305
370
|
"setter": false,
|
|
306
|
-
"reflect":
|
|
371
|
+
"reflect": true,
|
|
307
372
|
"attribute": "name"
|
|
308
373
|
},
|
|
309
374
|
"required": {
|
|
@@ -344,12 +409,32 @@ export class PdsSwitch {
|
|
|
344
409
|
"setter": false,
|
|
345
410
|
"reflect": false,
|
|
346
411
|
"attribute": "value"
|
|
412
|
+
},
|
|
413
|
+
"uncheckedValue": {
|
|
414
|
+
"type": "string",
|
|
415
|
+
"mutable": false,
|
|
416
|
+
"complexType": {
|
|
417
|
+
"original": "string",
|
|
418
|
+
"resolved": "string",
|
|
419
|
+
"references": {}
|
|
420
|
+
},
|
|
421
|
+
"required": false,
|
|
422
|
+
"optional": true,
|
|
423
|
+
"docs": {
|
|
424
|
+
"tags": [],
|
|
425
|
+
"text": "Provides a string submitted in form data under `name` while the switch is unchecked.\nWhen unset, an unchecked switch submits nothing, like a native checkbox."
|
|
426
|
+
},
|
|
427
|
+
"getter": false,
|
|
428
|
+
"setter": false,
|
|
429
|
+
"reflect": false,
|
|
430
|
+
"attribute": "unchecked-value"
|
|
347
431
|
}
|
|
348
432
|
};
|
|
349
433
|
}
|
|
350
434
|
static get states() {
|
|
351
435
|
return {
|
|
352
|
-
"hasLabelSlot": {}
|
|
436
|
+
"hasLabelSlot": {},
|
|
437
|
+
"fieldsetDisabled": {}
|
|
353
438
|
};
|
|
354
439
|
}
|
|
355
440
|
static get events() {
|
|
@@ -379,7 +464,19 @@ export class PdsSwitch {
|
|
|
379
464
|
static get watchers() {
|
|
380
465
|
return [{
|
|
381
466
|
"propName": "checked",
|
|
382
|
-
"methodName": "
|
|
467
|
+
"methodName": "syncFormValue"
|
|
468
|
+
}, {
|
|
469
|
+
"propName": "disabled",
|
|
470
|
+
"methodName": "syncFormValue"
|
|
471
|
+
}, {
|
|
472
|
+
"propName": "fieldsetDisabled",
|
|
473
|
+
"methodName": "syncFormValue"
|
|
474
|
+
}, {
|
|
475
|
+
"propName": "uncheckedValue",
|
|
476
|
+
"methodName": "syncFormValue"
|
|
477
|
+
}, {
|
|
478
|
+
"propName": "value",
|
|
479
|
+
"methodName": "syncFormValue"
|
|
383
480
|
}];
|
|
384
481
|
}
|
|
385
482
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -27,6 +28,8 @@ const BaseTemplate = (args) => html`
|
|
|
27
28
|
onChange=${args.onChange}
|
|
28
29
|
?required=${args.required}
|
|
29
30
|
type=${args.type}
|
|
31
|
+
unchecked-value=${ifDefined(args.uncheckedValue)}
|
|
32
|
+
value=${ifDefined(args.value)}
|
|
30
33
|
/>
|
|
31
34
|
`;
|
|
32
35
|
|
|
@@ -83,3 +86,79 @@ Invalid.args = {
|
|
|
83
86
|
required: true,
|
|
84
87
|
type: 'checkbox',
|
|
85
88
|
};
|
|
89
|
+
|
|
90
|
+
export const DisabledWithReason = BaseTemplate.bind({});
|
|
91
|
+
|
|
92
|
+
DisabledWithReason.args = {
|
|
93
|
+
checked: false,
|
|
94
|
+
disabled: true,
|
|
95
|
+
componentId: 'pds-switch-disabled-reason-example',
|
|
96
|
+
helperMessage: 'Free offers can\'t have affiliate commissions.',
|
|
97
|
+
invalid: false,
|
|
98
|
+
label: 'Affiliate commissions',
|
|
99
|
+
name: 'pds-switch-disabled-reason',
|
|
100
|
+
required: false,
|
|
101
|
+
type: 'checkbox',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Described = (args) => html`
|
|
105
|
+
<pds-box direction="column" gap="xs">
|
|
106
|
+
<pds-text id="pds-switch-described-text" tag="p">Send customers a receipt after each purchase.</pds-text>
|
|
107
|
+
<pds-switch
|
|
108
|
+
aria-describedby="pds-switch-described-text"
|
|
109
|
+
?checked=${args.checked}
|
|
110
|
+
component-id=${args.componentId}
|
|
111
|
+
?disabled=${args.disabled}
|
|
112
|
+
label=${args.label}
|
|
113
|
+
name=${args.name}
|
|
114
|
+
></pds-switch>
|
|
115
|
+
</pds-box>
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
Described.args = {
|
|
119
|
+
checked: false,
|
|
120
|
+
disabled: false,
|
|
121
|
+
componentId: 'pds-switch-described-example',
|
|
122
|
+
label: 'Purchase receipts',
|
|
123
|
+
name: 'pds-switch-described',
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Shows what the form submits, since an unchecked value isn't visible on the switch itself.
|
|
127
|
+
const showFormData = (event) => {
|
|
128
|
+
const form = event.target.closest('form');
|
|
129
|
+
const output = form?.querySelector('output');
|
|
130
|
+
if (!form || !output) return;
|
|
131
|
+
// The switch sets its form value before it emits pdsSwitchChange, so FormData is already current here.
|
|
132
|
+
const entries = Array.from(new FormData(form).entries());
|
|
133
|
+
output.textContent = entries.length > 0 ? entries.map(([key, value]) => `${key}=${value}`).join('&') : '(nothing)';
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const submitted = ({ checked, name, uncheckedValue, value }) => {
|
|
137
|
+
if (checked) return `${name}=${value || 'on'}`;
|
|
138
|
+
return uncheckedValue === undefined ? '(nothing)' : `${name}=${uncheckedValue}`;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const UncheckedValue = (args) => html`
|
|
142
|
+
<form @pdsSwitchChange=${showFormData}>
|
|
143
|
+
<pds-box direction="column" gap="sm">
|
|
144
|
+
<pds-switch
|
|
145
|
+
?checked=${args.checked}
|
|
146
|
+
component-id=${args.componentId}
|
|
147
|
+
label=${args.label}
|
|
148
|
+
name=${args.name}
|
|
149
|
+
unchecked-value=${ifDefined(args.uncheckedValue)}
|
|
150
|
+
value=${ifDefined(args.value)}
|
|
151
|
+
></pds-switch>
|
|
152
|
+
<pds-text tag="p">Submits: <output>${submitted(args)}</output></pds-text>
|
|
153
|
+
</pds-box>
|
|
154
|
+
</form>
|
|
155
|
+
`;
|
|
156
|
+
|
|
157
|
+
UncheckedValue.args = {
|
|
158
|
+
checked: false,
|
|
159
|
+
componentId: 'pds-switch-unchecked-value-example',
|
|
160
|
+
label: 'Email notifications',
|
|
161
|
+
name: 'notify',
|
|
162
|
+
uncheckedValue: '0',
|
|
163
|
+
value: '1',
|
|
164
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @part body - Set on the `pds-table-body` element itself, so `::part(body)` matches it only from a shadow root that contains it. Style `pds-table-body` directly instead.
|
|
4
|
+
*/
|
|
2
5
|
export class PdsTableBody {
|
|
3
6
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '4b4da65979e3d3557d05cb9aff8d257d29e2c0a5', role: "rowgroup", part: "body" }, h("slot", { key: '70dcd401a705a430c54c57bf994a410a636c4a53' })));
|
|
5
8
|
}
|
|
6
9
|
static get is() { return "pds-table-body"; }
|
|
7
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { closest } from "../../../utils/closest";
|
|
2
3
|
import { isScrolledFromInlineStart } from "../../../utils/scroll";
|
|
3
4
|
import { setupTruncationTooltip } from "../../../utils/truncation-tooltip";
|
|
5
|
+
/**
|
|
6
|
+
* @part cell - Set on the `pds-table-cell` element itself, so `::part(cell)` matches it only from a shadow root that contains it. Style `pds-table-cell` directly instead. In a `selectable` table, each row's selection cell sits in the row's shadow root: it has the `checkbox-cell` part when first rendered and `cell` after any re-render, so target both with `pds-table-row::part(checkbox-cell), pds-table-row::part(cell)`.
|
|
7
|
+
*/
|
|
4
8
|
export class PdsTableCell {
|
|
5
9
|
constructor() {
|
|
6
10
|
this.scrollContainer = null;
|
|
@@ -30,14 +34,16 @@ export class PdsTableCell {
|
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
36
|
componentWillRender() {
|
|
33
|
-
|
|
37
|
+
// The shadow-crossing `closest` util, not the native one -- a selectable row's checkbox
|
|
38
|
+
// cell lives inside pds-table-row's own shadow root, which native `closest` can't see past.
|
|
39
|
+
this.tableRef = closest('pds-table', this.hostElement);
|
|
34
40
|
}
|
|
35
41
|
// Fires again each time the cell is moved (a sort re-appends every row), unlike componentDidLoad,
|
|
36
42
|
// so it re-binds what disconnectedCallback tore down. The tooltip binds to the host, which exists before load.
|
|
37
43
|
connectedCallback() {
|
|
38
44
|
if (!this.hasLoaded)
|
|
39
45
|
return;
|
|
40
|
-
this.tableRef =
|
|
46
|
+
this.tableRef = closest('pds-table', this.hostElement);
|
|
41
47
|
this.cleanupScrollListener();
|
|
42
48
|
if (this.needsScrollShadow) {
|
|
43
49
|
this.setupScrollListener();
|
|
@@ -103,6 +109,22 @@ export class PdsTableCell {
|
|
|
103
109
|
this.setupTimer = undefined;
|
|
104
110
|
}
|
|
105
111
|
this.setupRetries = 0; // Reset retry counter
|
|
112
|
+
// Without a listener there's no way to know the scroll position any more, so the shadow
|
|
113
|
+
// this drove shouldn't linger -- matters when a rebind tears this down without setting it
|
|
114
|
+
// back up (responsive turned off while scrolled), not just on disconnect.
|
|
115
|
+
this.tableScrolling = false;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Re-binds the scroll listener to the table's current responsive container. Called by
|
|
119
|
+
* `pds-table` after a live `responsive` toggle: the cell stays in light DOM across that change,
|
|
120
|
+
* so it never reconnects on its own and would otherwise keep listening to a container the
|
|
121
|
+
* table already replaced or removed.
|
|
122
|
+
*/
|
|
123
|
+
async rebindScrollListener() {
|
|
124
|
+
this.cleanupScrollListener();
|
|
125
|
+
if (this.needsScrollShadow) {
|
|
126
|
+
this.setupScrollListener();
|
|
127
|
+
}
|
|
106
128
|
}
|
|
107
129
|
handleTruncateChange(newValue) {
|
|
108
130
|
if (newValue) {
|
|
@@ -143,11 +165,11 @@ export class PdsTableCell {
|
|
|
143
165
|
return classNames.join(' ');
|
|
144
166
|
}
|
|
145
167
|
render() {
|
|
146
|
-
return (h(Host, { key: '
|
|
168
|
+
return (h(Host, { key: 'bc40b70bcb8f1df7307df6c00e3b73427c8d5ff2', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
|
|
147
169
|
this.tableRef.fixedColumn &&
|
|
148
170
|
this.tableRef.selectable
|
|
149
171
|
? { '--fixed-cell-position': '40px' }
|
|
150
|
-
: {} }, h("slot", { key: '
|
|
172
|
+
: {} }, h("slot", { key: '418219bf8b870557f5f39ae6553db78fe7037389' })));
|
|
151
173
|
}
|
|
152
174
|
static get is() { return "pds-table-cell"; }
|
|
153
175
|
static get encapsulation() { return "shadow"; }
|
|
@@ -208,6 +230,27 @@ export class PdsTableCell {
|
|
|
208
230
|
"tableScrolling": {}
|
|
209
231
|
};
|
|
210
232
|
}
|
|
233
|
+
static get methods() {
|
|
234
|
+
return {
|
|
235
|
+
"rebindScrollListener": {
|
|
236
|
+
"complexType": {
|
|
237
|
+
"signature": "() => Promise<void>",
|
|
238
|
+
"parameters": [],
|
|
239
|
+
"references": {
|
|
240
|
+
"Promise": {
|
|
241
|
+
"location": "global",
|
|
242
|
+
"id": "global::Promise"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"return": "Promise<void>"
|
|
246
|
+
},
|
|
247
|
+
"docs": {
|
|
248
|
+
"text": "Re-binds the scroll listener to the table's current responsive container. Called by\n`pds-table` after a live `responsive` toggle: the cell stays in light DOM across that change,\nso it never reconnects on its own and would otherwise keep listening to a container the\ntable already replaced or removed.",
|
|
249
|
+
"tags": []
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
211
254
|
static get elementRef() { return "hostElement"; }
|
|
212
255
|
static get watchers() {
|
|
213
256
|
return [{
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { closest } from "../../../utils/closest";
|
|
3
|
+
/**
|
|
4
|
+
* @part head - Set on the `pds-table-head` element itself, so `::part(head)` matches it only from a shadow root that contains it. Style `pds-table-head` directly instead.
|
|
5
|
+
* @part select-all-checkbox - Exposes the select-all checkbox for styling. Appears only when the table is `selectable` and `disableSelectAll` isn't set.
|
|
6
|
+
*/
|
|
3
7
|
export class PdsTableHead {
|
|
4
8
|
constructor() {
|
|
5
9
|
/**
|
|
@@ -42,7 +46,7 @@ export class PdsTableHead {
|
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
render() {
|
|
45
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: 'ba81f3a9655b49cf01311c697a8aae3e69de0e81', role: "row", part: "head" }, this.tableRef && this.tableRef.selectable && (h("pds-table-head-cell", { key: '4f182b3053469afbaff81c4918bf66376fc7ade4', part: this.tableRef.selectable ? 'checkbox-cell' : '', width: this.tableRef.tableLayout === 'fixed' ? 'var(--pine-dimension-2xl)' : undefined }, !this.tableRef.disableSelectAll && (h("pds-checkbox", { key: 'b26c7e8c26b3cc837f180431dc53a17ae0d84f1f', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected, part: "select-all-checkbox" })))), h("slot", { key: 'e9eef43af95340fcce2d9f2f60800d897ee423f1' })));
|
|
46
50
|
}
|
|
47
51
|
static get is() { return "pds-table-head"; }
|
|
48
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +96,7 @@ export class PdsTableHead {
|
|
|
92
96
|
"name": "defaultValue",
|
|
93
97
|
"text": "false"
|
|
94
98
|
}],
|
|
95
|
-
"text": "Determines if the
|
|
99
|
+
"text": "Determines if the select all checkbox is checked."
|
|
96
100
|
},
|
|
97
101
|
"getter": false,
|
|
98
102
|
"setter": false,
|
|
@@ -16,6 +16,17 @@
|
|
|
16
16
|
vertical-align: inherit;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
:host(.has-width) {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
min-width: var(--pds-table-head-cell-width);
|
|
22
|
+
width: var(--pds-table-head-cell-width);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(.has-auto-width) {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
width: var(--pds-table-head-cell-auto-floor-width, auto);
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
:host(.is-compact) {
|
|
20
31
|
padding-block: var(--pine-dimension-2xs);
|
|
21
32
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { downSmall, upSmall } from "@pine-ds/icons/icons";
|
|
3
|
+
import { closest } from "../../../utils/closest";
|
|
3
4
|
import { isScrolledFromInlineStart } from "../../../utils/scroll";
|
|
5
|
+
/**
|
|
6
|
+
* @part head-cell - Set on the `pds-table-head-cell` element itself, so `::part(head-cell)` matches it only from a shadow root that contains it. Style `pds-table-head-cell` directly instead. In a `selectable` table, the select-all cell sits in `pds-table-head`'s shadow root: it has the `checkbox-cell` part when first rendered and `head-cell` after any re-render, so target both with `pds-table-head::part(checkbox-cell), pds-table-head::part(head-cell)`.
|
|
7
|
+
* @part sort-icon - Exposes the sort direction icon for styling. Appears only on a `sortable` column while it's the active sort.
|
|
8
|
+
*/
|
|
4
9
|
export class PdsTableHeadCell {
|
|
5
10
|
constructor() {
|
|
6
11
|
this.scrollContainer = null;
|
|
7
12
|
this.setupRetries = 0;
|
|
13
|
+
this.hasLoaded = false;
|
|
8
14
|
/**
|
|
9
15
|
* The direction of sorting.
|
|
10
16
|
*/
|
|
@@ -96,22 +102,39 @@ export class PdsTableHeadCell {
|
|
|
96
102
|
this.hostElement.classList.remove('is-active');
|
|
97
103
|
}
|
|
98
104
|
componentWillLoad() {
|
|
99
|
-
// Set initial references and state before first render
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
// Set initial references and state before first render. The shadow-crossing `closest`
|
|
106
|
+
// util, not the native one -- the select-all cell lives inside pds-table-head's own shadow
|
|
107
|
+
// root, which native `closest` can't see past.
|
|
108
|
+
this.tableRef = closest('pds-table', this.hostElement);
|
|
109
|
+
const tableHead = closest('pds-table-head', this.hostElement);
|
|
102
110
|
if (tableHead) {
|
|
103
111
|
this.hasHeadBorder = tableHead.hasAttribute('border');
|
|
104
112
|
this.hasHeadBackground = tableHead.hasAttribute('background');
|
|
105
113
|
}
|
|
106
114
|
}
|
|
115
|
+
// Fires again each time the cell is moved (such as a reparent or DOM morph), unlike
|
|
116
|
+
// componentDidLoad, so it re-binds what disconnectedCallback tore down.
|
|
117
|
+
connectedCallback() {
|
|
118
|
+
if (!this.hasLoaded)
|
|
119
|
+
return;
|
|
120
|
+
this.tableRef = closest('pds-table', this.hostElement);
|
|
121
|
+
if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {
|
|
122
|
+
this.setupScrollListener();
|
|
123
|
+
}
|
|
124
|
+
this.setupHeadObserver();
|
|
125
|
+
}
|
|
107
126
|
componentDidLoad() {
|
|
127
|
+
this.hasLoaded = true;
|
|
108
128
|
if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {
|
|
109
129
|
// For responsive tables with fixed columns, set up scroll detection
|
|
110
130
|
// This enables the first column header to show a shadow when the table is scrolled horizontally
|
|
111
131
|
this.setupScrollListener();
|
|
112
132
|
}
|
|
113
|
-
|
|
114
|
-
|
|
133
|
+
this.setupHeadObserver();
|
|
134
|
+
}
|
|
135
|
+
// Watches the parent table-head's border and background attributes.
|
|
136
|
+
setupHeadObserver() {
|
|
137
|
+
const tableHead = closest('pds-table-head', this.hostElement);
|
|
115
138
|
if (tableHead && typeof MutationObserver !== 'undefined') {
|
|
116
139
|
// Defensive guard: disconnect existing observer before creating a new one
|
|
117
140
|
if (this.headObserver) {
|
|
@@ -172,6 +195,22 @@ export class PdsTableHeadCell {
|
|
|
172
195
|
this.setupTimer = undefined;
|
|
173
196
|
}
|
|
174
197
|
this.setupRetries = 0; // Reset retry counter
|
|
198
|
+
// Without a listener there's no way to know the scroll position any more, so the shadow
|
|
199
|
+
// this drove shouldn't linger -- matters when a rebind tears this down without setting it
|
|
200
|
+
// back up (responsive turned off while scrolled), not just on disconnect.
|
|
201
|
+
this.tableScrolling = false;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Re-binds the scroll listener to the table's current responsive container. Called by
|
|
205
|
+
* `pds-table` after a live `responsive` toggle: the cell stays in light DOM across that
|
|
206
|
+
* change, so it never reconnects on its own and would otherwise keep listening to a container
|
|
207
|
+
* the table already replaced or removed.
|
|
208
|
+
*/
|
|
209
|
+
async rebindScrollListener() {
|
|
210
|
+
this.cleanupScrollListener();
|
|
211
|
+
if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {
|
|
212
|
+
this.setupScrollListener();
|
|
213
|
+
}
|
|
175
214
|
}
|
|
176
215
|
classNames() {
|
|
177
216
|
const classNames = [];
|
|
@@ -196,14 +235,27 @@ export class PdsTableHeadCell {
|
|
|
196
235
|
if (this.hasHeadBorder) {
|
|
197
236
|
classNames.push('has-head-border');
|
|
198
237
|
}
|
|
238
|
+
if (this.width) {
|
|
239
|
+
classNames.push('has-width');
|
|
240
|
+
}
|
|
241
|
+
else if (this.tableRef && this.tableRef.tableLayout === 'fixed') {
|
|
242
|
+
classNames.push('has-auto-width');
|
|
243
|
+
}
|
|
199
244
|
return classNames.join(' ');
|
|
200
245
|
}
|
|
246
|
+
hostStyles() {
|
|
247
|
+
const styles = {};
|
|
248
|
+
if (this.tableRef && this.tableRef.fixedColumn && this.tableRef.selectable) {
|
|
249
|
+
styles['--fixed-cell-position'] = '40px';
|
|
250
|
+
}
|
|
251
|
+
// Hand the width to the stylesheet as a custom property rather than an inline width.
|
|
252
|
+
if (this.width) {
|
|
253
|
+
styles['--pds-table-head-cell-width'] = this.width;
|
|
254
|
+
}
|
|
255
|
+
return styles;
|
|
256
|
+
}
|
|
201
257
|
render() {
|
|
202
|
-
return (h(Host, { key: '
|
|
203
|
-
this.tableRef.fixedColumn &&
|
|
204
|
-
this.tableRef.selectable
|
|
205
|
-
? { '--fixed-cell-position': '40px' }
|
|
206
|
-
: {} }, h("slot", { key: '7aff5994fe4c5250ce83516960183dbd9ffa9c69' }), this.sortable && this.isActive && (h("pds-icon", { key: '0a7b99ab2c56ea0cfb3aa6f810bf802422a29bef', icon: this.sortingDirection === 'asc' ? upSmall : downSmall, part: "sort-icon", "aria-hidden": "true" }))));
|
|
258
|
+
return (h(Host, { key: '353a05a4026064d05a4b924bec3fa2f17f1902ce', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, part: "head-cell", style: this.hostStyles() }, h("slot", { key: '51ead68fc052805d60bbfc6e626f6aedcc5671fc' }), this.sortable && this.isActive && (h("pds-icon", { key: '9a5c27232f06a15dc8329c329f01b08cb6d836b8', icon: this.sortingDirection === 'asc' ? upSmall : downSmall, part: "sort-icon", "aria-hidden": "true" }))));
|
|
207
259
|
}
|
|
208
260
|
static get is() { return "pds-table-head-cell"; }
|
|
209
261
|
static get encapsulation() { return "shadow"; }
|
|
@@ -256,6 +308,25 @@ export class PdsTableHeadCell {
|
|
|
256
308
|
"setter": false,
|
|
257
309
|
"reflect": false,
|
|
258
310
|
"attribute": "sortable"
|
|
311
|
+
},
|
|
312
|
+
"width": {
|
|
313
|
+
"type": "string",
|
|
314
|
+
"mutable": false,
|
|
315
|
+
"complexType": {
|
|
316
|
+
"original": "string",
|
|
317
|
+
"resolved": "string",
|
|
318
|
+
"references": {}
|
|
319
|
+
},
|
|
320
|
+
"required": false,
|
|
321
|
+
"optional": true,
|
|
322
|
+
"docs": {
|
|
323
|
+
"tags": [],
|
|
324
|
+
"text": "Sets the width of the column. Accepts any CSS length (e.g. '148px', '12rem', '20%').\nWhen the table's `tableLayout` is `fixed`, the column keeps this width whatever its content.\nOtherwise the column is at least this wide and can grow to fit its content."
|
|
325
|
+
},
|
|
326
|
+
"getter": false,
|
|
327
|
+
"setter": false,
|
|
328
|
+
"reflect": true,
|
|
329
|
+
"attribute": "width"
|
|
259
330
|
}
|
|
260
331
|
};
|
|
261
332
|
}
|
|
@@ -329,6 +400,23 @@ export class PdsTableHeadCell {
|
|
|
329
400
|
"text": "Clears the active sort state from this column.\nUsed internally when another column becomes active.",
|
|
330
401
|
"tags": []
|
|
331
402
|
}
|
|
403
|
+
},
|
|
404
|
+
"rebindScrollListener": {
|
|
405
|
+
"complexType": {
|
|
406
|
+
"signature": "() => Promise<void>",
|
|
407
|
+
"parameters": [],
|
|
408
|
+
"references": {
|
|
409
|
+
"Promise": {
|
|
410
|
+
"location": "global",
|
|
411
|
+
"id": "global::Promise"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"return": "Promise<void>"
|
|
415
|
+
},
|
|
416
|
+
"docs": {
|
|
417
|
+
"text": "Re-binds the scroll listener to the table's current responsive container. Called by\n`pds-table` after a live `responsive` toggle: the cell stays in light DOM across that\nchange, so it never reconnects on its own and would otherwise keep listening to a container\nthe table already replaced or removed.",
|
|
418
|
+
"tags": []
|
|
419
|
+
}
|
|
332
420
|
}
|
|
333
421
|
};
|
|
334
422
|
}
|