@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,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index$1 = require('./index-D9iJuJCP.js');
|
|
4
|
-
var
|
|
4
|
+
var sortableLabel = require('./sortable-label-DOcJrHvA.js');
|
|
5
|
+
var attributes = require('./attributes-Cgbkw6gO.js');
|
|
6
|
+
var i18nFormat = require('./i18n-format-BD0PmYzT.js');
|
|
5
7
|
require('./keep-hydrated-AKoh0DG4.js');
|
|
6
8
|
|
|
7
9
|
/**!
|
|
@@ -2655,6 +2657,9 @@ Sortable.mount(Remove, Revert);
|
|
|
2655
2657
|
|
|
2656
2658
|
const pdsSortableCss = () => `.pds-sortable.sc-pds-sortable-h{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-sortable.pds-sortable--bordered.sc-pds-sortable-h{border:var(--pine-border);border-radius:var(--pine-dimension-2xs)}`;
|
|
2657
2659
|
|
|
2660
|
+
const LIVE_REGION_CLASS = 'pds-sortable__live-region';
|
|
2661
|
+
const GRABBED_CLASS = 'pds-sortable-item--grabbed';
|
|
2662
|
+
const HANDLE_SELECTOR = '.pds-sortable-item__handle';
|
|
2658
2663
|
const PdsSortable = class {
|
|
2659
2664
|
constructor(hostRef) {
|
|
2660
2665
|
index$1.registerInstance(this, hostRef);
|
|
@@ -2677,11 +2682,155 @@ const PdsSortable = class {
|
|
|
2677
2682
|
* Determines the grabbable area for the `pds-sortable-item`.
|
|
2678
2683
|
*/
|
|
2679
2684
|
this.handleType = 'row';
|
|
2685
|
+
/**
|
|
2686
|
+
* Accessible label for each item's reorder handle, the button the keyboard reorders with. Pass a translated string to localize it; `{item}` is interpolated.
|
|
2687
|
+
* @defaultValue 'Reorder {item}'
|
|
2688
|
+
*/
|
|
2689
|
+
this.handleLabel = 'Reorder {item}';
|
|
2690
|
+
/**
|
|
2691
|
+
* Screen-reader announcement when an item is picked up from the keyboard. Pass a translated string to localize it; `{item}`, `{position}` and `{total}` are interpolated.
|
|
2692
|
+
* @defaultValue '{item}, picked up. Position {position} of {total}. Press the arrow keys to move, Space or Enter to drop, Escape to cancel.'
|
|
2693
|
+
*/
|
|
2694
|
+
this.itemPickedUpLabel = '{item}, picked up. Position {position} of {total}. Press the arrow keys to move, Space or Enter to drop, Escape to cancel.';
|
|
2695
|
+
/**
|
|
2696
|
+
* Screen-reader announcement when a picked-up item is moved. Pass a translated string to localize it; `{item}`, `{position}` and `{total}` are interpolated.
|
|
2697
|
+
* @defaultValue '{item}, moved to position {position} of {total}'
|
|
2698
|
+
*/
|
|
2699
|
+
this.itemMovedLabel = '{item}, moved to position {position} of {total}';
|
|
2700
|
+
/**
|
|
2701
|
+
* Screen-reader announcement when a picked-up item is dropped. Pass a translated string to localize it; `{item}`, `{position}` and `{total}` are interpolated.
|
|
2702
|
+
* @defaultValue '{item}, dropped at position {position} of {total}'
|
|
2703
|
+
*/
|
|
2704
|
+
this.itemDroppedLabel = '{item}, dropped at position {position} of {total}';
|
|
2705
|
+
/**
|
|
2706
|
+
* Screen-reader announcement when a keyboard reorder is canceled and the item goes back. Pass a translated string to localize it; `{item}`, `{position}` and `{total}` are interpolated.
|
|
2707
|
+
* @defaultValue 'Reorder canceled. {item} returned to position {position} of {total}'
|
|
2708
|
+
*/
|
|
2709
|
+
this.reorderCanceledLabel = 'Reorder canceled. {item} returned to position {position} of {total}';
|
|
2710
|
+
/** The item picked up from the keyboard, and where it started. */
|
|
2711
|
+
this.grabbed = null;
|
|
2712
|
+
this.liveRegion = null;
|
|
2680
2713
|
this.hostKeeper = new attributes.HostStylingKeeper();
|
|
2714
|
+
// Set only when a `pointerdown` here drops a picked-up item, and only until the `click` that
|
|
2715
|
+
// follows it, if one does: a screen reader's browse-mode Enter or Space synthesizes both for
|
|
2716
|
+
// the same press, and that click must not re-pick-up what its own pointerdown just dropped.
|
|
2717
|
+
this.droppedByPointerDown = null;
|
|
2718
|
+
this.handleFocusIn = () => {
|
|
2719
|
+
this.ensureLiveRegion();
|
|
2720
|
+
};
|
|
2721
|
+
/**
|
|
2722
|
+
* Focus leaving a picked-up item drops it where it is, unless the whole window lost focus (the user
|
|
2723
|
+
* switched apps), when the item stays picked up for their return. A real window blur does not move
|
|
2724
|
+
* `document.activeElement` away from the handle that's losing focus (some browsers reset it to `body`
|
|
2725
|
+
* instead, but never to a different element), so it's told apart from focus moving into an iframe or
|
|
2726
|
+
* another embedded document that way: an iframe becomes a genuinely different active element, while a
|
|
2727
|
+
* window blur leaves `activeElement` as the handle itself, `null`, or `body`.
|
|
2728
|
+
*/
|
|
2729
|
+
this.handleFocusOut = (ev) => {
|
|
2730
|
+
var _a;
|
|
2731
|
+
if (!this.isGrabbing() || ev.target !== this.focusTarget(this.grabbed.item))
|
|
2732
|
+
return;
|
|
2733
|
+
const nothingElseFocused = document.activeElement === null || document.activeElement === document.body || document.activeElement === ev.target;
|
|
2734
|
+
if (ev.relatedTarget === null && ((_a = document.hasFocus) === null || _a === void 0 ? void 0 : _a.call(document)) === false && nothingElseFocused)
|
|
2735
|
+
return;
|
|
2736
|
+
this.drop(ev);
|
|
2737
|
+
};
|
|
2738
|
+
/**
|
|
2739
|
+
* Screen readers in browse mode turn Enter and Space on a button into a click with no key events,
|
|
2740
|
+
* so a click that isn't from a pointer (`detail` is 0) picks up or drops too.
|
|
2741
|
+
*/
|
|
2742
|
+
this.handleClick = (ev) => {
|
|
2743
|
+
if (this.disabled || ev.detail !== 0)
|
|
2744
|
+
return;
|
|
2745
|
+
const item = this.targetItem(ev.target);
|
|
2746
|
+
if (!item)
|
|
2747
|
+
return;
|
|
2748
|
+
// NVDA and JAWS in Chromium fire this click's capture-phase `pointerdown` first, for the
|
|
2749
|
+
// same Enter or Space press. If that pointerdown found the item already grabbed and dropped
|
|
2750
|
+
// it, this click is that same press's drop, already handled -- picking the item back up here
|
|
2751
|
+
// would leave it stuck grabbed, since Escape and the arrow keys don't reach the handle in
|
|
2752
|
+
// browse mode.
|
|
2753
|
+
if (this.droppedByPointerDown === item) {
|
|
2754
|
+
this.droppedByPointerDown = null;
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
if (!this.isGrabbing()) {
|
|
2758
|
+
this.pickUp(item);
|
|
2759
|
+
}
|
|
2760
|
+
else if (this.grabbed.item === item) {
|
|
2761
|
+
this.drop(ev);
|
|
2762
|
+
}
|
|
2763
|
+
};
|
|
2764
|
+
this.handleKeyDown = (ev) => {
|
|
2765
|
+
if (this.disabled || ev.altKey || ev.ctrlKey || ev.metaKey)
|
|
2766
|
+
return;
|
|
2767
|
+
const item = this.targetItem(ev.target);
|
|
2768
|
+
if (!item)
|
|
2769
|
+
return;
|
|
2770
|
+
if (!this.isGrabbing()) {
|
|
2771
|
+
if ((ev.key === ' ' || ev.key === 'Enter') && !ev.repeat) {
|
|
2772
|
+
ev.preventDefault();
|
|
2773
|
+
this.pickUp(item);
|
|
2774
|
+
}
|
|
2775
|
+
return;
|
|
2776
|
+
}
|
|
2777
|
+
if (this.grabbed.item !== item)
|
|
2778
|
+
return;
|
|
2779
|
+
const items = this.items();
|
|
2780
|
+
const index = items.indexOf(item);
|
|
2781
|
+
switch (ev.key) {
|
|
2782
|
+
case 'ArrowUp':
|
|
2783
|
+
ev.preventDefault();
|
|
2784
|
+
this.moveTo(item, index - 1);
|
|
2785
|
+
break;
|
|
2786
|
+
case 'ArrowDown':
|
|
2787
|
+
ev.preventDefault();
|
|
2788
|
+
this.moveTo(item, index + 1);
|
|
2789
|
+
break;
|
|
2790
|
+
case 'Home':
|
|
2791
|
+
ev.preventDefault();
|
|
2792
|
+
this.moveTo(item, 0);
|
|
2793
|
+
break;
|
|
2794
|
+
case 'End':
|
|
2795
|
+
ev.preventDefault();
|
|
2796
|
+
this.moveTo(item, items.length - 1);
|
|
2797
|
+
break;
|
|
2798
|
+
case ' ':
|
|
2799
|
+
case 'Enter':
|
|
2800
|
+
ev.preventDefault();
|
|
2801
|
+
if (!ev.repeat)
|
|
2802
|
+
this.drop(ev);
|
|
2803
|
+
break;
|
|
2804
|
+
case 'Escape':
|
|
2805
|
+
// Keep an enclosing modal or drawer from closing too.
|
|
2806
|
+
ev.preventDefault();
|
|
2807
|
+
ev.stopPropagation();
|
|
2808
|
+
this.cancel();
|
|
2809
|
+
break;
|
|
2810
|
+
}
|
|
2811
|
+
};
|
|
2681
2812
|
}
|
|
2682
2813
|
handleDisabledChange() {
|
|
2683
2814
|
var _a;
|
|
2684
2815
|
(_a = this.sortableInstance) === null || _a === void 0 ? void 0 : _a.option('disabled', this.disabled);
|
|
2816
|
+
if (this.disabled && this.isGrabbing())
|
|
2817
|
+
this.cancel();
|
|
2818
|
+
this.updateItems();
|
|
2819
|
+
}
|
|
2820
|
+
handleHandleTypeChange() {
|
|
2821
|
+
var _a;
|
|
2822
|
+
if (this.isGrabbing())
|
|
2823
|
+
this.cancel();
|
|
2824
|
+
// `null`, not `undefined`: SortableJS treats `option(name, undefined)` as a read, which would
|
|
2825
|
+
// leave a previous handle restriction in place.
|
|
2826
|
+
(_a = this.sortableInstance) === null || _a === void 0 ? void 0 : _a.option('handle', this.handleType === 'handle' ? HANDLE_SELECTOR : null);
|
|
2827
|
+
this.updateItems();
|
|
2828
|
+
}
|
|
2829
|
+
updateItems() {
|
|
2830
|
+
this.items().forEach((item) => {
|
|
2831
|
+
if (item.tagName === 'PDS-SORTABLE-ITEM')
|
|
2832
|
+
index$1.forceUpdate(item);
|
|
2833
|
+
});
|
|
2685
2834
|
}
|
|
2686
2835
|
classNames() {
|
|
2687
2836
|
const classNames = ['pds-sortable'];
|
|
@@ -2703,11 +2852,19 @@ const PdsSortable = class {
|
|
|
2703
2852
|
this.hostKeeper.connect(this.el);
|
|
2704
2853
|
}
|
|
2705
2854
|
disconnectedCallback() {
|
|
2855
|
+
var _a;
|
|
2706
2856
|
this.hostKeeper.disconnect();
|
|
2857
|
+
// Put the order back: a move that was never dropped was never emitted.
|
|
2858
|
+
if (this.isGrabbing())
|
|
2859
|
+
this.cancel(false);
|
|
2860
|
+
(_a = this.liveRegion) === null || _a === void 0 ? void 0 : _a.remove();
|
|
2861
|
+
this.liveRegion = null;
|
|
2707
2862
|
}
|
|
2708
2863
|
componentDidLoad() {
|
|
2864
|
+
var _a;
|
|
2865
|
+
const reduceMotion = typeof window !== 'undefined' && ((_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-reduced-motion: reduce)').matches);
|
|
2709
2866
|
let sortableOptions = {
|
|
2710
|
-
animation: 150,
|
|
2867
|
+
animation: reduceMotion ? 0 : 150,
|
|
2711
2868
|
disabled: this.disabled,
|
|
2712
2869
|
ghostClass: 'pds-sortable-item--ghost',
|
|
2713
2870
|
dragClass: 'pds-sortable-item--drag',
|
|
@@ -2716,19 +2873,214 @@ const PdsSortable = class {
|
|
|
2716
2873
|
},
|
|
2717
2874
|
};
|
|
2718
2875
|
if (this.handleType === 'handle') {
|
|
2719
|
-
sortableOptions = Object.assign(Object.assign({}, sortableOptions), { handle:
|
|
2876
|
+
sortableOptions = Object.assign(Object.assign({}, sortableOptions), { handle: HANDLE_SELECTOR });
|
|
2720
2877
|
}
|
|
2721
2878
|
this.sortableInstance = Sortable.create(this.el, sortableOptions);
|
|
2879
|
+
// In place before the first announcement, as a region that's created with its text isn't read.
|
|
2880
|
+
this.ensureLiveRegion();
|
|
2881
|
+
// Items that rendered before this list was defined have no handle yet.
|
|
2882
|
+
this.updateItems();
|
|
2883
|
+
}
|
|
2884
|
+
/** The children that can be reordered, counted as SortableJS counts them. */
|
|
2885
|
+
items() {
|
|
2886
|
+
return Array.from(this.el.children).filter((child) => child.tagName !== 'TEMPLATE');
|
|
2887
|
+
}
|
|
2888
|
+
/**
|
|
2889
|
+
* The live region sits right after the list, not in it, so it's never counted as an item, by
|
|
2890
|
+
* SortableJS or by a consumer reading the list's children, and it's still in the same modal. A
|
|
2891
|
+
* morph that removes it gets it put back on the next focus.
|
|
2892
|
+
*/
|
|
2893
|
+
ensureLiveRegion() {
|
|
2894
|
+
if (!this.liveRegion) {
|
|
2895
|
+
// A page-cache (bfcache, Turbo) restore brings back a DOM snapshot that can already have
|
|
2896
|
+
// this list's own live region sitting right after it -- adopted here instead of making
|
|
2897
|
+
// another, which would leave the stale one behind with its last message still in it.
|
|
2898
|
+
const existing = this.el.nextElementSibling;
|
|
2899
|
+
if (existing === null || existing === void 0 ? void 0 : existing.classList.contains(LIVE_REGION_CLASS)) {
|
|
2900
|
+
this.liveRegion = existing;
|
|
2901
|
+
return;
|
|
2902
|
+
}
|
|
2903
|
+
const region = document.createElement('span');
|
|
2904
|
+
region.className = LIVE_REGION_CLASS;
|
|
2905
|
+
region.setAttribute('role', 'status');
|
|
2906
|
+
region.setAttribute('aria-live', 'polite');
|
|
2907
|
+
region.setAttribute('aria-atomic', 'true');
|
|
2908
|
+
// Created here, not rendered, so the scoped stylesheet can't reach it. With no inset, an
|
|
2909
|
+
// absolutely positioned element sits at its static position -- the end of the list, here --
|
|
2910
|
+
// rather than collapsing to (0, 0), which can grow a scrollable ancestor's scroll area.
|
|
2911
|
+
Object.assign(region.style, {
|
|
2912
|
+
position: 'absolute',
|
|
2913
|
+
width: '1px',
|
|
2914
|
+
height: '1px',
|
|
2915
|
+
margin: '-1px',
|
|
2916
|
+
padding: '0',
|
|
2917
|
+
overflow: 'hidden',
|
|
2918
|
+
clipPath: 'inset(50%)',
|
|
2919
|
+
whiteSpace: 'nowrap',
|
|
2920
|
+
border: '0',
|
|
2921
|
+
});
|
|
2922
|
+
this.liveRegion = region;
|
|
2923
|
+
}
|
|
2924
|
+
if (!this.liveRegion.isConnected && this.el.parentNode) {
|
|
2925
|
+
// The host may itself be slotted into a named slot (e.g. inside a modal); stay in it rather
|
|
2926
|
+
// than falling back to the default slot, which a consumer's template may not render.
|
|
2927
|
+
const hostSlot = this.el.getAttribute('slot');
|
|
2928
|
+
if (hostSlot !== null) {
|
|
2929
|
+
this.liveRegion.setAttribute('slot', hostSlot);
|
|
2930
|
+
}
|
|
2931
|
+
else {
|
|
2932
|
+
this.liveRegion.removeAttribute('slot');
|
|
2933
|
+
}
|
|
2934
|
+
this.el.parentNode.insertBefore(this.liveRegion, this.el.nextSibling);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
announce(template, item) {
|
|
2938
|
+
this.ensureLiveRegion();
|
|
2939
|
+
const items = this.items();
|
|
2940
|
+
const message = i18nFormat.formatMessage(template, {
|
|
2941
|
+
item: sortableLabel.sortableItemLabel(item),
|
|
2942
|
+
position: items.indexOf(item) + 1,
|
|
2943
|
+
total: items.length,
|
|
2944
|
+
});
|
|
2945
|
+
// A repeat of the same text isn't announced again, so tell the two apart.
|
|
2946
|
+
this.liveRegion.textContent = message === this.liveRegion.textContent ? `${message} ` : message;
|
|
2947
|
+
}
|
|
2948
|
+
handlePointerDown(ev) {
|
|
2949
|
+
// A drag takes over from a keyboard reorder: keep the moves so far, so the drag starts from them.
|
|
2950
|
+
// Only the primary button (or a touch/pen contact, same value) can start that drag -- a
|
|
2951
|
+
// right-click or a secondary pointer does something else (a context menu, typically) and
|
|
2952
|
+
// must not drop the item out from under it.
|
|
2953
|
+
if (ev.button !== 0 || !this.isGrabbing())
|
|
2954
|
+
return;
|
|
2955
|
+
const item = this.grabbed.item;
|
|
2956
|
+
this.drop(ev);
|
|
2957
|
+
this.droppedByPointerDown = item;
|
|
2958
|
+
window.setTimeout(() => {
|
|
2959
|
+
if (this.droppedByPointerDown === item)
|
|
2960
|
+
this.droppedByPointerDown = null;
|
|
2961
|
+
}, 0);
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2964
|
+
* Whether an item is picked up. One that's been taken out of the list meanwhile (a re-render, a
|
|
2965
|
+
* stream update) is let go, as there's nothing left to move.
|
|
2966
|
+
*/
|
|
2967
|
+
isGrabbing() {
|
|
2968
|
+
if (this.grabbed && this.grabbed.item.parentElement !== this.el)
|
|
2969
|
+
this.release();
|
|
2970
|
+
return this.grabbed !== null;
|
|
2971
|
+
}
|
|
2972
|
+
/** The item whose handle `target` is, if it is one. */
|
|
2973
|
+
targetItem(target) {
|
|
2974
|
+
const item = this.items().find((candidate) => candidate.contains(target));
|
|
2975
|
+
return item && this.focusTarget(item) === target ? item : undefined;
|
|
2976
|
+
}
|
|
2977
|
+
/** The item's handle, the button the keyboard reorders with. */
|
|
2978
|
+
focusTarget(item) {
|
|
2979
|
+
var _a;
|
|
2980
|
+
return ((_a = Array.from(item.children).find((child) => child.matches(HANDLE_SELECTOR))) !== null && _a !== void 0 ? _a : null);
|
|
2981
|
+
}
|
|
2982
|
+
// SortableJS tells `index` (among all children) and `draggableIndex` (among draggable ones)
|
|
2983
|
+
// apart for a list that also holds non-draggable children. This list doesn't -- the live
|
|
2984
|
+
// region that once lived among `this.el`'s children now sits outside it as a sibling -- so
|
|
2985
|
+
// `items()` already is every child, and the two counts are always the same.
|
|
2986
|
+
indexes(item) {
|
|
2987
|
+
const index = this.items().indexOf(item);
|
|
2988
|
+
return { index, draggableIndex: index };
|
|
2989
|
+
}
|
|
2990
|
+
pickUp(item) {
|
|
2991
|
+
var _a;
|
|
2992
|
+
const { index, draggableIndex } = this.indexes(item);
|
|
2993
|
+
this.grabbed = { item, oldIndex: index, oldDraggableIndex: draggableIndex };
|
|
2994
|
+
item.classList.add(GRABBED_CLASS);
|
|
2995
|
+
(_a = this.focusTarget(item)) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-pressed', 'true');
|
|
2996
|
+
this.announce(this.itemPickedUpLabel, item);
|
|
2997
|
+
}
|
|
2998
|
+
/**
|
|
2999
|
+
* Moves the other items around `item` rather than `item` itself, so it never leaves the DOM and
|
|
3000
|
+
* keeps focus.
|
|
3001
|
+
*/
|
|
3002
|
+
moveTo(item, to, announce = true) {
|
|
3003
|
+
var _a;
|
|
3004
|
+
const items = this.items();
|
|
3005
|
+
const from = items.indexOf(item);
|
|
3006
|
+
if (to < 0 || to >= items.length || to === from) {
|
|
3007
|
+
// At the first or last position, an out-of-range attempt (ArrowUp at the top, ArrowDown at
|
|
3008
|
+
// the bottom) or a no-op one (Home already first, End already last) would otherwise leave
|
|
3009
|
+
// a screen reader user with no sign the key landed at all. Repeating the current position
|
|
3010
|
+
// confirms it without implying a move that didn't happen -- `cancel()`'s own call here
|
|
3011
|
+
// passes `announce: false` and gets its own, different announcement instead.
|
|
3012
|
+
if (announce)
|
|
3013
|
+
this.announce(this.itemMovedLabel, item);
|
|
3014
|
+
return;
|
|
3015
|
+
}
|
|
3016
|
+
if (to < from) {
|
|
3017
|
+
const next = item.nextSibling;
|
|
3018
|
+
items.slice(to, from).forEach((sibling) => this.el.insertBefore(sibling, next));
|
|
3019
|
+
}
|
|
3020
|
+
else {
|
|
3021
|
+
items.slice(from + 1, to + 1).forEach((sibling) => this.el.insertBefore(sibling, item));
|
|
3022
|
+
}
|
|
3023
|
+
// Focus doesn't move, so the browser won't scroll the item into view itself.
|
|
3024
|
+
(_a = item.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(item, { block: 'nearest' });
|
|
3025
|
+
if (announce)
|
|
3026
|
+
this.announce(this.itemMovedLabel, item);
|
|
3027
|
+
}
|
|
3028
|
+
drop(originalEvent) {
|
|
3029
|
+
const { item, oldIndex, oldDraggableIndex } = this.grabbed;
|
|
3030
|
+
this.release();
|
|
3031
|
+
this.announce(this.itemDroppedLabel, item);
|
|
3032
|
+
const { index, draggableIndex } = this.indexes(item);
|
|
3033
|
+
// A keyboard drop happens more often than a drag: tabbing away from a picked-up row, a click
|
|
3034
|
+
// elsewhere in the list, or the second press of a screen reader's browse-mode Enter all drop
|
|
3035
|
+
// it too. Emitting unconditionally would have a consumer that saves on every event send a
|
|
3036
|
+
// no-op request each time nothing actually moved.
|
|
3037
|
+
if (draggableIndex === oldDraggableIndex)
|
|
3038
|
+
return;
|
|
3039
|
+
// The same shape SortableJS gives `onEnd`, with the event that ended the move as
|
|
3040
|
+
// `originalEvent` -- not always a `KeyboardEvent`: a `FocusEvent` when focus leaves the row,
|
|
3041
|
+
// a `PointerEvent` for a pointerdown, or a `MouseEvent` for a browse-mode click.
|
|
3042
|
+
const detail = Object.assign(new CustomEvent('end', { bubbles: true, cancelable: true }), {
|
|
3043
|
+
item,
|
|
3044
|
+
from: this.el,
|
|
3045
|
+
to: this.el,
|
|
3046
|
+
oldIndex,
|
|
3047
|
+
newIndex: index,
|
|
3048
|
+
oldDraggableIndex,
|
|
3049
|
+
newDraggableIndex: draggableIndex,
|
|
3050
|
+
originalEvent,
|
|
3051
|
+
pullMode: undefined,
|
|
3052
|
+
});
|
|
3053
|
+
this.pdsSortableItemMoved.emit(detail);
|
|
3054
|
+
}
|
|
3055
|
+
cancel(announce = true) {
|
|
3056
|
+
const { item, oldDraggableIndex } = this.grabbed;
|
|
3057
|
+
this.release();
|
|
3058
|
+
// Items may have come or gone meanwhile, so go back as near the start as the list allows.
|
|
3059
|
+
this.moveTo(item, Math.min(oldDraggableIndex, this.items().length - 1), false);
|
|
3060
|
+
if (announce)
|
|
3061
|
+
this.announce(this.reorderCanceledLabel, item);
|
|
3062
|
+
}
|
|
3063
|
+
release() {
|
|
3064
|
+
var _a;
|
|
3065
|
+
this.grabbed.item.classList.remove(GRABBED_CLASS);
|
|
3066
|
+
(_a = this.focusTarget(this.grabbed.item)) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-pressed', 'false');
|
|
3067
|
+
this.grabbed = null;
|
|
2722
3068
|
}
|
|
2723
3069
|
render() {
|
|
2724
3070
|
const classNames = this.classNames();
|
|
2725
3071
|
this.hostKeeper.record(classNames);
|
|
2726
|
-
return (index$1.h(index$1.Host, { key: '
|
|
3072
|
+
return (index$1.h(index$1.Host, { key: 'a1fb28574e3aa92a923c4baeecec690d4052601f', class: classNames, id: this.componentId, onFocusin: this.handleFocusIn, onFocusout: this.handleFocusOut, onKeyDown: this.handleKeyDown, onClick: this.handleClick }, index$1.h("slot", { key: 'b9a255d4f94a6b9976a4cac7e142e45210125828' })));
|
|
2727
3073
|
}
|
|
2728
3074
|
get el() { return index$1.getElement(this); }
|
|
2729
3075
|
static get watchers() { return {
|
|
2730
3076
|
"disabled": [{
|
|
2731
3077
|
"handleDisabledChange": 0
|
|
3078
|
+
}],
|
|
3079
|
+
"handleType": [{
|
|
3080
|
+
"handleHandleTypeChange": 0
|
|
3081
|
+
}],
|
|
3082
|
+
"handleLabel": [{
|
|
3083
|
+
"updateItems": 0
|
|
2732
3084
|
}]
|
|
2733
3085
|
}; }
|
|
2734
3086
|
};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
var index = require('./index-D9iJuJCP.js');
|
|
4
4
|
var form = require('./form-MhwfKTuo.js');
|
|
5
5
|
var index$1 = require('./index-BDnbr0DK.js');
|
|
6
|
-
var attributes = require('./attributes-
|
|
6
|
+
var attributes = require('./attributes-Cgbkw6gO.js');
|
|
7
|
+
var ariaReferences = require('./aria-references-CUmqibnO.js');
|
|
7
8
|
require('./keep-hydrated-AKoh0DG4.js');
|
|
8
9
|
|
|
9
10
|
const labelCss = () => `:host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}`;
|
|
@@ -16,8 +17,11 @@ const PdsSwitch = class {
|
|
|
16
17
|
this.pdsSwitchChange = index.createEvent(this, "pdsSwitchChange");
|
|
17
18
|
this.inheritedAttributes = {};
|
|
18
19
|
this._type = 'checkbox';
|
|
20
|
+
this.forwardsDescription = false;
|
|
19
21
|
this.hostKeeper = new attributes.HostStylingKeeper();
|
|
20
22
|
this.hasLabelSlot = false;
|
|
23
|
+
// Kept apart from the `disabled` prop so a fieldset never overwrites what the consumer set.
|
|
24
|
+
this.fieldsetDisabled = false;
|
|
21
25
|
/**
|
|
22
26
|
* Determines the input 'checked' state.
|
|
23
27
|
*/
|
|
@@ -35,7 +39,7 @@ const PdsSwitch = class {
|
|
|
35
39
|
*/
|
|
36
40
|
this.required = false;
|
|
37
41
|
this.onSwitchUpdate = (e) => {
|
|
38
|
-
if (this.
|
|
42
|
+
if (this.isDisabled())
|
|
39
43
|
return;
|
|
40
44
|
const input = e.target;
|
|
41
45
|
this.checked = input.checked;
|
|
@@ -55,10 +59,40 @@ const PdsSwitch = class {
|
|
|
55
59
|
}
|
|
56
60
|
return switchClasses;
|
|
57
61
|
};
|
|
62
|
+
// An ID on the host can't reach into the shadow root, so the input is pointed at the elements the host's
|
|
63
|
+
// aria-describedby names, followed by its own helper or error message. A browser without ARIA element
|
|
64
|
+
// reflection keeps the input's own message only.
|
|
65
|
+
this.forwardDescription = () => {
|
|
66
|
+
var _a;
|
|
67
|
+
const input = this.inputEl;
|
|
68
|
+
if (input === undefined || !('ariaDescribedByElements' in input))
|
|
69
|
+
return;
|
|
70
|
+
const ownId = this.ownDescriptionId();
|
|
71
|
+
const referenced = ariaReferences.referencedElements(this.el, 'aria-describedby');
|
|
72
|
+
if (referenced.length === 0) {
|
|
73
|
+
if (!this.forwardsDescription)
|
|
74
|
+
return;
|
|
75
|
+
this.forwardsDescription = false;
|
|
76
|
+
// Setting the element property cleared the attribute render wrote, so put that back.
|
|
77
|
+
if (ownId !== undefined) {
|
|
78
|
+
input.setAttribute('aria-describedby', ownId);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
input.removeAttribute('aria-describedby');
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const own = ownId === undefined ? null : (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById(ownId);
|
|
86
|
+
input.ariaDescribedByElements = own == null ? referenced : [...referenced, own];
|
|
87
|
+
this.forwardsDescription = true;
|
|
88
|
+
};
|
|
58
89
|
this.updateHasLabelSlot = () => {
|
|
59
90
|
this.hasLabelSlot = Array.from(this.el.children).some((child) => child.getAttribute('slot') === 'label');
|
|
60
91
|
};
|
|
61
92
|
}
|
|
93
|
+
isDisabled() {
|
|
94
|
+
return this.disabled || this.fieldsetDisabled;
|
|
95
|
+
}
|
|
62
96
|
connectedCallback() {
|
|
63
97
|
this.hostKeeper.connect(this.el);
|
|
64
98
|
// Initialize ElementInternals for form association (only once per element instance)
|
|
@@ -67,28 +101,58 @@ const PdsSwitch = class {
|
|
|
67
101
|
}
|
|
68
102
|
// Expose type property on the element instance to match native form element behavior
|
|
69
103
|
form.exposeTypeProperty(this.el, () => this._type);
|
|
104
|
+
// A reconnected switch may sit in a different tree, where its description IDs name other elements.
|
|
105
|
+
this.forwardDescription();
|
|
106
|
+
if (typeof MutationObserver === 'undefined')
|
|
107
|
+
return;
|
|
108
|
+
// Consumers set aria-describedby on the host, sometimes after render, but only the inner input is announced.
|
|
109
|
+
this.hostDescriptionObserver = new MutationObserver(this.forwardDescription);
|
|
110
|
+
this.hostDescriptionObserver.observe(this.el, { attributeFilter: ['aria-describedby'] });
|
|
70
111
|
}
|
|
71
112
|
disconnectedCallback() {
|
|
113
|
+
var _a;
|
|
72
114
|
this.hostKeeper.disconnect();
|
|
115
|
+
(_a = this.hostDescriptionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
116
|
+
this.hostDescriptionObserver = undefined;
|
|
117
|
+
}
|
|
118
|
+
componentDidRender() {
|
|
119
|
+
this.forwardDescription();
|
|
73
120
|
}
|
|
74
121
|
componentDidLoad() {
|
|
75
122
|
this.updateFormValue();
|
|
76
123
|
}
|
|
77
|
-
|
|
124
|
+
syncFormValue() {
|
|
78
125
|
this.updateFormValue();
|
|
79
126
|
}
|
|
80
127
|
updateFormValue() {
|
|
81
128
|
if (form.isSpecTest())
|
|
82
129
|
return;
|
|
83
130
|
if (this.internals && this.internals.setFormValue) {
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
this.internals.setFormValue(formValue);
|
|
131
|
+
// The restoration state always carries the checked value, even while disabled, so a bfcache or
|
|
132
|
+
// back-forward restore can bring back a checked-then-disabled switch instead of losing it to a null state.
|
|
133
|
+
this.internals.setFormValue(this.formValue(), this.checkedValue());
|
|
87
134
|
}
|
|
88
135
|
if (this.internals && this.internals.setValidity) {
|
|
89
136
|
this.internals.setValidity({});
|
|
90
137
|
}
|
|
91
138
|
}
|
|
139
|
+
// Unchecked sends uncheckedValue when set, even an empty string, otherwise nothing. Disabled sends nothing, like a
|
|
140
|
+
// native checkbox: the platform only leaves out a host with the disabled attribute present, which is also how
|
|
141
|
+
// React's own custom-element attribute serialization writes it.
|
|
142
|
+
formValue() {
|
|
143
|
+
if (this.isDisabled())
|
|
144
|
+
return null;
|
|
145
|
+
return this.checkedValue();
|
|
146
|
+
}
|
|
147
|
+
checkedValue() {
|
|
148
|
+
var _a;
|
|
149
|
+
if (this.checked)
|
|
150
|
+
return this.value || 'on';
|
|
151
|
+
return (_a = this.uncheckedValue) !== null && _a !== void 0 ? _a : null;
|
|
152
|
+
}
|
|
153
|
+
ownDescriptionId() {
|
|
154
|
+
return form.assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage);
|
|
155
|
+
}
|
|
92
156
|
formStateRestoreCallback(state) {
|
|
93
157
|
if (state instanceof FormData) {
|
|
94
158
|
// For switches, restore if the value exists in FormData
|
|
@@ -108,27 +172,40 @@ const PdsSwitch = class {
|
|
|
108
172
|
// literal string "false" (a consumer's or React's attribute serialization can write that) —
|
|
109
173
|
// the platform treats any value as disabled, independent of fieldset state. A real disabled
|
|
110
174
|
// fieldset ancestor confirms this is genuinely that, not this element's own attribute.
|
|
111
|
-
|
|
112
|
-
return;
|
|
113
|
-
this.disabled = disabled;
|
|
175
|
+
this.fieldsetDisabled = disabled && this.el.closest('fieldset[disabled]') !== null;
|
|
114
176
|
}
|
|
115
177
|
componentWillLoad() {
|
|
116
|
-
this.inheritedAttributes = Object.assign({}, attributes.inheritAriaAttributes(this.el));
|
|
178
|
+
this.inheritedAttributes = Object.assign({}, attributes.inheritAriaAttributes(this.el, ['aria-describedby']));
|
|
117
179
|
this.updateHasLabelSlot();
|
|
118
180
|
}
|
|
119
181
|
render() {
|
|
120
182
|
const hostClass = this.switchClassNames();
|
|
121
|
-
const ariaDisabled = this.
|
|
183
|
+
const ariaDisabled = this.isDisabled() ? 'true' : null;
|
|
122
184
|
this.hostKeeper.record(hostClass, {}, { 'aria-disabled': ariaDisabled });
|
|
123
|
-
return (index.h(index.Host, { key: '
|
|
124
|
-
|
|
125
|
-
|
|
185
|
+
return (index.h(index.Host, { key: 'e5100ae3ecfac3bb556582507cc628b2455ae6cc', class: hostClass, "aria-disabled": ariaDisabled }, index.h("label", { key: 'c337b8c4dc381c3a745100c707792c11711c01a1', htmlFor: this.componentId }, index.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,
|
|
186
|
+
// A description added after the switch, or replaced by a framework or a DOM morph, is picked up by the
|
|
187
|
+
// time focus reaches the switch and it's announced.
|
|
188
|
+
onFocus: this.forwardDescription, ref: (el) => (this.inputEl = el), required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), index.h("span", { key: '4bddfc080db7fee6fa8080e890918757dacde3fb', class: this.hideLabel ? 'visually-hidden' : '' }, index.h("slot", { key: 'c9302409719113e12f6debb426c78dd0caaee88a', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
189
|
+
index.h("div", { key: '60785b9779cb2d50e6f0f2b32179106256f55ebf', class: `pds-switch__message`, id: form.messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
190
|
+
index.h("div", { key: '9b258e9302c5ef959e8c06bee780d7d43144359b', class: `pds-switch__message pds-switch__message--error`, id: form.messageId(this.componentId, 'error'), "aria-live": "assertive" }, index.h("pds-icon", { key: 'f8df779a8c65a6f0b6ea139ff3c31cca76eb48fa', "aria-hidden": "true", icon: index$1.danger, size: "small" }), this.errorMessage)));
|
|
126
191
|
}
|
|
127
192
|
static get formAssociated() { return true; }
|
|
128
193
|
get el() { return index.getElement(this); }
|
|
129
194
|
static get watchers() { return {
|
|
130
195
|
"checked": [{
|
|
131
|
-
"
|
|
196
|
+
"syncFormValue": 0
|
|
197
|
+
}],
|
|
198
|
+
"disabled": [{
|
|
199
|
+
"syncFormValue": 0
|
|
200
|
+
}],
|
|
201
|
+
"fieldsetDisabled": [{
|
|
202
|
+
"syncFormValue": 0
|
|
203
|
+
}],
|
|
204
|
+
"uncheckedValue": [{
|
|
205
|
+
"syncFormValue": 0
|
|
206
|
+
}],
|
|
207
|
+
"value": [{
|
|
208
|
+
"syncFormValue": 0
|
|
132
209
|
}]
|
|
133
210
|
}; }
|
|
134
211
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-D9iJuJCP.js');
|
|
4
|
-
var attributes = require('./attributes-
|
|
4
|
+
var attributes = require('./attributes-Cgbkw6gO.js');
|
|
5
5
|
var reconnectedContent = require('./reconnected-content-CpnEQcTp.js');
|
|
6
6
|
require('./keep-hydrated-AKoh0DG4.js');
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ const PdsTableBody = class {
|
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (index.h(index.Host, { key: '
|
|
13
|
+
return (index.h(index.Host, { key: '4b4da65979e3d3557d05cb9aff8d257d29e2c0a5', role: "rowgroup", part: "body" }, index.h("slot", { key: '70dcd401a705a430c54c57bf994a410a636c4a53' })));
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
PdsTableBody.style = pdsTableBodyCss();
|