@pine-ds/core 3.0.3 → 3.2.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/index.d.ts +20 -0
- package/components/index.js +10 -0
- package/components/index.js.map +1 -1
- package/components/index2.js +1 -1
- package/components/index2.js.map +1 -1
- package/components/mock-pds-modal.d.ts +11 -0
- package/components/mock-pds-modal.js +108 -0
- package/components/mock-pds-modal.js.map +1 -0
- package/components/pds-alert.d.ts +11 -0
- package/components/pds-alert.js +107 -0
- package/components/pds-alert.js.map +1 -0
- package/components/pds-avatar.js +1 -1
- package/components/pds-box.js +1 -110
- package/components/pds-box.js.map +1 -1
- package/components/pds-box2.js +115 -0
- package/components/pds-box2.js.map +1 -0
- package/components/pds-button2.js +31 -5
- package/components/pds-button2.js.map +1 -1
- package/components/pds-checkbox2.js +9 -3
- package/components/pds-checkbox2.js.map +1 -1
- package/components/pds-chip.js +1 -1
- package/components/pds-copytext.js +2 -2
- package/components/pds-copytext.js.map +1 -1
- package/components/pds-divider.js +1 -1
- package/components/pds-dropdown-menu-item.d.ts +11 -0
- package/components/pds-dropdown-menu-item.js +117 -0
- package/components/pds-dropdown-menu-item.js.map +1 -0
- package/components/pds-dropdown-menu-separator.d.ts +11 -0
- package/components/pds-dropdown-menu-separator.js +44 -0
- package/components/pds-dropdown-menu-separator.js.map +1 -0
- package/components/pds-dropdown-menu.d.ts +11 -0
- package/components/pds-dropdown-menu.js +1600 -0
- package/components/pds-dropdown-menu.js.map +1 -0
- package/components/pds-icon2.js +103 -7
- package/components/pds-icon2.js.map +1 -1
- package/components/pds-image.js +2 -2
- package/components/pds-input.js +4 -4
- package/components/pds-link.js +1 -67
- package/components/pds-link.js.map +1 -1
- package/components/pds-link2.js +85 -0
- package/components/pds-link2.js.map +1 -0
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.d.ts +11 -0
- package/components/pds-modal-content.js +111 -0
- package/components/pds-modal-content.js.map +1 -0
- package/components/pds-modal-footer.d.ts +11 -0
- package/components/pds-modal-footer.js +35 -0
- package/components/pds-modal-footer.js.map +1 -0
- package/components/pds-modal-header.d.ts +11 -0
- package/components/pds-modal-header.js +35 -0
- package/components/pds-modal-header.js.map +1 -0
- package/components/pds-modal.d.ts +11 -0
- package/components/pds-modal.js +278 -0
- package/components/pds-modal.js.map +1 -0
- package/components/pds-popover.js +33 -1
- package/components/pds-popover.js.map +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-radio.js +3 -3
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +2 -2
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +1 -1
- package/components/pds-switch.js +8 -3
- package/components/pds-switch.js.map +1 -1
- package/components/pds-tab.js +3 -3
- package/components/pds-table-body.js +1 -1
- package/components/pds-table-cell2.js +2 -2
- package/components/pds-table-head-cell2.js +2 -2
- 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-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text.js +1 -53
- package/components/pds-text.js.map +1 -1
- package/components/pds-text2.js +58 -0
- package/components/pds-text2.js.map +1 -0
- package/components/pds-textarea.js +4 -4
- package/components/pds-toast.d.ts +11 -0
- package/components/pds-toast.js +137 -0
- package/components/pds-toast.js.map +1 -0
- package/components/pds-tooltip.js +283 -81
- package/components/pds-tooltip.js.map +1 -1
- package/components/utils.js +3 -2
- package/components/utils.js.map +1 -1
- package/dist/cjs/{index-Br1YlNK2.js → index-CG2Rr2io.js} +3 -3
- package/dist/cjs/index-CG2Rr2io.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mock-pds-modal.cjs.entry.js +86 -0
- package/dist/cjs/mock-pds-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/mock-pds-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/pds-alert.cjs.entry.js +66 -0
- package/dist/cjs/pds-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-alert.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-avatar.cjs.entry.js +2 -2
- package/dist/cjs/pds-box.cjs.entry.js +2 -2
- package/dist/cjs/pds-box.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-box.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-button.cjs.entry.js +33 -7
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +10 -4
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-chip.cjs.entry.js +2 -2
- package/dist/cjs/pds-copytext.cjs.entry.js +3 -3
- package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-copytext.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-divider.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +82 -0
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-item.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +25 -0
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-separator.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1574 -0
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-icon.cjs.entry.js +102 -7
- package/dist/cjs/pds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-image.cjs.entry.js +2 -2
- package/dist/cjs/pds-input.cjs.entry.js +6 -6
- package/dist/cjs/pds-link.cjs.entry.js +16 -4
- package/dist/cjs/pds-link.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-link.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-loader.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +93 -0
- package/dist/cjs/pds-modal-content.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-content.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal-footer.cjs.entry.js +20 -0
- package/dist/cjs/pds-modal-footer.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-footer.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal-header.cjs.entry.js +20 -0
- package/dist/cjs/pds-modal-header.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-header.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal.cjs.entry.js +253 -0
- package/dist/cjs/pds-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-popover.cjs.entry.js +33 -1
- package/dist/cjs/pds-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-progress.cjs.entry.js +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +4 -4
- package/dist/cjs/pds-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +3 -3
- package/dist/cjs/pds-sortable-item.cjs.entry.js +2 -2
- package/dist/cjs/pds-sortable.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +9 -4
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-tab.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +3 -3
- 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 +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/pds-text.cjs.entry.js +2 -2
- package/dist/cjs/pds-text.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-text.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +6 -6
- package/dist/cjs/pds-toast.cjs.entry.js +104 -0
- package/dist/cjs/pds-toast.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-toast.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js +281 -79
- package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/{utils-CQKIgzWg.js → utils-jWx-Mf12.js} +5 -4
- package/dist/cjs/utils-jWx-Mf12.js.map +1 -0
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/pds-alert/pds-alert.css +108 -0
- package/dist/collection/components/pds-alert/pds-alert.js +198 -0
- package/dist/collection/components/pds-alert/pds-alert.js.map +1 -0
- package/dist/collection/components/pds-alert/pds-alert.tokens.css +32 -0
- package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +97 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +1 -1
- package/dist/collection/components/pds-box/pds-box.js +8 -8
- package/dist/collection/components/pds-box/pds-box.js.map +1 -1
- package/dist/collection/components/pds-button/pds-button.css +7 -11
- package/dist/collection/components/pds-button/pds-button.js +37 -5
- package/dist/collection/components/pds-button/pds-button.js.map +1 -1
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +46 -11
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +9 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -1
- package/dist/collection/components/pds-chip/pds-chip.js +1 -1
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.css +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
- package/dist/collection/components/pds-divider/pds-divider.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +68 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +219 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.css +4 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +72 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +16 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +328 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +44 -0
- package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +1 -1
- package/dist/collection/components/pds-image/pds-image.js +2 -2
- package/dist/collection/components/pds-input/pds-input.js +4 -4
- package/dist/collection/components/pds-link/pds-link.css +23 -9
- package/dist/collection/components/pds-link/pds-link.js +33 -2
- package/dist/collection/components/pds-link/pds-link.js.map +1 -1
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +15 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.css +27 -0
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +125 -0
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.css +8 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +18 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.css +8 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +18 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal.css +79 -0
- package/dist/collection/components/pds-modal/pds-modal.js +426 -0
- package/dist/collection/components/pds-modal/pds-modal.js.map +1 -0
- package/dist/collection/components/pds-modal/stories/pds-modal.stories.js +415 -0
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +256 -0
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js.map +1 -0
- package/dist/collection/components/pds-popover/pds-popover.js +33 -1
- package/dist/collection/components/pds-popover/pds-popover.js.map +1 -1
- package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +4 -5
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +3 -3
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.js +2 -2
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +8 -3
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-table/pds-table.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -3
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +2 -2
- package/dist/collection/components/pds-text/pds-text.js.map +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
- package/dist/collection/components/pds-toast/pds-toast.css +153 -0
- package/dist/collection/components/pds-toast/pds-toast.js +263 -0
- package/dist/collection/components/pds-toast/pds-toast.js.map +1 -0
- package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +103 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +2 -12
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +211 -26
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -1
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +7 -3
- package/dist/collection/utils/interfaces.js +2 -0
- package/dist/collection/utils/interfaces.js.map +1 -0
- package/dist/collection/utils/overlay.js +66 -49
- package/dist/collection/utils/overlay.js.map +1 -1
- package/dist/collection/utils/utils.js +3 -2
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/docs.json +1670 -268
- package/dist/esm/{index-mVZRKoXd.js → index-_4gljHh-.js} +3 -3
- package/dist/esm/index-_4gljHh-.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mock-pds-modal.entry.js +84 -0
- package/dist/esm/mock-pds-modal.entry.js.map +1 -0
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-alert.entry.js +64 -0
- package/dist/esm/pds-alert.entry.js.map +1 -0
- package/dist/esm/pds-avatar.entry.js +2 -2
- package/dist/esm/pds-box.entry.js +2 -2
- package/dist/esm/pds-box.entry.js.map +1 -1
- package/dist/esm/pds-button.entry.js +33 -7
- package/dist/esm/pds-button.entry.js.map +1 -1
- package/dist/esm/pds-checkbox.entry.js +11 -5
- package/dist/esm/pds-checkbox.entry.js.map +1 -1
- package/dist/esm/pds-chip.entry.js +2 -2
- package/dist/esm/pds-copytext.entry.js +3 -3
- package/dist/esm/pds-copytext.entry.js.map +1 -1
- package/dist/esm/pds-divider.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu-item.entry.js +80 -0
- package/dist/esm/pds-dropdown-menu-item.entry.js.map +1 -0
- package/dist/esm/pds-dropdown-menu-separator.entry.js +23 -0
- package/dist/esm/pds-dropdown-menu-separator.entry.js.map +1 -0
- package/dist/esm/pds-dropdown-menu.entry.js +1572 -0
- package/dist/esm/pds-dropdown-menu.entry.js.map +1 -0
- package/dist/esm/pds-icon.entry.js +102 -7
- package/dist/esm/pds-icon.entry.js.map +1 -1
- package/dist/esm/pds-image.entry.js +2 -2
- package/dist/esm/pds-input.entry.js +6 -6
- package/dist/esm/pds-link.entry.js +16 -4
- package/dist/esm/pds-link.entry.js.map +1 -1
- package/dist/esm/pds-loader.entry.js +1 -1
- package/dist/esm/pds-modal-content.entry.js +91 -0
- package/dist/esm/pds-modal-content.entry.js.map +1 -0
- package/dist/esm/pds-modal-footer.entry.js +18 -0
- package/dist/esm/pds-modal-footer.entry.js.map +1 -0
- package/dist/esm/pds-modal-header.entry.js +18 -0
- package/dist/esm/pds-modal-header.entry.js.map +1 -0
- package/dist/esm/pds-modal.entry.js +251 -0
- package/dist/esm/pds-modal.entry.js.map +1 -0
- package/dist/esm/pds-popover.entry.js +33 -1
- package/dist/esm/pds-popover.entry.js.map +1 -1
- package/dist/esm/pds-progress.entry.js +1 -1
- package/dist/esm/pds-radio.entry.js +4 -4
- 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 +2 -2
- package/dist/esm/pds-sortable.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +9 -4
- package/dist/esm/pds-switch.entry.js.map +1 -1
- package/dist/esm/pds-tab.entry.js +3 -3
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +2 -2
- package/dist/esm/pds-table-head-cell.entry.js +3 -3
- 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 +1 -1
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +1 -1
- package/dist/esm/pds-text.entry.js +2 -2
- package/dist/esm/pds-text.entry.js.map +1 -1
- package/dist/esm/pds-textarea.entry.js +6 -6
- package/dist/esm/pds-toast.entry.js +102 -0
- package/dist/esm/pds-toast.entry.js.map +1 -0
- package/dist/esm/pds-tooltip.entry.js +281 -79
- package/dist/esm/pds-tooltip.entry.js.map +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/{utils-Dw9B1JDC.js → utils-DkabwBZT.js} +5 -4
- package/dist/esm/utils-DkabwBZT.js.map +1 -0
- package/dist/esm-es5/{index-mVZRKoXd.js → index-_4gljHh-.js} +1 -1
- package/dist/esm-es5/index-_4gljHh-.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +2 -0
- package/dist/esm-es5/mock-pds-modal.entry.js.map +1 -0
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +2 -0
- package/dist/esm-es5/pds-alert.entry.js.map +1 -0
- 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-box.entry.js.map +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js.map +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -1
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js.map +1 -0
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js.map +1 -0
- package/dist/esm-es5/pds-dropdown-menu.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu.entry.js.map +1 -0
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js.map +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-link.entry.js.map +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +2 -0
- package/dist/esm-es5/pds-modal-content.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal-footer.entry.js +2 -0
- package/dist/esm-es5/pds-modal-footer.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal-header.entry.js +2 -0
- package/dist/esm-es5/pds-modal-header.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal.entry.js +2 -0
- package/dist/esm-es5/pds-modal.entry.js.map +1 -0
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js.map +1 -1
- package/dist/esm-es5/pds-progress.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 +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js.map +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-text.entry.js.map +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +2 -0
- package/dist/esm-es5/pds-toast.entry.js.map +1 -0
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/utils-DkabwBZT.js +2 -0
- package/dist/esm-es5/utils-DkabwBZT.js.map +1 -0
- package/dist/pine-core/mock-pds-modal.entry.esm.js.map +1 -0
- package/dist/pine-core/{p-ad69e5f9.system.entry.js → p-0069abf8.system.entry.js} +2 -2
- package/dist/pine-core/{p-a14c8ab4.system.entry.js → p-03d8cb4c.system.entry.js} +2 -2
- package/dist/pine-core/{p-2ab26d3d.system.entry.js → p-04df41d7.system.entry.js} +2 -2
- package/dist/pine-core/{p-0486ad57.entry.js → p-0572825b.entry.js} +2 -2
- package/dist/pine-core/{p-d2110923.system.entry.js → p-111e7da2.system.entry.js} +2 -2
- package/dist/pine-core/p-121e03ad.system.entry.js +2 -0
- package/dist/pine-core/p-121e03ad.system.entry.js.map +1 -0
- package/dist/pine-core/p-1224c874.entry.js +2 -0
- package/dist/pine-core/{p-b2bbc362.entry.js → p-146fcd44.entry.js} +2 -2
- package/dist/pine-core/{p-abcce8af.entry.js → p-17d3fa8b.entry.js} +2 -2
- package/dist/pine-core/p-1b109c01.entry.js +2 -0
- package/dist/pine-core/p-1b109c01.entry.js.map +1 -0
- package/dist/pine-core/p-1bd715ee.system.entry.js +2 -0
- package/dist/pine-core/p-1bd715ee.system.entry.js.map +1 -0
- package/dist/pine-core/{p-e4ea5041.system.entry.js → p-1eec6bea.system.entry.js} +2 -2
- package/dist/pine-core/p-21c3aaeb.entry.js +2 -0
- package/dist/pine-core/{p-f439922f.entry.js → p-2296c34f.entry.js} +2 -2
- package/dist/pine-core/{p-f439922f.entry.js.map → p-2296c34f.entry.js.map} +1 -1
- package/dist/pine-core/{p-5c396e75.entry.js → p-24607f93.entry.js} +2 -2
- package/dist/pine-core/p-28e28f42.system.entry.js +2 -0
- package/dist/pine-core/p-28e28f42.system.entry.js.map +1 -0
- package/dist/pine-core/p-29ad0b86.entry.js +2 -0
- package/dist/pine-core/p-29ad0b86.entry.js.map +1 -0
- package/dist/pine-core/{p-c0f0b368.system.entry.js → p-30142a25.system.entry.js} +2 -2
- package/dist/pine-core/p-32bd3e33.entry.js +2 -0
- package/dist/pine-core/p-32bd3e33.entry.js.map +1 -0
- package/dist/pine-core/{p-8305cd4d.entry.js → p-367e188f.entry.js} +2 -2
- package/dist/pine-core/{p-6147b1ea.system.entry.js → p-3798a631.system.entry.js} +2 -2
- package/dist/pine-core/p-3D0orTx_.system.js.map +1 -0
- package/dist/pine-core/p-3e91dccd.entry.js +2 -0
- package/dist/pine-core/p-3e91dccd.entry.js.map +1 -0
- package/dist/pine-core/{p-3fdbda99.system.entry.js → p-3f82ac77.system.entry.js} +2 -2
- package/dist/pine-core/p-4288c861.entry.js +2 -0
- package/dist/pine-core/p-4288c861.entry.js.map +1 -0
- package/dist/pine-core/p-47a7a65b.entry.js +2 -0
- package/dist/pine-core/p-47a7a65b.entry.js.map +1 -0
- package/dist/pine-core/{p-42f1190a.system.entry.js → p-48e76945.system.entry.js} +2 -2
- package/dist/pine-core/p-49265849.system.entry.js +2 -0
- package/dist/pine-core/p-49265849.system.entry.js.map +1 -0
- package/dist/pine-core/{p-b9f99fc9.entry.js → p-4ff0838c.entry.js} +2 -2
- package/dist/pine-core/p-513c16c7.entry.js +2 -0
- package/dist/pine-core/p-513c16c7.entry.js.map +1 -0
- package/dist/pine-core/{p-820faa91.system.entry.js → p-596e0292.system.entry.js} +2 -2
- package/dist/pine-core/p-5acda4ac.system.entry.js +2 -0
- package/dist/pine-core/p-5acda4ac.system.entry.js.map +1 -0
- package/dist/pine-core/p-5c4aceb7.entry.js +2 -0
- package/dist/pine-core/p-5c4aceb7.entry.js.map +1 -0
- package/dist/pine-core/{p-598ade79.entry.js → p-5e1e7762.entry.js} +2 -2
- package/dist/pine-core/p-624db3d6.system.entry.js +2 -0
- package/dist/pine-core/p-624db3d6.system.entry.js.map +1 -0
- package/dist/pine-core/{p-d0780ca1.system.entry.js → p-6a2296e6.system.entry.js} +2 -2
- package/dist/pine-core/{p-b68cb43d.system.entry.js → p-71265b2a.system.entry.js} +2 -2
- package/dist/pine-core/p-71f01676.system.entry.js +2 -0
- package/dist/pine-core/p-71f01676.system.entry.js.map +1 -0
- package/dist/pine-core/{p-a5587332.entry.js → p-722012ac.entry.js} +2 -2
- package/dist/pine-core/p-722012ac.entry.js.map +1 -0
- package/dist/pine-core/{p-98181fa8.system.entry.js → p-730221a8.system.entry.js} +2 -2
- package/dist/pine-core/{p-a97952fc.system.entry.js → p-73412ca9.system.entry.js} +2 -2
- package/dist/pine-core/{p-a97952fc.system.entry.js.map → p-73412ca9.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-91dadcbe.entry.js → p-742d4490.entry.js} +2 -2
- package/dist/pine-core/p-761946a0.entry.js +2 -0
- package/dist/pine-core/p-761946a0.entry.js.map +1 -0
- package/dist/pine-core/{p-950427b2.entry.js → p-77c3a10d.entry.js} +2 -2
- package/dist/pine-core/{p-fed4c0c0.system.entry.js → p-78cb1c40.system.entry.js} +2 -2
- package/dist/pine-core/{p-1d92261f.system.entry.js → p-78fb945e.system.entry.js} +2 -2
- package/dist/pine-core/p-7b38e384.system.entry.js +2 -0
- package/dist/pine-core/{p-9d0c1b2e.system.entry.js.map → p-7b38e384.system.entry.js.map} +1 -1
- package/dist/pine-core/p-7e92ec48.system.entry.js +2 -0
- package/dist/pine-core/p-7e92ec48.system.entry.js.map +1 -0
- package/dist/pine-core/{p-13b9ed06.system.entry.js → p-7ff213bb.system.entry.js} +2 -2
- package/dist/pine-core/{p-9e9d3a2b.entry.js → p-8023086c.entry.js} +2 -2
- package/dist/pine-core/p-83252078.system.entry.js +2 -0
- package/dist/pine-core/{p-bedddd53.entry.js → p-833f08f3.entry.js} +2 -2
- package/dist/pine-core/p-83c632f6.system.entry.js +2 -0
- package/dist/pine-core/p-83c632f6.system.entry.js.map +1 -0
- package/dist/pine-core/p-83ffc1cc.entry.js +2 -0
- package/dist/pine-core/p-83ffc1cc.entry.js.map +1 -0
- package/dist/pine-core/p-85ff1482.entry.js +2 -0
- package/dist/pine-core/{p-d5838288.entry.js.map → p-85ff1482.entry.js.map} +1 -1
- package/dist/pine-core/{p-12bee2e5.entry.js → p-86d388a2.entry.js} +2 -2
- package/dist/pine-core/p-929bb7ab.system.entry.js +2 -0
- package/dist/pine-core/p-929bb7ab.system.entry.js.map +1 -0
- package/dist/pine-core/p-942fa145.system.entry.js +2 -0
- package/dist/pine-core/p-942fa145.system.entry.js.map +1 -0
- package/dist/pine-core/{p-e045e337.system.entry.js → p-984578f8.system.entry.js} +2 -2
- package/dist/pine-core/{p-e281ac09.entry.js → p-99b5e1a5.entry.js} +2 -2
- package/dist/pine-core/{p-BFPxUBwH.system.js.map → p-B-pTdYoP.system.js.map} +1 -1
- package/dist/pine-core/p-B2gfQpwn.system.js.map +1 -0
- package/dist/pine-core/{p-Bd19LaTb.system.js → p-B4W0_y2p.system.js} +1 -1
- package/dist/pine-core/p-B4W0_y2p.system.js.map +1 -0
- package/dist/pine-core/{p-CDhmuxC9.system.js.map → p-B5JFBYFw.system.js.map} +1 -1
- package/dist/pine-core/p-B5LBNcOw.system.js.map +1 -0
- package/dist/pine-core/{p-B46WXJMn.system.js.map → p-BHZ6CSg4.system.js.map} +1 -1
- package/dist/pine-core/{p-Dlv6r83m.system.js.map → p-BO1OsmVU.system.js.map} +1 -1
- package/dist/pine-core/{p-Cj21y714.system.js.map → p-BOJnNd1p.system.js.map} +1 -1
- package/dist/pine-core/p-BVUeEWjl.system.js.map +1 -0
- package/dist/pine-core/{p-C94EgDFz.system.js → p-BhPuKJbQ.system.js} +2 -2
- package/dist/pine-core/p-BhPuKJbQ.system.js.map +1 -0
- package/dist/pine-core/p-Bo6FQRlR.system.js.map +1 -0
- package/dist/pine-core/{p-kMnJefdU.system.js.map → p-Bs9Nyvj2.system.js.map} +1 -1
- package/dist/pine-core/p-BsL2GDnH.system.js +1 -1
- package/dist/pine-core/p-C-oNYS10.system.js.map +1 -0
- package/dist/pine-core/p-C3ud771n.system.js.map +1 -0
- package/dist/pine-core/{p-C0hVtnK2.system.js.map → p-CDIHBBTC.system.js.map} +1 -1
- package/dist/pine-core/p-CLNi-hRD.system.js.map +1 -0
- package/dist/pine-core/{p-BjCOR1Nn.system.js.map → p-CV405yTU.system.js.map} +1 -1
- package/dist/pine-core/p-CWtKi9tV.system.js.map +1 -0
- package/dist/pine-core/{p-BoNavS-S.system.js.map → p-CcsZC7UR.system.js.map} +1 -1
- package/dist/pine-core/p-CiDIFl28.system.js.map +1 -0
- package/dist/pine-core/{p-BYgoXBct.system.js.map → p-Cj2r1nL6.system.js.map} +1 -1
- package/dist/pine-core/{p-w3zTyPF1.system.js.map → p-CnPERKGo.system.js.map} +1 -1
- package/dist/pine-core/p-CsM74dxm.system.js.map +1 -0
- package/dist/pine-core/{p-CFcYB49C.system.js.map → p-CtAVdPaE.system.js.map} +1 -1
- package/dist/pine-core/{p-qXPbJ8Ls.system.js.map → p-CzKqvFNN.system.js.map} +1 -1
- package/dist/pine-core/{p-CmTz2SvK.system.js.map → p-D-4Xbxlj.system.js.map} +1 -1
- package/dist/pine-core/{p-BVNW4NmT.system.js.map → p-D5vuiRx2.system.js.map} +1 -1
- package/dist/pine-core/p-D8DRYw9w.system.js.map +1 -0
- package/dist/pine-core/{p-DVVPJPOu.system.js.map → p-D9LPgNmN.system.js.map} +1 -1
- package/dist/pine-core/{p-DY5LpFEG.system.js.map → p-DEsea81X.system.js.map} +1 -1
- package/dist/pine-core/p-DKSZziVY.system.js.map +1 -0
- package/dist/pine-core/{p-CLIVqKy5.system.js.map → p-DN9puCWI.system.js.map} +1 -1
- package/dist/pine-core/{p-C0cdB2AV.system.js.map → p-DS7q5AvX.system.js.map} +1 -1
- package/dist/pine-core/{p-BSINexOf.system.js.map → p-DV_GadHU.system.js.map} +1 -1
- package/dist/pine-core/{p-BgcVBzVE.system.js.map → p-DbVkYdnF.system.js.map} +1 -1
- package/dist/pine-core/{p-eKz-xVcI.system.js.map → p-Derxa-nn.system.js.map} +1 -1
- package/dist/pine-core/{p-BW-n3jjz.system.js.map → p-DgOMN0Ur.system.js.map} +1 -1
- package/dist/pine-core/p-DiJV28pi.system.js.map +1 -0
- package/dist/pine-core/p-DkabwBZT.js +2 -0
- package/dist/pine-core/p-DkabwBZT.js.map +1 -0
- package/dist/pine-core/p-DyQ_s5MV.system.js.map +1 -0
- package/dist/pine-core/p-HBgo7i_E.system.js.map +1 -0
- package/dist/pine-core/{p-BUZBNCHp.system.js.map → p-M2Hhmwex.system.js.map} +1 -1
- package/dist/pine-core/p-PkSWq78_.system.js.map +1 -0
- package/dist/pine-core/{p-mVZRKoXd.js → p-_4gljHh-.js} +1 -1
- package/dist/pine-core/p-_4gljHh-.js.map +1 -0
- package/dist/pine-core/{p-1995a0f8.system.entry.js → p-a2572675.system.entry.js} +2 -2
- package/dist/pine-core/{p-85073252.system.entry.js → p-a394645a.system.entry.js} +2 -2
- package/dist/pine-core/p-a52b1413.entry.js +2 -0
- package/dist/pine-core/p-a52b1413.entry.js.map +1 -0
- package/dist/pine-core/{p-dae339c3.entry.js → p-abec6606.entry.js} +2 -2
- package/dist/pine-core/p-b2796d3c.system.entry.js +2 -0
- package/dist/pine-core/p-b2796d3c.system.entry.js.map +1 -0
- package/dist/pine-core/{p-5db706e1.entry.js → p-b3d05184.entry.js} +2 -2
- package/dist/pine-core/{p-b902f535.entry.js → p-b7ba6316.entry.js} +2 -2
- package/dist/pine-core/p-b9c13f99.entry.js +2 -0
- package/dist/pine-core/p-b9c13f99.entry.js.map +1 -0
- package/dist/pine-core/{p-14ca569b.entry.js → p-bcc4edaa.entry.js} +2 -2
- package/dist/pine-core/{p-1178485a.system.entry.js → p-bd04212c.system.entry.js} +2 -2
- package/dist/pine-core/{p-1178485a.system.entry.js.map → p-bd04212c.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-9cdd57de.entry.js → p-c0f74199.entry.js} +2 -2
- package/dist/pine-core/{p-ed8c3064.system.entry.js → p-c1b0f921.system.entry.js} +2 -2
- package/dist/pine-core/{p-68de979e.entry.js → p-c4294be2.entry.js} +2 -2
- package/dist/pine-core/p-cd2cd116.entry.js +2 -0
- package/dist/pine-core/p-cd2cd116.entry.js.map +1 -0
- package/dist/pine-core/p-d1b222f5.entry.js +2 -0
- package/dist/pine-core/p-d1b222f5.entry.js.map +1 -0
- package/dist/pine-core/{p-7b6b354a.system.entry.js → p-d2ccda59.system.entry.js} +2 -2
- package/dist/pine-core/p-d6ac2862.system.entry.js +2 -0
- package/dist/pine-core/p-d6ac2862.system.entry.js.map +1 -0
- package/dist/pine-core/{p-040f3c92.system.entry.js → p-e09a3682.system.entry.js} +2 -2
- package/dist/pine-core/{p-792355e6.entry.js → p-e2dc81c0.entry.js} +2 -2
- package/dist/pine-core/p-e6d6e103.entry.js +2 -0
- package/dist/pine-core/p-e6d6e103.entry.js.map +1 -0
- package/dist/pine-core/{p-6c21bcb0.system.entry.js → p-e9d972db.system.entry.js} +2 -2
- package/dist/pine-core/p-e9d972db.system.entry.js.map +1 -0
- package/dist/pine-core/p-ef9ed75a.system.entry.js +2 -0
- package/dist/pine-core/p-ef9ed75a.system.entry.js.map +1 -0
- package/dist/pine-core/{p-4b59cae8.entry.js → p-f256dd8a.entry.js} +2 -2
- package/dist/pine-core/{p-4b59cae8.entry.js.map → p-f256dd8a.entry.js.map} +1 -1
- package/dist/pine-core/p-f2c807ac.entry.js +2 -0
- package/dist/pine-core/p-f2c807ac.entry.js.map +1 -0
- package/dist/pine-core/{p-eda0dc79.entry.js → p-f47133fd.entry.js} +2 -2
- package/dist/pine-core/p-f4fff209.system.entry.js +2 -0
- package/dist/pine-core/p-f4fff209.system.entry.js.map +1 -0
- package/dist/pine-core/p-f9e01886.system.entry.js +2 -0
- package/dist/pine-core/p-f9e01886.system.entry.js.map +1 -0
- package/dist/pine-core/{p-DhYEBuMP.system.js.map → p-xgOOHGQo.system.js.map} +1 -1
- package/dist/pine-core/p-yku4NLl6.system.js.map +1 -0
- package/dist/pine-core/pds-alert.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-box.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-checkbox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-copytext.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-dropdown-menu-item.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-dropdown-menu-separator.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-dropdown-menu.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-icon.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-link.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-modal-content.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal-footer.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal-header.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-popover.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-switch.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-text.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-toast.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-tooltip.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-alert/pds-alert.d.ts +39 -0
- package/dist/types/components/pds-box/pds-box.d.ts +6 -6
- package/dist/types/components/pds-button/pds-button.d.ts +8 -1
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +3 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +43 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.d.ts +13 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +33 -0
- package/dist/types/components/pds-link/pds-link.d.ts +5 -0
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +25 -0
- package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal.d.ts +72 -0
- package/dist/types/components/pds-modal/test/mock-pds-modal.d.ts +63 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +2 -0
- package/dist/types/components/pds-toast/pds-toast.d.ts +57 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +28 -3
- package/dist/types/components.d.ts +543 -16
- package/dist/types/utils/interfaces.d.ts +6 -0
- package/dist/types/utils/overlay.d.ts +3 -3
- package/dist/types/utils/utils.d.ts +1 -1
- package/hydrate/index.js +3093 -324
- package/hydrate/index.mjs +3093 -324
- package/package.json +6 -2
- package/dist/cjs/index-Br1YlNK2.js.map +0 -1
- package/dist/cjs/utils-CQKIgzWg.js.map +0 -1
- package/dist/esm/index-mVZRKoXd.js.map +0 -1
- package/dist/esm/utils-Dw9B1JDC.js.map +0 -1
- package/dist/esm-es5/index-mVZRKoXd.js.map +0 -1
- package/dist/esm-es5/utils-Dw9B1JDC.js +0 -2
- package/dist/esm-es5/utils-Dw9B1JDC.js.map +0 -1
- package/dist/pine-core/p-012c4d8b.entry.js +0 -2
- package/dist/pine-core/p-012c4d8b.entry.js.map +0 -1
- package/dist/pine-core/p-1d690915.entry.js +0 -2
- package/dist/pine-core/p-294f9b1f.entry.js +0 -2
- package/dist/pine-core/p-3be0323a.system.entry.js +0 -2
- package/dist/pine-core/p-3be0323a.system.entry.js.map +0 -1
- package/dist/pine-core/p-433c6687.system.entry.js +0 -2
- package/dist/pine-core/p-433c6687.system.entry.js.map +0 -1
- package/dist/pine-core/p-545ccff7.system.entry.js +0 -2
- package/dist/pine-core/p-545ccff7.system.entry.js.map +0 -1
- package/dist/pine-core/p-5c9e1a3d.system.entry.js +0 -2
- package/dist/pine-core/p-5c9e1a3d.system.entry.js.map +0 -1
- package/dist/pine-core/p-6c21bcb0.system.entry.js.map +0 -1
- package/dist/pine-core/p-722989ee.entry.js +0 -2
- package/dist/pine-core/p-722989ee.entry.js.map +0 -1
- package/dist/pine-core/p-768e754e.system.entry.js +0 -2
- package/dist/pine-core/p-768e754e.system.entry.js.map +0 -1
- package/dist/pine-core/p-953f619f.system.entry.js +0 -2
- package/dist/pine-core/p-9d0c1b2e.system.entry.js +0 -2
- package/dist/pine-core/p-BBpt-9kK.system.js.map +0 -1
- package/dist/pine-core/p-BUD-iaLL.system.js.map +0 -1
- package/dist/pine-core/p-Bd19LaTb.system.js.map +0 -1
- package/dist/pine-core/p-C94EgDFz.system.js.map +0 -1
- package/dist/pine-core/p-CIzJqNxZ.system.js.map +0 -1
- package/dist/pine-core/p-CbNKHcsJ.system.js.map +0 -1
- package/dist/pine-core/p-CdkqpuKd.system.js.map +0 -1
- package/dist/pine-core/p-Chrs_Qxi.system.js.map +0 -1
- package/dist/pine-core/p-DhwO1z4v.system.js.map +0 -1
- package/dist/pine-core/p-Dw9B1JDC.js +0 -2
- package/dist/pine-core/p-Dw9B1JDC.js.map +0 -1
- package/dist/pine-core/p-a5587332.entry.js.map +0 -1
- package/dist/pine-core/p-aa955b03.entry.js +0 -2
- package/dist/pine-core/p-aa955b03.entry.js.map +0 -1
- package/dist/pine-core/p-amsdFwC6.system.js.map +0 -1
- package/dist/pine-core/p-b41dee6f.system.entry.js +0 -2
- package/dist/pine-core/p-b41dee6f.system.entry.js.map +0 -1
- package/dist/pine-core/p-d5838288.entry.js +0 -2
- package/dist/pine-core/p-e7bf0be9.entry.js +0 -2
- package/dist/pine-core/p-e7bf0be9.entry.js.map +0 -1
- package/dist/pine-core/p-f1156360.entry.js +0 -2
- package/dist/pine-core/p-f1156360.entry.js.map +0 -1
- package/dist/pine-core/p-f4898d4f.entry.js +0 -2
- package/dist/pine-core/p-f4898d4f.entry.js.map +0 -1
- package/dist/pine-core/p-mVZRKoXd.js.map +0 -1
- /package/dist/pine-core/{p-ad69e5f9.system.entry.js.map → p-0069abf8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a14c8ab4.system.entry.js.map → p-03d8cb4c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2ab26d3d.system.entry.js.map → p-04df41d7.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0486ad57.entry.js.map → p-0572825b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d2110923.system.entry.js.map → p-111e7da2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1d690915.entry.js.map → p-1224c874.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b2bbc362.entry.js.map → p-146fcd44.entry.js.map} +0 -0
- /package/dist/pine-core/{p-abcce8af.entry.js.map → p-17d3fa8b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e4ea5041.system.entry.js.map → p-1eec6bea.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-294f9b1f.entry.js.map → p-21c3aaeb.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5c396e75.entry.js.map → p-24607f93.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c0f0b368.system.entry.js.map → p-30142a25.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-8305cd4d.entry.js.map → p-367e188f.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6147b1ea.system.entry.js.map → p-3798a631.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3fdbda99.system.entry.js.map → p-3f82ac77.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-42f1190a.system.entry.js.map → p-48e76945.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b9f99fc9.entry.js.map → p-4ff0838c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-820faa91.system.entry.js.map → p-596e0292.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-598ade79.entry.js.map → p-5e1e7762.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d0780ca1.system.entry.js.map → p-6a2296e6.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b68cb43d.system.entry.js.map → p-71265b2a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-98181fa8.system.entry.js.map → p-730221a8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-91dadcbe.entry.js.map → p-742d4490.entry.js.map} +0 -0
- /package/dist/pine-core/{p-950427b2.entry.js.map → p-77c3a10d.entry.js.map} +0 -0
- /package/dist/pine-core/{p-fed4c0c0.system.entry.js.map → p-78cb1c40.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1d92261f.system.entry.js.map → p-78fb945e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-13b9ed06.system.entry.js.map → p-7ff213bb.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9e9d3a2b.entry.js.map → p-8023086c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-953f619f.system.entry.js.map → p-83252078.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-bedddd53.entry.js.map → p-833f08f3.entry.js.map} +0 -0
- /package/dist/pine-core/{p-12bee2e5.entry.js.map → p-86d388a2.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e045e337.system.entry.js.map → p-984578f8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e281ac09.entry.js.map → p-99b5e1a5.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1995a0f8.system.entry.js.map → p-a2572675.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-85073252.system.entry.js.map → p-a394645a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-dae339c3.entry.js.map → p-abec6606.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5db706e1.entry.js.map → p-b3d05184.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b902f535.entry.js.map → p-b7ba6316.entry.js.map} +0 -0
- /package/dist/pine-core/{p-14ca569b.entry.js.map → p-bcc4edaa.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9cdd57de.entry.js.map → p-c0f74199.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ed8c3064.system.entry.js.map → p-c1b0f921.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-68de979e.entry.js.map → p-c4294be2.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7b6b354a.system.entry.js.map → p-d2ccda59.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-040f3c92.system.entry.js.map → p-e09a3682.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-792355e6.entry.js.map → p-e2dc81c0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-eda0dc79.entry.js.map → p-f47133fd.entry.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -3071,7 +3071,104 @@ var registerHost = (elm, cmpMeta) => {
|
|
|
3071
3071
|
};
|
|
3072
3072
|
var styles = /* @__PURE__ */ new Map();
|
|
3073
3073
|
|
|
3074
|
-
|
|
3074
|
+
const pdsModalCss$1 = ".pds-modal__backdrop{-ms-flex-align:start;align-items:flex-start;background-color:rgba(0, 0, 0, 0.4);border:0;display:-ms-flexbox;display:flex;height:100%;inset:0;-ms-flex-pack:center;justify-content:center;margin:0;max-height:100%;max-width:100%;opacity:0;padding:0;position:fixed;-webkit-transition:opacity 0.2s ease, visibility 0.2s ease;transition:opacity 0.2s ease, visibility 0.2s ease;visibility:hidden;width:100%;z-index:1000}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-modal__backdrop{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}}pds-modal .pds-modal__backdrop{z-index:1001}.pds-modal__backdrop::-webkit-backdrop{background:transparent}.pds-modal__backdrop::-ms-backdrop{background:transparent}.pds-modal__backdrop::backdrop{background:transparent}.pds-modal__backdrop.open{opacity:1;visibility:visible}.pds-modal{background:var(--pine-color-background-container);border-radius:var(--pine-dimension-sm);-webkit-box-shadow:var(--pine-box-shadow-400);box-shadow:var(--pine-box-shadow-400);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:var(--pine-dimension-md);max-height:calc(100vh - (6vh + 96px));width:100%}@media (min-width: 992px){.pds-modal{-webkit-margin-before:6vh;margin-block-start:6vh}}@media (min-width: 1200px){.pds-modal{-webkit-margin-before:8vh;margin-block-start:8vh}}.pds-modal--sm{max-width:520px}.pds-modal--md{max-width:700px}.pds-modal--lg{max-width:900px}.pds-modal--fullscreen{border-radius:0;height:100%;margin:0;max-height:100vh;max-width:100%}.pds-modal--fullscreen .pds-modal-content{-ms-flex:1;flex:1}";
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* Mock PdsModal component for testing purposes
|
|
3078
|
+
* This component mimics the real PdsModal but without using the Popover API
|
|
3079
|
+
*/
|
|
3080
|
+
class MockPdsModal {
|
|
3081
|
+
constructor(hostRef) {
|
|
3082
|
+
registerInstance(this, hostRef);
|
|
3083
|
+
this.pdsModalOpen = createEvent(this, "pdsModalOpen");
|
|
3084
|
+
this.pdsModalClose = createEvent(this, "pdsModalClose");
|
|
3085
|
+
this.pdsModalBackdropClick = createEvent(this, "pdsModalBackdropClick");
|
|
3086
|
+
/**
|
|
3087
|
+
* The size of the modal
|
|
3088
|
+
*/
|
|
3089
|
+
this.size = 'md';
|
|
3090
|
+
// Modal content is always scrollable by default
|
|
3091
|
+
/**
|
|
3092
|
+
* Whether the modal can be dismissed by clicking the backdrop
|
|
3093
|
+
*/
|
|
3094
|
+
this.backdropDismiss = true;
|
|
3095
|
+
// Native dialog element always closes on Escape key press, so no closeOnEsc property is needed
|
|
3096
|
+
/**
|
|
3097
|
+
* Whether the modal is open
|
|
3098
|
+
*/
|
|
3099
|
+
this.open = false;
|
|
3100
|
+
}
|
|
3101
|
+
/**
|
|
3102
|
+
* Shows the modal
|
|
3103
|
+
*/
|
|
3104
|
+
async showModal() {
|
|
3105
|
+
this.open = true;
|
|
3106
|
+
this.pdsModalOpen.emit();
|
|
3107
|
+
}
|
|
3108
|
+
/**
|
|
3109
|
+
* Hides the modal
|
|
3110
|
+
*/
|
|
3111
|
+
async hideModal() {
|
|
3112
|
+
this.open = false;
|
|
3113
|
+
this.pdsModalClose.emit();
|
|
3114
|
+
}
|
|
3115
|
+
/**
|
|
3116
|
+
* Listen for click events on the backdrop
|
|
3117
|
+
*/
|
|
3118
|
+
// Using direct method instead of @Listen to avoid ESLint warning
|
|
3119
|
+
handleBackdropClick(event) {
|
|
3120
|
+
const backdrop = this.el.querySelector('.pds-modal__backdrop');
|
|
3121
|
+
// Check if the click was directly on the backdrop (not on a child element)
|
|
3122
|
+
if (event.target === backdrop && this.backdropDismiss === true) {
|
|
3123
|
+
this.pdsModalBackdropClick.emit();
|
|
3124
|
+
this.hideModal();
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
/**
|
|
3128
|
+
* Listen for keydown events to handle Escape key
|
|
3129
|
+
* Native dialog element always closes on Escape key press
|
|
3130
|
+
*/
|
|
3131
|
+
// Using direct method instead of @Listen to avoid ESLint warning
|
|
3132
|
+
handleKeyDown(event) {
|
|
3133
|
+
if (event.key === 'Escape' && this.open === true) {
|
|
3134
|
+
this.hideModal();
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
componentDidLoad() {
|
|
3138
|
+
// No need to do anything in componentDidLoad for the mock
|
|
3139
|
+
}
|
|
3140
|
+
render() {
|
|
3141
|
+
const modalClasses = {
|
|
3142
|
+
'pds-modal': true,
|
|
3143
|
+
[`pds-modal--${this.size}`]: true,
|
|
3144
|
+
'pds-modal--scrollable': true, // Always scrollable by default
|
|
3145
|
+
};
|
|
3146
|
+
const backdropClasses = {
|
|
3147
|
+
'pds-modal__backdrop': true,
|
|
3148
|
+
'open': this.open,
|
|
3149
|
+
};
|
|
3150
|
+
return (hAsync("div", { key: 'fb141b585e21257f4e2b1e189211ffd8fdbf5f21', class: backdropClasses }, hAsync("div", { key: '2431265c962c17042b79e59e8799159c0af79bba', class: modalClasses, role: "dialog", "aria-modal": "true", "aria-labelledby": this.componentId ? `${this.componentId}-heading` : null }, hAsync("div", { key: '122d233ca19497ccd8541474343442391a9fd60b', class: "pds-modal__header" }, hAsync("slot", { key: 'abb92bd56f45ac7a1007649952eb6351dbe1193d', name: "header" })), hAsync("div", { key: 'fb096821bccb813311f3047bb33a81374808a99d', class: "pds-modal-content" }, hAsync("slot", { key: '79400555ec3420db6eda65f12b90060b5507c96e' })), hAsync("div", { key: '60462c314237b4b573c222df26aa41073437f298', class: "pds-modal__footer" }, hAsync("slot", { key: '9253219fc90477c4c86df974f4a6a196f693e548', name: "footer" })))));
|
|
3151
|
+
}
|
|
3152
|
+
get el() { return getElement(this); }
|
|
3153
|
+
static get style() { return pdsModalCss$1; }
|
|
3154
|
+
static get cmpMeta() { return {
|
|
3155
|
+
"$flags$": 4,
|
|
3156
|
+
"$tagName$": "mock-pds-modal",
|
|
3157
|
+
"$members$": {
|
|
3158
|
+
"componentId": [1, "component-id"],
|
|
3159
|
+
"size": [1],
|
|
3160
|
+
"backdropDismiss": [4, "backdrop-dismiss"],
|
|
3161
|
+
"open": [1028],
|
|
3162
|
+
"showModal": [64],
|
|
3163
|
+
"hideModal": [64]
|
|
3164
|
+
},
|
|
3165
|
+
"$listeners$": undefined,
|
|
3166
|
+
"$lazyBundleId$": "-",
|
|
3167
|
+
"$attrsToReflect$": []
|
|
3168
|
+
}; }
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
/* pds-icons v9.4.3, ES Modules */
|
|
3075
3172
|
|
|
3076
3173
|
const caretDown = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' class='pdsicon'><path fill-rule='evenodd' d='M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414'/></svg>";
|
|
3077
3174
|
const checkCircleFilled = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' class='pdsicon'><path fill-rule='evenodd' d='M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1m5.207 8.707a1 1 0 0 0-1.414-1.414L10.5 13.586l-2.293-2.293a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0z'/></svg>";
|
|
@@ -3137,6 +3234,82 @@ class PdsAccordion {
|
|
|
3137
3234
|
}; }
|
|
3138
3235
|
}
|
|
3139
3236
|
|
|
3237
|
+
const pdsAlertTokensCss = ":host{--pine-alert-color-background:var(--pine-color-grey-150);--pine-alert-color-border:var(--pine-color-grey-300);--pine-alert-color-dismiss:var(--pine-color-grey-900);--pine-alert-color-dismiss-hover:var(--pine-color-grey-300);--pine-alert-color-icon:var(--pine-color-grey-700);--pine-alert-color-text:var(--pine-color-grey-950);--pine-alert-color-danger-background:var(--pine-color-red-150);--pine-alert-color-danger-border:var(--pine-color-red-300);--pine-alert-color-danger-dismiss:var(--pine-color-red-900);--pine-alert-color-danger-dismiss-hover:var(--pine-color-red-300);--pine-alert-color-danger-icon:var(--pine-color-red-700);--pine-alert-color-danger-text:var(--pine-color-red-950);--pine-alert-color-info-background:var(--pine-color-blue-150);--pine-alert-color-info-border:var(--pine-color-blue-300);--pine-alert-color-info-dismiss:var(--pine-color-blue-900);--pine-alert-color-info-dismiss-hover:var(--pine-color-blue-300);--pine-alert-color-info-icon:var(--pine-color-blue-700);--pine-alert-color-info-text:var(--pine-color-blue-950);--pine-alert-color-success-background:var(--pine-color-green-150);--pine-alert-color-success-border:var(--pine-color-green-300);--pine-alert-color-success-dismiss:var(--pine-color-green-900);--pine-alert-color-success-dismiss-hover:var(--pine-color-green-300);--pine-alert-color-success-icon:var(--pine-color-green-700);--pine-alert-color-success-text:var(--pine-color-green-950);--pine-alert-color-warning-background:var(--pine-color-yellow-150);--pine-alert-color-warning-border:var(--pine-color-yellow-300);--pine-alert-color-warning-dismiss:var(--pine-color-yellow-900);--pine-alert-color-warning-dismiss-hover:var(--pine-color-yellow-300);--pine-alert-color-warning-icon:var(--pine-color-yellow-700);--pine-alert-color-warning-text:var(--pine-color-yellow-950)}";
|
|
3238
|
+
|
|
3239
|
+
const pdsAlertCss = ":host{display:block;line-height:1;width:100%}.pds-alert__container{--pds-alert-icon-size:var(--pine-dimension-sm);--pds-alert-border-dismiss-outline:2px solid var(--pds-alert-color-dismiss);--pds-alert-background:var(--pine-alert-color-background);--pds-alert-border-color:var(--pine-alert-color-border);--pds-alert-color-icon:var(--pine-alert-color-icon);--pds-alert-color-text:var(--pine-alert-color-text);--pds-alert-color-dismiss:var(--pine-alert-color-dismiss);--pds-alert-background-dismiss-hover:var(--pine-alert-color-dismiss-hover)}.pds-alert__container--danger{--pds-alert-background:var(--pine-alert-color-danger-background);--pds-alert-border-color:var(--pine-alert-color-danger-border);--pds-alert-color-icon:var(--pine-alert-color-danger-icon);--pds-alert-color-text:var(--pine-alert-color-danger-text);--pds-alert-color-dismiss:var(--pine-alert-color-danger-dismiss);--pds-alert-background-dismiss-hover:var(--pine-alert-color-danger-dismiss-hover)}.pds-alert__container--info{--pds-alert-background:var(--pine-alert-color-info-background);--pds-alert-border-color:var(--pine-alert-color-info-border);--pds-alert-color-icon:var(--pine-alert-color-info-icon);--pds-alert-color-text:var(--pine-alert-color-info-text);--pds-alert-color-dismiss:var(--pine-alert-color-info-dismiss);--pds-alert-background-dismiss-hover:var(--pine-alert-color-info-dismiss-hover)}.pds-alert__container--success{--pds-alert-background:var(--pine-alert-color-success-background);--pds-alert-border-color:var(--pine-alert-color-success-border);--pds-alert-color-icon:var(--pine-alert-color-success-icon);--pds-alert-color-text:var(--pine-alert-color-success-text);--pds-alert-color-dismiss:var(--pine-alert-color-success-dismiss);--pds-alert-background-dismiss-hover:var(--pine-alert-color-success-dismiss-hover)}.pds-alert__container--warning{--pds-alert-background:var(--pine-alert-color-warning-background);--pds-alert-border-color:var(--pine-alert-color-warning-border);--pds-alert-color-icon:var(--pine-alert-color-warning-icon);--pds-alert-color-text:var(--pine-alert-color-warning-text);--pds-alert-color-dismiss:var(--pine-alert-color-warning-dismiss);--pds-alert-background-dismiss-hover:var(--pine-alert-color-warning-dismiss-hover)}.pds-alert__icon{-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-alert__icon--small{-webkit-margin-before:calc(var(--pine-dimension-2xs) / 2);margin-block-start:calc(var(--pine-dimension-2xs) / 2)}.pds-alert__content-wrapper{-ms-flex:1;flex:1;min-width:0;overflow:hidden;width:100%}.pds-alert__dismiss{-ms-flex-align:center;align-items:center;background:none;border:0;border-radius:var(--pine-border-radius-full);cursor:pointer;display:-ms-flexbox;display:flex;height:var(--pine-dimension-250);-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-xs);width:var(--pine-dimension-250)}.pds-alert__dismiss:hover{background:var(--pds-alert-background-dismiss-hover);opacity:0.8}.pds-alert__dismiss:focus-visible{outline:var(--pds-alert-border-dismiss-outline)}.pds-alert__description--small{-ms-flex:1 1 auto;flex:1 1 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-alert__actions{-webkit-margin-before:var(--pine-dimension-sm);margin-block-start:var(--pine-dimension-sm)}.pds-alert__actions--small{-ms-flex-negative:0;flex-shrink:0;-webkit-margin-start:auto;margin-inline-start:auto;white-space:nowrap}";
|
|
3240
|
+
|
|
3241
|
+
/**
|
|
3242
|
+
* @slot actions - Slot for alert actions.
|
|
3243
|
+
*/
|
|
3244
|
+
class PdsAlert {
|
|
3245
|
+
constructor(hostRef) {
|
|
3246
|
+
registerInstance(this, hostRef);
|
|
3247
|
+
this.pdsAlertDismissClick = createEvent(this, "pdsAlertDismissClick");
|
|
3248
|
+
/**
|
|
3249
|
+
* If true, the alert is displayed in a smaller size and description text is truncated. Heading is not displayed.
|
|
3250
|
+
*/
|
|
3251
|
+
this.small = false;
|
|
3252
|
+
/**
|
|
3253
|
+
* If true, shows the dismiss button. If false, the dismiss button is hidden.
|
|
3254
|
+
* @defaultValue false
|
|
3255
|
+
*/
|
|
3256
|
+
this.dismissible = false;
|
|
3257
|
+
/**
|
|
3258
|
+
* Sets the style variant of the alert.
|
|
3259
|
+
* @defaultValue 'default'
|
|
3260
|
+
*/
|
|
3261
|
+
this.variant = 'default';
|
|
3262
|
+
this.hasActionsContent = false;
|
|
3263
|
+
this.handleCloseClick = () => {
|
|
3264
|
+
this.pdsAlertDismissClick.emit();
|
|
3265
|
+
};
|
|
3266
|
+
}
|
|
3267
|
+
componentWillRender() {
|
|
3268
|
+
// Check if the actions slot has any content.
|
|
3269
|
+
// If not, hide the actions container to prevent empty space.
|
|
3270
|
+
const actionsSlot = this.el.querySelector('[slot="actions"]');
|
|
3271
|
+
this.hasActionsContent = !!actionsSlot;
|
|
3272
|
+
}
|
|
3273
|
+
renderActions(isSmall) {
|
|
3274
|
+
return (hAsync("pds-box", { class: isSmall ? "pds-alert__actions--small" : "pds-alert__actions", gap: "sm", flex: isSmall ? "none" : undefined, "align-items": isSmall ? undefined : "center" }, hAsync("slot", { name: "actions" })));
|
|
3275
|
+
}
|
|
3276
|
+
renderContent() {
|
|
3277
|
+
if (this.small) {
|
|
3278
|
+
return (hAsync("pds-box", { display: "flex", gap: "md", "align-items": "center" }, hAsync("pds-text", { truncate: this.small, class: "pds-alert__description--small", color: "var(--pds-alert-color-text)", tag: "p" }, hAsync("slot", null)), this.hasActionsContent && this.renderActions(true)));
|
|
3279
|
+
}
|
|
3280
|
+
return (hAsync("div", null, hAsync("pds-text", { class: "pds-alert__description", color: "var(--pds-alert-color-text)", tag: "p" }, hAsync("slot", null)), this.hasActionsContent && this.renderActions(false)));
|
|
3281
|
+
}
|
|
3282
|
+
render() {
|
|
3283
|
+
const iconMap = {
|
|
3284
|
+
danger: 'warning-filled',
|
|
3285
|
+
default: 'info-circle-filled',
|
|
3286
|
+
info: 'info-circle-filled',
|
|
3287
|
+
success: 'check-circle-filled',
|
|
3288
|
+
warning: 'info-circle-filled',
|
|
3289
|
+
};
|
|
3290
|
+
// Get the icon name based on the current variant
|
|
3291
|
+
const iconName = iconMap[this.variant] || iconMap.default;
|
|
3292
|
+
return (hAsync(Host, { key: 'ccb4b954c20b4fedfe1336737a412753bf3c78a2', class: "pds-alert", id: this.componentId, variant: this.variant }, hAsync("pds-box", { key: '6feafdc553ab9854542cb53035486a0caa1f3348', class: `pds-alert__container pds-alert__container--${this.variant}`, "background-color": "var(--pds-alert-background)", "border-color": "var(--pds-alert-border-color)", "border-radius": "md", border: true, display: "block", padding: "md" }, hAsync("pds-box", { key: '86b160e97ac4724434b09cd832f7cdc61834a520', gap: "sm", display: "flex" }, hAsync("pds-icon", { key: 'c2f61f894b3f63915259e298dd9d973b719880c9', class: `pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`, color: "var(--pds-alert-color-icon)", icon: iconName, size: "var(--pds-alert-icon-size)" }), hAsync("pds-box", { key: '07926a4d7d6a1795edd2055ce9ae3d853982fe98', class: "pds-alert__content-wrapper", direction: "column", gap: "xs", flex: "grow" }, this.heading && !this.small && (hAsync("pds-text", { key: '2267241b05890cb4b955cd5418b26f30abd0503c', class: "pds-alert__heading", color: "var(--pds-alert-color-text)", size: "h5", tag: "h3", weight: "medium" }, this.heading)), this.renderContent()), this.dismissible && (hAsync("button", { key: 'bdc435db71e60d9233e97821ea10012f509cae26', class: "pds-alert__dismiss", type: "button", "aria-label": "Dismiss alert", onClick: this.handleCloseClick }, hAsync("pds-icon", { key: '22f013acfafafa6c32da9aa696bef8a8d3c633c0', icon: "remove", size: "var(--pds-alert-icon-size)", "aria-hidden": "true", color: "var(--pds-alert-color-dismiss)" })))))));
|
|
3293
|
+
}
|
|
3294
|
+
get el() { return getElement(this); }
|
|
3295
|
+
static get style() { return pdsAlertTokensCss + pdsAlertCss; }
|
|
3296
|
+
static get cmpMeta() { return {
|
|
3297
|
+
"$flags$": 9,
|
|
3298
|
+
"$tagName$": "pds-alert",
|
|
3299
|
+
"$members$": {
|
|
3300
|
+
"componentId": [1, "component-id"],
|
|
3301
|
+
"heading": [1],
|
|
3302
|
+
"small": [4],
|
|
3303
|
+
"dismissible": [4],
|
|
3304
|
+
"variant": [1],
|
|
3305
|
+
"hasActionsContent": [32]
|
|
3306
|
+
},
|
|
3307
|
+
"$listeners$": undefined,
|
|
3308
|
+
"$lazyBundleId$": "-",
|
|
3309
|
+
"$attrsToReflect$": []
|
|
3310
|
+
}; }
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3140
3313
|
const pdsAvatarCss = ":host{display:inline-block}div{--color-background-container:var(--pine-color-mercury-050);-ms-flex-align:center;align-items:center;background-color:var(--color-background-container);border-radius:var(--border-radius-admin-round, var(--pine-border-radius-full));display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;position:relative}:host(.pds-avatar--admin) div{--border-radius-admin-round:var(--pine-dimension-150);border-radius:var(--border-radius-admin-round)}:host(.pds-avatar--has-image) div{background:transparent}@supports selector(:has){div:has(img){background-color:transparent}}.pds-avatar__button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:var(--pine-dimension-none);border-radius:var(--pine-border-radius-full);cursor:pointer;display:-ms-flexbox;display:flex;padding:var(--pine-dimension-none)}.pds-avatar__button:focus-visible{outline:var(--pine-outline-focus)}.pds-avatar__badge{background-color:var(--pine-color-background-container);border:var(--pine-border);border-color:var(--pine-color-secondary);border-radius:var(--pine-border-radius-round);inset-block-end:var(--pine-dimension-none);inset-inline-end:var(--pine-dimension-none);position:absolute}img{border-radius:var(--border-radius-admin-round, var(--pine-border-radius-full));height:100%;-o-object-fit:cover;object-fit:cover;width:100%}";
|
|
3141
3314
|
|
|
3142
3315
|
/**
|
|
@@ -3222,7 +3395,7 @@ class PdsAvatar {
|
|
|
3222
3395
|
}
|
|
3223
3396
|
}
|
|
3224
3397
|
render() {
|
|
3225
|
-
return (hAsync(Host, { key: '
|
|
3398
|
+
return (hAsync(Host, { key: 'c19584898e4613085f6e6b8e227e7181eb4c8f1b', id: this.componentId, class: Object.assign({}, this.classNames()) }, this.renderAvatar()));
|
|
3226
3399
|
}
|
|
3227
3400
|
static get style() { return pdsAvatarCss; }
|
|
3228
3401
|
static get cmpMeta() { return {
|
|
@@ -3294,8 +3467,8 @@ class PdsBox {
|
|
|
3294
3467
|
this.sizeLg == undefined &&
|
|
3295
3468
|
this.sizeXl == undefined ? 'pds-box' : ''}
|
|
3296
3469
|
`;
|
|
3297
|
-
const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign({}, (this.backgroundColor && { '--color-background-box': this.backgroundColor })), (this.borderColor && { '--color-border-box': this.borderColor })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-
|
|
3298
|
-
return (hAsync(Host, { key: '
|
|
3470
|
+
const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign({}, (this.backgroundColor && { '--color-background-box': this.backgroundColor })), (this.borderColor && { '--color-border-box': this.borderColor })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-width-box': this.minWidth }));
|
|
3471
|
+
return (hAsync(Host, { key: '5a16a73506e9322444b85626dc71dceacbfac263', class: boxClasses, style: boxInlineStyles }));
|
|
3299
3472
|
}
|
|
3300
3473
|
static get style() { return pdsBoxCss; }
|
|
3301
3474
|
static get cmpMeta() { return {
|
|
@@ -3363,11 +3536,11 @@ const debounce = (func, wait = 0) => {
|
|
|
3363
3536
|
timer = setTimeout(func, wait, ...args);
|
|
3364
3537
|
};
|
|
3365
3538
|
};
|
|
3366
|
-
const setColor = (color) => {
|
|
3539
|
+
const setColor = (color, customColors) => {
|
|
3367
3540
|
var _a;
|
|
3368
3541
|
if (!color)
|
|
3369
3542
|
return;
|
|
3370
|
-
const
|
|
3543
|
+
const defaultColors = {
|
|
3371
3544
|
primary: 'var(--pine-color-text-primary)',
|
|
3372
3545
|
secondary: 'var(--pine-color-text-secondary)',
|
|
3373
3546
|
neutral: 'var(--pine-color-text-neutral)',
|
|
@@ -3377,12 +3550,13 @@ const setColor = (color) => {
|
|
|
3377
3550
|
success: 'var(--pine-color-text-success)',
|
|
3378
3551
|
warning: 'var(--pine-color-text-warning)',
|
|
3379
3552
|
};
|
|
3553
|
+
const colors = customColors || defaultColors;
|
|
3380
3554
|
return {
|
|
3381
3555
|
'--color': (_a = colors[color]) !== null && _a !== void 0 ? _a : (color.startsWith('--') ? `var(${color})` : color)
|
|
3382
3556
|
};
|
|
3383
3557
|
};
|
|
3384
3558
|
|
|
3385
|
-
const pdsButtonCss = ":host{--button-dimension:40px;--color-border-default:transparent;--color-border-disabled:transparent;--color-border-focus:transparent;--color-border-hover:transparent;--button-loader-color:var(--color-text-default);display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}:host([full-width=true]){display:-ms-flexbox;display:flex;width:100%}:host([full-width=true]) button{-ms-flex-pack:center;justify-content:center;width:100%}:host([full-width=true]) .pds-button__content{-ms-flex-pack:center;justify-content:center;text-align:center}:host([loading=true]){cursor:wait;pointer-events:none}:host([disabled=true]){pointer-events:none}.pds-button{--pds-loader-color:var(--color-text-default);-ms-flex-align:center;align-items:center;background-color:var(--color-background-default);border:var(--pine-border);border-color:var(--color-border-default);border-radius:var(--pine-border-radius-full);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-text-default);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body-brand-label);letter-spacing:var(--pine-letter-spacing);min-height:var(--button-dimension);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);text-decoration:none}.pds-button pds-icon{color:currentColor;fill:currentColor
|
|
3559
|
+
const pdsButtonCss = ":host{--button-dimension:40px;--color-border-default:transparent;--color-border-disabled:transparent;--color-border-focus:transparent;--color-border-hover:transparent;--button-loader-color:var(--color-text-default);display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}:host([full-width=true]){display:-ms-flexbox;display:flex;width:100%}:host([full-width=true]) button{-ms-flex-pack:center;justify-content:center;width:100%}:host([full-width=true]) .pds-button__content{-ms-flex-pack:center;justify-content:center;text-align:center}:host([loading=true]){cursor:wait;pointer-events:none}:host([disabled=true]){pointer-events:none}.pds-button{--pds-loader-color:var(--color-text-default);-ms-flex-align:center;align-items:center;background-color:var(--color-background-default);border:var(--pine-border);border-color:var(--color-border-default);border-radius:var(--pine-border-radius-full);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-text-default);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body-brand-label);letter-spacing:var(--pine-letter-spacing);min-height:var(--button-dimension);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);text-decoration:none}.pds-button pds-icon{color:currentColor;fill:currentColor}.pds-button:hover{background-color:var(--color-background-hover);border-color:var(--color-border-hover)}.pds-button:focus-visible{border-color:var(--color-border-focus);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-button:disabled{background-color:var(--color-background-disabled);border-color:var(--color-border-disabled);color:var(--color-text-disabled);pointer-events:none}.pds-button--primary{--color-background-default:var(--pine-color-primary);--color-background-hover:var(--pine-color-primary-hover);--color-background-disabled:var(--pine-color-primary-disabled);--color-border-default:var(--pine-color-primary);--color-border-hover:var(--pine-color-primary-hover);--color-text-default:var(--pine-color-text-primary);--color-text-disabled:var(--pine-color-text-primary-disabled);--color-outline:var(--pine-color-focus-ring);--button-loader-color:var(--pine-color-text-primary)}.pds-button--accent{--color-background-default:var(--pine-color-accent);--color-background-hover:var(--pine-color-accent-hover);--color-background-disabled:var(--pine-color-accent-disabled);--color-border-default:var(--pine-color-accent);--color-border-hover:var(--pine-color-accent-hover);--color-text-default:var(--pine-color-text-primary);--color-text-disabled:var(--pine-color-text-accent-disabled);--color-outline:var(--pine-color-focus-ring);--button-loader-color:var(--pine-color-text-primary)}.pds-button--destructive{--color-background-default:var(--pine-color-danger);--color-background-hover:var(--pine-color-danger-hover);--color-background-disabled:var(--pine-color-danger-disabled);--color-border-default:var(--pine-color-danger);--color-border-hover:var(--pine-color-danger-hover);--color-text-default:var(--pine-color-text-primary);--color-text-disabled:var(--pine-color-text-danger-disabled);--color-outline:var(--pine-color-focus-ring-danger);--button-loader-color:var(--pine-color-text-primary)}.pds-button--destructive:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-button--secondary,.pds-button--disclosure{--color-background-default:var(--pine-color-secondary);--color-background-hover:var(--pine-color-secondary-hover);--color-background-disabled:var(--pine-color-secondary-disabled);--color-border-disabled:var(--pine-color-border-disabled);--color-border-focus:var(--pine-color-border);--color-border-hover:var(--pine-color-border-hover);--color-border-default:var(--pine-color-border);--color-text-default:var(--pine-color-text-secondary);--color-text-disabled:var(--pine-color-text-secondary-disabled);--color-outline:var(--pine-color-focus-ring);--button-loader-color:var(--pine-color-text-secondary)}.pds-button--secondary:hover,.pds-button--disclosure:hover{background-color:var(--pine-color-secondary-hover)}.pds-button--unstyled{--color-background-default:transparent;--color-background-hover:transparent;--color-background-disabled:transparent;--color-text-default:inherit;--button-loader-color:inherit;border-width:var(--pine-dimension-none);margin:var(--pine-dimension-none);min-height:auto;padding:var(--pine-dimension-none);width:inherit}.pds-button__content{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;gap:var(--pine-dimension-xs);position:relative;width:100%}.pds-button__icon{display:-ms-inline-flexbox;display:inline-flex}.pds-button__text{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex}.pds-button__icon--hidden,.pds-button__text--hidden{opacity:0}.pds-button__loader{height:var(--pine-dimension-250);left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:var(--pine-dimension-250)}.pds-button--loading{cursor:wait;pointer-events:none}.pds-button--loading .pds-button__loader pds-loader{--loader-color:var(--button-loader-color)}.pds-button--icon-only{-ms-flex-align:center;align-items:center;border-radius:var(--pine-border-radius-full);height:var(--button-dimension);-ms-flex-pack:center;justify-content:center;min-height:var(--button-dimension);min-width:var(--button-dimension);padding:var(--pine-dimension-xs);width:var(--button-dimension)}.pds-button--icon-only .pds-button__content{height:100%;-ms-flex-pack:center;justify-content:center;width:100%}.pds-button--icon-only .pds-button__text--hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";
|
|
3386
3560
|
|
|
3387
3561
|
/**
|
|
3388
3562
|
* @part button - Exposes the button element for styling.
|
|
@@ -3390,6 +3564,9 @@ const pdsButtonCss = ":host{--button-dimension:40px;--color-border-default:trans
|
|
|
3390
3564
|
* @part button-text - Exposes the button text for styling.
|
|
3391
3565
|
* @part caret - Exposes the caret icon component for styling. Appears only on the disclosure variant.
|
|
3392
3566
|
* @part icon - Exposes the icon component for styling.
|
|
3567
|
+
* @slot (default) - Button text.
|
|
3568
|
+
* @slot start - Content to display before the button text.
|
|
3569
|
+
* @slot end - Content to display after the button text.
|
|
3393
3570
|
*/
|
|
3394
3571
|
class PdsButton {
|
|
3395
3572
|
constructor(hostRef) {
|
|
@@ -3406,8 +3583,9 @@ class PdsButton {
|
|
|
3406
3583
|
*/
|
|
3407
3584
|
this.fullWidth = false;
|
|
3408
3585
|
/**
|
|
3409
|
-
* Displays
|
|
3586
|
+
* Displays a leading icon in the button. DEPRECATED.
|
|
3410
3587
|
* @defaultValue null
|
|
3588
|
+
* @deprecated Use `start` slot instead.
|
|
3411
3589
|
*/
|
|
3412
3590
|
this.icon = null;
|
|
3413
3591
|
/**
|
|
@@ -3466,6 +3644,33 @@ class PdsButton {
|
|
|
3466
3644
|
}
|
|
3467
3645
|
return classNames.join(' ');
|
|
3468
3646
|
}
|
|
3647
|
+
hasSlotContent(slotName) {
|
|
3648
|
+
const elements = this.el.querySelectorAll(`[slot="${slotName}"]`);
|
|
3649
|
+
return elements.length > 0;
|
|
3650
|
+
}
|
|
3651
|
+
renderStartContent() {
|
|
3652
|
+
const hasIcon = this.icon && this.variant !== 'disclosure';
|
|
3653
|
+
const hasStartSlot = this.hasSlotContent('start');
|
|
3654
|
+
if (Boolean(hasIcon)) {
|
|
3655
|
+
return (hAsync("pds-icon", { class: this.loading ? 'pds-button__icon--hidden' : '', name: this.icon, part: "icon", "aria-hidden": "true" }));
|
|
3656
|
+
}
|
|
3657
|
+
else if (Boolean(hasStartSlot)) {
|
|
3658
|
+
return hAsync("span", { class: `pds-button__icon ${this.loading ? 'pds-button__icon--hidden' : ''}` }, hAsync("slot", { name: "start" }));
|
|
3659
|
+
}
|
|
3660
|
+
return null;
|
|
3661
|
+
}
|
|
3662
|
+
renderEndContent() {
|
|
3663
|
+
if (this.iconOnly) {
|
|
3664
|
+
return null;
|
|
3665
|
+
}
|
|
3666
|
+
if (this.variant === 'disclosure') {
|
|
3667
|
+
return (hAsync("pds-icon", { class: this.loading ? 'pds-button__icon--hidden' : '', icon: caretDown, part: "caret", "aria-hidden": "true" }));
|
|
3668
|
+
}
|
|
3669
|
+
else if (this.hasSlotContent('end')) {
|
|
3670
|
+
return hAsync("span", { class: `pds-button__icon ${this.loading ? 'pds-button__icon--hidden' : ''}` }, hAsync("slot", { name: "end" }));
|
|
3671
|
+
}
|
|
3672
|
+
return null;
|
|
3673
|
+
}
|
|
3469
3674
|
render() {
|
|
3470
3675
|
// Common props for both button and anchor elements
|
|
3471
3676
|
const commonProps = {
|
|
@@ -3481,9 +3686,7 @@ class PdsButton {
|
|
|
3481
3686
|
const ContentElement = this.href ? 'a' : 'button';
|
|
3482
3687
|
// Hide text when loading or iconOnly is true
|
|
3483
3688
|
const hideText = this.loading || this.iconOnly;
|
|
3484
|
-
const content = (hAsync("div", { class: "pds-button__content", part: "button-content" }, this.
|
|
3485
|
-
hAsync("pds-icon", { class: this.loading ? 'pds-button__icon--hidden' : '', name: this.icon, part: "icon", "aria-hidden": "true" }), hAsync("span", { class: `pds-button__text ${hideText ? 'pds-button__text--hidden' : ''}`, part: "button-text" }, hAsync("slot", null)), this.loading && (hAsync("span", { class: "pds-button__loader" }, hAsync("pds-loader", { "is-loading": true, size: "var(--pine-font-size-body-2xl)", variant: "spinner" }, "Loading..."))), this.variant === 'disclosure' &&
|
|
3486
|
-
hAsync("pds-icon", { class: this.loading ? 'pds-button__icon--hidden' : '', icon: caretDown, part: "caret", "aria-hidden": "true" })));
|
|
3689
|
+
const content = (hAsync("div", { class: "pds-button__content", part: "button-content" }, this.renderStartContent(), hAsync("span", { class: `pds-button__text ${hideText ? 'pds-button__text--hidden' : ''}`, part: "button-text" }, hAsync("slot", null)), this.loading && (hAsync("span", { class: "pds-button__loader" }, hAsync("pds-loader", { "is-loading": true, size: "var(--pine-font-size-body-2xl)", variant: "spinner" }, "Loading..."))), this.renderEndContent()));
|
|
3487
3690
|
return (hAsync(Host, { "aria-disabled": this.disabled ? 'true' : null, id: this.componentId, onClick: this.handleClick, variant: this.variant }, hAsync(ContentElement, Object.assign({}, attributes()), content)));
|
|
3488
3691
|
}
|
|
3489
3692
|
get el() { return getElement(this); }
|
|
@@ -3539,6 +3742,87 @@ const isRequired = (target, component) => {
|
|
|
3539
3742
|
}
|
|
3540
3743
|
};
|
|
3541
3744
|
|
|
3745
|
+
/**
|
|
3746
|
+
* Inherit attributes from the host element
|
|
3747
|
+
* @param el - Host element
|
|
3748
|
+
* @param attributes - Array of attributes to inherit
|
|
3749
|
+
*/
|
|
3750
|
+
const inheritAttributes$1 = (el, attributes = []) => {
|
|
3751
|
+
const attributeObject = {};
|
|
3752
|
+
attributes.forEach((attr) => {
|
|
3753
|
+
if (el.hasAttribute(attr)) {
|
|
3754
|
+
const value = el.getAttribute(attr);
|
|
3755
|
+
if (value !== null) {
|
|
3756
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
3757
|
+
}
|
|
3758
|
+
el.removeAttribute(attr);
|
|
3759
|
+
}
|
|
3760
|
+
});
|
|
3761
|
+
return attributeObject;
|
|
3762
|
+
};
|
|
3763
|
+
/**
|
|
3764
|
+
* List of available ARIA attributes + `role`.
|
|
3765
|
+
* Removed deprecated attributes.
|
|
3766
|
+
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
|
|
3767
|
+
*/
|
|
3768
|
+
const ariaAttributes = [
|
|
3769
|
+
'role',
|
|
3770
|
+
'aria-activedescendant',
|
|
3771
|
+
'aria-atomic',
|
|
3772
|
+
'aria-autocomplete',
|
|
3773
|
+
'aria-braillelabel',
|
|
3774
|
+
'aria-brailleroledescription',
|
|
3775
|
+
'aria-busy',
|
|
3776
|
+
'aria-checked',
|
|
3777
|
+
'aria-colcount',
|
|
3778
|
+
'aria-colindex',
|
|
3779
|
+
'aria-colindextext',
|
|
3780
|
+
'aria-colspan',
|
|
3781
|
+
'aria-controls',
|
|
3782
|
+
'aria-current',
|
|
3783
|
+
'aria-describedby',
|
|
3784
|
+
'aria-description',
|
|
3785
|
+
'aria-details',
|
|
3786
|
+
'aria-disabled',
|
|
3787
|
+
'aria-errormessage',
|
|
3788
|
+
'aria-expanded',
|
|
3789
|
+
'aria-flowto',
|
|
3790
|
+
'aria-haspopup',
|
|
3791
|
+
'aria-hidden',
|
|
3792
|
+
'aria-invalid',
|
|
3793
|
+
'aria-keyshortcuts',
|
|
3794
|
+
'aria-label',
|
|
3795
|
+
'aria-labelledby',
|
|
3796
|
+
'aria-level',
|
|
3797
|
+
'aria-live',
|
|
3798
|
+
'aria-multiline',
|
|
3799
|
+
'aria-multiselectable',
|
|
3800
|
+
'aria-orientation',
|
|
3801
|
+
'aria-owns',
|
|
3802
|
+
'aria-placeholder',
|
|
3803
|
+
'aria-posinset',
|
|
3804
|
+
'aria-pressed',
|
|
3805
|
+
'aria-readonly',
|
|
3806
|
+
'aria-relevant',
|
|
3807
|
+
'aria-required',
|
|
3808
|
+
'aria-roledescription',
|
|
3809
|
+
'aria-rowcount',
|
|
3810
|
+
'aria-rowindex',
|
|
3811
|
+
'aria-rowindextext',
|
|
3812
|
+
'aria-rowspan',
|
|
3813
|
+
'aria-selected',
|
|
3814
|
+
'aria-setsize',
|
|
3815
|
+
'aria-sort',
|
|
3816
|
+
'aria-valuemax',
|
|
3817
|
+
'aria-valuemin',
|
|
3818
|
+
'aria-valuenow',
|
|
3819
|
+
'aria-valuetext',
|
|
3820
|
+
];
|
|
3821
|
+
const inheritAriaAttributes = (el, ignoreList) => {
|
|
3822
|
+
let attributesToInherit = ariaAttributes;
|
|
3823
|
+
return inheritAttributes$1(el, attributesToInherit);
|
|
3824
|
+
};
|
|
3825
|
+
|
|
3542
3826
|
const labelCss$5 = ":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)}";
|
|
3543
3827
|
|
|
3544
3828
|
const pdsCheckboxCss = ":host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}:host(.is-invalid) input{border-color:var(--pine-color-border-danger)}:host(.is-invalid) input:checked{background:var(--pine-color-danger)}:host(.is-invalid) input:checked:hover{background:var(--pine-color-danger-hover);border-color:var(--pine-color-border-danger-hover)}:host(.is-invalid) input:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) label,:host(.is-invalid) .pds-checkbox__message--error{color:var(--pine-color-text-message-danger)}:host(.is-indeterminate) input{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}:host(.is-indeterminate) input:hover{background:var(--pine-color-accent);border-color:var(--pine-color-accent-hover)}:host(.is-indeterminate) input::after{border:1px solid var(--pine-color-secondary);-webkit-border-after:var(--pine-border-width-none);border-block-end:var(--pine-border-width-none);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:\"\";display:block;height:7px;left:50%;position:absolute;top:50%;-webkit-transform:rotate(90deg) translate3d(-103%, 32%, 0);transform:rotate(90deg) translate3d(-103%, 32%, 0);width:4px}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-2xs);-ms-flex:none;flex:none;height:var(--pine-dimension-sm);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--pine-dimension-sm)}input:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input:checked::after{border:1px solid var(--pine-color-secondary);-webkit-border-before:var(--pine-border-width-none);border-block-start:var(--pine-border-width-none);-webkit-border-start:var(--pine-border-width-none);border-inline-start:var(--pine-border-width-none);content:\"\";display:block;height:7px;left:50%;position:absolute;top:50%;-webkit-transform:rotate(43deg) translate3d(-110%, -30%, 0);transform:rotate(43deg) translate3d(-110%, -30%, 0);width:4px}input:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input:disabled:checked{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled)}input:disabled:checked::after{border-color:var(--pine-color-grey-300)}input:disabled+label{cursor:not-allowed}input:disabled~.pds-checkbox__message{color:var(--pine-color-text-disabled)}input:focus-visible{outline:var(--pine-outline-focus)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-checkbox__message{color:var(--pine-color-text-message);-webkit-margin-before:6px;margin-block-start:6px;-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-checkbox__message--error{display:-ms-flexbox;display:flex;font-size:var(--pine-font-size-085);gap:var(--pine-dimension-050)}.pds-checkbox__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}";
|
|
@@ -3548,6 +3832,7 @@ class PdsCheckbox {
|
|
|
3548
3832
|
registerInstance(this, hostRef);
|
|
3549
3833
|
this.pdsCheckboxChange = createEvent(this, "pdsCheckboxChange");
|
|
3550
3834
|
this.pdsCheckboxInput = createEvent(this, "pdsCheckboxInput");
|
|
3835
|
+
this.inheritedAttributes = {};
|
|
3551
3836
|
/**
|
|
3552
3837
|
* It determines whether or not the checkbox is checked.
|
|
3553
3838
|
*/
|
|
@@ -3586,11 +3871,15 @@ class PdsCheckbox {
|
|
|
3586
3871
|
}
|
|
3587
3872
|
return classNames.join(' ');
|
|
3588
3873
|
}
|
|
3874
|
+
componentWillLoad() {
|
|
3875
|
+
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
3876
|
+
}
|
|
3589
3877
|
render() {
|
|
3590
|
-
return (hAsync(Host, { key: '
|
|
3591
|
-
hAsync("div", { key: '
|
|
3592
|
-
hAsync("div", { key: '
|
|
3878
|
+
return (hAsync(Host, { key: 'a60ffb7c96f1d15735f263cb55cd982fbfcbe729', class: this.classNames() }, hAsync("label", { key: '6ed2c8670cded5165761374362d9f1e9f386a4d2', htmlFor: this.componentId }, hAsync("input", Object.assign({ key: '0661b30a9af3bd8ee83b2f3ceb249810a78f19a5', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }, this.inheritedAttributes)), hAsync("span", { key: 'b16d78ead4da7ebdffb0f37127bdacf8b1538f86', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), this.helperMessage &&
|
|
3879
|
+
hAsync("div", { key: '78e88b11ba9e2759264e08ff0ce9e16c9cf67170', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
3880
|
+
hAsync("div", { key: '0ba7d2bd2b4f6c996eecdd103abe3fb6497e4376', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: '65a94316603638e5230de0644fc8ca60e9543b63', icon: danger, size: "small" }), this.errorMessage)));
|
|
3593
3881
|
}
|
|
3882
|
+
get el() { return getElement(this); }
|
|
3594
3883
|
static get watchers() { return {
|
|
3595
3884
|
"checked": ["updateIndeterminate"]
|
|
3596
3885
|
}; }
|
|
@@ -3672,7 +3961,7 @@ class PdsChip {
|
|
|
3672
3961
|
return chipContent;
|
|
3673
3962
|
}
|
|
3674
3963
|
render() {
|
|
3675
|
-
return (hAsync(Host, { key: '
|
|
3964
|
+
return (hAsync(Host, { key: 'b1987e434a5b9dcc4a5536660822bcb9c1f79e4f', class: this.classNames(), id: this.componentId }, this.setChipContent(), this.variant === 'tag' && (hAsync("button", { key: '8f658cd564e86297a9b988d6080135e6d612be36', class: "pds-chip__close", type: "button", onClick: this.handleCloseClick, "aria-label": "Remove" }, hAsync("pds-icon", { key: '32266c84697e0ffa3ff5d2e554cdf6b7e598d0e6', icon: remove, size: "12px" })))));
|
|
3676
3965
|
}
|
|
3677
3966
|
static get style() { return pdsChipTokensCss + pdsChipCss; }
|
|
3678
3967
|
static get cmpMeta() { return {
|
|
@@ -3691,7 +3980,7 @@ class PdsChip {
|
|
|
3691
3980
|
}; }
|
|
3692
3981
|
}
|
|
3693
3982
|
|
|
3694
|
-
const pdsCopytextCss = ":host(.pds-copytext){--copytext-color-background-hover:var(--pine-color-grey-200)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;background:var(--pine-color-secondary);border-radius:var(--pine-border-radius-full);border-width:var(--pine-dimension-none);display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-heading);font-size:var(--pine-font-size-body-md);font-weight:var(--pine-font-weight-body-medium);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);max-width:100%;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs)}:host(.pds-copytext) pds-button::part(button){-webkit-padding-end:calc(var(--pine-dimension-xs) / 2);padding-inline-end:calc(var(--pine-dimension-xs) / 2)}:host(.pds-copytext) pds-button::part(button):hover{background-color:var(--copytext-color-background-hover);color:var(--pine-color-text-secondary-hover)}:host(.pds-copytext) pds-button span{font-weight:var(--pine-font-weight-medium);-webkit-margin-end:var(--pine-dimension-xs);margin-inline-end:var(--pine-dimension-xs);white-space:nowrap}:host(.pds-copytext) pds-button :nth-child(2){-ms-flex-negative:0;flex-shrink:0}:host(.pds-copytext):host(.pds-copytext--bordered){border-width:var(--pine-dimension-none);padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button{padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered)::part(button):hover{background-color:transparent}:host(.pds-copytext):host(.pds-copytext--bordered) span{border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm);padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-sm)}:host(.pds-copytext):host(.pds-copytext--bordered) :hover span{border:var(--pine-border-hover)}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button{display:-ms-inline-flexbox;display:inline-flex;min-width:auto;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-text),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-text){-ms-flex-negative:1;flex-shrink:1;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button span,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{text-align:
|
|
3983
|
+
const pdsCopytextCss = ":host(.pds-copytext){--copytext-color-background-hover:var(--pine-color-grey-200)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;background:var(--pine-color-secondary);border-radius:var(--pine-border-radius-full);border-width:var(--pine-dimension-none);display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-heading);font-size:var(--pine-font-size-body-md);font-weight:var(--pine-font-weight-body-medium);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);max-width:100%;padding:var(--pine-dimension-2xs) var(--pine-dimension-xs)}:host(.pds-copytext) pds-button::part(button){-webkit-padding-end:calc(var(--pine-dimension-xs) / 2);padding-inline-end:calc(var(--pine-dimension-xs) / 2)}:host(.pds-copytext) pds-button::part(button):hover{background-color:var(--copytext-color-background-hover);color:var(--pine-color-text-secondary-hover)}:host(.pds-copytext) pds-button span{font-weight:var(--pine-font-weight-medium);-webkit-margin-end:var(--pine-dimension-xs);margin-inline-end:var(--pine-dimension-xs);white-space:nowrap}:host(.pds-copytext) pds-button :nth-child(2){-ms-flex-negative:0;flex-shrink:0}:host(.pds-copytext):host(.pds-copytext--bordered){border-width:var(--pine-dimension-none);padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button{padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered)::part(button):hover{background-color:transparent}:host(.pds-copytext):host(.pds-copytext--bordered) span{border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm);padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-sm)}:host(.pds-copytext):host(.pds-copytext--bordered) :hover span{border:var(--pine-border-hover)}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button{display:-ms-inline-flexbox;display:inline-flex;min-width:auto;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-text),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-text){-ms-flex-negative:1;flex-shrink:1;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button span,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{text-align:start;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button{-ms-flex-pack:justify;justify-content:space-between}:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{overflow:hidden;text-overflow:ellipsis}";
|
|
3695
3984
|
|
|
3696
3985
|
class PdsCopytext {
|
|
3697
3986
|
constructor(hostRef) {
|
|
@@ -3741,7 +4030,7 @@ class PdsCopytext {
|
|
|
3741
4030
|
return classNames.join(' ');
|
|
3742
4031
|
}
|
|
3743
4032
|
render() {
|
|
3744
|
-
return (hAsync(Host, { key: '
|
|
4033
|
+
return (hAsync(Host, { key: '46c38faeba9b70d2e510a4b6af08866577936478', class: this.classNames(), id: this.componentId }, hAsync("pds-button", { key: '6e28c11a9a7a57f4c256b0283b64ec655a897f65', type: "button", variant: "unstyled", onClick: this.handleClick }, hAsync("span", { key: '6818451171f85fd6ad63f07c69871082d3fcba4e' }, this.value), hAsync("pds-icon", { key: '05e683d7b28575d924d6af482e6ce4c3cfee3f05', icon: copy, size: "16px" }))));
|
|
3745
4034
|
}
|
|
3746
4035
|
static get style() { return pdsCopytextCss; }
|
|
3747
4036
|
static get cmpMeta() { return {
|
|
@@ -3783,7 +4072,7 @@ class PdsDivider {
|
|
|
3783
4072
|
return classNames.join(' ');
|
|
3784
4073
|
}
|
|
3785
4074
|
render() {
|
|
3786
|
-
return (hAsync(Host, { key: '
|
|
4075
|
+
return (hAsync(Host, { key: 'ee48ee45e0463abbd3cb7aa686f8d86928830ccb', id: this.componentId }, hAsync("hr", { key: '4af739f85e502a7d9bff1b3581c283cb6ee53a0e', class: this.classNames() })));
|
|
3787
4076
|
}
|
|
3788
4077
|
static get style() { return pdsDividerCss; }
|
|
3789
4078
|
static get cmpMeta() { return {
|
|
@@ -3800,59 +4089,1841 @@ class PdsDivider {
|
|
|
3800
4089
|
}; }
|
|
3801
4090
|
}
|
|
3802
4091
|
|
|
3803
|
-
const getName = (iconName, icon) => {
|
|
3804
|
-
if (!iconName && icon && !isSrc(icon)) {
|
|
3805
|
-
iconName = icon;
|
|
3806
|
-
}
|
|
3807
|
-
if (isStr(iconName)) {
|
|
3808
|
-
iconName = toLower(iconName);
|
|
3809
|
-
}
|
|
3810
|
-
if (!isStr(iconName) || iconName.trim() === '') {
|
|
3811
|
-
return null;
|
|
3812
|
-
}
|
|
3813
|
-
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
|
3814
|
-
if (invalidChars != '') {
|
|
3815
|
-
return null;
|
|
3816
|
-
}
|
|
3817
|
-
return iconName;
|
|
3818
|
-
};
|
|
3819
|
-
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
|
3820
|
-
const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
3821
|
-
const toLower = (val) => val.toLowerCase();
|
|
3822
4092
|
/**
|
|
3823
|
-
*
|
|
3824
|
-
*
|
|
3825
|
-
* the `title` attribute that developers set directly on `pds-input`. This
|
|
3826
|
-
* helper function should be called in componentWillLoad and assigned to a variable
|
|
3827
|
-
* that is later used in the render function.
|
|
3828
|
-
*
|
|
3829
|
-
* This does not need to be reactive as changing attributes on the host element
|
|
3830
|
-
* does not trigger a re-render.
|
|
4093
|
+
* Custom positioning reference element.
|
|
4094
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
3831
4095
|
*/
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
4096
|
+
|
|
4097
|
+
const min = Math.min;
|
|
4098
|
+
const max = Math.max;
|
|
4099
|
+
const round = Math.round;
|
|
4100
|
+
const createCoords = v => ({
|
|
4101
|
+
x: v,
|
|
4102
|
+
y: v
|
|
4103
|
+
});
|
|
4104
|
+
const oppositeSideMap = {
|
|
4105
|
+
left: 'right',
|
|
4106
|
+
right: 'left',
|
|
4107
|
+
bottom: 'top',
|
|
4108
|
+
top: 'bottom'
|
|
4109
|
+
};
|
|
4110
|
+
const oppositeAlignmentMap = {
|
|
4111
|
+
start: 'end',
|
|
4112
|
+
end: 'start'
|
|
3844
4113
|
};
|
|
4114
|
+
function clamp(start, value, end) {
|
|
4115
|
+
return max(start, min(value, end));
|
|
4116
|
+
}
|
|
4117
|
+
function evaluate(value, param) {
|
|
4118
|
+
return typeof value === 'function' ? value(param) : value;
|
|
4119
|
+
}
|
|
4120
|
+
function getSide(placement) {
|
|
4121
|
+
return placement.split('-')[0];
|
|
4122
|
+
}
|
|
4123
|
+
function getAlignment(placement) {
|
|
4124
|
+
return placement.split('-')[1];
|
|
4125
|
+
}
|
|
4126
|
+
function getOppositeAxis(axis) {
|
|
4127
|
+
return axis === 'x' ? 'y' : 'x';
|
|
4128
|
+
}
|
|
4129
|
+
function getAxisLength(axis) {
|
|
4130
|
+
return axis === 'y' ? 'height' : 'width';
|
|
4131
|
+
}
|
|
4132
|
+
function getSideAxis(placement) {
|
|
4133
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
4134
|
+
}
|
|
4135
|
+
function getAlignmentAxis(placement) {
|
|
4136
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
4137
|
+
}
|
|
4138
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
4139
|
+
if (rtl === void 0) {
|
|
4140
|
+
rtl = false;
|
|
4141
|
+
}
|
|
4142
|
+
const alignment = getAlignment(placement);
|
|
4143
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
4144
|
+
const length = getAxisLength(alignmentAxis);
|
|
4145
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
4146
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
4147
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
4148
|
+
}
|
|
4149
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
4150
|
+
}
|
|
4151
|
+
function getExpandedPlacements(placement) {
|
|
4152
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
4153
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
4154
|
+
}
|
|
4155
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
4156
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
4157
|
+
}
|
|
4158
|
+
function getSideList(side, isStart, rtl) {
|
|
4159
|
+
const lr = ['left', 'right'];
|
|
4160
|
+
const rl = ['right', 'left'];
|
|
4161
|
+
const tb = ['top', 'bottom'];
|
|
4162
|
+
const bt = ['bottom', 'top'];
|
|
4163
|
+
switch (side) {
|
|
4164
|
+
case 'top':
|
|
4165
|
+
case 'bottom':
|
|
4166
|
+
if (rtl) return isStart ? rl : lr;
|
|
4167
|
+
return isStart ? lr : rl;
|
|
4168
|
+
case 'left':
|
|
4169
|
+
case 'right':
|
|
4170
|
+
return isStart ? tb : bt;
|
|
4171
|
+
default:
|
|
4172
|
+
return [];
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
4176
|
+
const alignment = getAlignment(placement);
|
|
4177
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
4178
|
+
if (alignment) {
|
|
4179
|
+
list = list.map(side => side + "-" + alignment);
|
|
4180
|
+
if (flipAlignment) {
|
|
4181
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
return list;
|
|
4185
|
+
}
|
|
4186
|
+
function getOppositePlacement(placement) {
|
|
4187
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
4188
|
+
}
|
|
4189
|
+
function expandPaddingObject(padding) {
|
|
4190
|
+
return {
|
|
4191
|
+
top: 0,
|
|
4192
|
+
right: 0,
|
|
4193
|
+
bottom: 0,
|
|
4194
|
+
left: 0,
|
|
4195
|
+
...padding
|
|
4196
|
+
};
|
|
4197
|
+
}
|
|
4198
|
+
function getPaddingObject(padding) {
|
|
4199
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
4200
|
+
top: padding,
|
|
4201
|
+
right: padding,
|
|
4202
|
+
bottom: padding,
|
|
4203
|
+
left: padding
|
|
4204
|
+
};
|
|
4205
|
+
}
|
|
4206
|
+
function rectToClientRect(rect) {
|
|
4207
|
+
const {
|
|
4208
|
+
x,
|
|
4209
|
+
y,
|
|
4210
|
+
width,
|
|
4211
|
+
height
|
|
4212
|
+
} = rect;
|
|
4213
|
+
return {
|
|
4214
|
+
width,
|
|
4215
|
+
height,
|
|
4216
|
+
top: y,
|
|
4217
|
+
left: x,
|
|
4218
|
+
right: x + width,
|
|
4219
|
+
bottom: y + height,
|
|
4220
|
+
x,
|
|
4221
|
+
y
|
|
4222
|
+
};
|
|
4223
|
+
}
|
|
3845
4224
|
|
|
3846
|
-
|
|
4225
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
4226
|
+
let {
|
|
4227
|
+
reference,
|
|
4228
|
+
floating
|
|
4229
|
+
} = _ref;
|
|
4230
|
+
const sideAxis = getSideAxis(placement);
|
|
4231
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
4232
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
4233
|
+
const side = getSide(placement);
|
|
4234
|
+
const isVertical = sideAxis === 'y';
|
|
4235
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
4236
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
4237
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
4238
|
+
let coords;
|
|
4239
|
+
switch (side) {
|
|
4240
|
+
case 'top':
|
|
4241
|
+
coords = {
|
|
4242
|
+
x: commonX,
|
|
4243
|
+
y: reference.y - floating.height
|
|
4244
|
+
};
|
|
4245
|
+
break;
|
|
4246
|
+
case 'bottom':
|
|
4247
|
+
coords = {
|
|
4248
|
+
x: commonX,
|
|
4249
|
+
y: reference.y + reference.height
|
|
4250
|
+
};
|
|
4251
|
+
break;
|
|
4252
|
+
case 'right':
|
|
4253
|
+
coords = {
|
|
4254
|
+
x: reference.x + reference.width,
|
|
4255
|
+
y: commonY
|
|
4256
|
+
};
|
|
4257
|
+
break;
|
|
4258
|
+
case 'left':
|
|
4259
|
+
coords = {
|
|
4260
|
+
x: reference.x - floating.width,
|
|
4261
|
+
y: commonY
|
|
4262
|
+
};
|
|
4263
|
+
break;
|
|
4264
|
+
default:
|
|
4265
|
+
coords = {
|
|
4266
|
+
x: reference.x,
|
|
4267
|
+
y: reference.y
|
|
4268
|
+
};
|
|
4269
|
+
}
|
|
4270
|
+
switch (getAlignment(placement)) {
|
|
4271
|
+
case 'start':
|
|
4272
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
4273
|
+
break;
|
|
4274
|
+
case 'end':
|
|
4275
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
4276
|
+
break;
|
|
4277
|
+
}
|
|
4278
|
+
return coords;
|
|
4279
|
+
}
|
|
3847
4280
|
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
4281
|
+
/**
|
|
4282
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
4283
|
+
* next to a given reference element.
|
|
4284
|
+
*
|
|
4285
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
4286
|
+
* write one for the platform you are using Floating UI with.
|
|
4287
|
+
*/
|
|
4288
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
4289
|
+
const {
|
|
4290
|
+
placement = 'bottom',
|
|
4291
|
+
strategy = 'absolute',
|
|
4292
|
+
middleware = [],
|
|
4293
|
+
platform
|
|
4294
|
+
} = config;
|
|
4295
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
4296
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
4297
|
+
let rects = await platform.getElementRects({
|
|
4298
|
+
reference,
|
|
4299
|
+
floating,
|
|
4300
|
+
strategy
|
|
4301
|
+
});
|
|
4302
|
+
let {
|
|
4303
|
+
x,
|
|
4304
|
+
y
|
|
4305
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
4306
|
+
let statefulPlacement = placement;
|
|
4307
|
+
let middlewareData = {};
|
|
4308
|
+
let resetCount = 0;
|
|
4309
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
4310
|
+
const {
|
|
4311
|
+
name,
|
|
4312
|
+
fn
|
|
4313
|
+
} = validMiddleware[i];
|
|
4314
|
+
const {
|
|
4315
|
+
x: nextX,
|
|
4316
|
+
y: nextY,
|
|
4317
|
+
data,
|
|
4318
|
+
reset
|
|
4319
|
+
} = await fn({
|
|
4320
|
+
x,
|
|
4321
|
+
y,
|
|
4322
|
+
initialPlacement: placement,
|
|
4323
|
+
placement: statefulPlacement,
|
|
4324
|
+
strategy,
|
|
4325
|
+
middlewareData,
|
|
4326
|
+
rects,
|
|
4327
|
+
platform,
|
|
4328
|
+
elements: {
|
|
4329
|
+
reference,
|
|
4330
|
+
floating
|
|
4331
|
+
}
|
|
4332
|
+
});
|
|
4333
|
+
x = nextX != null ? nextX : x;
|
|
4334
|
+
y = nextY != null ? nextY : y;
|
|
4335
|
+
middlewareData = {
|
|
4336
|
+
...middlewareData,
|
|
4337
|
+
[name]: {
|
|
4338
|
+
...middlewareData[name],
|
|
4339
|
+
...data
|
|
4340
|
+
}
|
|
4341
|
+
};
|
|
4342
|
+
if (reset && resetCount <= 50) {
|
|
4343
|
+
resetCount++;
|
|
4344
|
+
if (typeof reset === 'object') {
|
|
4345
|
+
if (reset.placement) {
|
|
4346
|
+
statefulPlacement = reset.placement;
|
|
4347
|
+
}
|
|
4348
|
+
if (reset.rects) {
|
|
4349
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
4350
|
+
reference,
|
|
4351
|
+
floating,
|
|
4352
|
+
strategy
|
|
4353
|
+
}) : reset.rects;
|
|
4354
|
+
}
|
|
4355
|
+
({
|
|
4356
|
+
x,
|
|
4357
|
+
y
|
|
4358
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
4359
|
+
}
|
|
4360
|
+
i = -1;
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
return {
|
|
4364
|
+
x,
|
|
4365
|
+
y,
|
|
4366
|
+
placement: statefulPlacement,
|
|
4367
|
+
strategy,
|
|
4368
|
+
middlewareData
|
|
4369
|
+
};
|
|
4370
|
+
};
|
|
4371
|
+
|
|
4372
|
+
/**
|
|
4373
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
4374
|
+
* element is overflowing a given clipping boundary on each side.
|
|
4375
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
4376
|
+
* - negative = how many pixels left before it will overflow
|
|
4377
|
+
* - 0 = lies flush with the boundary
|
|
4378
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
4379
|
+
*/
|
|
4380
|
+
async function detectOverflow(state, options) {
|
|
4381
|
+
var _await$platform$isEle;
|
|
4382
|
+
if (options === void 0) {
|
|
4383
|
+
options = {};
|
|
4384
|
+
}
|
|
4385
|
+
const {
|
|
4386
|
+
x,
|
|
4387
|
+
y,
|
|
4388
|
+
platform,
|
|
4389
|
+
rects,
|
|
4390
|
+
elements,
|
|
4391
|
+
strategy
|
|
4392
|
+
} = state;
|
|
4393
|
+
const {
|
|
4394
|
+
boundary = 'clippingAncestors',
|
|
4395
|
+
rootBoundary = 'viewport',
|
|
4396
|
+
elementContext = 'floating',
|
|
4397
|
+
altBoundary = false,
|
|
4398
|
+
padding = 0
|
|
4399
|
+
} = evaluate(options, state);
|
|
4400
|
+
const paddingObject = getPaddingObject(padding);
|
|
4401
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
4402
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
4403
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
4404
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
4405
|
+
boundary,
|
|
4406
|
+
rootBoundary,
|
|
4407
|
+
strategy
|
|
4408
|
+
}));
|
|
4409
|
+
const rect = elementContext === 'floating' ? {
|
|
4410
|
+
x,
|
|
4411
|
+
y,
|
|
4412
|
+
width: rects.floating.width,
|
|
4413
|
+
height: rects.floating.height
|
|
4414
|
+
} : rects.reference;
|
|
4415
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
4416
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
4417
|
+
x: 1,
|
|
4418
|
+
y: 1
|
|
4419
|
+
} : {
|
|
4420
|
+
x: 1,
|
|
4421
|
+
y: 1
|
|
4422
|
+
};
|
|
4423
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4424
|
+
elements,
|
|
4425
|
+
rect,
|
|
4426
|
+
offsetParent,
|
|
4427
|
+
strategy
|
|
4428
|
+
}) : rect);
|
|
4429
|
+
return {
|
|
4430
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
4431
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
4432
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
4433
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
4434
|
+
};
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/**
|
|
4438
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
4439
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
4440
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
4441
|
+
* @see https://floating-ui.com/docs/flip
|
|
4442
|
+
*/
|
|
4443
|
+
const flip$1 = function (options) {
|
|
4444
|
+
if (options === void 0) {
|
|
4445
|
+
options = {};
|
|
4446
|
+
}
|
|
4447
|
+
return {
|
|
4448
|
+
name: 'flip',
|
|
4449
|
+
options,
|
|
4450
|
+
async fn(state) {
|
|
4451
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
4452
|
+
const {
|
|
4453
|
+
placement,
|
|
4454
|
+
middlewareData,
|
|
4455
|
+
rects,
|
|
4456
|
+
initialPlacement,
|
|
4457
|
+
platform,
|
|
4458
|
+
elements
|
|
4459
|
+
} = state;
|
|
4460
|
+
const {
|
|
4461
|
+
mainAxis: checkMainAxis = true,
|
|
4462
|
+
crossAxis: checkCrossAxis = true,
|
|
4463
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
4464
|
+
fallbackStrategy = 'bestFit',
|
|
4465
|
+
fallbackAxisSideDirection = 'none',
|
|
4466
|
+
flipAlignment = true,
|
|
4467
|
+
...detectOverflowOptions
|
|
4468
|
+
} = evaluate(options, state);
|
|
4469
|
+
|
|
4470
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
4471
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
4472
|
+
// work.
|
|
4473
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
4474
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
4475
|
+
return {};
|
|
4476
|
+
}
|
|
4477
|
+
const side = getSide(placement);
|
|
4478
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
4479
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
4480
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
4481
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
4482
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
4483
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
4484
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
4485
|
+
}
|
|
4486
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
4487
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
4488
|
+
const overflows = [];
|
|
4489
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
4490
|
+
if (checkMainAxis) {
|
|
4491
|
+
overflows.push(overflow[side]);
|
|
4492
|
+
}
|
|
4493
|
+
if (checkCrossAxis) {
|
|
4494
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
4495
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
4496
|
+
}
|
|
4497
|
+
overflowsData = [...overflowsData, {
|
|
4498
|
+
placement,
|
|
4499
|
+
overflows
|
|
4500
|
+
}];
|
|
4501
|
+
|
|
4502
|
+
// One or more sides is overflowing.
|
|
4503
|
+
if (!overflows.every(side => side <= 0)) {
|
|
4504
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
4505
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
4506
|
+
const nextPlacement = placements[nextIndex];
|
|
4507
|
+
if (nextPlacement) {
|
|
4508
|
+
var _overflowsData$;
|
|
4509
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
4510
|
+
const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0;
|
|
4511
|
+
if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) {
|
|
4512
|
+
// Try next placement and re-run the lifecycle.
|
|
4513
|
+
return {
|
|
4514
|
+
data: {
|
|
4515
|
+
index: nextIndex,
|
|
4516
|
+
overflows: overflowsData
|
|
4517
|
+
},
|
|
4518
|
+
reset: {
|
|
4519
|
+
placement: nextPlacement
|
|
4520
|
+
}
|
|
4521
|
+
};
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
4526
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
4527
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
4528
|
+
|
|
4529
|
+
// Otherwise fallback.
|
|
4530
|
+
if (!resetPlacement) {
|
|
4531
|
+
switch (fallbackStrategy) {
|
|
4532
|
+
case 'bestFit':
|
|
4533
|
+
{
|
|
4534
|
+
var _overflowsData$filter2;
|
|
4535
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
4536
|
+
if (hasFallbackAxisSideDirection) {
|
|
4537
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
4538
|
+
return currentSideAxis === initialSideAxis ||
|
|
4539
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
4540
|
+
// reading directions favoring greater width.
|
|
4541
|
+
currentSideAxis === 'y';
|
|
4542
|
+
}
|
|
4543
|
+
return true;
|
|
4544
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
4545
|
+
if (placement) {
|
|
4546
|
+
resetPlacement = placement;
|
|
4547
|
+
}
|
|
4548
|
+
break;
|
|
4549
|
+
}
|
|
4550
|
+
case 'initialPlacement':
|
|
4551
|
+
resetPlacement = initialPlacement;
|
|
4552
|
+
break;
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
4555
|
+
if (placement !== resetPlacement) {
|
|
4556
|
+
return {
|
|
4557
|
+
reset: {
|
|
4558
|
+
placement: resetPlacement
|
|
4559
|
+
}
|
|
4560
|
+
};
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
return {};
|
|
4564
|
+
}
|
|
4565
|
+
};
|
|
4566
|
+
};
|
|
4567
|
+
|
|
4568
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
4569
|
+
// Derivable.
|
|
4570
|
+
|
|
4571
|
+
async function convertValueToCoords(state, options) {
|
|
4572
|
+
const {
|
|
4573
|
+
placement,
|
|
4574
|
+
platform,
|
|
4575
|
+
elements
|
|
4576
|
+
} = state;
|
|
4577
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
4578
|
+
const side = getSide(placement);
|
|
4579
|
+
const alignment = getAlignment(placement);
|
|
4580
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
4581
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
4582
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
4583
|
+
const rawValue = evaluate(options, state);
|
|
4584
|
+
|
|
4585
|
+
// eslint-disable-next-line prefer-const
|
|
4586
|
+
let {
|
|
4587
|
+
mainAxis,
|
|
4588
|
+
crossAxis,
|
|
4589
|
+
alignmentAxis
|
|
4590
|
+
} = typeof rawValue === 'number' ? {
|
|
4591
|
+
mainAxis: rawValue,
|
|
4592
|
+
crossAxis: 0,
|
|
4593
|
+
alignmentAxis: null
|
|
4594
|
+
} : {
|
|
4595
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
4596
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
4597
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
4598
|
+
};
|
|
4599
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
4600
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
4601
|
+
}
|
|
4602
|
+
return isVertical ? {
|
|
4603
|
+
x: crossAxis * crossAxisMulti,
|
|
4604
|
+
y: mainAxis * mainAxisMulti
|
|
4605
|
+
} : {
|
|
4606
|
+
x: mainAxis * mainAxisMulti,
|
|
4607
|
+
y: crossAxis * crossAxisMulti
|
|
4608
|
+
};
|
|
4609
|
+
}
|
|
4610
|
+
|
|
4611
|
+
/**
|
|
4612
|
+
* Modifies the placement by translating the floating element along the
|
|
4613
|
+
* specified axes.
|
|
4614
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
4615
|
+
* object may be passed.
|
|
4616
|
+
* @see https://floating-ui.com/docs/offset
|
|
4617
|
+
*/
|
|
4618
|
+
const offset$1 = function (options) {
|
|
4619
|
+
if (options === void 0) {
|
|
4620
|
+
options = 0;
|
|
4621
|
+
}
|
|
4622
|
+
return {
|
|
4623
|
+
name: 'offset',
|
|
4624
|
+
options,
|
|
4625
|
+
async fn(state) {
|
|
4626
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
4627
|
+
const {
|
|
4628
|
+
x,
|
|
4629
|
+
y,
|
|
4630
|
+
placement,
|
|
4631
|
+
middlewareData
|
|
4632
|
+
} = state;
|
|
4633
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
4634
|
+
|
|
4635
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
4636
|
+
// then we don't need to change the positioning coordinates.
|
|
4637
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
4638
|
+
return {};
|
|
4639
|
+
}
|
|
4640
|
+
return {
|
|
4641
|
+
x: x + diffCoords.x,
|
|
4642
|
+
y: y + diffCoords.y,
|
|
4643
|
+
data: {
|
|
4644
|
+
...diffCoords,
|
|
4645
|
+
placement
|
|
4646
|
+
}
|
|
4647
|
+
};
|
|
4648
|
+
}
|
|
4649
|
+
};
|
|
4650
|
+
};
|
|
4651
|
+
|
|
4652
|
+
/**
|
|
4653
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
4654
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
4655
|
+
* @see https://floating-ui.com/docs/shift
|
|
4656
|
+
*/
|
|
4657
|
+
const shift$1 = function (options) {
|
|
4658
|
+
if (options === void 0) {
|
|
4659
|
+
options = {};
|
|
4660
|
+
}
|
|
4661
|
+
return {
|
|
4662
|
+
name: 'shift',
|
|
4663
|
+
options,
|
|
4664
|
+
async fn(state) {
|
|
4665
|
+
const {
|
|
4666
|
+
x,
|
|
4667
|
+
y,
|
|
4668
|
+
placement
|
|
4669
|
+
} = state;
|
|
4670
|
+
const {
|
|
4671
|
+
mainAxis: checkMainAxis = true,
|
|
4672
|
+
crossAxis: checkCrossAxis = false,
|
|
4673
|
+
limiter = {
|
|
4674
|
+
fn: _ref => {
|
|
4675
|
+
let {
|
|
4676
|
+
x,
|
|
4677
|
+
y
|
|
4678
|
+
} = _ref;
|
|
4679
|
+
return {
|
|
4680
|
+
x,
|
|
4681
|
+
y
|
|
4682
|
+
};
|
|
4683
|
+
}
|
|
4684
|
+
},
|
|
4685
|
+
...detectOverflowOptions
|
|
4686
|
+
} = evaluate(options, state);
|
|
4687
|
+
const coords = {
|
|
4688
|
+
x,
|
|
4689
|
+
y
|
|
4690
|
+
};
|
|
4691
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
4692
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
4693
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
4694
|
+
let mainAxisCoord = coords[mainAxis];
|
|
4695
|
+
let crossAxisCoord = coords[crossAxis];
|
|
4696
|
+
if (checkMainAxis) {
|
|
4697
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
4698
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
4699
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
4700
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
4701
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
4702
|
+
}
|
|
4703
|
+
if (checkCrossAxis) {
|
|
4704
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
4705
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
4706
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
4707
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
4708
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
4709
|
+
}
|
|
4710
|
+
const limitedCoords = limiter.fn({
|
|
4711
|
+
...state,
|
|
4712
|
+
[mainAxis]: mainAxisCoord,
|
|
4713
|
+
[crossAxis]: crossAxisCoord
|
|
4714
|
+
});
|
|
4715
|
+
return {
|
|
4716
|
+
...limitedCoords,
|
|
4717
|
+
data: {
|
|
4718
|
+
x: limitedCoords.x - x,
|
|
4719
|
+
y: limitedCoords.y - y,
|
|
4720
|
+
enabled: {
|
|
4721
|
+
[mainAxis]: checkMainAxis,
|
|
4722
|
+
[crossAxis]: checkCrossAxis
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4725
|
+
};
|
|
4726
|
+
}
|
|
4727
|
+
};
|
|
4728
|
+
};
|
|
4729
|
+
|
|
4730
|
+
function hasWindow() {
|
|
4731
|
+
return typeof window !== 'undefined';
|
|
4732
|
+
}
|
|
4733
|
+
function getNodeName(node) {
|
|
4734
|
+
if (isNode(node)) {
|
|
4735
|
+
return (node.nodeName || '').toLowerCase();
|
|
4736
|
+
}
|
|
4737
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
4738
|
+
// returning `#document` an infinite loop won't occur.
|
|
4739
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
4740
|
+
return '#document';
|
|
4741
|
+
}
|
|
4742
|
+
function getWindow(node) {
|
|
4743
|
+
var _node$ownerDocument;
|
|
4744
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
4745
|
+
}
|
|
4746
|
+
function getDocumentElement(node) {
|
|
4747
|
+
var _ref;
|
|
4748
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
4749
|
+
}
|
|
4750
|
+
function isNode(value) {
|
|
4751
|
+
if (!hasWindow()) {
|
|
4752
|
+
return false;
|
|
4753
|
+
}
|
|
4754
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
4755
|
+
}
|
|
4756
|
+
function isElement(value) {
|
|
4757
|
+
if (!hasWindow()) {
|
|
4758
|
+
return false;
|
|
4759
|
+
}
|
|
4760
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
4761
|
+
}
|
|
4762
|
+
function isHTMLElement(value) {
|
|
4763
|
+
if (!hasWindow()) {
|
|
4764
|
+
return false;
|
|
4765
|
+
}
|
|
4766
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
4767
|
+
}
|
|
4768
|
+
function isShadowRoot(value) {
|
|
4769
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
4770
|
+
return false;
|
|
4771
|
+
}
|
|
4772
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
4773
|
+
}
|
|
4774
|
+
function isOverflowElement(element) {
|
|
4775
|
+
const {
|
|
4776
|
+
overflow,
|
|
4777
|
+
overflowX,
|
|
4778
|
+
overflowY,
|
|
4779
|
+
display
|
|
4780
|
+
} = getComputedStyle$1(element);
|
|
4781
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
4782
|
+
}
|
|
4783
|
+
function isTableElement(element) {
|
|
4784
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
4785
|
+
}
|
|
4786
|
+
function isTopLayer(element) {
|
|
4787
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
4788
|
+
try {
|
|
4789
|
+
return element.matches(selector);
|
|
4790
|
+
} catch (e) {
|
|
4791
|
+
return false;
|
|
4792
|
+
}
|
|
4793
|
+
});
|
|
4794
|
+
}
|
|
4795
|
+
function isContainingBlock(elementOrCss) {
|
|
4796
|
+
const webkit = isWebKit();
|
|
4797
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
4798
|
+
|
|
4799
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
4800
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
4801
|
+
return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
4802
|
+
}
|
|
4803
|
+
function getContainingBlock(element) {
|
|
4804
|
+
let currentNode = getParentNode(element);
|
|
4805
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
4806
|
+
if (isContainingBlock(currentNode)) {
|
|
4807
|
+
return currentNode;
|
|
4808
|
+
} else if (isTopLayer(currentNode)) {
|
|
4809
|
+
return null;
|
|
4810
|
+
}
|
|
4811
|
+
currentNode = getParentNode(currentNode);
|
|
4812
|
+
}
|
|
4813
|
+
return null;
|
|
4814
|
+
}
|
|
4815
|
+
function isWebKit() {
|
|
4816
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
4817
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
4818
|
+
}
|
|
4819
|
+
function isLastTraversableNode(node) {
|
|
4820
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
4821
|
+
}
|
|
4822
|
+
function getComputedStyle$1(element) {
|
|
4823
|
+
return getWindow(element).getComputedStyle(element);
|
|
4824
|
+
}
|
|
4825
|
+
function getNodeScroll(element) {
|
|
4826
|
+
if (isElement(element)) {
|
|
4827
|
+
return {
|
|
4828
|
+
scrollLeft: element.scrollLeft,
|
|
4829
|
+
scrollTop: element.scrollTop
|
|
4830
|
+
};
|
|
4831
|
+
}
|
|
4832
|
+
return {
|
|
4833
|
+
scrollLeft: element.scrollX,
|
|
4834
|
+
scrollTop: element.scrollY
|
|
4835
|
+
};
|
|
4836
|
+
}
|
|
4837
|
+
function getParentNode(node) {
|
|
4838
|
+
if (getNodeName(node) === 'html') {
|
|
4839
|
+
return node;
|
|
4840
|
+
}
|
|
4841
|
+
const result =
|
|
4842
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
4843
|
+
node.assignedSlot ||
|
|
4844
|
+
// DOM Element detected.
|
|
4845
|
+
node.parentNode ||
|
|
4846
|
+
// ShadowRoot detected.
|
|
4847
|
+
isShadowRoot(node) && node.host ||
|
|
4848
|
+
// Fallback.
|
|
4849
|
+
getDocumentElement(node);
|
|
4850
|
+
return isShadowRoot(result) ? result.host : result;
|
|
4851
|
+
}
|
|
4852
|
+
function getNearestOverflowAncestor(node) {
|
|
4853
|
+
const parentNode = getParentNode(node);
|
|
4854
|
+
if (isLastTraversableNode(parentNode)) {
|
|
4855
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
4856
|
+
}
|
|
4857
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
4858
|
+
return parentNode;
|
|
4859
|
+
}
|
|
4860
|
+
return getNearestOverflowAncestor(parentNode);
|
|
4861
|
+
}
|
|
4862
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
4863
|
+
var _node$ownerDocument2;
|
|
4864
|
+
if (list === void 0) {
|
|
4865
|
+
list = [];
|
|
4866
|
+
}
|
|
4867
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
4868
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
4869
|
+
const win = getWindow(scrollableAncestor);
|
|
4870
|
+
if (isBody) {
|
|
4871
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], []);
|
|
4872
|
+
}
|
|
4873
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
|
|
4874
|
+
}
|
|
4875
|
+
function getFrameElement(win) {
|
|
4876
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
function getCssDimensions(element) {
|
|
4880
|
+
const css = getComputedStyle$1(element);
|
|
4881
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
4882
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
4883
|
+
let width = parseFloat(css.width) || 0;
|
|
4884
|
+
let height = parseFloat(css.height) || 0;
|
|
4885
|
+
const hasOffset = isHTMLElement(element);
|
|
4886
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
4887
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
4888
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
4889
|
+
if (shouldFallback) {
|
|
4890
|
+
width = offsetWidth;
|
|
4891
|
+
height = offsetHeight;
|
|
4892
|
+
}
|
|
4893
|
+
return {
|
|
4894
|
+
width,
|
|
4895
|
+
height,
|
|
4896
|
+
$: shouldFallback
|
|
4897
|
+
};
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4900
|
+
function unwrapElement(element) {
|
|
4901
|
+
return !isElement(element) ? element.contextElement : element;
|
|
4902
|
+
}
|
|
4903
|
+
|
|
4904
|
+
function getScale(element) {
|
|
4905
|
+
const domElement = unwrapElement(element);
|
|
4906
|
+
if (!isHTMLElement(domElement)) {
|
|
4907
|
+
return createCoords(1);
|
|
4908
|
+
}
|
|
4909
|
+
const rect = domElement.getBoundingClientRect();
|
|
4910
|
+
const {
|
|
4911
|
+
width,
|
|
4912
|
+
height,
|
|
4913
|
+
$
|
|
4914
|
+
} = getCssDimensions(domElement);
|
|
4915
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
4916
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
4917
|
+
|
|
4918
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
4919
|
+
|
|
4920
|
+
if (!x || !Number.isFinite(x)) {
|
|
4921
|
+
x = 1;
|
|
4922
|
+
}
|
|
4923
|
+
if (!y || !Number.isFinite(y)) {
|
|
4924
|
+
y = 1;
|
|
4925
|
+
}
|
|
4926
|
+
return {
|
|
4927
|
+
x,
|
|
4928
|
+
y
|
|
4929
|
+
};
|
|
4930
|
+
}
|
|
4931
|
+
|
|
4932
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
4933
|
+
function getVisualOffsets(element) {
|
|
4934
|
+
const win = getWindow(element);
|
|
4935
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
4936
|
+
return noOffsets;
|
|
4937
|
+
}
|
|
4938
|
+
return {
|
|
4939
|
+
x: win.visualViewport.offsetLeft,
|
|
4940
|
+
y: win.visualViewport.offsetTop
|
|
4941
|
+
};
|
|
4942
|
+
}
|
|
4943
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
4944
|
+
if (isFixed === void 0) {
|
|
4945
|
+
isFixed = false;
|
|
4946
|
+
}
|
|
4947
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
4948
|
+
return false;
|
|
4949
|
+
}
|
|
4950
|
+
return isFixed;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
4954
|
+
if (includeScale === void 0) {
|
|
4955
|
+
includeScale = false;
|
|
4956
|
+
}
|
|
4957
|
+
if (isFixedStrategy === void 0) {
|
|
4958
|
+
isFixedStrategy = false;
|
|
4959
|
+
}
|
|
4960
|
+
const clientRect = element.getBoundingClientRect();
|
|
4961
|
+
const domElement = unwrapElement(element);
|
|
4962
|
+
let scale = createCoords(1);
|
|
4963
|
+
if (includeScale) {
|
|
4964
|
+
if (offsetParent) {
|
|
4965
|
+
if (isElement(offsetParent)) {
|
|
4966
|
+
scale = getScale(offsetParent);
|
|
4967
|
+
}
|
|
4968
|
+
} else {
|
|
4969
|
+
scale = getScale(element);
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
4973
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
4974
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
4975
|
+
let width = clientRect.width / scale.x;
|
|
4976
|
+
let height = clientRect.height / scale.y;
|
|
4977
|
+
if (domElement) {
|
|
4978
|
+
const win = getWindow(domElement);
|
|
4979
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
4980
|
+
let currentWin = win;
|
|
4981
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
4982
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
4983
|
+
const iframeScale = getScale(currentIFrame);
|
|
4984
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
4985
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
4986
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
4987
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
4988
|
+
x *= iframeScale.x;
|
|
4989
|
+
y *= iframeScale.y;
|
|
4990
|
+
width *= iframeScale.x;
|
|
4991
|
+
height *= iframeScale.y;
|
|
4992
|
+
x += left;
|
|
4993
|
+
y += top;
|
|
4994
|
+
currentWin = getWindow(currentIFrame);
|
|
4995
|
+
currentIFrame = getFrameElement(currentWin);
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
return rectToClientRect({
|
|
4999
|
+
width,
|
|
5000
|
+
height,
|
|
5001
|
+
x,
|
|
5002
|
+
y
|
|
5003
|
+
});
|
|
5004
|
+
}
|
|
5005
|
+
|
|
5006
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
5007
|
+
// incorrect for RTL.
|
|
5008
|
+
function getWindowScrollBarX(element, rect) {
|
|
5009
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
5010
|
+
if (!rect) {
|
|
5011
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
5012
|
+
}
|
|
5013
|
+
return rect.left + leftScroll;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
5016
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
5017
|
+
if (ignoreScrollbarX === void 0) {
|
|
5018
|
+
ignoreScrollbarX = false;
|
|
5019
|
+
}
|
|
5020
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
5021
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
|
|
5022
|
+
// RTL <body> scrollbar.
|
|
5023
|
+
getWindowScrollBarX(documentElement, htmlRect));
|
|
5024
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
5025
|
+
return {
|
|
5026
|
+
x,
|
|
5027
|
+
y
|
|
5028
|
+
};
|
|
5029
|
+
}
|
|
5030
|
+
|
|
5031
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
5032
|
+
let {
|
|
5033
|
+
elements,
|
|
5034
|
+
rect,
|
|
5035
|
+
offsetParent,
|
|
5036
|
+
strategy
|
|
5037
|
+
} = _ref;
|
|
5038
|
+
const isFixed = strategy === 'fixed';
|
|
5039
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
5040
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
5041
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
5042
|
+
return rect;
|
|
5043
|
+
}
|
|
5044
|
+
let scroll = {
|
|
5045
|
+
scrollLeft: 0,
|
|
5046
|
+
scrollTop: 0
|
|
5047
|
+
};
|
|
5048
|
+
let scale = createCoords(1);
|
|
5049
|
+
const offsets = createCoords(0);
|
|
5050
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
5051
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
5052
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
5053
|
+
scroll = getNodeScroll(offsetParent);
|
|
5054
|
+
}
|
|
5055
|
+
if (isHTMLElement(offsetParent)) {
|
|
5056
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
5057
|
+
scale = getScale(offsetParent);
|
|
5058
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
5059
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
5060
|
+
}
|
|
5061
|
+
}
|
|
5062
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
5063
|
+
return {
|
|
5064
|
+
width: rect.width * scale.x,
|
|
5065
|
+
height: rect.height * scale.y,
|
|
5066
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
5067
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
5068
|
+
};
|
|
5069
|
+
}
|
|
5070
|
+
|
|
5071
|
+
function getClientRects(element) {
|
|
5072
|
+
return Array.from(element.getClientRects());
|
|
5073
|
+
}
|
|
5074
|
+
|
|
5075
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
5076
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
5077
|
+
function getDocumentRect(element) {
|
|
5078
|
+
const html = getDocumentElement(element);
|
|
5079
|
+
const scroll = getNodeScroll(element);
|
|
5080
|
+
const body = element.ownerDocument.body;
|
|
5081
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
5082
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
5083
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
5084
|
+
const y = -scroll.scrollTop;
|
|
5085
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
5086
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
5087
|
+
}
|
|
5088
|
+
return {
|
|
5089
|
+
width,
|
|
5090
|
+
height,
|
|
5091
|
+
x,
|
|
5092
|
+
y
|
|
5093
|
+
};
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5096
|
+
function getViewportRect(element, strategy) {
|
|
5097
|
+
const win = getWindow(element);
|
|
5098
|
+
const html = getDocumentElement(element);
|
|
5099
|
+
const visualViewport = win.visualViewport;
|
|
5100
|
+
let width = html.clientWidth;
|
|
5101
|
+
let height = html.clientHeight;
|
|
5102
|
+
let x = 0;
|
|
5103
|
+
let y = 0;
|
|
5104
|
+
if (visualViewport) {
|
|
5105
|
+
width = visualViewport.width;
|
|
5106
|
+
height = visualViewport.height;
|
|
5107
|
+
const visualViewportBased = isWebKit();
|
|
5108
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
5109
|
+
x = visualViewport.offsetLeft;
|
|
5110
|
+
y = visualViewport.offsetTop;
|
|
5111
|
+
}
|
|
5112
|
+
}
|
|
5113
|
+
return {
|
|
5114
|
+
width,
|
|
5115
|
+
height,
|
|
5116
|
+
x,
|
|
5117
|
+
y
|
|
5118
|
+
};
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
5122
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
5123
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
5124
|
+
const top = clientRect.top + element.clientTop;
|
|
5125
|
+
const left = clientRect.left + element.clientLeft;
|
|
5126
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
5127
|
+
const width = element.clientWidth * scale.x;
|
|
5128
|
+
const height = element.clientHeight * scale.y;
|
|
5129
|
+
const x = left * scale.x;
|
|
5130
|
+
const y = top * scale.y;
|
|
5131
|
+
return {
|
|
5132
|
+
width,
|
|
5133
|
+
height,
|
|
5134
|
+
x,
|
|
5135
|
+
y
|
|
5136
|
+
};
|
|
5137
|
+
}
|
|
5138
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
5139
|
+
let rect;
|
|
5140
|
+
if (clippingAncestor === 'viewport') {
|
|
5141
|
+
rect = getViewportRect(element, strategy);
|
|
5142
|
+
} else if (clippingAncestor === 'document') {
|
|
5143
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
5144
|
+
} else if (isElement(clippingAncestor)) {
|
|
5145
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
5146
|
+
} else {
|
|
5147
|
+
const visualOffsets = getVisualOffsets(element);
|
|
5148
|
+
rect = {
|
|
5149
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
5150
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
5151
|
+
width: clippingAncestor.width,
|
|
5152
|
+
height: clippingAncestor.height
|
|
5153
|
+
};
|
|
5154
|
+
}
|
|
5155
|
+
return rectToClientRect(rect);
|
|
5156
|
+
}
|
|
5157
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
5158
|
+
const parentNode = getParentNode(element);
|
|
5159
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
5160
|
+
return false;
|
|
5161
|
+
}
|
|
5162
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
5163
|
+
}
|
|
5164
|
+
|
|
5165
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
5166
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
5167
|
+
// of the given element up the tree.
|
|
5168
|
+
function getClippingElementAncestors(element, cache) {
|
|
5169
|
+
const cachedResult = cache.get(element);
|
|
5170
|
+
if (cachedResult) {
|
|
5171
|
+
return cachedResult;
|
|
5172
|
+
}
|
|
5173
|
+
let result = getOverflowAncestors(element, []).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
5174
|
+
let currentContainingBlockComputedStyle = null;
|
|
5175
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
5176
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
5177
|
+
|
|
5178
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
5179
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
5180
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
5181
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
5182
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
5183
|
+
currentContainingBlockComputedStyle = null;
|
|
5184
|
+
}
|
|
5185
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
5186
|
+
if (shouldDropCurrentNode) {
|
|
5187
|
+
// Drop non-containing blocks.
|
|
5188
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
5189
|
+
} else {
|
|
5190
|
+
// Record last containing block for next iteration.
|
|
5191
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
5192
|
+
}
|
|
5193
|
+
currentNode = getParentNode(currentNode);
|
|
5194
|
+
}
|
|
5195
|
+
cache.set(element, result);
|
|
5196
|
+
return result;
|
|
5197
|
+
}
|
|
5198
|
+
|
|
5199
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
5200
|
+
// clipping ancestors.
|
|
5201
|
+
function getClippingRect(_ref) {
|
|
5202
|
+
let {
|
|
5203
|
+
element,
|
|
5204
|
+
boundary,
|
|
5205
|
+
rootBoundary,
|
|
5206
|
+
strategy
|
|
5207
|
+
} = _ref;
|
|
5208
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
5209
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
5210
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
5211
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
5212
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
5213
|
+
accRect.top = max(rect.top, accRect.top);
|
|
5214
|
+
accRect.right = min(rect.right, accRect.right);
|
|
5215
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
5216
|
+
accRect.left = max(rect.left, accRect.left);
|
|
5217
|
+
return accRect;
|
|
5218
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
5219
|
+
return {
|
|
5220
|
+
width: clippingRect.right - clippingRect.left,
|
|
5221
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
5222
|
+
x: clippingRect.left,
|
|
5223
|
+
y: clippingRect.top
|
|
5224
|
+
};
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
function getDimensions(element) {
|
|
5228
|
+
const {
|
|
5229
|
+
width,
|
|
5230
|
+
height
|
|
5231
|
+
} = getCssDimensions(element);
|
|
5232
|
+
return {
|
|
5233
|
+
width,
|
|
5234
|
+
height
|
|
5235
|
+
};
|
|
5236
|
+
}
|
|
5237
|
+
|
|
5238
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
5239
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
5240
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
5241
|
+
const isFixed = strategy === 'fixed';
|
|
5242
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
5243
|
+
let scroll = {
|
|
5244
|
+
scrollLeft: 0,
|
|
5245
|
+
scrollTop: 0
|
|
5246
|
+
};
|
|
5247
|
+
const offsets = createCoords(0);
|
|
5248
|
+
|
|
5249
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
5250
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
5251
|
+
function setLeftRTLScrollbarOffset() {
|
|
5252
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
5253
|
+
}
|
|
5254
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
5255
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
5256
|
+
scroll = getNodeScroll(offsetParent);
|
|
5257
|
+
}
|
|
5258
|
+
if (isOffsetParentAnElement) {
|
|
5259
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
5260
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
5261
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
5262
|
+
} else if (documentElement) {
|
|
5263
|
+
setLeftRTLScrollbarOffset();
|
|
5264
|
+
}
|
|
5265
|
+
}
|
|
5266
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
5267
|
+
setLeftRTLScrollbarOffset();
|
|
5268
|
+
}
|
|
5269
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
5270
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
5271
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
5272
|
+
return {
|
|
5273
|
+
x,
|
|
5274
|
+
y,
|
|
5275
|
+
width: rect.width,
|
|
5276
|
+
height: rect.height
|
|
5277
|
+
};
|
|
5278
|
+
}
|
|
5279
|
+
|
|
5280
|
+
function isStaticPositioned(element) {
|
|
5281
|
+
return getComputedStyle$1(element).position === 'static';
|
|
5282
|
+
}
|
|
5283
|
+
|
|
5284
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
5285
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
5286
|
+
return null;
|
|
5287
|
+
}
|
|
5288
|
+
if (polyfill) {
|
|
5289
|
+
return polyfill(element);
|
|
5290
|
+
}
|
|
5291
|
+
let rawOffsetParent = element.offsetParent;
|
|
5292
|
+
|
|
5293
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
5294
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
5295
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
5296
|
+
// non-static.
|
|
5297
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
5298
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
5299
|
+
}
|
|
5300
|
+
return rawOffsetParent;
|
|
5301
|
+
}
|
|
5302
|
+
|
|
5303
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
5304
|
+
// such as table ancestors and cross browser bugs.
|
|
5305
|
+
function getOffsetParent(element, polyfill) {
|
|
5306
|
+
const win = getWindow(element);
|
|
5307
|
+
if (isTopLayer(element)) {
|
|
5308
|
+
return win;
|
|
5309
|
+
}
|
|
5310
|
+
if (!isHTMLElement(element)) {
|
|
5311
|
+
let svgOffsetParent = getParentNode(element);
|
|
5312
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
5313
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
5314
|
+
return svgOffsetParent;
|
|
5315
|
+
}
|
|
5316
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
5317
|
+
}
|
|
5318
|
+
return win;
|
|
5319
|
+
}
|
|
5320
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
5321
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
5322
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
5323
|
+
}
|
|
5324
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
5325
|
+
return win;
|
|
5326
|
+
}
|
|
5327
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
5328
|
+
}
|
|
5329
|
+
|
|
5330
|
+
const getElementRects = async function (data) {
|
|
5331
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
5332
|
+
const getDimensionsFn = this.getDimensions;
|
|
5333
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
5334
|
+
return {
|
|
5335
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
5336
|
+
floating: {
|
|
5337
|
+
x: 0,
|
|
5338
|
+
y: 0,
|
|
5339
|
+
width: floatingDimensions.width,
|
|
5340
|
+
height: floatingDimensions.height
|
|
5341
|
+
}
|
|
5342
|
+
};
|
|
5343
|
+
};
|
|
5344
|
+
|
|
5345
|
+
function isRTL$1(element) {
|
|
5346
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
5347
|
+
}
|
|
5348
|
+
|
|
5349
|
+
const platform = {
|
|
5350
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
5351
|
+
getDocumentElement,
|
|
5352
|
+
getClippingRect,
|
|
5353
|
+
getOffsetParent,
|
|
5354
|
+
getElementRects,
|
|
5355
|
+
getClientRects,
|
|
5356
|
+
getDimensions,
|
|
5357
|
+
getScale,
|
|
5358
|
+
isElement,
|
|
5359
|
+
isRTL: isRTL$1
|
|
5360
|
+
};
|
|
5361
|
+
|
|
5362
|
+
/**
|
|
5363
|
+
* Modifies the placement by translating the floating element along the
|
|
5364
|
+
* specified axes.
|
|
5365
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
5366
|
+
* object may be passed.
|
|
5367
|
+
* @see https://floating-ui.com/docs/offset
|
|
5368
|
+
*/
|
|
5369
|
+
const offset = offset$1;
|
|
5370
|
+
|
|
5371
|
+
/**
|
|
5372
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
5373
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
5374
|
+
* @see https://floating-ui.com/docs/shift
|
|
5375
|
+
*/
|
|
5376
|
+
const shift = shift$1;
|
|
5377
|
+
|
|
5378
|
+
/**
|
|
5379
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
5380
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
5381
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
5382
|
+
* @see https://floating-ui.com/docs/flip
|
|
5383
|
+
*/
|
|
5384
|
+
const flip = flip$1;
|
|
5385
|
+
|
|
5386
|
+
/**
|
|
5387
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
5388
|
+
* next to a given reference element.
|
|
5389
|
+
*/
|
|
5390
|
+
const computePosition = (reference, floating, options) => {
|
|
5391
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
5392
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
5393
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
5394
|
+
const cache = new Map();
|
|
5395
|
+
const mergedOptions = {
|
|
5396
|
+
platform,
|
|
5397
|
+
...options
|
|
5398
|
+
};
|
|
5399
|
+
const platformWithCache = {
|
|
5400
|
+
...mergedOptions.platform,
|
|
5401
|
+
_c: cache
|
|
5402
|
+
};
|
|
5403
|
+
return computePosition$1(reference, floating, {
|
|
5404
|
+
...mergedOptions,
|
|
5405
|
+
platform: platformWithCache
|
|
5406
|
+
});
|
|
5407
|
+
};
|
|
5408
|
+
|
|
5409
|
+
const pdsDropdownMenuCss = ":host{display:block}.is-hidden{display:none}.pds-dropdown-menu--panel{background-color:var(--pine-color-background-container);left:var(--pine-dimension-none);min-width:170px;padding:var(--pine-dimension-xs);position:absolute;z-index:9999}";
|
|
5410
|
+
|
|
5411
|
+
class PdsDropdownMenu {
|
|
5412
|
+
constructor(hostRef) {
|
|
5413
|
+
registerInstance(this, hostRef);
|
|
5414
|
+
this.isOpen = false;
|
|
5415
|
+
this.menuItems = [];
|
|
5416
|
+
this.currentFocusIndex = -1;
|
|
5417
|
+
/**
|
|
5418
|
+
* The placement of the dropdown panel relative to the trigger.
|
|
5419
|
+
*/
|
|
5420
|
+
this.placement = 'bottom-start';
|
|
5421
|
+
this.handleTriggerSlotChange = (event) => {
|
|
5422
|
+
this.slotEl = event.target;
|
|
5423
|
+
// Get all elements assigned to this slot
|
|
5424
|
+
const assignedElements = this.slotEl.assignedElements();
|
|
5425
|
+
this.triggerEl = assignedElements[0];
|
|
5426
|
+
this.triggerEl.onclick = this.handleClick;
|
|
5427
|
+
// Add accessibility attributes to trigger
|
|
5428
|
+
this.triggerEl.setAttribute('aria-haspopup', 'menu');
|
|
5429
|
+
this.triggerEl.setAttribute('aria-expanded', 'false');
|
|
5430
|
+
};
|
|
5431
|
+
this.handleSlotChange = (event) => {
|
|
5432
|
+
this.slotEl = event.target;
|
|
5433
|
+
// Get all elements assigned to this slot
|
|
5434
|
+
const assignedElements = this.slotEl.assignedElements();
|
|
5435
|
+
// ensure assignedElements only contains pds-dropdown-menu-item or pds-dropdown-menu-separator
|
|
5436
|
+
// if there are other elements, throw an error
|
|
5437
|
+
const invalidElements = assignedElements.filter(el => el.tagName.toLowerCase() !== 'pds-dropdown-menu-item' && el.tagName.toLowerCase() !== 'pds-dropdown-menu-separator');
|
|
5438
|
+
if (invalidElements.length > 0) {
|
|
5439
|
+
throw new Error(`pds-dropdown-menu only accepts pds-dropdown-menu-item and pds-dropdown-menu-separator elements`);
|
|
5440
|
+
}
|
|
5441
|
+
// Store all menu items for keyboard navigation
|
|
5442
|
+
this.menuItems = assignedElements.filter(el => el.tagName.toLowerCase() === 'pds-dropdown-menu-item');
|
|
5443
|
+
};
|
|
5444
|
+
// Toggle dropdown open/closed
|
|
5445
|
+
this.toggleDropdown = () => {
|
|
5446
|
+
this.isOpen = !this.isOpen;
|
|
5447
|
+
if (this.isOpen) {
|
|
5448
|
+
this.openDropdown();
|
|
5449
|
+
}
|
|
5450
|
+
else {
|
|
5451
|
+
this.closeDropdown();
|
|
5452
|
+
}
|
|
5453
|
+
};
|
|
5454
|
+
// Open the dropdown and position it
|
|
5455
|
+
this.openDropdown = () => {
|
|
5456
|
+
var _a;
|
|
5457
|
+
computePosition(this.triggerEl, this.panelEl, {
|
|
5458
|
+
placement: this.placement,
|
|
5459
|
+
middleware: [offset(6), flip(), shift({ padding: 5 })],
|
|
5460
|
+
}).then(({ x, y }) => {
|
|
5461
|
+
Object.assign(this.panelEl.style, {
|
|
5462
|
+
left: `${x}px`,
|
|
5463
|
+
top: `${y}px`,
|
|
5464
|
+
});
|
|
5465
|
+
});
|
|
5466
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-box').classList.remove('is-hidden');
|
|
5467
|
+
this.isOpen = true;
|
|
5468
|
+
// Update ARIA attributes
|
|
5469
|
+
this.triggerEl.setAttribute('aria-expanded', 'true');
|
|
5470
|
+
};
|
|
5471
|
+
// Close the dropdown
|
|
5472
|
+
this.closeDropdown = () => {
|
|
5473
|
+
var _a;
|
|
5474
|
+
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-box').classList.add('is-hidden');
|
|
5475
|
+
this.isOpen = false;
|
|
5476
|
+
// Update ARIA attributes
|
|
5477
|
+
this.triggerEl.setAttribute('aria-expanded', 'false');
|
|
5478
|
+
// Reset focus index
|
|
5479
|
+
this.currentFocusIndex = -1;
|
|
5480
|
+
// Return focus to trigger
|
|
5481
|
+
this.triggerEl.focus();
|
|
5482
|
+
};
|
|
5483
|
+
// Handle click on the trigger element
|
|
5484
|
+
this.handleClick = () => {
|
|
5485
|
+
this.toggleDropdown();
|
|
5486
|
+
};
|
|
5487
|
+
}
|
|
5488
|
+
componentDidRender() {
|
|
5489
|
+
var _a;
|
|
5490
|
+
this.panelEl = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('pds-box');
|
|
5491
|
+
}
|
|
5492
|
+
// Get the index of the currently focused menu item
|
|
5493
|
+
getFocusedItemIndex() {
|
|
5494
|
+
const activeElement = document.activeElement;
|
|
5495
|
+
if (!activeElement)
|
|
5496
|
+
return -1;
|
|
5497
|
+
return this.menuItems.findIndex(item => item === activeElement);
|
|
5498
|
+
}
|
|
5499
|
+
// Focus a specific menu item by index
|
|
5500
|
+
focusItemByIndex(index) {
|
|
5501
|
+
var _a, _b, _c, _d;
|
|
5502
|
+
if (index >= 0 && index < this.menuItems.length) {
|
|
5503
|
+
this.currentFocusIndex = index;
|
|
5504
|
+
// Focus the inner button/link instead of the host element
|
|
5505
|
+
const menuItem = this.menuItems[index];
|
|
5506
|
+
const innerButton = (_a = menuItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button');
|
|
5507
|
+
const innerLink = (_d = (_c = (_b = menuItem.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('pds-link')) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('a');
|
|
5508
|
+
if (innerButton) {
|
|
5509
|
+
return innerButton.focus();
|
|
5510
|
+
}
|
|
5511
|
+
else if (innerLink) {
|
|
5512
|
+
return innerLink.focus();
|
|
5513
|
+
}
|
|
5514
|
+
else {
|
|
5515
|
+
// Fallback to focusing the host if we can't find the inner element
|
|
5516
|
+
menuItem.focus();
|
|
5517
|
+
}
|
|
5518
|
+
}
|
|
5519
|
+
}
|
|
5520
|
+
// Focus the next menu item
|
|
5521
|
+
focusNextItem() {
|
|
5522
|
+
let nextIndex = (this.currentFocusIndex + 1) % this.menuItems.length;
|
|
5523
|
+
// Skip disabled items
|
|
5524
|
+
let attempts = 0;
|
|
5525
|
+
const maxAttempts = this.menuItems.length;
|
|
5526
|
+
while (attempts < maxAttempts && this.menuItems[nextIndex].disabled) {
|
|
5527
|
+
nextIndex = (nextIndex + 1) % this.menuItems.length;
|
|
5528
|
+
attempts++;
|
|
5529
|
+
}
|
|
5530
|
+
// Only focus if we found a non-disabled item
|
|
5531
|
+
if (attempts < maxAttempts) {
|
|
5532
|
+
this.focusItemByIndex(nextIndex);
|
|
5533
|
+
}
|
|
5534
|
+
}
|
|
5535
|
+
// Focus the previous menu item
|
|
5536
|
+
focusPreviousItem() {
|
|
5537
|
+
let prevIndex = this.currentFocusIndex <= 0
|
|
5538
|
+
? this.menuItems.length - 1
|
|
5539
|
+
: this.currentFocusIndex - 1;
|
|
5540
|
+
// Skip disabled items
|
|
5541
|
+
let attempts = 0;
|
|
5542
|
+
const maxAttempts = this.menuItems.length;
|
|
5543
|
+
while (attempts < maxAttempts && this.menuItems[prevIndex].disabled) {
|
|
5544
|
+
prevIndex = prevIndex <= 0 ? this.menuItems.length - 1 : prevIndex - 1;
|
|
5545
|
+
attempts++;
|
|
5546
|
+
}
|
|
5547
|
+
// Only focus if we found a non-disabled item
|
|
5548
|
+
if (attempts < maxAttempts) {
|
|
5549
|
+
this.focusItemByIndex(prevIndex);
|
|
5550
|
+
}
|
|
5551
|
+
}
|
|
5552
|
+
// Handle keyboard events for the dropdown
|
|
5553
|
+
handleKeyDown(event) {
|
|
5554
|
+
if (!this.isOpen)
|
|
5555
|
+
return;
|
|
5556
|
+
switch (event.key) {
|
|
5557
|
+
case 'Escape':
|
|
5558
|
+
event.preventDefault();
|
|
5559
|
+
this.closeDropdown();
|
|
5560
|
+
break;
|
|
5561
|
+
case 'ArrowDown':
|
|
5562
|
+
event.preventDefault();
|
|
5563
|
+
this.focusNextItem();
|
|
5564
|
+
break;
|
|
5565
|
+
case 'ArrowUp':
|
|
5566
|
+
event.preventDefault();
|
|
5567
|
+
this.focusPreviousItem();
|
|
5568
|
+
break;
|
|
5569
|
+
case 'Home':
|
|
5570
|
+
event.preventDefault();
|
|
5571
|
+
if (this.menuItems.length > 0) {
|
|
5572
|
+
// Find first non-disabled item
|
|
5573
|
+
let firstIndex = 0;
|
|
5574
|
+
while (firstIndex < this.menuItems.length && this.menuItems[firstIndex].disabled) {
|
|
5575
|
+
firstIndex++;
|
|
5576
|
+
}
|
|
5577
|
+
if (firstIndex < this.menuItems.length) {
|
|
5578
|
+
this.focusItemByIndex(firstIndex);
|
|
5579
|
+
}
|
|
5580
|
+
}
|
|
5581
|
+
break;
|
|
5582
|
+
case 'End':
|
|
5583
|
+
event.preventDefault();
|
|
5584
|
+
if (this.menuItems.length > 0) {
|
|
5585
|
+
// Find last non-disabled item
|
|
5586
|
+
let lastIndex = this.menuItems.length - 1;
|
|
5587
|
+
while (lastIndex >= 0 && this.menuItems[lastIndex].disabled) {
|
|
5588
|
+
lastIndex--;
|
|
5589
|
+
}
|
|
5590
|
+
if (lastIndex >= 0) {
|
|
5591
|
+
this.focusItemByIndex(lastIndex);
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
break;
|
|
5595
|
+
case 'Tab':
|
|
5596
|
+
if (event.shiftKey) {
|
|
5597
|
+
// Let Shift+Tab navigate naturally from first item to trigger
|
|
5598
|
+
// For all other items, move to previous item
|
|
5599
|
+
const currentIndex = this.getFocusedItemIndex();
|
|
5600
|
+
if (currentIndex > 0) {
|
|
5601
|
+
// If not on first item, prevent default and go to previous item
|
|
5602
|
+
event.preventDefault();
|
|
5603
|
+
this.focusPreviousItem(); // Use our method that skips disabled items
|
|
5604
|
+
}
|
|
5605
|
+
// If on first item or no item, let natural tab order move back to trigger
|
|
5606
|
+
}
|
|
5607
|
+
else {
|
|
5608
|
+
// Forward Tab navigation
|
|
5609
|
+
const activeElement = document.activeElement;
|
|
5610
|
+
const isTriggerFocused = activeElement === this.triggerEl;
|
|
5611
|
+
const currentIndex = this.getFocusedItemIndex();
|
|
5612
|
+
if (isTriggerFocused && this.menuItems.length > 0) {
|
|
5613
|
+
// If trigger is focused, move to first non-disabled menu item
|
|
5614
|
+
event.preventDefault();
|
|
5615
|
+
// Find the first non-disabled item
|
|
5616
|
+
let firstFocusableIndex = 0;
|
|
5617
|
+
while (firstFocusableIndex < this.menuItems.length && this.menuItems[firstFocusableIndex].disabled) {
|
|
5618
|
+
firstFocusableIndex++;
|
|
5619
|
+
}
|
|
5620
|
+
if (firstFocusableIndex < this.menuItems.length) {
|
|
5621
|
+
this.focusItemByIndex(firstFocusableIndex);
|
|
5622
|
+
}
|
|
5623
|
+
}
|
|
5624
|
+
else if (currentIndex === -1 && this.menuItems.length > 0) {
|
|
5625
|
+
// If no menu item is focused, focus the first non-disabled one
|
|
5626
|
+
event.preventDefault();
|
|
5627
|
+
// Find the first non-disabled item
|
|
5628
|
+
let firstFocusableIndex = 0;
|
|
5629
|
+
while (firstFocusableIndex < this.menuItems.length && this.menuItems[firstFocusableIndex].disabled) {
|
|
5630
|
+
firstFocusableIndex++;
|
|
5631
|
+
}
|
|
5632
|
+
if (firstFocusableIndex < this.menuItems.length) {
|
|
5633
|
+
this.focusItemByIndex(firstFocusableIndex);
|
|
5634
|
+
}
|
|
5635
|
+
}
|
|
5636
|
+
else if (currentIndex !== -1) {
|
|
5637
|
+
// Use our method that skips disabled items
|
|
5638
|
+
event.preventDefault();
|
|
5639
|
+
this.focusNextItem();
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
break;
|
|
5643
|
+
}
|
|
5644
|
+
}
|
|
5645
|
+
// Handle clicks outside the dropdown to close it
|
|
5646
|
+
handleWindowClick(event) {
|
|
5647
|
+
if (this.isOpen && !this.host.contains(event.target) && event.target !== this.triggerEl) {
|
|
5648
|
+
this.closeDropdown();
|
|
5649
|
+
}
|
|
5650
|
+
}
|
|
5651
|
+
render() {
|
|
5652
|
+
return (hAsync(Host, { key: '492d6a2baba8c0cf5e05a6c34b774900f5da6886', id: this.componentId }, hAsync("slot", { key: '9d57ee287cff289693c941410bcc62bb9fb1da95', name: "trigger", onSlotchange: this.handleTriggerSlotChange }), hAsync("pds-box", { key: '62ae569a3bf7f958c01cfe1a74d174e413763f72', "border-radius": "sm", display: "flex", direction: "column", class: "pds-dropdown-menu--panel is-hidden", shadow: "100", role: "menu", "aria-orientation": "vertical" }, hAsync("slot", { key: 'ea6d26124c06683e4fde23bc29f955cb04468d7a', onSlotchange: this.handleSlotChange }))));
|
|
5653
|
+
}
|
|
5654
|
+
get host() { return getElement(this); }
|
|
5655
|
+
static get style() { return pdsDropdownMenuCss; }
|
|
5656
|
+
static get cmpMeta() { return {
|
|
5657
|
+
"$flags$": 9,
|
|
5658
|
+
"$tagName$": "pds-dropdown-menu",
|
|
5659
|
+
"$members$": {
|
|
5660
|
+
"componentId": [1, "component-id"],
|
|
5661
|
+
"placement": [1],
|
|
5662
|
+
"currentFocusIndex": [32]
|
|
5663
|
+
},
|
|
5664
|
+
"$listeners$": [[8, "keydown", "handleKeyDown"], [8, "click", "handleWindowClick"]],
|
|
5665
|
+
"$lazyBundleId$": "-",
|
|
5666
|
+
"$attrsToReflect$": []
|
|
5667
|
+
}; }
|
|
5668
|
+
}
|
|
5669
|
+
|
|
5670
|
+
const pdsDropdownMenuItemCss = ":host{cursor:pointer;display:-ms-flexbox;display:flex;width:100%;}:host(.is-disabled){cursor:not-allowed !important;opacity:0.5 !important}:host(.is-disabled) .pds-dropdown-menu-item__content{cursor:not-allowed !important;pointer-events:none !important}.pds-dropdown-menu-item__content{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-dimension-xs);display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium);gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px);padding:var(--pine-dimension-xs);text-align:start;width:100%;}.pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-grey-150);color:var(--pine-color-text-hover)}.pds-dropdown-menu-item__content:focus,.pds-dropdown-menu-item__content:focus-visible,.pds-dropdown-menu-item__content.has-focus{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}:host(.destructive) .pds-dropdown-menu-item__content{-ms-flex-align:center;align-items:center;color:var(--pine-color-danger)}:host(.destructive) .pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-danger-disabled);color:var(--pine-color-danger-hover)}:host(.destructive) .pds-dropdown-menu-item__content:focus,:host(.destructive) .pds-dropdown-menu-item__content:focus-visible,:host(.destructive) .pds-dropdown-menu-item__content.has-focus{background-color:var(--pine-color-danger-disabled);outline:var(--pine-outline-focus-danger);outline-offset:var(--pine-border-width)}pds-link::part(link):focus,pds-link::part(link):focus-visible{-webkit-box-shadow:none;box-shadow:none;outline:none}pds-link::part(link){display:block;margin-inline:calc(var(--pine-dimension-xs) * -1);padding-inline:var(--pine-dimension-xs);width:100%}";
|
|
5671
|
+
|
|
5672
|
+
class PdsDropdownMenuItem {
|
|
5673
|
+
constructor(hostRef) {
|
|
5674
|
+
registerInstance(this, hostRef);
|
|
5675
|
+
this.pdsClick = createEvent(this, "pdsClick");
|
|
5676
|
+
/**
|
|
5677
|
+
* It determines whether or not the dropdown-item is destructive.
|
|
5678
|
+
* @defaultValue false
|
|
5679
|
+
*/
|
|
5680
|
+
this.destructive = false;
|
|
5681
|
+
/**
|
|
5682
|
+
* It determines whether or not the dropdown-item is disabled.
|
|
5683
|
+
* @defaultValue false
|
|
5684
|
+
*/
|
|
5685
|
+
this.disabled = false;
|
|
5686
|
+
this.hasFocus = false;
|
|
5687
|
+
this.handleFocus = () => {
|
|
5688
|
+
this.hasFocus = true;
|
|
5689
|
+
};
|
|
5690
|
+
this.handleBlur = () => {
|
|
5691
|
+
this.hasFocus = false;
|
|
5692
|
+
};
|
|
5693
|
+
this.handleKeyDown = (event) => {
|
|
5694
|
+
// Handle keyboard events
|
|
5695
|
+
if (!this.disabled && (event.key === 'Enter')) {
|
|
5696
|
+
// Only prevent default for button elements or Space key
|
|
5697
|
+
// For links with Enter key, we want the default navigation behavior
|
|
5698
|
+
if (!this.href) {
|
|
5699
|
+
event.preventDefault();
|
|
5700
|
+
}
|
|
5701
|
+
this.handleClick();
|
|
5702
|
+
}
|
|
5703
|
+
};
|
|
5704
|
+
}
|
|
5705
|
+
/**
|
|
5706
|
+
* Trigger the click event
|
|
5707
|
+
*/
|
|
5708
|
+
async clickItem() {
|
|
5709
|
+
this.handleClick();
|
|
5710
|
+
}
|
|
5711
|
+
;
|
|
5712
|
+
handleClick() {
|
|
5713
|
+
var _a;
|
|
5714
|
+
// Filter only pds-dropdown-menu-item elements and find the index of the current item
|
|
5715
|
+
const menuItems = Array.from(this.host.parentNode.children).filter((child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item');
|
|
5716
|
+
const itemIndex = menuItems.indexOf(this.host);
|
|
5717
|
+
// Get the text content from the slotted content
|
|
5718
|
+
const content = ((_a = this.host.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
5719
|
+
this.pdsClick.emit({
|
|
5720
|
+
itemIndex,
|
|
5721
|
+
item: this.host,
|
|
5722
|
+
content
|
|
5723
|
+
});
|
|
5724
|
+
}
|
|
5725
|
+
renderElement() {
|
|
5726
|
+
if (this.href !== undefined) {
|
|
5727
|
+
return (hAsync("pds-link", { href: this.disabled ? null : this.href, class: {
|
|
5728
|
+
'pds-dropdown-menu-item__content': true,
|
|
5729
|
+
'has-focus': this.hasFocus
|
|
5730
|
+
}, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-disabled": this.disabled ? 'true' : null }, hAsync("slot", null)));
|
|
5731
|
+
}
|
|
5732
|
+
return (hAsync("button", { class: {
|
|
5733
|
+
'pds-dropdown-menu-item__content': true,
|
|
5734
|
+
'has-focus': this.hasFocus
|
|
5735
|
+
}, tabIndex: this.disabled ? -1 : 0, type: "button", onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null }, hAsync("slot", null)));
|
|
5736
|
+
}
|
|
5737
|
+
render() {
|
|
5738
|
+
return (hAsync(Host, { key: 'b27f62c0f1cfe56e777b1a875b93954d4c9da00d', id: this.componentId, class: { 'is-disabled': this.disabled, 'destructive': !this.disabled && this.destructive }, onClick: () => !this.disabled && this.handleClick(), role: "none", tabIndex: -1, "aria-disabled": this.disabled ? 'true' : null }, this.renderElement()));
|
|
5739
|
+
}
|
|
5740
|
+
get host() { return getElement(this); }
|
|
5741
|
+
static get style() { return pdsDropdownMenuItemCss; }
|
|
5742
|
+
static get cmpMeta() { return {
|
|
5743
|
+
"$flags$": 9,
|
|
5744
|
+
"$tagName$": "pds-dropdown-menu-item",
|
|
5745
|
+
"$members$": {
|
|
5746
|
+
"componentId": [1, "component-id"],
|
|
5747
|
+
"destructive": [4],
|
|
5748
|
+
"disabled": [4],
|
|
5749
|
+
"href": [1],
|
|
5750
|
+
"hasFocus": [32],
|
|
5751
|
+
"clickItem": [64]
|
|
5752
|
+
},
|
|
5753
|
+
"$listeners$": undefined,
|
|
5754
|
+
"$lazyBundleId$": "-",
|
|
5755
|
+
"$attrsToReflect$": []
|
|
5756
|
+
}; }
|
|
5757
|
+
}
|
|
5758
|
+
|
|
5759
|
+
const pdsDropdownMenuSeparatorCss = ":host hr{border:1px solid var(--pine-color-border);margin-block:var(--pine-dimension-xs)}";
|
|
5760
|
+
|
|
5761
|
+
class PdsDropdownMenuSeparator {
|
|
5762
|
+
constructor(hostRef) {
|
|
5763
|
+
registerInstance(this, hostRef);
|
|
5764
|
+
/**
|
|
5765
|
+
* It determines whether or not the dropdown-item is disabled.
|
|
5766
|
+
* @defaultValue false
|
|
5767
|
+
*/
|
|
5768
|
+
this.disabled = false;
|
|
5769
|
+
}
|
|
5770
|
+
render() {
|
|
5771
|
+
return (hAsync(Host, { key: '71b19470921b7848e5f0c44ef82aa0d9f8ef2017', id: this.componentId }, hAsync("hr", { key: 'efc84b6b3f3f35421c0af863fb2d4636e542773e' })));
|
|
5772
|
+
}
|
|
5773
|
+
static get style() { return pdsDropdownMenuSeparatorCss; }
|
|
5774
|
+
static get cmpMeta() { return {
|
|
5775
|
+
"$flags$": 9,
|
|
5776
|
+
"$tagName$": "pds-dropdown-menu-separator",
|
|
5777
|
+
"$members$": {
|
|
5778
|
+
"componentId": [1, "component-id"],
|
|
5779
|
+
"disabled": [4]
|
|
5780
|
+
},
|
|
5781
|
+
"$listeners$": undefined,
|
|
5782
|
+
"$lazyBundleId$": "-",
|
|
5783
|
+
"$attrsToReflect$": []
|
|
5784
|
+
}; }
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
const getName = (iconName, icon) => {
|
|
5788
|
+
if (!iconName && icon && !isSrc(icon)) {
|
|
5789
|
+
iconName = icon;
|
|
5790
|
+
}
|
|
5791
|
+
if (isStr(iconName)) {
|
|
5792
|
+
iconName = toLower(iconName);
|
|
5793
|
+
}
|
|
5794
|
+
if (!isStr(iconName) || iconName.trim() === '') {
|
|
5795
|
+
return null;
|
|
5796
|
+
}
|
|
5797
|
+
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
|
5798
|
+
if (invalidChars != '') {
|
|
5799
|
+
return null;
|
|
5800
|
+
}
|
|
5801
|
+
return iconName;
|
|
5802
|
+
};
|
|
5803
|
+
/**
|
|
5804
|
+
* Returns `true` if the document or host element
|
|
5805
|
+
* has a `dir` set to `rtl`. The host value will always
|
|
5806
|
+
* take priority over the root document value.
|
|
5807
|
+
*/
|
|
5808
|
+
const isRTL = (hostEl) => {
|
|
5809
|
+
if (hostEl) {
|
|
5810
|
+
if (hostEl.dir !== '') {
|
|
5811
|
+
return hostEl.dir.toLowerCase() === 'rtl';
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5814
|
+
return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
|
|
5815
|
+
};
|
|
5816
|
+
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
|
5817
|
+
const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
5818
|
+
const toLower = (val) => val.toLowerCase();
|
|
5819
|
+
/**
|
|
5820
|
+
* Elements inside of web components sometimes need to inherit global attributes
|
|
5821
|
+
* set on the host. For example, the inner input in `pds-input` should inherit
|
|
5822
|
+
* the `title` attribute that developers set directly on `pds-input`. This
|
|
5823
|
+
* helper function should be called in componentWillLoad and assigned to a variable
|
|
5824
|
+
* that is later used in the render function.
|
|
5825
|
+
*
|
|
5826
|
+
* This does not need to be reactive as changing attributes on the host element
|
|
5827
|
+
* does not trigger a re-render.
|
|
5828
|
+
*/
|
|
5829
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
5830
|
+
const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
5831
|
+
attributes.forEach(attr => {
|
|
5832
|
+
if (el.hasAttribute(attr)) {
|
|
5833
|
+
const value = el.getAttribute(attr);
|
|
5834
|
+
if (value !== null) {
|
|
5835
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
5836
|
+
}
|
|
5837
|
+
el.removeAttribute(attr);
|
|
5838
|
+
}
|
|
5839
|
+
});
|
|
5840
|
+
return attributeObject;
|
|
5841
|
+
};
|
|
5842
|
+
/**
|
|
5843
|
+
* Determines if an icon should be flipped when RTL is enabled
|
|
5844
|
+
* @param iconName - The name of the icon to check
|
|
5845
|
+
* @param hostEl - Optional host element to check for RTL direction
|
|
5846
|
+
* @returns {boolean} - True if the icon should be flipped in RTL mode, false otherwise
|
|
5847
|
+
*/
|
|
5848
|
+
const shouldRtlFlipIcon = (iconName, hostEl) => {
|
|
5849
|
+
// First check if we're in RTL mode
|
|
5850
|
+
const rtlEnabled = isRTL(hostEl);
|
|
5851
|
+
// Only flip if we're in RTL mode and the icon is in the flip list
|
|
5852
|
+
return rtlEnabled && ICONS_TO_FLIP.includes(iconName);
|
|
5853
|
+
};
|
|
5854
|
+
/**
|
|
5855
|
+
* Array of available icon names
|
|
5856
|
+
*/
|
|
5857
|
+
const ICONS_TO_FLIP = [
|
|
5858
|
+
'align-horizontal-bottom',
|
|
5859
|
+
'align-horizontal-center',
|
|
5860
|
+
'align-horizontal-top',
|
|
5861
|
+
'align-left',
|
|
5862
|
+
'align-right',
|
|
5863
|
+
'align-vertical-left',
|
|
5864
|
+
'align-vertical-right',
|
|
5865
|
+
'arrow-corner',
|
|
5866
|
+
'arrow-left',
|
|
5867
|
+
'arrow-right',
|
|
5868
|
+
'calendar-schedule',
|
|
5869
|
+
'caret-left',
|
|
5870
|
+
'caret-right',
|
|
5871
|
+
'cart',
|
|
5872
|
+
'cart-add',
|
|
5873
|
+
'comment',
|
|
5874
|
+
'comment-no',
|
|
5875
|
+
'conversation',
|
|
5876
|
+
'copy',
|
|
5877
|
+
'copy-07',
|
|
5878
|
+
'delete-key',
|
|
5879
|
+
'delete-x',
|
|
5880
|
+
'downsell',
|
|
5881
|
+
'drawer-collapse',
|
|
5882
|
+
'drawer-expand',
|
|
5883
|
+
'duplicate',
|
|
5884
|
+
'feedback',
|
|
5885
|
+
'file-lock',
|
|
5886
|
+
'file-search',
|
|
5887
|
+
'form-field',
|
|
5888
|
+
'form-filled',
|
|
5889
|
+
'left-small',
|
|
5890
|
+
'launch',
|
|
5891
|
+
'list-bullet',
|
|
5892
|
+
'list-numbers',
|
|
5893
|
+
'margin-left',
|
|
5894
|
+
'margin-right',
|
|
5895
|
+
'move-left',
|
|
5896
|
+
'move-right',
|
|
5897
|
+
'newsletter-2',
|
|
5898
|
+
'one-off-session',
|
|
5899
|
+
'quote',
|
|
5900
|
+
'redo',
|
|
5901
|
+
'reset-password',
|
|
5902
|
+
'right-small',
|
|
5903
|
+
'send-message',
|
|
5904
|
+
'share',
|
|
5905
|
+
'super-admin',
|
|
5906
|
+
'tablet-landscape',
|
|
5907
|
+
'undo',
|
|
5908
|
+
'user-star',
|
|
5909
|
+
'user-star-filled',
|
|
5910
|
+
'users',
|
|
5911
|
+
'users-filled',
|
|
5912
|
+
'users-tone'
|
|
5913
|
+
];
|
|
5914
|
+
|
|
5915
|
+
const pdsIconCss = ":host{--dimension-icon-height:16px;--dimension-icon-width:16px;--color-icon-fill:currentColor;contain:strict;display:inline-block;fill:var(--color-icon-fill);-ms-flex-negative:0;flex-shrink:0;height:var(--dimension-icon-height);width:var(--dimension-icon-width)}:host .pdsicon{fill:var(--color-icon-fill)}.pds-icon-fill-none{fill:none}.icon-inner,.pds-icon,svg{display:block;height:100%;width:100%}:host(.flip-rtl):host-context([dir=rtl]) .icon-inner{-webkit-transform:scaleX(-1);transform:scaleX(-1)}:host(.flip-rtl:dir(rtl)) .icon-inner{-webkit-transform:scaleX(-1);transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{-webkit-transform:scaleX(1);transform:scaleX(1)}";
|
|
5916
|
+
|
|
5917
|
+
class PdsIcon {
|
|
5918
|
+
constructor(hostRef) {
|
|
5919
|
+
registerInstance(this, hostRef);
|
|
5920
|
+
this.didLoadIcon = false;
|
|
5921
|
+
this.iconName = null;
|
|
5922
|
+
this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
3852
5923
|
this.isVisible = false;
|
|
3853
5924
|
/**
|
|
3854
5925
|
* The size of the icon. This can be
|
|
3855
|
-
* 'small', 'regular', 'medium', large, or a
|
|
5926
|
+
* 'small', 'regular', 'medium', 'large', or a
|
|
3856
5927
|
* custom value (40px, 1rem, etc)
|
|
3857
5928
|
*
|
|
3858
5929
|
*/
|
|
@@ -3879,9 +5950,12 @@ class PdsIcon {
|
|
|
3879
5950
|
}
|
|
3880
5951
|
componentDidLoad() {
|
|
3881
5952
|
this.setCSSVariables();
|
|
5953
|
+
if (!this.didLoadIcon) {
|
|
5954
|
+
this.loadIcon();
|
|
5955
|
+
}
|
|
3882
5956
|
}
|
|
3883
5957
|
componentWillLoad() {
|
|
3884
|
-
this.inheritedAttributes = inheritAttributes
|
|
5958
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
3885
5959
|
this.setCSSVariables();
|
|
3886
5960
|
}
|
|
3887
5961
|
setCSSVariables() {
|
|
@@ -3905,14 +5979,18 @@ class PdsIcon {
|
|
|
3905
5979
|
this.setCSSVariables();
|
|
3906
5980
|
}
|
|
3907
5981
|
loadIcon() {
|
|
3908
|
-
|
|
3909
|
-
if (
|
|
3910
|
-
this.ariaLabel =
|
|
5982
|
+
this.iconName = getName(this.name, this.icon);
|
|
5983
|
+
if (this.iconName) {
|
|
5984
|
+
this.ariaLabel = this.iconName.replace(/\-/g, ' ');
|
|
3911
5985
|
}
|
|
3912
5986
|
}
|
|
3913
5987
|
render() {
|
|
3914
|
-
const { ariaLabel, inheritedAttributes } = this;
|
|
3915
|
-
|
|
5988
|
+
const { ariaLabel, flipRtl, iconName, inheritedAttributes } = this;
|
|
5989
|
+
const shouldIconAutoFlip = iconName
|
|
5990
|
+
? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false
|
|
5991
|
+
: false;
|
|
5992
|
+
const shouldFlip = flipRtl || shouldIconAutoFlip;
|
|
5993
|
+
return (hAsync(Host, Object.assign({ key: 'bc8e46daa75df27a8039e0e767bdb43164ad7d4c', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), (hAsync("div", { class: "icon-inner" }))));
|
|
3916
5994
|
}
|
|
3917
5995
|
/*****
|
|
3918
5996
|
* Private Methods
|
|
@@ -3939,6 +6017,7 @@ class PdsIcon {
|
|
|
3939
6017
|
"$tagName$": "pds-icon",
|
|
3940
6018
|
"$members$": {
|
|
3941
6019
|
"color": [1],
|
|
6020
|
+
"flipRtl": [4, "flip-rtl"],
|
|
3942
6021
|
"icon": [8],
|
|
3943
6022
|
"name": [513],
|
|
3944
6023
|
"size": [513],
|
|
@@ -3980,9 +6059,9 @@ class PdsImage {
|
|
|
3980
6059
|
this.loading = 'eager';
|
|
3981
6060
|
}
|
|
3982
6061
|
render() {
|
|
3983
|
-
return (hAsync(Host, { key: '
|
|
6062
|
+
return (hAsync(Host, { key: 'a706be22398297ae7087239a3dc7474ae17ab358', class: {
|
|
3984
6063
|
'pds-image': true,
|
|
3985
|
-
}, id: this.componentId }, hAsync("img", { key: '
|
|
6064
|
+
}, id: this.componentId }, hAsync("img", { key: '37a465ed175ae298e174370246885fb6d7837112', alt: this.alt, height: this.height, loading: this.loading, sizes: this.sizes, src: this.src, srcset: this.srcset, width: this.width })));
|
|
3986
6065
|
}
|
|
3987
6066
|
static get style() { return pdsImageCss; }
|
|
3988
6067
|
static get cmpMeta() { return {
|
|
@@ -4004,87 +6083,6 @@ class PdsImage {
|
|
|
4004
6083
|
}; }
|
|
4005
6084
|
}
|
|
4006
6085
|
|
|
4007
|
-
/**
|
|
4008
|
-
* Inherit attributes from the host element
|
|
4009
|
-
* @param el - Host element
|
|
4010
|
-
* @param attributes - Array of attributes to inherit
|
|
4011
|
-
*/
|
|
4012
|
-
const inheritAttributes = (el, attributes = []) => {
|
|
4013
|
-
const attributeObject = {};
|
|
4014
|
-
attributes.forEach((attr) => {
|
|
4015
|
-
if (el.hasAttribute(attr)) {
|
|
4016
|
-
const value = el.getAttribute(attr);
|
|
4017
|
-
if (value !== null) {
|
|
4018
|
-
attributeObject[attr] = el.getAttribute(attr);
|
|
4019
|
-
}
|
|
4020
|
-
el.removeAttribute(attr);
|
|
4021
|
-
}
|
|
4022
|
-
});
|
|
4023
|
-
return attributeObject;
|
|
4024
|
-
};
|
|
4025
|
-
/**
|
|
4026
|
-
* List of available ARIA attributes + `role`.
|
|
4027
|
-
* Removed deprecated attributes.
|
|
4028
|
-
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
|
|
4029
|
-
*/
|
|
4030
|
-
const ariaAttributes = [
|
|
4031
|
-
'role',
|
|
4032
|
-
'aria-activedescendant',
|
|
4033
|
-
'aria-atomic',
|
|
4034
|
-
'aria-autocomplete',
|
|
4035
|
-
'aria-braillelabel',
|
|
4036
|
-
'aria-brailleroledescription',
|
|
4037
|
-
'aria-busy',
|
|
4038
|
-
'aria-checked',
|
|
4039
|
-
'aria-colcount',
|
|
4040
|
-
'aria-colindex',
|
|
4041
|
-
'aria-colindextext',
|
|
4042
|
-
'aria-colspan',
|
|
4043
|
-
'aria-controls',
|
|
4044
|
-
'aria-current',
|
|
4045
|
-
'aria-describedby',
|
|
4046
|
-
'aria-description',
|
|
4047
|
-
'aria-details',
|
|
4048
|
-
'aria-disabled',
|
|
4049
|
-
'aria-errormessage',
|
|
4050
|
-
'aria-expanded',
|
|
4051
|
-
'aria-flowto',
|
|
4052
|
-
'aria-haspopup',
|
|
4053
|
-
'aria-hidden',
|
|
4054
|
-
'aria-invalid',
|
|
4055
|
-
'aria-keyshortcuts',
|
|
4056
|
-
'aria-label',
|
|
4057
|
-
'aria-labelledby',
|
|
4058
|
-
'aria-level',
|
|
4059
|
-
'aria-live',
|
|
4060
|
-
'aria-multiline',
|
|
4061
|
-
'aria-multiselectable',
|
|
4062
|
-
'aria-orientation',
|
|
4063
|
-
'aria-owns',
|
|
4064
|
-
'aria-placeholder',
|
|
4065
|
-
'aria-posinset',
|
|
4066
|
-
'aria-pressed',
|
|
4067
|
-
'aria-readonly',
|
|
4068
|
-
'aria-relevant',
|
|
4069
|
-
'aria-required',
|
|
4070
|
-
'aria-roledescription',
|
|
4071
|
-
'aria-rowcount',
|
|
4072
|
-
'aria-rowindex',
|
|
4073
|
-
'aria-rowindextext',
|
|
4074
|
-
'aria-rowspan',
|
|
4075
|
-
'aria-selected',
|
|
4076
|
-
'aria-setsize',
|
|
4077
|
-
'aria-sort',
|
|
4078
|
-
'aria-valuemax',
|
|
4079
|
-
'aria-valuemin',
|
|
4080
|
-
'aria-valuenow',
|
|
4081
|
-
'aria-valuetext',
|
|
4082
|
-
];
|
|
4083
|
-
const inheritAriaAttributes = (el, ignoreList) => {
|
|
4084
|
-
let attributesToInherit = ariaAttributes;
|
|
4085
|
-
return inheritAttributes(el, attributesToInherit);
|
|
4086
|
-
};
|
|
4087
|
-
|
|
4088
6086
|
const pdsInputTokensCss$1 = ":host{--pine-input-color-background-danger:var(--pine-color-red-050)}";
|
|
4089
6087
|
|
|
4090
6088
|
const labelCss$4 = ":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)}";
|
|
@@ -4207,10 +6205,10 @@ class PdsInput {
|
|
|
4207
6205
|
return classNames.join(' ');
|
|
4208
6206
|
}
|
|
4209
6207
|
render() {
|
|
4210
|
-
return (hAsync(Host, { key: '
|
|
4211
|
-
hAsync("label", { key: '
|
|
4212
|
-
hAsync("p", { key: '
|
|
4213
|
-
hAsync("p", { key: '
|
|
6208
|
+
return (hAsync(Host, { key: 'a2a05a1e0d3e7722c1dc3dea957facaf5ef24c3c', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null }, hAsync("div", { key: 'd95ad9600e7d80050bf41503a2eb9ccb91f77893', class: "pds-input" }, this.label &&
|
|
6209
|
+
hAsync("label", { key: 'b5772c8283fe3c8899235c432bbabd36012c2aef', class: "pds-input__label", htmlFor: this.componentId }, this.label), hAsync("input", Object.assign({ key: '65a2ff8c31ebf545caf755609fa2f3e95cdd1098', class: this.inputClassNames(), ref: (input) => this.nativeInput = input, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInputEvent, onChange: this.onChangeEvent, onBlur: this.onBlurEvent, onFocus: this.onFocusEvent, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.helperMessage &&
|
|
6210
|
+
hAsync("p", { key: 'a7a30bc28a0e9aa16ebd842b8b3851569f556591', class: "pds-input__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
6211
|
+
hAsync("p", { key: '3ffc19523e9378534e665ba52247935e924d4168', class: "pds-input__error-message", id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: '6961e5735ffe279414ea5333224baa72561697d5', icon: danger, size: "small" }), this.errorMessage))));
|
|
4214
6212
|
}
|
|
4215
6213
|
get el() { return getElement(this); }
|
|
4216
6214
|
static get watchers() { return {
|
|
@@ -4245,7 +6243,7 @@ class PdsInput {
|
|
|
4245
6243
|
}; }
|
|
4246
6244
|
}
|
|
4247
6245
|
|
|
4248
|
-
const pdsLinkCss = ":host{display:inline}:host pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-link{-ms-flex-align:center;align-items:center;color:var(--pine-color-text);display:-ms-inline-flexbox;display:inline-flex;font-weight:var(--pine-font-weight-medium)}.pds-link:focus-visible{border-radius:var(--pine-dimension-2xs);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width-thick);position:relative}.pds-link--sm{font-size:var(--pine-font-size-body-xs)}.pds-link--sm pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--md{font-size:var(--pine-font-size-body-sm)}.pds-link--md pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--lg{font-size:var(--pine-font-size-body-md)}.pds-link--lg pds-icon{height:var(--pine-dimension-sm);width:var(--pine-dimension-sm)}.pds-link--plain{text-decoration:none}.pds-link--plain:hover{color:var(--pine-color-text-hover);text-decoration:underline}
|
|
6246
|
+
const pdsLinkCss = ":host{display:inline}:host pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-link{-ms-flex-align:center;align-items:center;color:var(--color, var(--pine-color-text));display:-ms-inline-flexbox;display:inline-flex;font-weight:var(--pine-font-weight-medium)}.pds-link:focus-visible{border-radius:var(--pine-dimension-2xs);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width-thick);position:relative}.pds-link:hover{color:var(--color, var(--pine-color-text-hover));text-decoration:none}:host([color=secondary]) .pds-link{color:var(--pine-color-text-primary)}:host([color=secondary]) .pds-link:hover{color:var(--pine-color-grey-150)}:host([color=accent]) .pds-link{color:var(--pine-color-accent)}:host([color=accent]) .pds-link:hover{color:var(--pine-color-accent-hover)}:host([color=danger]) .pds-link{color:var(--pine-color-danger)}:host([color=danger]) .pds-link:hover{color:var(--pine-color-danger-hover)}.pds-link--sm{font-size:var(--pine-font-size-body-xs)}.pds-link--sm pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--md{font-size:var(--pine-font-size-body-sm)}.pds-link--md pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--lg{font-size:var(--pine-font-size-body-md)}.pds-link--lg pds-icon{height:var(--pine-dimension-sm);width:var(--pine-dimension-sm)}.pds-link--plain{text-decoration:none}.pds-link--plain:hover{color:var(--pine-color-text-hover);text-decoration:underline}";
|
|
4249
6247
|
|
|
4250
6248
|
/**
|
|
4251
6249
|
* @part link - Link element styles.
|
|
@@ -4280,20 +6278,360 @@ class PdsLink {
|
|
|
4280
6278
|
}
|
|
4281
6279
|
return classNames.join(' ');
|
|
4282
6280
|
}
|
|
6281
|
+
setLinkStyles() {
|
|
6282
|
+
if (!this.color)
|
|
6283
|
+
return;
|
|
6284
|
+
const linkColors = {
|
|
6285
|
+
secondary: 'var(--pine-color-text-primary)',
|
|
6286
|
+
accent: 'var(--pine-color-accent)',
|
|
6287
|
+
danger: 'var(--pine-color-danger)',
|
|
6288
|
+
};
|
|
6289
|
+
const linkStyles = setColor(this.color, linkColors);
|
|
6290
|
+
return linkStyles;
|
|
6291
|
+
}
|
|
6292
|
+
render() {
|
|
6293
|
+
return (hAsync("a", { key: 'bd418a8fd35a3f3b7e240c09f9dcae3bdaa49013', class: this.classNames(), href: this.href, id: this.componentId, part: "link", target: this.external ? '_blank' : undefined, style: this.setLinkStyles() }, hAsync("slot", { key: '45aa4d6d1b2daaf4413227e39811595073f65744' }, this.href), this.external &&
|
|
6294
|
+
hAsync("pds-icon", { key: '4b8dec593ddefb68278e3c102174ec24b63680f6', icon: launch, size: this.fontSize })));
|
|
6295
|
+
}
|
|
6296
|
+
static get style() { return pdsLinkCss; }
|
|
6297
|
+
static get cmpMeta() { return {
|
|
6298
|
+
"$flags$": 9,
|
|
6299
|
+
"$tagName$": "pds-link",
|
|
6300
|
+
"$members$": {
|
|
6301
|
+
"color": [1],
|
|
6302
|
+
"componentId": [1, "component-id"],
|
|
6303
|
+
"external": [4],
|
|
6304
|
+
"variant": [1],
|
|
6305
|
+
"fontSize": [1, "font-size"],
|
|
6306
|
+
"href": [1]
|
|
6307
|
+
},
|
|
6308
|
+
"$listeners$": undefined,
|
|
6309
|
+
"$lazyBundleId$": "-",
|
|
6310
|
+
"$attrsToReflect$": []
|
|
6311
|
+
}; }
|
|
6312
|
+
}
|
|
6313
|
+
|
|
6314
|
+
const pdsLoaderCss = ":host{--loader-color:var(--pine-color-brand);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pine-dimension-xs)}:host(.pds-loader--hidden),.pds-loader--hidden{border-width:0;clip:rect(0, 0, 0, 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-loader--spinner svg{--number-spinner-timing:2s;--number-spinner-path-timing:1.5s;-webkit-animation:rotate var(--number-spinner-timing) linear infinite;animation:rotate var(--number-spinner-timing) linear infinite;color:var(--loader-color)}.pds-loader__spinner-path{stroke-width:8px}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.pds-loader--typing{--number-typing-timing:1s;--opacity-typing-dot-default:0.4;--opacity-typing-dot-active:1;-ms-flex-align:center;align-items:center;background-color:var(--pine-color-background-container-disabled);border-radius:var(--pine-dimension-sm);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);display:-ms-inline-flexbox;display:inline-flex;gap:var(--pine-dimension-2xs);margin-block:var(--pine-dimension-none);margin-inline:auto;padding-block:15px;padding-inline:20px;position:relative}.pds-loader--typing span{background-color:var(--pine-color-border-hover);block-size:6px;border-radius:var(--pine-border-radius-full);inline-size:6px;opacity:var(--opacity-typing-dot-default)}.pds-loader--typing span:nth-of-type(1){-webkit-animation:var(--number-typing-timing) typing infinite 0.3333s;animation:var(--number-typing-timing) typing infinite 0.3333s}.pds-loader--typing span:nth-of-type(2){-webkit-animation:var(--number-typing-timing) typing infinite 0.6666s;animation:var(--number-typing-timing) typing infinite 0.6666s}.pds-loader--typing span:nth-of-type(3){-webkit-animation:var(--number-typing-timing) typing infinite 0.9999s;animation:var(--number-typing-timing) typing infinite 0.9999s}@-webkit-keyframes typing{50%{opacity:var(--opacity-typing-dot-active);-webkit-transform:scale(1.25);transform:scale(1.25)}}@keyframes typing{50%{opacity:var(--opacity-typing-dot-active);-webkit-transform:scale(1.25);transform:scale(1.25)}}.pds-loader__label{--typography-label-default:var(--pine-font-weight-medium) var(--pine-font-size-body-md)/var(--pine-line-height-body) var(--pine-font-family-body);font:var(--typography-label-default)}";
|
|
6315
|
+
|
|
6316
|
+
/**
|
|
6317
|
+
* @slot label - Default slot for Loader label text.
|
|
6318
|
+
*/
|
|
6319
|
+
class PdsLoader {
|
|
6320
|
+
constructor(hostRef) {
|
|
6321
|
+
registerInstance(this, hostRef);
|
|
6322
|
+
/**
|
|
6323
|
+
* If false, the loader will be hidden.
|
|
6324
|
+
*/
|
|
6325
|
+
this.isLoading = true;
|
|
6326
|
+
/**
|
|
6327
|
+
* Determines whether the loader should display a label.
|
|
6328
|
+
*/
|
|
6329
|
+
this.showLabel = false;
|
|
6330
|
+
/**
|
|
6331
|
+
* Sets the size of the spinner loader. Value can be preset or custom.
|
|
6332
|
+
*/
|
|
6333
|
+
this.size = 'md';
|
|
6334
|
+
/**
|
|
6335
|
+
* Determines the type of loader.
|
|
6336
|
+
*/
|
|
6337
|
+
this.variant = 'spinner';
|
|
6338
|
+
this.style = () => {
|
|
6339
|
+
if (this.size !== undefined) {
|
|
6340
|
+
return {
|
|
6341
|
+
height: this.loaderSize(),
|
|
6342
|
+
width: this.loaderSize(),
|
|
6343
|
+
};
|
|
6344
|
+
}
|
|
6345
|
+
};
|
|
6346
|
+
}
|
|
6347
|
+
loaderSize() {
|
|
6348
|
+
const sizes = {
|
|
6349
|
+
xs: '24px',
|
|
6350
|
+
sm: '32px',
|
|
6351
|
+
md: '48px',
|
|
6352
|
+
lg: '64px',
|
|
6353
|
+
xl: '80px',
|
|
6354
|
+
};
|
|
6355
|
+
if (sizes[this.size]) {
|
|
6356
|
+
return sizes[this.size];
|
|
6357
|
+
}
|
|
6358
|
+
else {
|
|
6359
|
+
return this.size;
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6362
|
+
render() {
|
|
6363
|
+
return (hAsync(Host, { key: '1885f34a4ea3b114fac209f543680e531059bbbc', class: `pds-loader ${this.isLoading ? '' : 'pds-loader--hidden'}`, "aria-hidden": !this.isLoading, "aria-busy": this.isLoading, "aria-live": "polite" }, this.variant === 'spinner' && (hAsync("div", { key: '179e5c12cf4b049fc065034f0a6658ad6ddd9040', class: "pds-loader--spinner" }, hAsync("svg", { key: '8f4ba909fc4b9fe64ea7ea37ff26ae1d835292ae', style: this.style(), viewBox: "0 0 200 200", fill: "none" }, hAsync("defs", { key: 'ded765d5064790ad53f65a7e831e86367ce394ee' }, hAsync("linearGradient", { key: 'a8d3bca4fb569a52e61fd3908512803b2020dc38', id: "spinner-secondHalf" }, hAsync("stop", { key: '5c573e2545c778350b7481a4f2f468f4ae8094c0', offset: "0%", "stop-opacity": "0", "stop-color": "currentColor" }), hAsync("stop", { key: '99ade176b1d6a84f4ae8a4d3b2c9e98954dbb519', offset: "100%", "stop-opacity": "0.5", "stop-color": "currentColor" })), hAsync("linearGradient", { key: '3730c343c31190b037d0a6401a89b63640250f4a', id: "spinner-firstHalf" }, hAsync("stop", { key: 'f989c168a08aec3cb0b3f3bbfc71483b1991aff3', offset: "0%", "stop-opacity": "1", "stop-color": "currentColor" }), hAsync("stop", { key: '2ef58c6b7ec9058856b0fa30158182e4262396c6', offset: "100%", "stop-opacity": "0.5", "stop-color": "currentColor" }))), hAsync("g", { key: '6421330f6d04f90f24207057a67e03a38985d63b', class: "pds-loader__spinner-path" }, hAsync("path", { key: '594bf9e8c6b5c311ba2f461f873f6e5e9b6ccf27', stroke: "url(#spinner-secondHalf)", d: "M 4 100 A 96 96 0 0 1 196 100" }), hAsync("path", { key: 'd44edd943fe5ffd3d8708232a0ca16a254e688e4', stroke: "url(#spinner-firstHalf)", d: "M 196 100 A 96 96 0 0 1 4 100" }), hAsync("path", { key: 'ed3a5152042d5970dfa01d560ad234a8401702ca', stroke: "currentColor", "stroke-linecap": "round", d: "M 4 100 A 96 96 0 0 1 4 98" }))))), this.variant === 'typing' && (hAsync("div", { key: 'b7c4a013453a7233b8a9090b614b1ef0e5234ccd', class: "pds-loader--typing" }, hAsync("span", { key: '41408b1e02d88e80f8aa0468f607aad34015ff38' }), hAsync("span", { key: 'c41fc78a3160a72875301b968da6229351953e30' }), hAsync("span", { key: '02d33e3953dc291e60f293ac2c5906229decc4b9' }))), hAsync("div", { key: '2e767fdad673b59d07ab1aa02aeb002eb1930d24', class: `pds-loader__label ${this.showLabel ? '' : 'pds-loader--hidden'}` }, hAsync("slot", { key: '27956937cf99517d73c8a465457fde1c0c985c15', name: "label" }, "Loading..."))));
|
|
6364
|
+
}
|
|
6365
|
+
static get style() { return pdsLoaderCss; }
|
|
6366
|
+
static get cmpMeta() { return {
|
|
6367
|
+
"$flags$": 9,
|
|
6368
|
+
"$tagName$": "pds-loader",
|
|
6369
|
+
"$members$": {
|
|
6370
|
+
"isLoading": [4, "is-loading"],
|
|
6371
|
+
"showLabel": [4, "show-label"],
|
|
6372
|
+
"size": [513],
|
|
6373
|
+
"variant": [1]
|
|
6374
|
+
},
|
|
6375
|
+
"$listeners$": undefined,
|
|
6376
|
+
"$lazyBundleId$": "-",
|
|
6377
|
+
"$attrsToReflect$": [["size", "size"]]
|
|
6378
|
+
}; }
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
const pdsModalCss = ".pds-modal__backdrop{-ms-flex-align:start;align-items:flex-start;background-color:rgba(0, 0, 0, 0.4);border:0;display:-ms-flexbox;display:flex;height:100%;inset:0;-ms-flex-pack:center;justify-content:center;margin:0;max-height:100%;max-width:100%;opacity:0;padding:0;position:fixed;-webkit-transition:opacity 0.2s ease, visibility 0.2s ease;transition:opacity 0.2s ease, visibility 0.2s ease;visibility:hidden;width:100%;z-index:1000}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-modal__backdrop{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}}pds-modal .pds-modal__backdrop{z-index:1001}.pds-modal__backdrop::-webkit-backdrop{background:transparent}.pds-modal__backdrop::-ms-backdrop{background:transparent}.pds-modal__backdrop::backdrop{background:transparent}.pds-modal__backdrop.open{opacity:1;visibility:visible}.pds-modal{background:var(--pine-color-background-container);border-radius:var(--pine-dimension-sm);-webkit-box-shadow:var(--pine-box-shadow-400);box-shadow:var(--pine-box-shadow-400);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:var(--pine-dimension-md);max-height:calc(100vh - (6vh + 96px));width:100%}@media (min-width: 992px){.pds-modal{-webkit-margin-before:6vh;margin-block-start:6vh}}@media (min-width: 1200px){.pds-modal{-webkit-margin-before:8vh;margin-block-start:8vh}}.pds-modal--sm{max-width:520px}.pds-modal--md{max-width:700px}.pds-modal--lg{max-width:900px}.pds-modal--fullscreen{border-radius:0;height:100%;margin:0;max-height:100vh;max-width:100%}.pds-modal--fullscreen .pds-modal-content{-ms-flex:1;flex:1}";
|
|
6382
|
+
|
|
6383
|
+
class PdsModal {
|
|
6384
|
+
constructor(hostRef) {
|
|
6385
|
+
registerInstance(this, hostRef);
|
|
6386
|
+
this.pdsModalOpen = createEvent(this, "pdsModalOpen");
|
|
6387
|
+
this.pdsModalClose = createEvent(this, "pdsModalClose");
|
|
6388
|
+
this.focusableElements = [];
|
|
6389
|
+
/**
|
|
6390
|
+
* Whether the modal can be dismissed by clicking the backdrop
|
|
6391
|
+
* @default true
|
|
6392
|
+
*/
|
|
6393
|
+
this.backdropDismiss = true;
|
|
6394
|
+
/**
|
|
6395
|
+
* Whether the modal is open
|
|
6396
|
+
* @default false
|
|
6397
|
+
*/
|
|
6398
|
+
this.open = false;
|
|
6399
|
+
/**
|
|
6400
|
+
* The size of the modal
|
|
6401
|
+
* @default 'md'
|
|
6402
|
+
*/
|
|
6403
|
+
this.size = 'md';
|
|
6404
|
+
/**
|
|
6405
|
+
* Stores the list of focusable elements in the modal
|
|
6406
|
+
*/
|
|
6407
|
+
this.focusableElementsArray = [];
|
|
6408
|
+
this.handleBackdropClick = (e) => {
|
|
6409
|
+
if (!this.backdropDismiss || !this.open)
|
|
6410
|
+
return;
|
|
6411
|
+
if (e.target.classList.contains('pds-modal__backdrop')) {
|
|
6412
|
+
e.stopPropagation();
|
|
6413
|
+
// Only close if this is the innermost modal
|
|
6414
|
+
if (this.isInnermostModal()) {
|
|
6415
|
+
this.hideModal();
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
};
|
|
6419
|
+
this.handleKeyDown = (e) => {
|
|
6420
|
+
// If the modal is not open, don't handle any keyboard events
|
|
6421
|
+
if (!this.open)
|
|
6422
|
+
return;
|
|
6423
|
+
// Handle Escape key to close the modal
|
|
6424
|
+
if (e.key === 'Escape') {
|
|
6425
|
+
// Only close if this is the innermost modal
|
|
6426
|
+
if (this.isInnermostModal()) {
|
|
6427
|
+
e.preventDefault();
|
|
6428
|
+
this.hideModal();
|
|
6429
|
+
}
|
|
6430
|
+
return;
|
|
6431
|
+
}
|
|
6432
|
+
// Handle Tab key for focus trapping
|
|
6433
|
+
if (e.key === 'Tab') {
|
|
6434
|
+
// If there are no focusable elements, do nothing
|
|
6435
|
+
if (this.focusableElements.length === 0)
|
|
6436
|
+
return;
|
|
6437
|
+
// Get the first and last focusable elements
|
|
6438
|
+
const firstFocusableElement = this.focusableElements[0];
|
|
6439
|
+
const lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];
|
|
6440
|
+
// Get the current active element
|
|
6441
|
+
const activeElement = document.activeElement;
|
|
6442
|
+
// Check if we need to wrap focus
|
|
6443
|
+
const isFirstElement = activeElement === firstFocusableElement ||
|
|
6444
|
+
firstFocusableElement.contains(activeElement);
|
|
6445
|
+
const isLastElement = activeElement === lastFocusableElement ||
|
|
6446
|
+
lastFocusableElement.contains(activeElement);
|
|
6447
|
+
// If shift + tab is pressed and focus is on the first element, move to the last element
|
|
6448
|
+
if (e.shiftKey && isFirstElement) {
|
|
6449
|
+
e.preventDefault();
|
|
6450
|
+
this.focusElement(lastFocusableElement);
|
|
6451
|
+
}
|
|
6452
|
+
// If tab is pressed and focus is on the last element, move to the first element
|
|
6453
|
+
else if (!e.shiftKey && isLastElement) {
|
|
6454
|
+
e.preventDefault();
|
|
6455
|
+
this.focusElement(firstFocusableElement);
|
|
6456
|
+
}
|
|
6457
|
+
}
|
|
6458
|
+
};
|
|
6459
|
+
}
|
|
6460
|
+
componentDidLoad() {
|
|
6461
|
+
this.modalRef = this.el.querySelector('.pds-modal__backdrop');
|
|
6462
|
+
// Add keyboard event listener
|
|
6463
|
+
document.addEventListener('keydown', this.handleKeyDown);
|
|
6464
|
+
}
|
|
6465
|
+
disconnectedCallback() {
|
|
6466
|
+
// Clean up event listener
|
|
6467
|
+
document.removeEventListener('keydown', this.handleKeyDown);
|
|
6468
|
+
}
|
|
6469
|
+
handleOpenChange(newValue) {
|
|
6470
|
+
if (newValue) {
|
|
6471
|
+
this.showModal();
|
|
6472
|
+
}
|
|
6473
|
+
else {
|
|
6474
|
+
this.hideModal();
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6477
|
+
/**
|
|
6478
|
+
* Updates the list of focusable elements in the modal
|
|
6479
|
+
*/
|
|
6480
|
+
updateFocusableElements() {
|
|
6481
|
+
if (!this.modalRef)
|
|
6482
|
+
return;
|
|
6483
|
+
// Get all focusable elements within the modal
|
|
6484
|
+
const selector = [
|
|
6485
|
+
'a[href]',
|
|
6486
|
+
'button:not([disabled])',
|
|
6487
|
+
'input:not([disabled])',
|
|
6488
|
+
'select:not([disabled])',
|
|
6489
|
+
'textarea:not([disabled])',
|
|
6490
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
6491
|
+
'pds-button:not([disabled])',
|
|
6492
|
+
'pds-link:not([disabled])',
|
|
6493
|
+
'pds-input:not([disabled])',
|
|
6494
|
+
'pds-checkbox:not([disabled])',
|
|
6495
|
+
'pds-radio:not([disabled])',
|
|
6496
|
+
'pds-switch:not([disabled])',
|
|
6497
|
+
'pds-select:not([disabled])',
|
|
6498
|
+
].join(',');
|
|
6499
|
+
this.focusableElements = Array.from(this.modalRef.querySelectorAll(selector));
|
|
6500
|
+
// Filter out elements with display: none or visibility: hidden
|
|
6501
|
+
this.focusableElements = this.focusableElements.filter(el => {
|
|
6502
|
+
const style = window.getComputedStyle(el);
|
|
6503
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
6504
|
+
});
|
|
6505
|
+
}
|
|
6506
|
+
/**
|
|
6507
|
+
* Sets focus to the first focusable element in the modal
|
|
6508
|
+
*/
|
|
6509
|
+
setInitialFocus() {
|
|
6510
|
+
if (this.focusableElements.length === 0)
|
|
6511
|
+
return;
|
|
6512
|
+
// Focus the first focusable element
|
|
6513
|
+
const firstElement = this.focusableElements[0];
|
|
6514
|
+
// For web components, we need to ensure they're properly focused
|
|
6515
|
+
this.focusElement(firstElement);
|
|
6516
|
+
}
|
|
6517
|
+
/**
|
|
6518
|
+
* Helper method to focus an element, with special handling for web components
|
|
6519
|
+
*/
|
|
6520
|
+
focusElement(element) {
|
|
6521
|
+
if (!element)
|
|
6522
|
+
return;
|
|
6523
|
+
try {
|
|
6524
|
+
// Try standard focus first
|
|
6525
|
+
element.focus();
|
|
6526
|
+
// Check if focus worked
|
|
6527
|
+
setTimeout(() => {
|
|
6528
|
+
if (document.activeElement !== element) {
|
|
6529
|
+
// For web components, try to find a focusable element inside
|
|
6530
|
+
if (element.shadowRoot) {
|
|
6531
|
+
const focusableInShadow = element.shadowRoot.querySelector('button, [tabindex], input, a[href]');
|
|
6532
|
+
if (focusableInShadow) {
|
|
6533
|
+
focusableInShadow.focus();
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
}
|
|
6537
|
+
}, 0);
|
|
6538
|
+
}
|
|
6539
|
+
catch (error) {
|
|
6540
|
+
console.error('Error focusing element:', error);
|
|
6541
|
+
}
|
|
6542
|
+
}
|
|
6543
|
+
/**
|
|
6544
|
+
* Opens the modal
|
|
6545
|
+
*/
|
|
6546
|
+
async showModal() {
|
|
6547
|
+
if (this.modalRef) {
|
|
6548
|
+
try {
|
|
6549
|
+
// Store the currently focused element to restore focus when modal closes
|
|
6550
|
+
this.previousActiveElement = document.activeElement;
|
|
6551
|
+
// Use native dialog showModal method which makes the rest of the page inert
|
|
6552
|
+
this.modalRef.showModal();
|
|
6553
|
+
this.open = true;
|
|
6554
|
+
// Update focusable elements and set initial focus
|
|
6555
|
+
// Using a longer timeout to ensure all components are fully rendered
|
|
6556
|
+
setTimeout(() => {
|
|
6557
|
+
this.updateFocusableElements();
|
|
6558
|
+
this.setInitialFocus();
|
|
6559
|
+
this.pdsModalOpen.emit();
|
|
6560
|
+
}, 100);
|
|
6561
|
+
}
|
|
6562
|
+
catch (error) {
|
|
6563
|
+
console.error('Failed to show modal:', error);
|
|
6564
|
+
}
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
/**
|
|
6568
|
+
* Closes the modal
|
|
6569
|
+
*/
|
|
6570
|
+
async hideModal() {
|
|
6571
|
+
if (this.modalRef) {
|
|
6572
|
+
try {
|
|
6573
|
+
this.modalRef.close();
|
|
6574
|
+
this.open = false;
|
|
6575
|
+
// Restore focus to the element that was focused before the modal was opened
|
|
6576
|
+
if (this.previousActiveElement && typeof this.previousActiveElement.focus === 'function') {
|
|
6577
|
+
this.previousActiveElement.focus();
|
|
6578
|
+
}
|
|
6579
|
+
this.pdsModalClose.emit();
|
|
6580
|
+
}
|
|
6581
|
+
catch (error) {
|
|
6582
|
+
console.error('Failed to hide modal:', error);
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6585
|
+
}
|
|
6586
|
+
/**
|
|
6587
|
+
* Gets the z-index of a modal's backdrop element
|
|
6588
|
+
*/
|
|
6589
|
+
getBackdropZIndex(modal) {
|
|
6590
|
+
const backdrop = modal.querySelector('.pds-modal__backdrop');
|
|
6591
|
+
return backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;
|
|
6592
|
+
}
|
|
6593
|
+
/**
|
|
6594
|
+
* Checks if this modal is the innermost (highest z-index) modal
|
|
6595
|
+
*/
|
|
6596
|
+
isInnermostModal() {
|
|
6597
|
+
// Find all open modals
|
|
6598
|
+
const openModals = Array.from(document.querySelectorAll('pds-modal')).filter(modal => modal.open);
|
|
6599
|
+
if (openModals.length === 0)
|
|
6600
|
+
return false;
|
|
6601
|
+
// Get this modal's backdrop element
|
|
6602
|
+
const thisBackdrop = this.el.querySelector('.pds-modal__backdrop');
|
|
6603
|
+
if (!thisBackdrop)
|
|
6604
|
+
return false;
|
|
6605
|
+
// Get computed z-index of all open modal backdrops
|
|
6606
|
+
const modalZIndexes = openModals.map(modal => this.getBackdropZIndex(modal));
|
|
6607
|
+
// Get the highest z-index
|
|
6608
|
+
const maxZIndex = Math.max(...modalZIndexes);
|
|
6609
|
+
// Check if this modal's backdrop has the highest z-index
|
|
6610
|
+
const thisZIndex = this.getBackdropZIndex(this.el);
|
|
6611
|
+
return thisZIndex === maxZIndex;
|
|
6612
|
+
}
|
|
4283
6613
|
render() {
|
|
4284
|
-
return (hAsync("
|
|
4285
|
-
|
|
6614
|
+
return (hAsync("dialog", { key: 'c27d56b7717f739fb8ed7a243e0715a806ed3b0c', class: {
|
|
6615
|
+
'pds-modal__backdrop': true,
|
|
6616
|
+
'open': this.open
|
|
6617
|
+
}, "aria-modal": "true", "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick }, hAsync("div", { key: '083bfc9fa7ec82b9f5deb9b49f19d10abfc5c912', class: `pds-modal pds-modal--${this.size} pds-modal--scrollable` }, hAsync("slot", { key: '2c47ddf024a9b1b7824de478f8d15a4af74627bb' }))));
|
|
4286
6618
|
}
|
|
4287
|
-
|
|
6619
|
+
get el() { return getElement(this); }
|
|
6620
|
+
static get watchers() { return {
|
|
6621
|
+
"open": ["handleOpenChange"]
|
|
6622
|
+
}; }
|
|
6623
|
+
static get style() { return pdsModalCss; }
|
|
4288
6624
|
static get cmpMeta() { return {
|
|
4289
|
-
"$flags$":
|
|
4290
|
-
"$tagName$": "pds-
|
|
6625
|
+
"$flags$": 4,
|
|
6626
|
+
"$tagName$": "pds-modal",
|
|
4291
6627
|
"$members$": {
|
|
6628
|
+
"backdropDismiss": [4, "backdrop-dismiss"],
|
|
4292
6629
|
"componentId": [1, "component-id"],
|
|
4293
|
-
"
|
|
4294
|
-
"
|
|
4295
|
-
"
|
|
4296
|
-
"
|
|
6630
|
+
"open": [1028],
|
|
6631
|
+
"size": [1],
|
|
6632
|
+
"focusableElementsArray": [32],
|
|
6633
|
+
"showModal": [64],
|
|
6634
|
+
"hideModal": [64]
|
|
4297
6635
|
},
|
|
4298
6636
|
"$listeners$": undefined,
|
|
4299
6637
|
"$lazyBundleId$": "-",
|
|
@@ -4301,70 +6639,139 @@ class PdsLink {
|
|
|
4301
6639
|
}; }
|
|
4302
6640
|
}
|
|
4303
6641
|
|
|
4304
|
-
const
|
|
6642
|
+
const pdsModalContentCss = "pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:auto;width:100%}pds-modal-content:has(.pds-modal-content--border-none){border:0}pds-modal-content:has(.pds-modal-content--border-both){-webkit-border-after:1px solid var(--pine-color-grey-200);border-block-end:1px solid var(--pine-color-grey-200);-webkit-border-before:1px solid var(--pine-color-grey-200);border-block-start:1px solid var(--pine-color-grey-200)}pds-modal-content:has(.pds-modal-content--border-top){-webkit-border-before:1px solid var(--pine-color-grey-200);border-block-start:1px solid var(--pine-color-grey-200)}pds-modal-content:has(.pds-modal-content--border-bottom){-webkit-border-after:1px solid var(--pine-color-grey-200);border-block-end:1px solid var(--pine-color-grey-200)}.pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;overflow-y:auto;width:100%}";
|
|
4305
6643
|
|
|
4306
|
-
|
|
4307
|
-
* @slot label - Default slot for Loader label text.
|
|
4308
|
-
*/
|
|
4309
|
-
class PdsLoader {
|
|
6644
|
+
class PdsModalContent {
|
|
4310
6645
|
constructor(hostRef) {
|
|
4311
6646
|
registerInstance(this, hostRef);
|
|
4312
6647
|
/**
|
|
4313
|
-
*
|
|
4314
|
-
|
|
4315
|
-
this.isLoading = true;
|
|
4316
|
-
/**
|
|
4317
|
-
* Determines whether the loader should display a label.
|
|
4318
|
-
*/
|
|
4319
|
-
this.showLabel = false;
|
|
4320
|
-
/**
|
|
4321
|
-
* Sets the size of the spinner loader. Value can be preset or custom.
|
|
4322
|
-
*/
|
|
4323
|
-
this.size = 'md';
|
|
4324
|
-
/**
|
|
4325
|
-
* Determines the type of loader.
|
|
6648
|
+
* The border style for the content area. Automatically set based on available space of the modal content.
|
|
6649
|
+
* @default 'none'
|
|
4326
6650
|
*/
|
|
4327
|
-
this.
|
|
4328
|
-
this.
|
|
4329
|
-
if (this.size !== undefined) {
|
|
4330
|
-
return {
|
|
4331
|
-
height: this.loaderSize(),
|
|
4332
|
-
width: this.loaderSize(),
|
|
4333
|
-
};
|
|
4334
|
-
}
|
|
4335
|
-
};
|
|
6651
|
+
this.border = 'none';
|
|
6652
|
+
this.contentMaxHeight = '60vh';
|
|
4336
6653
|
}
|
|
4337
|
-
|
|
4338
|
-
const
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
6654
|
+
componentDidLoad() {
|
|
6655
|
+
const slotContent = this.el.firstElementChild;
|
|
6656
|
+
const isScrollable = slotContent.scrollHeight > slotContent.clientHeight;
|
|
6657
|
+
this.border = isScrollable ? 'both' : 'none';
|
|
6658
|
+
this.calculateMaxHeight();
|
|
6659
|
+
window.addEventListener('resize', this.calculateMaxHeight.bind(this));
|
|
6660
|
+
}
|
|
6661
|
+
disconnectedCallback() {
|
|
6662
|
+
window.removeEventListener('resize', this.calculateMaxHeight.bind(this));
|
|
6663
|
+
if (this.mutationObserver) {
|
|
6664
|
+
this.mutationObserver.disconnect();
|
|
4347
6665
|
}
|
|
4348
|
-
|
|
4349
|
-
|
|
6666
|
+
}
|
|
6667
|
+
/**
|
|
6668
|
+
* Calculates the max-height based on header and footer heights
|
|
6669
|
+
*/
|
|
6670
|
+
calculateMaxHeight() {
|
|
6671
|
+
// Find the modal element (parent of this component)
|
|
6672
|
+
const modalElement = this.el.closest('pds-modal');
|
|
6673
|
+
if (!modalElement)
|
|
6674
|
+
return;
|
|
6675
|
+
setTimeout(() => {
|
|
6676
|
+
// Find header and footer elements
|
|
6677
|
+
const headerElement = modalElement.querySelector('pds-modal-header');
|
|
6678
|
+
const footerElement = modalElement.querySelector('pds-modal-footer');
|
|
6679
|
+
// Get header and footer heights
|
|
6680
|
+
const headerHeight = headerElement ? headerElement.offsetHeight : 0;
|
|
6681
|
+
const footerHeight = footerElement ? footerElement.offsetHeight : 0;
|
|
6682
|
+
// Set the max-height as a calculation
|
|
6683
|
+
if (headerHeight > 0 || footerHeight > 0) {
|
|
6684
|
+
// Calculate the available height by subtracting:
|
|
6685
|
+
// 1. Header and footer heights
|
|
6686
|
+
// 2. Modal padding (48px)
|
|
6687
|
+
// 3. Additional space for modal positioning (6vh)
|
|
6688
|
+
// 4. Extra adjustment for perfect fit (50px)
|
|
6689
|
+
const viewportAdjustment = Math.round(window.innerHeight * 0.06); // 6vh approximation
|
|
6690
|
+
const totalReduction = headerHeight + footerHeight + 48 + viewportAdjustment + 50;
|
|
6691
|
+
// Set the content max height
|
|
6692
|
+
this.contentMaxHeight = `calc(100vh - ${totalReduction}px)`;
|
|
6693
|
+
// Apply the style directly to ensure it takes effect
|
|
6694
|
+
const contentElement = this.el.querySelector('.pds-modal-content');
|
|
6695
|
+
if (contentElement) {
|
|
6696
|
+
contentElement.style.maxHeight = this.contentMaxHeight;
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
else {
|
|
6700
|
+
this.contentMaxHeight = '60vh'; // Default fallback
|
|
6701
|
+
}
|
|
6702
|
+
}, 100); // Delay to ensure DOM is fully rendered
|
|
6703
|
+
// Set up mutation observer if not already done
|
|
6704
|
+
if (!this.mutationObserver && modalElement) {
|
|
6705
|
+
this.mutationObserver = new MutationObserver(() => {
|
|
6706
|
+
this.calculateMaxHeight();
|
|
6707
|
+
});
|
|
6708
|
+
// Observe changes to the modal's children
|
|
6709
|
+
this.mutationObserver.observe(modalElement, {
|
|
6710
|
+
childList: true,
|
|
6711
|
+
subtree: true,
|
|
6712
|
+
attributes: true,
|
|
6713
|
+
attributeFilter: ['style', 'class']
|
|
6714
|
+
});
|
|
4350
6715
|
}
|
|
4351
6716
|
}
|
|
4352
6717
|
render() {
|
|
4353
|
-
return (hAsync(Host, { key: '
|
|
6718
|
+
return (hAsync(Host, { key: '4ff98a386d18f5047752cf8915fa30ea3b6805e2' }, hAsync("div", { key: '686b6fc2263664f7b5f8178827c9e9ae9d53d086', class: {
|
|
6719
|
+
'pds-modal-content': true,
|
|
6720
|
+
[`pds-modal-content--border-${this.border}`]: true
|
|
6721
|
+
}, style: { maxHeight: this.contentMaxHeight }, tabindex: "-1" }, hAsync("slot", { key: '4531f6ba4c499c9404704c9d3a59e1b9ef4744f9' }))));
|
|
4354
6722
|
}
|
|
4355
|
-
|
|
6723
|
+
get el() { return getElement(this); }
|
|
6724
|
+
static get style() { return pdsModalContentCss; }
|
|
4356
6725
|
static get cmpMeta() { return {
|
|
4357
|
-
"$flags$":
|
|
4358
|
-
"$tagName$": "pds-
|
|
6726
|
+
"$flags$": 4,
|
|
6727
|
+
"$tagName$": "pds-modal-content",
|
|
4359
6728
|
"$members$": {
|
|
4360
|
-
"
|
|
4361
|
-
"
|
|
4362
|
-
"size": [513],
|
|
4363
|
-
"variant": [1]
|
|
6729
|
+
"border": [513],
|
|
6730
|
+
"contentMaxHeight": [32]
|
|
4364
6731
|
},
|
|
4365
6732
|
"$listeners$": undefined,
|
|
4366
6733
|
"$lazyBundleId$": "-",
|
|
4367
|
-
"$attrsToReflect$": [["
|
|
6734
|
+
"$attrsToReflect$": [["border", "border"]]
|
|
6735
|
+
}; }
|
|
6736
|
+
}
|
|
6737
|
+
|
|
6738
|
+
const pdsModalFooterCss = "pds-modal-footer{display:block;width:100%}.pds-modal__footer{width:100%}";
|
|
6739
|
+
|
|
6740
|
+
class PdsModalFooter {
|
|
6741
|
+
constructor(hostRef) {
|
|
6742
|
+
registerInstance(this, hostRef);
|
|
6743
|
+
}
|
|
6744
|
+
render() {
|
|
6745
|
+
return (hAsync("footer", { key: 'ea47425a063c04c1cdff3481fc09f32bd65b7679', class: "pds-modal__footer" }, hAsync("slot", { key: '55c560cb8cca95687eb04ba727ae45542ef2209f' })));
|
|
6746
|
+
}
|
|
6747
|
+
static get style() { return pdsModalFooterCss; }
|
|
6748
|
+
static get cmpMeta() { return {
|
|
6749
|
+
"$flags$": 4,
|
|
6750
|
+
"$tagName$": "pds-modal-footer",
|
|
6751
|
+
"$members$": undefined,
|
|
6752
|
+
"$listeners$": undefined,
|
|
6753
|
+
"$lazyBundleId$": "-",
|
|
6754
|
+
"$attrsToReflect$": []
|
|
6755
|
+
}; }
|
|
6756
|
+
}
|
|
6757
|
+
|
|
6758
|
+
const pdsModalHeaderCss = "pds-modal-header{display:block;width:100%}.pds-modal__header{width:100%}";
|
|
6759
|
+
|
|
6760
|
+
class PdsModalHeader {
|
|
6761
|
+
constructor(hostRef) {
|
|
6762
|
+
registerInstance(this, hostRef);
|
|
6763
|
+
}
|
|
6764
|
+
render() {
|
|
6765
|
+
return (hAsync("header", { key: '63d1121b84d10ea99354d07b029b7625d52d9095', class: "pds-modal__header" }, hAsync("slot", { key: 'dd08fc600f122e422ccd3161bc558f3b9cc075f9' })));
|
|
6766
|
+
}
|
|
6767
|
+
static get style() { return pdsModalHeaderCss; }
|
|
6768
|
+
static get cmpMeta() { return {
|
|
6769
|
+
"$flags$": 4,
|
|
6770
|
+
"$tagName$": "pds-modal-header",
|
|
6771
|
+
"$members$": undefined,
|
|
6772
|
+
"$listeners$": undefined,
|
|
6773
|
+
"$lazyBundleId$": "-",
|
|
6774
|
+
"$attrsToReflect$": []
|
|
4368
6775
|
}; }
|
|
4369
6776
|
}
|
|
4370
6777
|
|
|
@@ -4422,27 +6829,59 @@ class PdsPopover {
|
|
|
4422
6829
|
const offset = 8;
|
|
4423
6830
|
switch (this.placement) {
|
|
4424
6831
|
case 'top':
|
|
6832
|
+
top = triggerRect.top - popoverRect.height - offset;
|
|
6833
|
+
left = triggerRect.left + (triggerRect.width - popoverRect.width) / 2;
|
|
6834
|
+
break;
|
|
6835
|
+
case 'top-start':
|
|
4425
6836
|
top = triggerRect.top - popoverRect.height - offset;
|
|
4426
6837
|
left = triggerRect.left;
|
|
4427
6838
|
break;
|
|
6839
|
+
case 'top-end':
|
|
6840
|
+
top = triggerRect.top - popoverRect.height - offset;
|
|
6841
|
+
left = triggerRect.right - popoverRect.width;
|
|
6842
|
+
break;
|
|
4428
6843
|
case 'right':
|
|
6844
|
+
top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2;
|
|
6845
|
+
left = triggerRect.right + offset;
|
|
6846
|
+
break;
|
|
6847
|
+
case 'right-start':
|
|
4429
6848
|
top = triggerRect.top;
|
|
4430
6849
|
left = triggerRect.right + offset;
|
|
4431
6850
|
break;
|
|
6851
|
+
case 'right-end':
|
|
6852
|
+
top = triggerRect.bottom - popoverRect.height;
|
|
6853
|
+
left = triggerRect.right + offset;
|
|
6854
|
+
break;
|
|
4432
6855
|
case 'bottom':
|
|
6856
|
+
top = triggerRect.bottom + offset;
|
|
6857
|
+
left = triggerRect.left + (triggerRect.width - popoverRect.width) / 2;
|
|
6858
|
+
break;
|
|
6859
|
+
case 'bottom-start':
|
|
4433
6860
|
top = triggerRect.bottom + offset;
|
|
4434
6861
|
left = triggerRect.left;
|
|
4435
6862
|
break;
|
|
6863
|
+
case 'bottom-end':
|
|
6864
|
+
top = triggerRect.bottom + offset;
|
|
6865
|
+
left = triggerRect.right - popoverRect.width;
|
|
6866
|
+
break;
|
|
4436
6867
|
case 'left':
|
|
6868
|
+
top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2;
|
|
6869
|
+
left = triggerRect.left - popoverRect.width - offset;
|
|
6870
|
+
break;
|
|
6871
|
+
case 'left-start':
|
|
4437
6872
|
top = triggerRect.top;
|
|
4438
6873
|
left = triggerRect.left - popoverRect.width - offset;
|
|
4439
6874
|
break;
|
|
6875
|
+
case 'left-end':
|
|
6876
|
+
top = triggerRect.bottom - popoverRect.height;
|
|
6877
|
+
left = triggerRect.left - popoverRect.width - offset;
|
|
6878
|
+
break;
|
|
4440
6879
|
}
|
|
4441
6880
|
popoverEl.style.top = `${top}px`;
|
|
4442
6881
|
popoverEl.style.left = `${left}px`;
|
|
4443
6882
|
}
|
|
4444
6883
|
render() {
|
|
4445
|
-
return (hAsync(Host, { key: '
|
|
6884
|
+
return (hAsync(Host, { key: 'b150645b71d528055c6cd6cf2ff9c898c3fe1f3f' }, hAsync("button", { key: '3090efe8ffd85d0d3e4d5dc5f54147a5aff61fb9', class: "pds-popover__trigger", popoverTarget: this.componentId, popoverTargetAction: this.popoverTargetAction, onClick: this.handleClick }, this.text), hAsync("div", { key: '6e9b4af0278507b6f8bf4b5f2d8c3a2891f974b6', class: `pds-popover ${this.active ? 'pds-popover--active' : ''}`, id: this.componentId, popover: this.popoverType, style: { maxWidth: `${this.maxWidth}px` } }, hAsync("slot", { key: 'f4303d3f3aca19314413b86d3973c8d9f1477e8f' }))));
|
|
4446
6885
|
}
|
|
4447
6886
|
get el() { return getElement(this); }
|
|
4448
6887
|
static get style() { return pdsPopoverCss; }
|
|
@@ -4486,7 +6925,7 @@ class PdsProgress {
|
|
|
4486
6925
|
this.showPercent = false;
|
|
4487
6926
|
}
|
|
4488
6927
|
render() {
|
|
4489
|
-
return (hAsync(Host, { key: '
|
|
6928
|
+
return (hAsync(Host, { key: '71ce602dccee62ee76ef51c3994af86829399452', class: this.animated ? { 'is-animated': this.animated } : '' }, hAsync("div", { key: 'c26188786bcfd4d6f039050032cd48982327355e', class: "pds-progress" }, hAsync("label", { key: 'e18f75dae8fcf3fde684156638cc47f9d5e253dd', class: "pds-progress__label", htmlFor: this.componentId }, this.label), hAsync("progress", { key: '37a5bb5609e25912c006a89dd0bbc244cfa5896b', id: this.componentId, max: "100", style: this.fillColor ? { '--color-progress-fill': this.fillColor } : {}, value: this.percent })), this.showPercent && hAsync("div", { key: '68e859cafbcf74c74fc3b72a5347fb03eda83556', class: "pds-progress__percentage" }, this.percent, "%")));
|
|
4490
6929
|
}
|
|
4491
6930
|
static get style() { return pdsProgressCss; }
|
|
4492
6931
|
static get cmpMeta() { return {
|
|
@@ -4554,9 +6993,9 @@ class PdsRadio {
|
|
|
4554
6993
|
return classNames.join(' ');
|
|
4555
6994
|
}
|
|
4556
6995
|
render() {
|
|
4557
|
-
return (hAsync(Host, { key: '
|
|
4558
|
-
hAsync("div", { key: '
|
|
4559
|
-
hAsync("div", { key: '
|
|
6996
|
+
return (hAsync(Host, { key: 'a31d9cd94150a104a83595043dc003fa5d9779a2', class: this.classNames() }, hAsync("label", { key: '1d71e515a00c25bbaac7d0420f4a4ee6a5189836', htmlFor: this.componentId }, hAsync("input", { key: '800b2bbf703e68fbf60f62d6c28228759d976436', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, type: "radio", id: this.componentId, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleRadioChange }), hAsync("span", { key: '33c241168498b07a25dfc5ac6f9244eb3ce93547', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), this.helperMessage &&
|
|
6997
|
+
hAsync("div", { key: 'f159de72b68a0f1bf07abb52d50a0d6d89b4f766', class: 'pds-radio__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
6998
|
+
hAsync("div", { key: 'fb5877c78e519db27964308c1607ab58fc2fcb08', class: `pds-radio__message pds-radio__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: '1385571ed511a800778d64edf48e2853a1c4793e', icon: danger, size: "small" }), this.errorMessage)));
|
|
4560
6999
|
}
|
|
4561
7000
|
static get style() { return labelCss$3 + pdsRadioCss; }
|
|
4562
7001
|
static get cmpMeta() { return {
|
|
@@ -4618,7 +7057,7 @@ class PdsRow {
|
|
|
4618
7057
|
})), (this.minHeight && {
|
|
4619
7058
|
'min-height': this.minHeight,
|
|
4620
7059
|
}));
|
|
4621
|
-
return hAsync(Host, { key: '
|
|
7060
|
+
return hAsync(Host, { key: '2e962d6f8edd5023b3d8d7c8192e4f4ea2b2d2be', class: `pds-row ${rowClasses}`, style: rowInlineStyles });
|
|
4622
7061
|
}
|
|
4623
7062
|
static get style() { return pdsRowCss; }
|
|
4624
7063
|
static get cmpMeta() { return {
|
|
@@ -4759,8 +7198,8 @@ class PdsSelect {
|
|
|
4759
7198
|
return classNames.join(' ');
|
|
4760
7199
|
}
|
|
4761
7200
|
render() {
|
|
4762
|
-
return (hAsync(Host, { key: '
|
|
4763
|
-
hAsync("label", { key: '
|
|
7201
|
+
return (hAsync(Host, { key: '2d39b1eac389e27eea511728ef668d4d548d0c09', "aria-disabled": this.disabled ? 'true' : null, class: this.classNames() }, hAsync("div", { key: 'c0c4e64a19b7b11e0d64d94cbc529be7e455b12a', class: "pds-select" }, this.label &&
|
|
7202
|
+
hAsync("label", { key: '9eadfcc4e6fd6d42f718eb0ad1542f7c03b67052', htmlFor: this.componentId }, this.label), hAsync("select", { key: 'eb1d368ed4f765dead79f6101265e922bd06ca94', autocomplete: this.autocomplete || undefined, class: "pds-select__field", disabled: this.disabled, id: this.componentId, multiple: this.multiple, name: this.name, onChange: this.onSelectUpdate, required: this.required, ref: (el) => (this.selectEl = el) }), hAsync("div", { key: '1dcbfe5d51e55af333e80bb99995cef1693f36c1', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, hAsync("slot", { key: '4d0c76c632e9588dc178c859be5ef1fd474fa191', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && hAsync("pds-icon", { key: '954d31034ed522ba128c9048998e92553592d12f', class: "pds-select__select-icon", icon: enlarge }))));
|
|
4764
7203
|
}
|
|
4765
7204
|
static get watchers() { return {
|
|
4766
7205
|
"value": ["valueChanged"]
|
|
@@ -7499,7 +9938,7 @@ class PdsSortable {
|
|
|
7499
9938
|
Sortable.create(this.el, sortableOptions);
|
|
7500
9939
|
}
|
|
7501
9940
|
render() {
|
|
7502
|
-
return (hAsync(Host, { key: '
|
|
9941
|
+
return (hAsync(Host, { key: 'cbbd28ad002093f627befee44c5ae911f86b0221', class: this.classNames(), id: this.componentId }, hAsync("slot", { key: 'f4ef09a82d8e47b471a2463912fd37ac3b9b383f' })));
|
|
7503
9942
|
}
|
|
7504
9943
|
get el() { return getElement(this); }
|
|
7505
9944
|
static get style() { return pdsSortableCss; }
|
|
@@ -7546,7 +9985,7 @@ class PdsSortableItem {
|
|
|
7546
9985
|
}
|
|
7547
9986
|
}
|
|
7548
9987
|
render() {
|
|
7549
|
-
return (hAsync(Host, { key: '
|
|
9988
|
+
return (hAsync(Host, { key: 'b54ef05cc6a8f2dd3c6f7f971b32bd4566738600', class: "pds-sortable-item", id: this.componentId }, this.showHandle && (hAsync("div", { key: 'fa402ec9c8ad9a75a73a23c28d2a5101bcf3d170', class: "pds-sortable-item__handle" }, hAsync("pds-icon", { key: 'def73620ade698eccc0fb8abb4dfeb5b7de46c95', icon: handle }))), hAsync("slot", { key: 'd9dfcc135b7bd8bf893360798baa30297d4fb4ea' }), this.enableActions && (hAsync("div", { key: 'd0852370b35b213238739cea2aa1c3dcd91cbd9d', class: "pds-sortable-item__actions" }, hAsync("slot", { key: 'cbf966a4c56be43ced57e200b91d64e68f5077d9', name: "sortable-item-actions" })))));
|
|
7550
9989
|
}
|
|
7551
9990
|
get el() { return getElement(this); }
|
|
7552
9991
|
static get style() { return pdsSortableItemCss; }
|
|
@@ -7572,6 +10011,7 @@ class PdsSwitch {
|
|
|
7572
10011
|
constructor(hostRef) {
|
|
7573
10012
|
registerInstance(this, hostRef);
|
|
7574
10013
|
this.pdsSwitchChange = createEvent(this, "pdsSwitchChange");
|
|
10014
|
+
this.inheritedAttributes = {};
|
|
7575
10015
|
/**
|
|
7576
10016
|
* Determines the input 'checked' state.
|
|
7577
10017
|
*/
|
|
@@ -7606,10 +10046,13 @@ class PdsSwitch {
|
|
|
7606
10046
|
return switchClasses;
|
|
7607
10047
|
};
|
|
7608
10048
|
}
|
|
10049
|
+
componentWillLoad() {
|
|
10050
|
+
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
10051
|
+
}
|
|
7609
10052
|
render() {
|
|
7610
|
-
return (hAsync(Host, { key: '
|
|
7611
|
-
hAsync("div", { key: '
|
|
7612
|
-
hAsync("div", { key: '
|
|
10053
|
+
return (hAsync(Host, { key: '04755f80f89f4eff8d44f8c8e76e6020f6be65fb', class: this.switchClassNames(), "aria-disabled": this.disabled ? 'true' : null }, hAsync("label", { key: 'cdf1c4d58c640954ada9d50b4832fa26094b3476', htmlFor: this.componentId }, hAsync("input", Object.assign({ key: 'f141885523b649f8dca4e9fe11494ebf640510bc', "aria-describedby": assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.disabled, id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate, required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), hAsync("span", { key: 'f80b28bd0904dfae3a4e7b46bfecc46c82843764', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), this.helperMessage &&
|
|
10054
|
+
hAsync("div", { key: '7b60b9c273f4773f9d0e90fd8132dc979c088183', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
10055
|
+
hAsync("div", { key: '9d068c8da41e985ff63851a909f985a80bdabf89', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, hAsync("pds-icon", { key: '14a69e6ce04e3434f440f19d6ea0e9b347a9b352', icon: danger, size: "small" }), this.errorMessage)));
|
|
7613
10056
|
}
|
|
7614
10057
|
get el() { return getElement(this); }
|
|
7615
10058
|
static get style() { return labelCss$1 + pdsSwitchCss; }
|
|
@@ -7651,9 +10094,9 @@ class PdsTab {
|
|
|
7651
10094
|
this.pdsTabClick.emit([index, parentComponentId]);
|
|
7652
10095
|
}
|
|
7653
10096
|
render() {
|
|
7654
|
-
const availabilityTabEdgeInlineStart = (hAsync("span", { key: '
|
|
7655
|
-
const availabilityTabEdgeInlineEnd = (hAsync("span", { key: '
|
|
7656
|
-
return (hAsync(Host, { key: '
|
|
10097
|
+
const availabilityTabEdgeInlineStart = (hAsync("span", { key: '5256039455be2b9e0dbfd18caf5a7a4f6ca2f047', class: "pds-tab-edge", role: "presentation" }));
|
|
10098
|
+
const availabilityTabEdgeInlineEnd = (hAsync("span", { key: 'c65bc9ccb5a43ee1c1f634fa19c4ac6d66259747', class: "pds-tab-edge pds-tab-edge--end", role: "presentation" }));
|
|
10099
|
+
return (hAsync(Host, { key: '0f379e0d4cce1590dc917196dd520b26bb5e89d9', variant: this.variant, slot: "tabs", index: this.index }, hAsync("button", { key: '70b033b21ff9093b2393565c026ff4954d74dbf3', role: "tab", id: this.parentComponentId + "__" + this.name, "aria-controls": this.parentComponentId + "__" + this.name + "-panel", tabindex: this.selected ? "0" : "-1", "aria-selected": this.selected ? "true" : "false", class: this.selected ? "pds-tab is-active" : "pds-tab", onClick: this.onTabClick.bind(this, this.index, this.parentComponentId) }, this.variant === "availability" && availabilityTabEdgeInlineStart, this.variant === "availability" && availabilityTabEdgeInlineEnd, hAsync("div", { key: 'b01547140256199ec4e829a83e11ea27d059e0ea', class: "pds-tab__content" }, hAsync("slot", { key: '7dce311009731af53a4b6fff4af6e90f91a060a7' })))));
|
|
7657
10100
|
}
|
|
7658
10101
|
get el() { return getElement(this); }
|
|
7659
10102
|
static get style() { return pdsTabCss; }
|
|
@@ -7762,7 +10205,7 @@ class PdsTable {
|
|
|
7762
10205
|
headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;
|
|
7763
10206
|
}
|
|
7764
10207
|
render() {
|
|
7765
|
-
return (hAsync(Host, { key: '
|
|
10208
|
+
return (hAsync(Host, { key: 'b874cdb2b0f0dcc313befdd557d5ce4203a183ac', class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, hAsync("slot", { key: '52bcce99761712662828ba5a708155410de6e15d' })));
|
|
7766
10209
|
}
|
|
7767
10210
|
get el() { return getElement(this); }
|
|
7768
10211
|
static get style() { return pdsTableCss; }
|
|
@@ -7791,7 +10234,7 @@ class PdsTableBody {
|
|
|
7791
10234
|
registerInstance(this, hostRef);
|
|
7792
10235
|
}
|
|
7793
10236
|
render() {
|
|
7794
|
-
return (hAsync(Host, { key: '
|
|
10237
|
+
return (hAsync(Host, { key: 'ec68d794fd59876a83f40077d29e97af4366f19a', role: "rowgroup" }, hAsync("slot", { key: '9d052cdf3c0ea8afa86a6900d492c9de5c9adaf1' })));
|
|
7795
10238
|
}
|
|
7796
10239
|
static get style() { return pdsTableBodyCss; }
|
|
7797
10240
|
static get cmpMeta() { return {
|
|
@@ -7845,11 +10288,11 @@ class PdsTableCell {
|
|
|
7845
10288
|
return classNames.join(' ');
|
|
7846
10289
|
}
|
|
7847
10290
|
render() {
|
|
7848
|
-
return (hAsync(Host, { key: '
|
|
10291
|
+
return (hAsync(Host, { key: 'f86b2ae5eaee0f3bcb1cd55951a0e83bce4ccfca', class: this.classNames(), role: "gridcell", style: this.tableRef &&
|
|
7849
10292
|
this.tableRef.fixedColumn &&
|
|
7850
10293
|
this.tableRef.selectable
|
|
7851
10294
|
? { '--fixed-cell-position': '40px' }
|
|
7852
|
-
: {} }, hAsync("slot", { key: '
|
|
10295
|
+
: {} }, hAsync("slot", { key: '347d6487bc869bf9903c5e1fb8b05ca29d6e6d50' })));
|
|
7853
10296
|
}
|
|
7854
10297
|
get hostElement() { return getElement(this); }
|
|
7855
10298
|
static get style() { return pdsTableCellCss; }
|
|
@@ -7910,7 +10353,7 @@ class PdsTableHead {
|
|
|
7910
10353
|
}
|
|
7911
10354
|
}
|
|
7912
10355
|
render() {
|
|
7913
|
-
return (hAsync(Host, { key: '
|
|
10356
|
+
return (hAsync(Host, { key: 'f74bfa35afc2f26957ffff431c5438fbb159e15b', role: "row" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-head-cell", { key: '13bcfb69c1e8ab696ba702d39209944fa97f34ea', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, hAsync("pds-checkbox", { key: '898170f579ad89627621bb693908b1b04ca25f83', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected }))), hAsync("slot", { key: 'd7dc459310c32ee112e05df947b8c9da57180035' })));
|
|
7914
10357
|
}
|
|
7915
10358
|
get hostElement() { return getElement(this); }
|
|
7916
10359
|
static get style() { return pdsTableHeadCss; }
|
|
@@ -7992,11 +10435,11 @@ class PdsTableHeadCell {
|
|
|
7992
10435
|
return classNames.join(' ');
|
|
7993
10436
|
}
|
|
7994
10437
|
render() {
|
|
7995
|
-
return (hAsync(Host, { key: '
|
|
10438
|
+
return (hAsync(Host, { key: '9f9138f88914add530416fbf776d5a68685a3fab', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, style: this.tableRef &&
|
|
7996
10439
|
this.tableRef.fixedColumn &&
|
|
7997
10440
|
this.tableRef.selectable
|
|
7998
10441
|
? { '--fixed-cell-position': '40px' }
|
|
7999
|
-
: {} }, hAsync("slot", { key: '
|
|
10442
|
+
: {} }, hAsync("slot", { key: '84d3c20fc656b468d6c46cc9f5a8c49071af7d04' }), this.sortable && (hAsync("pds-icon", { key: '4ad357565f9542604c16ade571bc5e55b4fa1077', icon: this.sortingDirection === 'asc' ? upSmall : downSmall }))));
|
|
8000
10443
|
}
|
|
8001
10444
|
get hostElement() { return getElement(this); }
|
|
8002
10445
|
static get style() { return pdsTableHeadCellCss; }
|
|
@@ -8062,7 +10505,7 @@ class PdsTableRow {
|
|
|
8062
10505
|
}
|
|
8063
10506
|
}
|
|
8064
10507
|
render() {
|
|
8065
|
-
return (hAsync(Host, { key: '
|
|
10508
|
+
return (hAsync(Host, { key: 'd3ebaeea3a8007634ea821da5a458189a36837a7', class: this.classNames(), role: "row" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-cell", { key: '62705fadc9cdb18de2eebd4c608c0dffa119cfba', part: this.tableRef.fixedColumn ? 'checkbox-cell' : '', class: this.tableRef.selectable ? 'has-checkbox' : '' }, hAsync("pds-checkbox", { key: '19e01d4eef0657f7e34a5a9061e568a18eb9b7c6', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected }))), hAsync("slot", { key: '59b3c28a61f36f9ea6e891876bf007590a7cce51' })));
|
|
8066
10509
|
}
|
|
8067
10510
|
get hostElement() { return getElement(this); }
|
|
8068
10511
|
static get style() { return pdsTableRowCss; }
|
|
@@ -8091,7 +10534,7 @@ class PdsTabpanel {
|
|
|
8091
10534
|
this.selected = false; // eslint-disable-line @stencil-community/strict-mutable
|
|
8092
10535
|
}
|
|
8093
10536
|
render() {
|
|
8094
|
-
return (hAsync(Host, { key: '
|
|
10537
|
+
return (hAsync(Host, { key: 'fe7548d8da3149d13d23b41d6860beb1f351b3c6', slot: "tabpanels" }, hAsync("div", { key: 'bf50bfc20be721ba467ff22ba24f0410153223f5', role: "tabpanel", id: this.parentComponentId + "__" + this.name + '-panel', tabindex: "0", "aria-labelledby": this.parentComponentId + "__" + this.name, class: this.selected ? "pds-tabpanel is-active" : "pds-tabpanel" }, hAsync("slot", { key: '3de1657e963e7e9fca81fac07f78edc064cd86e7' }))));
|
|
8095
10538
|
}
|
|
8096
10539
|
get el() { return getElement(this); }
|
|
8097
10540
|
static get style() { return pdsTabpanelCss; }
|
|
@@ -8192,7 +10635,7 @@ class PdsTabs {
|
|
|
8192
10635
|
this.passPropsToChildren();
|
|
8193
10636
|
}
|
|
8194
10637
|
render() {
|
|
8195
|
-
return (hAsync(Host, { key: '
|
|
10638
|
+
return (hAsync(Host, { key: '571b33280e4473d1a8bef6e90103c4d42a29ed03', "active-tab-name": this.activeTabName, class: this.classNames(), id: this.componentId }, hAsync("div", { key: 'c50a6cd3b8a06e13ff14626258769b7918f57ed0', class: "pds-tabs__tablist", role: "tablist", "aria-label": this.tablistLabel }, hAsync("slot", { key: '1fcbefc41181ce48f2a109ee0703d03f9975784f', name: "tabs" })), hAsync("slot", { key: '9762d5533cbbea5672f2a4235b90b3a766066179', name: "tabpanels" })));
|
|
8196
10639
|
}
|
|
8197
10640
|
get el() { return getElement(this); }
|
|
8198
10641
|
static get style() { return pdsTabsCss; }
|
|
@@ -8232,7 +10675,7 @@ class PdsText {
|
|
|
8232
10675
|
${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}
|
|
8233
10676
|
${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}
|
|
8234
10677
|
`;
|
|
8235
|
-
return (hAsync(Tag, { key: '
|
|
10678
|
+
return (hAsync(Tag, { key: 'dbb51692cc782fcef771390934ca6efc7a2728b9', style: this.color && setColor(this.color), class: typeClasses }, hAsync("slot", { key: '9e7351a9de468132a213f3e26c20c8ca894881a8' })));
|
|
8236
10679
|
}
|
|
8237
10680
|
get el() { return getElement(this); }
|
|
8238
10681
|
static get style() { return pdsTextCss; }
|
|
@@ -8248,11 +10691,11 @@ class PdsText {
|
|
|
8248
10691
|
"size": [1],
|
|
8249
10692
|
"weight": [1],
|
|
8250
10693
|
"tag": [1],
|
|
8251
|
-
"truncate": [
|
|
10694
|
+
"truncate": [516]
|
|
8252
10695
|
},
|
|
8253
10696
|
"$listeners$": undefined,
|
|
8254
10697
|
"$lazyBundleId$": "-",
|
|
8255
|
-
"$attrsToReflect$": []
|
|
10698
|
+
"$attrsToReflect$": [["truncate", "truncate"]]
|
|
8256
10699
|
}; }
|
|
8257
10700
|
}
|
|
8258
10701
|
|
|
@@ -8378,17 +10821,17 @@ class PdsTextarea {
|
|
|
8378
10821
|
this.debounceChanged();
|
|
8379
10822
|
}
|
|
8380
10823
|
componentWillLoad() {
|
|
8381
|
-
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el));
|
|
10824
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes$1(this.el));
|
|
8382
10825
|
}
|
|
8383
10826
|
componentDidLoad() {
|
|
8384
10827
|
this.originalPdsInput = this.pdsInput;
|
|
8385
10828
|
}
|
|
8386
10829
|
render() {
|
|
8387
10830
|
const value = this.getValue();
|
|
8388
|
-
return (hAsync(Host, { key: '
|
|
8389
|
-
hAsync("label", { key: '
|
|
8390
|
-
hAsync("p", { key: '
|
|
8391
|
-
hAsync("p", { key: '
|
|
10831
|
+
return (hAsync(Host, { key: 'a7db5e94c424af94616faae520aa8f39ee23cedd', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null }, hAsync("div", { key: '26c4a0b5e464e648f627c6de6d948a159e1b4603', class: "pds-textarea" }, this.label &&
|
|
10832
|
+
hAsync("label", { key: 'b32a15274079ba8fdb4d911dfc4915da9437a57a', htmlFor: this.componentId }, this.label), hAsync("textarea", Object.assign({ key: '6348ed57813a044849a8de53a172f9f724d7b00e', ref: (el) => this.nativeTextarea = el, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, class: this.textareaClassNames(), disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, rows: this.rows, onBlur: this.onBlur, onChange: this.onTextareaChange, onFocus: this.onFocus, onInput: this.onInput }, this.inheritedAttributes), value), this.helperMessage &&
|
|
10833
|
+
hAsync("p", { key: '0f9a7606295b5d020e4762f2dc66bc920a60f8da', class: "pds-textarea__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.invalid &&
|
|
10834
|
+
hAsync("p", { key: 'badc7d45069955709993c594ed9792c7cdc8727b', "aria-live": "assertive", class: "pds-textarea__error-message", id: messageId(this.componentId, 'error') }, hAsync("pds-icon", { key: '460955036713315d8dd7b125a50b09d0cb1a282d', icon: danger, size: "small" }), this.errorMessage))));
|
|
8392
10835
|
}
|
|
8393
10836
|
get el() { return getElement(this); }
|
|
8394
10837
|
static get watchers() { return {
|
|
@@ -8423,75 +10866,205 @@ class PdsTextarea {
|
|
|
8423
10866
|
}; }
|
|
8424
10867
|
}
|
|
8425
10868
|
|
|
10869
|
+
const pdsToastCss = ":host{--animation-duration:0.3s;--animation-timing:cubic-bezier(0.4, 0, 0.2, 1);--padding-inline:var(--pine-dimension-md);--padding-inline-desktop:var(--pine-dimension-2xl);--sizing-height-default:68px;--sizing-min-width:calc(var(--sizing-total-width) - (var(--padding-inline) * 2));--sizing-min-width-desktop:calc(var(--sizing-total-width) - (var(--padding-inline-desktop) * 2));--sizing-total-width:350px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;font:var(--pine-typography-body-medium)}.pds-toast{-ms-flex-align:center;align-items:center;-webkit-animation:pds-toast-animate-in var(--animation-duration) var(--animation-timing);animation:pds-toast-animate-in var(--animation-duration) var(--animation-timing);background-color:var(--pine-color-primary);border-radius:var(--pine-dimension-xs);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);color:var(--pine-color-text-primary);display:-ms-flexbox;display:flex;height:var(--sizing-height-default);-ms-flex-pack:start;justify-content:flex-start;-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs);max-width:90vw;min-width:var(--sizing-min-width);padding:0 var(--padding-inline);position:relative;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media screen and (max-width: 767px){.pds-toast{height:36px;max-width:calc(100vw - var(--pine-dimension-2xs) * 2);min-width:auto;padding-inline:var(--pine-dimension-2xs)}}.pds-toast--danger{background-color:var(--pine-color-danger)}.pds-toast--loading .pds-toast__loader{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm);position:relative}.pds-toast--loading .pds-toast__loader-spinner{-webkit-animation:pds-toast-rotate 2s linear infinite;animation:pds-toast-rotate 2s linear infinite;height:20px;width:20px}.pds-toast--loading .pds-toast__loader-path{-webkit-animation:pds-toast-dash 1.5s ease-in-out infinite;animation:pds-toast-dash 1.5s ease-in-out infinite;stroke-dasharray:1, 200;stroke-dashoffset:0;stroke-linecap:round}.pds-toast__icon{color:var(--pine-color-text-primary);display:-ms-inline-flexbox;display:inline-flex;-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm)}.pds-toast__message{font:var(--pine-typography-body-sm-medium);-webkit-margin-end:auto;margin-inline-end:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-toast__message ::slotted(a){color:var(--pine-color-text-primary);-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs);opacity:0.7;text-decoration:underline}.pds-toast__message ::slotted(a):hover,.pds-toast__message ::slotted(a):focus-visible{opacity:1}.pds-toast__message ::slotted(a):focus-visible{outline:2px solid var(--pine-color-text-primary);outline-offset:2px}.pds-toast__button{-ms-flex-align:center;align-items:center;background:none;border:0;border-radius:var(--pine-border-radius-full);color:inherit;cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);opacity:0.7;padding:0;white-space:nowrap}.pds-toast__button:hover,.pds-toast__button:focus{opacity:1}.pds-toast__button:focus{outline:var(--pine-outline-focus);outline-offset:var(--pine-dimension-2xs)}@-webkit-keyframes pds-toast-animate-in{from{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes pds-toast-animate-in{from{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes pds-toast-animate-out{from{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes pds-toast-animate-out{from{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}@-webkit-keyframes pds-toast-rotate{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pds-toast-rotate{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes pds-toast-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124}}@keyframes pds-toast-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124}}:host([hidden]) .pds-toast,.pds-toast--animating-out{-webkit-animation:pds-toast-animate-out var(--animation-duration) var(--animation-timing) forwards;animation:pds-toast-animate-out var(--animation-duration) var(--animation-timing) forwards;pointer-events:none;}";
|
|
10870
|
+
|
|
10871
|
+
class PdsToast {
|
|
10872
|
+
constructor(hostRef) {
|
|
10873
|
+
registerInstance(this, hostRef);
|
|
10874
|
+
this.pdsToastDismissed = createEvent(this, "pdsToastDismissed");
|
|
10875
|
+
/**
|
|
10876
|
+
* Whether the toast can be dismissed manually via the close button.
|
|
10877
|
+
* Note: This only controls manual dismissal. Auto-dismissal via duration still applies.
|
|
10878
|
+
* @default true
|
|
10879
|
+
*/
|
|
10880
|
+
this.dismissible = true;
|
|
10881
|
+
/**
|
|
10882
|
+
* The duration in milliseconds to show the toast before auto-dismissing.
|
|
10883
|
+
* Set to 0 to disable auto-dismiss.
|
|
10884
|
+
* @default 4500
|
|
10885
|
+
*/
|
|
10886
|
+
this.duration = 4500;
|
|
10887
|
+
/**
|
|
10888
|
+
* The type of toast to display.
|
|
10889
|
+
* - default: Grey background (default)
|
|
10890
|
+
* - danger: Red background
|
|
10891
|
+
* - loading: With spinner animation
|
|
10892
|
+
* @default 'default'
|
|
10893
|
+
*/
|
|
10894
|
+
this.type = 'default';
|
|
10895
|
+
/**
|
|
10896
|
+
* Whether the toast is currently visible.
|
|
10897
|
+
*/
|
|
10898
|
+
this.isVisible = true;
|
|
10899
|
+
/**
|
|
10900
|
+
* Whether the toast is animating out.
|
|
10901
|
+
*/
|
|
10902
|
+
this.isAnimatingOut = false;
|
|
10903
|
+
}
|
|
10904
|
+
componentDidLoad() {
|
|
10905
|
+
if (this.duration > 0) {
|
|
10906
|
+
this.startDismissTimer();
|
|
10907
|
+
}
|
|
10908
|
+
}
|
|
10909
|
+
disconnectedCallback() {
|
|
10910
|
+
this.cleanup();
|
|
10911
|
+
}
|
|
10912
|
+
handleDurationChange(newDuration) {
|
|
10913
|
+
if (this.dismissTimer) {
|
|
10914
|
+
window.clearTimeout(this.dismissTimer);
|
|
10915
|
+
this.dismissTimer = undefined;
|
|
10916
|
+
}
|
|
10917
|
+
if (newDuration > 0) {
|
|
10918
|
+
this.startDismissTimer();
|
|
10919
|
+
}
|
|
10920
|
+
}
|
|
10921
|
+
async dismiss() {
|
|
10922
|
+
// Start the animation out
|
|
10923
|
+
this.isAnimatingOut = true;
|
|
10924
|
+
// Wait for animation to complete before hiding and cleanup
|
|
10925
|
+
await new Promise((resolve) => setTimeout(resolve, 300)); // Match --animation-duration
|
|
10926
|
+
this.isVisible = false;
|
|
10927
|
+
this.cleanup();
|
|
10928
|
+
this.pdsToastDismissed.emit({ componentId: this.componentId });
|
|
10929
|
+
}
|
|
10930
|
+
// Private methods
|
|
10931
|
+
cleanup() {
|
|
10932
|
+
if (this.dismissTimer) {
|
|
10933
|
+
window.clearTimeout(this.dismissTimer);
|
|
10934
|
+
this.dismissTimer = undefined;
|
|
10935
|
+
}
|
|
10936
|
+
}
|
|
10937
|
+
startDismissTimer() {
|
|
10938
|
+
this.dismissTimer = window.setTimeout(() => {
|
|
10939
|
+
this.dismiss();
|
|
10940
|
+
}, this.duration);
|
|
10941
|
+
}
|
|
10942
|
+
renderIcon() {
|
|
10943
|
+
// Loading type takes priority
|
|
10944
|
+
if (this.type === 'loading') {
|
|
10945
|
+
return (hAsync("div", { class: "pds-toast__loader" }, hAsync("svg", { class: "pds-toast__loader-spinner", viewBox: "25 25 50 50", "aria-hidden": "true" }, hAsync("circle", { class: "pds-toast__loader-path", cx: "50", cy: "50", r: "20", fill: "none", stroke: "currentColor", "stroke-width": "4", "stroke-linecap": "round" }))));
|
|
10946
|
+
}
|
|
10947
|
+
// Return icon if provided, otherwise undefined (which renders as nothing)
|
|
10948
|
+
return this.icon && hAsync("pds-icon", { name: this.icon, class: "pds-toast__icon" });
|
|
10949
|
+
}
|
|
10950
|
+
render() {
|
|
10951
|
+
return (hAsync(Host, { key: 'c950cf3a269952f6048f79e5c6c793c65ff2b89a', hidden: !this.isVisible }, hAsync("div", { key: '0cec10124aecec0c7af86b460165a577c65d1571', class: {
|
|
10952
|
+
'pds-toast': true,
|
|
10953
|
+
[`pds-toast--${this.type}`]: this.type !== 'default',
|
|
10954
|
+
'pds-toast--animating-out': this.isAnimatingOut
|
|
10955
|
+
}, role: "alert", "aria-live": "polite" }, this.renderIcon(), hAsync("span", { key: '5dda529f788df94ed0e444924fb11a1061a20dd1', class: "pds-toast__message" }, hAsync("slot", { key: '29a6c93dbf14f92b1375eff7a3c8f4556babe67a' })), this.dismissible && (hAsync("button", { key: 'f3bcbcacceb5ef2b1d2127d408879e2a95418230', type: "button", class: "pds-toast__button", onClick: () => {
|
|
10956
|
+
this.dismiss();
|
|
10957
|
+
}, "aria-label": "Dismiss message" }, hAsync("pds-icon", { key: '1ea48def81a89dc7ba38f493abb0107632005075', name: "remove" }))))));
|
|
10958
|
+
}
|
|
10959
|
+
static get watchers() { return {
|
|
10960
|
+
"duration": ["handleDurationChange"]
|
|
10961
|
+
}; }
|
|
10962
|
+
static get style() { return pdsToastCss; }
|
|
10963
|
+
static get cmpMeta() { return {
|
|
10964
|
+
"$flags$": 9,
|
|
10965
|
+
"$tagName$": "pds-toast",
|
|
10966
|
+
"$members$": {
|
|
10967
|
+
"componentId": [1, "component-id"],
|
|
10968
|
+
"dismissible": [4],
|
|
10969
|
+
"duration": [2],
|
|
10970
|
+
"icon": [1],
|
|
10971
|
+
"type": [1],
|
|
10972
|
+
"isVisible": [32],
|
|
10973
|
+
"isAnimatingOut": [32],
|
|
10974
|
+
"dismiss": [64]
|
|
10975
|
+
},
|
|
10976
|
+
"$listeners$": undefined,
|
|
10977
|
+
"$lazyBundleId$": "-",
|
|
10978
|
+
"$attrsToReflect$": []
|
|
10979
|
+
}; }
|
|
10980
|
+
}
|
|
10981
|
+
|
|
8426
10982
|
const positionTooltip = ({ elem, elemPlacement, overlay, offset = 8 }) => {
|
|
8427
|
-
if (elem
|
|
8428
|
-
return;
|
|
10983
|
+
if (elem === null || overlay === null)
|
|
10984
|
+
return false;
|
|
10985
|
+
if (typeof elemPlacement !== 'string' || elemPlacement.trim() === '') {
|
|
10986
|
+
return false;
|
|
10987
|
+
}
|
|
8429
10988
|
const rect = elem.getBoundingClientRect();
|
|
8430
10989
|
const contentRect = overlay.getBoundingClientRect();
|
|
8431
|
-
//
|
|
8432
|
-
|
|
8433
|
-
|
|
10990
|
+
// Reset styles
|
|
10991
|
+
overlay.style.top = '';
|
|
10992
|
+
overlay.style.left = '';
|
|
10993
|
+
overlay.style.right = '';
|
|
10994
|
+
overlay.style.bottom = '';
|
|
10995
|
+
overlay.style.transform = '';
|
|
10996
|
+
// Use fixed positioning for portal overlays
|
|
10997
|
+
overlay.style.position = 'fixed';
|
|
10998
|
+
// Detect if the trigger is a span with only text or a text node
|
|
10999
|
+
let isTextTrigger = false;
|
|
11000
|
+
if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
11001
|
+
isTextTrigger = true;
|
|
11002
|
+
}
|
|
11003
|
+
else if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.ELEMENT_NODE) {
|
|
11004
|
+
const child = elem.childNodes[0];
|
|
11005
|
+
if (child.tagName === 'SPAN' && child.childNodes.length === 1 && child.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
11006
|
+
isTextTrigger = true;
|
|
11007
|
+
}
|
|
11008
|
+
}
|
|
8434
11009
|
switch (true) {
|
|
8435
|
-
case elemPlacement.includes(
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
overlay.style.
|
|
11010
|
+
case elemPlacement.includes('right'):
|
|
11011
|
+
if (isTextTrigger) {
|
|
11012
|
+
// Align to the bottom of the trigger for text triggers
|
|
11013
|
+
overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;
|
|
11014
|
+
}
|
|
11015
|
+
else {
|
|
11016
|
+
overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;
|
|
8442
11017
|
}
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
overlay.style.top =
|
|
8446
|
-
|
|
11018
|
+
overlay.style.left = `${rect.right + offset}px`;
|
|
11019
|
+
if (elemPlacement.includes('start')) {
|
|
11020
|
+
overlay.style.top = `${rect.top}px`;
|
|
11021
|
+
}
|
|
11022
|
+
if (elemPlacement.includes('end')) {
|
|
11023
|
+
overlay.style.top = `${rect.bottom - contentRect.height}px`;
|
|
8447
11024
|
}
|
|
8448
11025
|
break;
|
|
8449
|
-
case elemPlacement.includes(
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
overlay.style.top =
|
|
8455
|
-
|
|
11026
|
+
case elemPlacement.includes('left'):
|
|
11027
|
+
if (isTextTrigger) {
|
|
11028
|
+
overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;
|
|
11029
|
+
}
|
|
11030
|
+
else {
|
|
11031
|
+
overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;
|
|
11032
|
+
}
|
|
11033
|
+
overlay.style.left = `${rect.left - contentRect.width - offset}px`;
|
|
11034
|
+
if (elemPlacement.includes('start')) {
|
|
11035
|
+
overlay.style.top = `${rect.top}px`;
|
|
8456
11036
|
}
|
|
8457
|
-
if (elemPlacement.includes(
|
|
8458
|
-
overlay.style.
|
|
8459
|
-
overlay.style.top = 'initial';
|
|
8460
|
-
overlay.style.transform = 'translateY(0)';
|
|
11037
|
+
if (elemPlacement.includes('end')) {
|
|
11038
|
+
overlay.style.top = `${rect.bottom - contentRect.height}px`;
|
|
8461
11039
|
}
|
|
8462
11040
|
break;
|
|
8463
|
-
case elemPlacement.includes(
|
|
8464
|
-
overlay.style.top =
|
|
8465
|
-
overlay.style.left =
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
overlay.style.left = '0';
|
|
8469
|
-
overlay.style.transform = 'translateX(0)';
|
|
11041
|
+
case elemPlacement.includes('bottom'):
|
|
11042
|
+
overlay.style.top = `${rect.bottom + offset}px`;
|
|
11043
|
+
overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;
|
|
11044
|
+
if (elemPlacement.includes('start')) {
|
|
11045
|
+
overlay.style.left = `${rect.left}px`;
|
|
8470
11046
|
}
|
|
8471
|
-
if (elemPlacement.includes(
|
|
8472
|
-
overlay.style.left =
|
|
8473
|
-
overlay.style.right = '
|
|
8474
|
-
overlay.style.transform = 'translateX(0)';
|
|
11047
|
+
if (elemPlacement.includes('end')) {
|
|
11048
|
+
overlay.style.left = `${rect.right - contentRect.width}px`;
|
|
11049
|
+
overlay.style.right = 'initial';
|
|
8475
11050
|
}
|
|
8476
11051
|
break;
|
|
8477
|
-
case elemPlacement.includes(
|
|
8478
|
-
overlay.style.top =
|
|
8479
|
-
overlay.style.left =
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
overlay.style.left = '0';
|
|
8483
|
-
overlay.style.transform = 'translateX(0)';
|
|
11052
|
+
case elemPlacement.includes('top'):
|
|
11053
|
+
overlay.style.top = `${rect.top - contentRect.height - offset}px`;
|
|
11054
|
+
overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;
|
|
11055
|
+
if (elemPlacement.includes('start')) {
|
|
11056
|
+
overlay.style.left = `${rect.left}px`;
|
|
8484
11057
|
}
|
|
8485
|
-
if (elemPlacement.includes(
|
|
8486
|
-
overlay.style.left =
|
|
8487
|
-
overlay.style.right = '
|
|
8488
|
-
overlay.style.transform = 'translateX(0)';
|
|
11058
|
+
if (elemPlacement.includes('end')) {
|
|
11059
|
+
overlay.style.left = `${rect.right - contentRect.width}px`;
|
|
11060
|
+
overlay.style.right = 'initial';
|
|
8489
11061
|
}
|
|
8490
11062
|
break;
|
|
8491
11063
|
}
|
|
11064
|
+
return true;
|
|
8492
11065
|
};
|
|
8493
11066
|
|
|
8494
|
-
const pdsTooltipCss = "
|
|
11067
|
+
const pdsTooltipCss = ".pds-tooltip{--tooltip-border-width-arrow-down:var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow) 0;--tooltip-border-width-arrow-left:var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow) 0;--tooltip-border-width-arrow-right:var(--tooltip-sizing-arrow) 0 var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow);--tooltip-border-width-arrow-up:0 var(--tooltip-sizing-arrow) var(--tooltip-sizing-arrow);--tooltip-sizing-arrow:6px;--tooltip-sizing-arrow-offset:14px;--tooltip-dimension-max-width:320px}.pds-tooltip__content{background-color:var(--pine-color-primary);border-radius:calc(var(--pine-dimension-xs) * 1.25);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);color:var(--pine-color-text-primary);max-width:var(--tooltip-dimension-max-width);opacity:0;padding:var(--pine-dimension-xs) calc(var(--pine-dimension-md) / 2);position:absolute;visibility:hidden;width:-webkit-max-content;width:-moz-max-content;width:max-content}.pds-tooltip--is-open .pds-tooltip__content{opacity:1;visibility:visible;z-index:1}.pds-tooltip.pds-tooltip--has-html-content .pds-tooltip__content{width:auto}.pds-tooltip__content::after{border-color:transparent;border-right-color:transparent;border-style:solid;border-width:var(--tooltip-border-width-arrow-left);content:\"\";height:0;position:absolute;width:0}.pds-tooltip--right .pds-tooltip__content::after{border-inline-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-left);left:calc(var(--tooltip-sizing-arrow) * -1);top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pds-tooltip--right-end .pds-tooltip__content::after{border-inline-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-left);bottom:var(--tooltip-sizing-arrow-offset);left:calc(var(--tooltip-sizing-arrow) * -1);top:initial}.pds-tooltip--right-start .pds-tooltip__content::after{border-inline-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-left);left:calc(var(--tooltip-sizing-arrow) * -1);top:var(--tooltip-sizing-arrow-offset)}.pds-tooltip--top .pds-tooltip__content::after{border-block-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-down);bottom:calc(var(--tooltip-sizing-arrow) * -1);left:50%;top:initial;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.pds-tooltip--top-start .pds-tooltip__content::after{border-block-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-down);bottom:calc(var(--tooltip-sizing-arrow) * -1);left:var(--tooltip-sizing-arrow-offset);top:initial}.pds-tooltip--top-end .pds-tooltip__content::after{border-block-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-down);bottom:calc(var(--tooltip-sizing-arrow) * -1);left:initial;right:var(--tooltip-sizing-arrow-offset);top:initial}.pds-tooltip--left .pds-tooltip__content::after{border-inline-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-right);left:initial;right:calc(var(--tooltip-sizing-arrow) * -1);top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pds-tooltip--left-end .pds-tooltip__content::after{border-inline-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-right);bottom:var(--tooltip-sizing-arrow-offset);left:initial;right:calc(var(--tooltip-sizing-arrow) * -1);top:initial}.pds-tooltip--left-start .pds-tooltip__content::after{border-inline-start-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-right);left:initial;right:calc(var(--tooltip-sizing-arrow) * -1);top:var(--tooltip-sizing-arrow-offset)}.pds-tooltip--bottom .pds-tooltip__content::after{border-block-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-up);left:50%;top:calc(var(--tooltip-sizing-arrow) * -1);-webkit-transform:translateX(-50%);transform:translateX(-50%)}.pds-tooltip--bottom-end .pds-tooltip__content::after{border-block-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-up);left:initial;right:var(--tooltip-sizing-arrow-offset);top:calc(var(--tooltip-sizing-arrow) * -1)}.pds-tooltip--bottom-start .pds-tooltip__content::after{border-block-end-color:var(--pine-color-primary);border-width:var(--tooltip-border-width-arrow-up);left:var(--tooltip-sizing-arrow-offset);top:calc(var(--tooltip-sizing-arrow) * -1)}.pds-tooltip--no-arrow .pds-tooltip__content::after{border-width:0}";
|
|
8495
11068
|
|
|
8496
11069
|
/**
|
|
8497
11070
|
* @slot (default) - The tooltip's target element
|
|
@@ -8500,6 +11073,16 @@ const pdsTooltipCss = ":host{--tooltip-border-width-arrow-down:var(--tooltip-siz
|
|
|
8500
11073
|
class PdsTooltip {
|
|
8501
11074
|
constructor(hostRef) {
|
|
8502
11075
|
registerInstance(this, hostRef);
|
|
11076
|
+
/**
|
|
11077
|
+
* Internal state: true if the tooltip was opened by user interaction (hover/focus),
|
|
11078
|
+
* false if opened via the `opened` prop or currently closed.
|
|
11079
|
+
*/
|
|
11080
|
+
this._isInteractiveOpen = false;
|
|
11081
|
+
this.portalEl = null;
|
|
11082
|
+
this.triggerEl = null;
|
|
11083
|
+
this.contentDiv = null;
|
|
11084
|
+
this.slotMutationObserver = null;
|
|
11085
|
+
this.overlayResizeObserver = null;
|
|
8503
11086
|
/**
|
|
8504
11087
|
* Determines when the tooltip is open
|
|
8505
11088
|
* @defaultValue false
|
|
@@ -8531,44 +11114,80 @@ class PdsTooltip {
|
|
|
8531
11114
|
*/
|
|
8532
11115
|
this.opened = false;
|
|
8533
11116
|
this.handleHide = () => {
|
|
11117
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
11118
|
+
return;
|
|
11119
|
+
}
|
|
8534
11120
|
this.hideTooltip();
|
|
11121
|
+
this._isInteractiveOpen = false;
|
|
8535
11122
|
};
|
|
8536
11123
|
this.handleShow = () => {
|
|
11124
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
11125
|
+
return;
|
|
11126
|
+
}
|
|
11127
|
+
this._isInteractiveOpen = true;
|
|
8537
11128
|
this.showTooltip();
|
|
8538
11129
|
};
|
|
8539
11130
|
this.handlePageShow = () => {
|
|
11131
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
11132
|
+
return;
|
|
11133
|
+
}
|
|
8540
11134
|
this.opened = false;
|
|
11135
|
+
this._isInteractiveOpen = false;
|
|
11136
|
+
};
|
|
11137
|
+
this.handleScroll = () => {
|
|
11138
|
+
if (this.opened) {
|
|
11139
|
+
if (!this._isInteractiveOpen) {
|
|
11140
|
+
this.repositionPortal();
|
|
11141
|
+
}
|
|
11142
|
+
else {
|
|
11143
|
+
this.hideTooltip();
|
|
11144
|
+
this._isInteractiveOpen = false;
|
|
11145
|
+
}
|
|
11146
|
+
}
|
|
11147
|
+
};
|
|
11148
|
+
this.handleSpaNavigation = () => {
|
|
11149
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
11150
|
+
return;
|
|
11151
|
+
}
|
|
11152
|
+
this.hideTooltip();
|
|
11153
|
+
this._isInteractiveOpen = false;
|
|
8541
11154
|
};
|
|
8542
11155
|
}
|
|
8543
|
-
handleOpenToggle() {
|
|
8544
|
-
if (
|
|
8545
|
-
this.
|
|
8546
|
-
}
|
|
8547
|
-
else {
|
|
8548
|
-
this.handleHide();
|
|
11156
|
+
handleOpenToggle(newValue, oldValue) {
|
|
11157
|
+
if (newValue === false && oldValue === true) {
|
|
11158
|
+
this._isInteractiveOpen = false;
|
|
8549
11159
|
}
|
|
8550
11160
|
}
|
|
8551
11161
|
componentWillLoad() {
|
|
8552
|
-
|
|
8553
|
-
this.showTooltip();
|
|
8554
|
-
}
|
|
8555
|
-
this.el.addEventListener('blur', this.handleHide, true);
|
|
8556
|
-
this.el.addEventListener('focus', this.handleShow, true);
|
|
11162
|
+
this._isInteractiveOpen = false;
|
|
8557
11163
|
}
|
|
8558
11164
|
componentDidLoad() {
|
|
8559
|
-
// fix for Safari iOS back button issue
|
|
8560
11165
|
window.addEventListener('pageshow', this.handlePageShow);
|
|
11166
|
+
this.triggerEl = this.el.querySelector('.pds-tooltip__trigger');
|
|
11167
|
+
const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');
|
|
11168
|
+
if (contentSlotWrapper !== null) {
|
|
11169
|
+
this.slotMutationObserver = new MutationObserver(() => {
|
|
11170
|
+
if (this.opened && this.portalEl !== null) {
|
|
11171
|
+
this.removePortal();
|
|
11172
|
+
this.createPortal();
|
|
11173
|
+
}
|
|
11174
|
+
});
|
|
11175
|
+
this.slotMutationObserver.observe(contentSlotWrapper, { childList: true, subtree: false });
|
|
11176
|
+
}
|
|
8561
11177
|
return () => {
|
|
8562
11178
|
window.removeEventListener('pageshow', this.handlePageShow);
|
|
11179
|
+
if (this.slotMutationObserver !== null) {
|
|
11180
|
+
this.slotMutationObserver.disconnect();
|
|
11181
|
+
}
|
|
8563
11182
|
};
|
|
8564
11183
|
}
|
|
8565
|
-
componentDidUpdate() {
|
|
8566
|
-
if (this.opened) {
|
|
8567
|
-
this.showTooltip();
|
|
8568
|
-
}
|
|
8569
|
-
}
|
|
8570
11184
|
componentDidRender() {
|
|
8571
|
-
|
|
11185
|
+
if (this.opened && this.portalEl === null) {
|
|
11186
|
+
this.createPortal();
|
|
11187
|
+
}
|
|
11188
|
+
else if (!this.opened && this.portalEl !== null) {
|
|
11189
|
+
this.removePortal();
|
|
11190
|
+
}
|
|
8572
11191
|
}
|
|
8573
11192
|
/**
|
|
8574
11193
|
* Shows the tooltip by enabling the opened property
|
|
@@ -8582,14 +11201,152 @@ class PdsTooltip {
|
|
|
8582
11201
|
async hideTooltip() {
|
|
8583
11202
|
this.opened = false;
|
|
8584
11203
|
}
|
|
11204
|
+
/**
|
|
11205
|
+
* Determines the most accurate HTML element to use as the anchor for positioning the tooltip.
|
|
11206
|
+
* If `htmlContent` is false, it attempts to find the actual element slotted as the trigger.
|
|
11207
|
+
* Otherwise, or if no specific element is found, it defaults to the span wrapper around the trigger slot.
|
|
11208
|
+
* This helps with precise alignment.
|
|
11209
|
+
*/
|
|
11210
|
+
determinePositioningAnchor() {
|
|
11211
|
+
let positioningAnchor = this.triggerEl;
|
|
11212
|
+
if (this.triggerEl !== null) {
|
|
11213
|
+
const children = this.triggerEl.childNodes;
|
|
11214
|
+
for (let i = 0; i < children.length; i++) {
|
|
11215
|
+
const childNode = children[i];
|
|
11216
|
+
if (childNode.nodeType === Node.ELEMENT_NODE) {
|
|
11217
|
+
positioningAnchor = childNode;
|
|
11218
|
+
break; // Found the first element, use it as the anchor
|
|
11219
|
+
}
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11222
|
+
// If no ELEMENT_NODE is found within this.triggerEl (e.g., if trigger is just text),
|
|
11223
|
+
// positioningAnchor will correctly remain this.triggerEl (the span).
|
|
11224
|
+
return positioningAnchor;
|
|
11225
|
+
}
|
|
11226
|
+
/**
|
|
11227
|
+
* Centralized method to calculate and apply the tooltip's position.
|
|
11228
|
+
* Uses the determined anchor element and the current content dimensions.
|
|
11229
|
+
*/
|
|
11230
|
+
repositionPortal() {
|
|
11231
|
+
const anchor = this.determinePositioningAnchor();
|
|
11232
|
+
if (anchor !== null && this.contentDiv !== null) {
|
|
11233
|
+
positionTooltip({ elem: anchor, elemPlacement: this.placement, overlay: this.contentDiv });
|
|
11234
|
+
const placementParts = this.placement.split('-');
|
|
11235
|
+
const primaryPlacement = placementParts[0];
|
|
11236
|
+
const isCardinalCenterPlacement = placementParts.length === 1;
|
|
11237
|
+
if (isCardinalCenterPlacement) {
|
|
11238
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
11239
|
+
const overlayRect = this.contentDiv.getBoundingClientRect();
|
|
11240
|
+
if (primaryPlacement === 'left' || primaryPlacement === 'right') {
|
|
11241
|
+
const currentOverlayTop = parseFloat(this.contentDiv.style.top || '0');
|
|
11242
|
+
const anchorCenterY = anchorRect.top + (anchorRect.height / 2);
|
|
11243
|
+
const overlayCenterY = overlayRect.top + (overlayRect.height / 2);
|
|
11244
|
+
const adjustmentY = anchorCenterY - overlayCenterY;
|
|
11245
|
+
if (Math.abs(adjustmentY) > 0.5) {
|
|
11246
|
+
this.contentDiv.style.top = `${currentOverlayTop + adjustmentY}px`;
|
|
11247
|
+
}
|
|
11248
|
+
}
|
|
11249
|
+
else if (primaryPlacement === 'top' || primaryPlacement === 'bottom') {
|
|
11250
|
+
const currentOverlayLeft = parseFloat(this.contentDiv.style.left || '0');
|
|
11251
|
+
const anchorCenterX = anchorRect.left + (anchorRect.width / 2);
|
|
11252
|
+
const overlayCenterX = overlayRect.left + (overlayRect.width / 2);
|
|
11253
|
+
const adjustmentX = anchorCenterX - overlayCenterX;
|
|
11254
|
+
if (Math.abs(adjustmentX) > 0.5) {
|
|
11255
|
+
this.contentDiv.style.left = `${currentOverlayLeft + adjustmentX}px`;
|
|
11256
|
+
}
|
|
11257
|
+
}
|
|
11258
|
+
}
|
|
11259
|
+
}
|
|
11260
|
+
}
|
|
11261
|
+
createPortal() {
|
|
11262
|
+
if (this.portalEl !== null)
|
|
11263
|
+
return;
|
|
11264
|
+
this.portalEl = document.createElement('div');
|
|
11265
|
+
this.portalEl.className = `pds-tooltip pds-tooltip--${this.placement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;
|
|
11266
|
+
this.portalEl.style.position = 'fixed';
|
|
11267
|
+
this.portalEl.style.zIndex = '9999';
|
|
11268
|
+
if (this.portalEl.id === '') {
|
|
11269
|
+
this.portalEl.id = this.componentId || this.el.id || `pds-tooltip-portal-${PdsTooltip.instanceCounter++}`;
|
|
11270
|
+
}
|
|
11271
|
+
if (this.portalEl.getAttribute('id') !== this.portalEl.id) {
|
|
11272
|
+
this.portalEl.setAttribute('id', this.portalEl.id);
|
|
11273
|
+
}
|
|
11274
|
+
this.portalEl.setAttribute('role', 'tooltip');
|
|
11275
|
+
this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');
|
|
11276
|
+
this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');
|
|
11277
|
+
this.portalEl.style.maxWidth = this.maxWidth;
|
|
11278
|
+
this.contentDiv = document.createElement('div');
|
|
11279
|
+
this.contentDiv.className = 'pds-tooltip__content';
|
|
11280
|
+
this.contentDiv.setAttribute('aria-hidden', this.opened ? 'false' : 'true');
|
|
11281
|
+
this.contentDiv.setAttribute('aria-live', this.opened ? 'polite' : 'off');
|
|
11282
|
+
this.contentDiv.setAttribute('role', 'tooltip');
|
|
11283
|
+
this.contentDiv.style.maxWidth = this.maxWidth;
|
|
11284
|
+
const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');
|
|
11285
|
+
const slottedContentContainer = contentSlotWrapper === null || contentSlotWrapper === void 0 ? void 0 : contentSlotWrapper.querySelector('[slot="content"]');
|
|
11286
|
+
let hasSlottedContent = false;
|
|
11287
|
+
if (slottedContentContainer !== null) {
|
|
11288
|
+
const childrenToClone = Array.from(slottedContentContainer.childNodes);
|
|
11289
|
+
if (childrenToClone.length > 0) {
|
|
11290
|
+
const hasMeaningfulNode = childrenToClone.some(node => {
|
|
11291
|
+
var _a;
|
|
11292
|
+
return node.nodeType === Node.ELEMENT_NODE ||
|
|
11293
|
+
(node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '');
|
|
11294
|
+
});
|
|
11295
|
+
if (hasMeaningfulNode) {
|
|
11296
|
+
hasSlottedContent = true;
|
|
11297
|
+
childrenToClone.forEach((node /*, index*/) => {
|
|
11298
|
+
var _a;
|
|
11299
|
+
if (node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '')) {
|
|
11300
|
+
this.contentDiv.appendChild(node.cloneNode(true));
|
|
11301
|
+
}
|
|
11302
|
+
});
|
|
11303
|
+
}
|
|
11304
|
+
}
|
|
11305
|
+
}
|
|
11306
|
+
if (!hasSlottedContent) {
|
|
11307
|
+
if (this.content !== '') {
|
|
11308
|
+
this.contentDiv.textContent = this.content;
|
|
11309
|
+
}
|
|
11310
|
+
}
|
|
11311
|
+
this.portalEl.appendChild(this.contentDiv);
|
|
11312
|
+
document.body.appendChild(this.portalEl);
|
|
11313
|
+
this.repositionPortal();
|
|
11314
|
+
if (this.contentDiv !== null) {
|
|
11315
|
+
this.overlayResizeObserver = new ResizeObserver(() => {
|
|
11316
|
+
this.repositionPortal();
|
|
11317
|
+
});
|
|
11318
|
+
this.overlayResizeObserver.observe(this.contentDiv);
|
|
11319
|
+
}
|
|
11320
|
+
// Add global listeners when portal is created
|
|
11321
|
+
window.addEventListener('scroll', this.handleScroll, true);
|
|
11322
|
+
window.addEventListener('popstate', this.handleSpaNavigation, true);
|
|
11323
|
+
window.addEventListener('hashchange', this.handleSpaNavigation, true);
|
|
11324
|
+
// Add ARIA attribute to trigger, now that portalEl and its ID are confirmed
|
|
11325
|
+
if (this.triggerEl !== null && this.portalEl.id !== '') {
|
|
11326
|
+
this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);
|
|
11327
|
+
}
|
|
11328
|
+
}
|
|
11329
|
+
removePortal() {
|
|
11330
|
+
if (this.overlayResizeObserver !== null && this.contentDiv !== null) {
|
|
11331
|
+
this.overlayResizeObserver.unobserve(this.contentDiv);
|
|
11332
|
+
this.overlayResizeObserver = null;
|
|
11333
|
+
}
|
|
11334
|
+
if (this.portalEl !== null) {
|
|
11335
|
+
window.removeEventListener('scroll', this.handleScroll, true);
|
|
11336
|
+
window.removeEventListener('popstate', this.handleSpaNavigation, true);
|
|
11337
|
+
window.removeEventListener('hashchange', this.handleSpaNavigation, true);
|
|
11338
|
+
document.body.removeChild(this.portalEl);
|
|
11339
|
+
this.portalEl = null;
|
|
11340
|
+
}
|
|
11341
|
+
// Remove ARIA attribute from trigger
|
|
11342
|
+
if (this.triggerEl !== null) {
|
|
11343
|
+
this.triggerEl.removeAttribute('aria-describedby');
|
|
11344
|
+
}
|
|
11345
|
+
this.contentDiv = null;
|
|
11346
|
+
}
|
|
8585
11347
|
render() {
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
pds-tooltip--${this.placement}
|
|
8589
|
-
${this.htmlContent ? 'pds-tooltip--has-html-content' : ''}
|
|
8590
|
-
${this.opened ? 'pds-tooltip--is-open' : ''}
|
|
8591
|
-
${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}
|
|
8592
|
-
` }, hAsync("span", { key: '33e96cb4f46ebc418f79971047a37fc5c3498e0d', "aria-describedby": this.componentId, class: "pds-tooltip__trigger" }, hAsync("slot", { key: 'cca7b5d50e2cbc0f839a46caa5a5dc8a79f1cb15' })), hAsync("div", { key: '22c666894f7835629e00e9c2c3964bcaf63000ae', class: "pds-tooltip__content", "aria-hidden": this.opened ? 'false' : 'true', "aria-live": this.opened ? 'polite' : 'off', id: this.componentId, ref: (el) => (this.contentEl = el), role: "tooltip", style: { maxWidth: this.maxWidth } }, hAsync("slot", { key: '83a805d9eef71ac261a03d56853ccc8ac7bfe818', name: "content" }), this.content))));
|
|
11348
|
+
const hostId = this.componentId || undefined;
|
|
11349
|
+
return (hAsync(Host, { key: '0fe2bea1ea0e8eaeb5879644694a2e129f1f4898', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, hAsync("span", { key: 'f26feb3c37957573d3b6b0a55091b2e7012ae31b', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide, onFocus: this.handleShow, onBlur: this.handleHide, ref: el => this.triggerEl = el }, hAsync("slot", { key: 'c7940e3aa7f17fc5d5fcdedc0a624204ceed291c' })), hAsync("div", { key: '0c8dc83e3b7f8c1337aae8641d80f63c0866c348', class: "pds-tooltip__content-slot-wrapper", style: { display: 'none' } }, hAsync("slot", { key: '2f6701768c0debdd69673da3ad7dc34b8b237f6a', name: "content" }))));
|
|
8593
11350
|
}
|
|
8594
11351
|
get el() { return getElement(this); }
|
|
8595
11352
|
static get watchers() { return {
|
|
@@ -8597,7 +11354,7 @@ class PdsTooltip {
|
|
|
8597
11354
|
}; }
|
|
8598
11355
|
static get style() { return pdsTooltipCss; }
|
|
8599
11356
|
static get cmpMeta() { return {
|
|
8600
|
-
"$flags$":
|
|
11357
|
+
"$flags$": 4,
|
|
8601
11358
|
"$tagName$": "pds-tooltip",
|
|
8602
11359
|
"$members$": {
|
|
8603
11360
|
"content": [1],
|
|
@@ -8607,6 +11364,7 @@ class PdsTooltip {
|
|
|
8607
11364
|
"placement": [513],
|
|
8608
11365
|
"maxWidth": [1, "max-width"],
|
|
8609
11366
|
"opened": [1540],
|
|
11367
|
+
"_isInteractiveOpen": [32],
|
|
8610
11368
|
"isOpen": [32],
|
|
8611
11369
|
"showTooltip": [64],
|
|
8612
11370
|
"hideTooltip": [64]
|
|
@@ -8616,9 +11374,12 @@ class PdsTooltip {
|
|
|
8616
11374
|
"$attrsToReflect$": [["placement", "placement"], ["opened", "opened"]]
|
|
8617
11375
|
}; }
|
|
8618
11376
|
}
|
|
11377
|
+
PdsTooltip.instanceCounter = 0;
|
|
8619
11378
|
|
|
8620
11379
|
registerComponents([
|
|
11380
|
+
MockPdsModal,
|
|
8621
11381
|
PdsAccordion,
|
|
11382
|
+
PdsAlert,
|
|
8622
11383
|
PdsAvatar,
|
|
8623
11384
|
PdsBox,
|
|
8624
11385
|
PdsButton,
|
|
@@ -8626,11 +11387,18 @@ registerComponents([
|
|
|
8626
11387
|
PdsChip,
|
|
8627
11388
|
PdsCopytext,
|
|
8628
11389
|
PdsDivider,
|
|
11390
|
+
PdsDropdownMenu,
|
|
11391
|
+
PdsDropdownMenuItem,
|
|
11392
|
+
PdsDropdownMenuSeparator,
|
|
8629
11393
|
PdsIcon,
|
|
8630
11394
|
PdsImage,
|
|
8631
11395
|
PdsInput,
|
|
8632
11396
|
PdsLink,
|
|
8633
11397
|
PdsLoader,
|
|
11398
|
+
PdsModal,
|
|
11399
|
+
PdsModalContent,
|
|
11400
|
+
PdsModalFooter,
|
|
11401
|
+
PdsModalHeader,
|
|
8634
11402
|
PdsPopover,
|
|
8635
11403
|
PdsProgress,
|
|
8636
11404
|
PdsRadio,
|
|
@@ -8650,6 +11418,7 @@ registerComponents([
|
|
|
8650
11418
|
PdsTabs,
|
|
8651
11419
|
PdsText,
|
|
8652
11420
|
PdsTextarea,
|
|
11421
|
+
PdsToast,
|
|
8653
11422
|
PdsTooltip,
|
|
8654
11423
|
]);
|
|
8655
11424
|
|