@pine-ds/core 4.4.3 → 4.5.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/attributes.js +1 -1
- package/components/closest.js +1 -1
- package/components/index.js +1 -1
- package/components/pds-avatar.js +1 -1
- package/components/pds-box2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +2 -2
- package/components/pds-copytext.js +1 -1
- package/components/pds-datepicker.js +1 -1
- package/components/pds-drawer-content.js +1 -1
- package/components/pds-drawer-footer.js +1 -1
- package/components/pds-drawer-header.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.js +1 -1
- package/components/pds-modal-footer.js +1 -1
- package/components/pds-modal-header.js +1 -1
- package/components/pds-modal2.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-radio-group.js +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +1 -1
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +2 -2
- package/components/pds-switch.js +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-tooltip.js +1 -1
- package/components/reflected-attribute-default.js +1 -0
- package/dist/cjs/attributes-DXvaSETR.js +178 -0
- package/dist/cjs/{index-D8Gl0bIB.js → index-BQjWfQXw.js} +10 -1
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/keep-hydrated-iLS88j1Z.js +67 -0
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/mock-pds-modal.cjs.entry.js +2 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +2 -1
- package/dist/cjs/pds-alert.cjs.entry.js +2 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +19 -2
- package/dist/cjs/pds-box.cjs.entry.js +13 -2
- package/dist/cjs/pds-button.cjs.entry.js +2 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +13 -5
- package/dist/cjs/pds-chip.cjs.entry.js +12 -2
- package/dist/cjs/pds-combobox.cjs.entry.js +13 -7
- package/dist/cjs/pds-container.cjs.entry.js +2 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +18 -2
- package/dist/cjs/pds-datepicker.cjs.entry.js +3 -2
- package/dist/cjs/pds-divider.cjs.entry.js +2 -1
- package/dist/cjs/pds-drawer-content.cjs.entry.js +3 -2
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +3 -2
- package/dist/cjs/pds-drawer-header.cjs.entry.js +3 -2
- package/dist/cjs/pds-drawer.cjs.entry.js +4 -3
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -1
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -1
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +41 -10
- package/dist/cjs/pds-filter.cjs.entry.js +2 -1
- package/dist/cjs/pds-filters.cjs.entry.js +2 -1
- package/dist/cjs/pds-icon.cjs.entry.js +2 -1
- package/dist/cjs/pds-image.cjs.entry.js +2 -1
- package/dist/cjs/pds-input.cjs.entry.js +3 -2
- package/dist/cjs/pds-link.cjs.entry.js +2 -1
- package/dist/cjs/pds-loader.cjs.entry.js +29 -2
- package/dist/cjs/pds-modal-content.cjs.entry.js +4 -3
- package/dist/cjs/pds-modal-footer.cjs.entry.js +3 -2
- package/dist/cjs/pds-modal-header.cjs.entry.js +3 -2
- package/dist/cjs/pds-modal.cjs.entry.js +137 -50
- package/dist/cjs/pds-multiselect.cjs.entry.js +2 -1
- package/dist/cjs/pds-popover.cjs.entry.js +83 -14
- package/dist/cjs/pds-progress.cjs.entry.js +14 -2
- package/dist/cjs/pds-property.cjs.entry.js +2 -1
- package/dist/cjs/pds-radio-group.cjs.entry.js +5 -4
- package/dist/cjs/pds-radio.cjs.entry.js +13 -4
- package/dist/cjs/pds-row.cjs.entry.js +13 -2
- package/dist/cjs/pds-select.cjs.entry.js +15 -2
- package/dist/cjs/pds-sortable-item.cjs.entry.js +12 -2
- package/dist/cjs/pds-sortable.cjs.entry.js +13 -2
- package/dist/cjs/pds-switch.cjs.entry.js +14 -5
- package/dist/cjs/pds-tab.cjs.entry.js +2 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +2 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +2 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -1
- package/dist/cjs/pds-table-head.cjs.entry.js +2 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +2 -1
- package/dist/cjs/pds-table.cjs.entry.js +2 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +3 -2
- package/dist/cjs/pds-tabs.cjs.entry.js +15 -2
- package/dist/cjs/pds-text.cjs.entry.js +2 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +3 -2
- package/dist/cjs/pds-toast.cjs.entry.js +2 -1
- package/dist/cjs/pds-tooltip.cjs.entry.js +4 -3
- package/dist/cjs/pine-core.cjs.js +3 -2
- package/dist/cjs/reflected-attribute-default-DVYHG6O1.js +44 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/pds-avatar/pds-avatar.js +20 -3
- package/dist/collection/components/pds-box/pds-box.js +14 -1
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +11 -4
- package/dist/collection/components/pds-chip/pds-chip.js +10 -1
- package/dist/collection/components/pds-combobox/pds-combobox.css +14 -2
- package/dist/collection/components/pds-combobox/pds-combobox.js +33 -5
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +41 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js +17 -2
- package/dist/collection/components/pds-datepicker/pds-datepicker.css +4 -2
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +2 -1
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +4 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +4 -1
- package/dist/collection/components/pds-drawer/pds-drawer.js +3 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +39 -9
- package/dist/collection/components/pds-loader/pds-loader.js +29 -2
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +5 -2
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +4 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +4 -1
- package/dist/collection/components/pds-modal/pds-modal.js +138 -49
- package/dist/collection/components/pds-popover/pds-popover.js +83 -14
- package/dist/collection/components/pds-progress/pds-progress.js +12 -1
- package/dist/collection/components/pds-radio/pds-radio.js +12 -3
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +4 -3
- package/dist/collection/components/pds-row/pds-row.js +14 -1
- package/dist/collection/components/pds-select/pds-select.js +13 -1
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +11 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +14 -1
- package/dist/collection/components/pds-switch/pds-switch.js +12 -4
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +4 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +13 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +3 -2
- package/dist/collection/global/pine-global.js +6 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/attributes.js +90 -0
- package/dist/collection/utils/keep-hydrated.js +61 -0
- package/dist/collection/utils/reflected-attribute-default.js +40 -0
- package/dist/collection/utils/test/host-strip.js +50 -0
- package/dist/docs.json +129 -19
- package/dist/esm/attributes-CF5K2pxn.js +173 -0
- package/dist/esm/{index-bLhIfh0N.js → index-2HMD-zUO.js} +10 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/keep-hydrated-Dv7ssOTc.js +63 -0
- package/dist/esm/loader.js +4 -3
- package/dist/esm/mock-pds-modal.entry.js +2 -1
- package/dist/esm/pds-accordion.entry.js +2 -1
- package/dist/esm/pds-alert.entry.js +2 -1
- package/dist/esm/pds-avatar.entry.js +19 -2
- package/dist/esm/pds-box.entry.js +13 -2
- package/dist/esm/pds-button.entry.js +2 -1
- package/dist/esm/pds-checkbox.entry.js +13 -5
- package/dist/esm/pds-chip.entry.js +12 -2
- package/dist/esm/pds-combobox.entry.js +13 -7
- package/dist/esm/pds-container.entry.js +2 -1
- package/dist/esm/pds-copytext.entry.js +18 -2
- package/dist/esm/pds-datepicker.entry.js +3 -2
- package/dist/esm/pds-divider.entry.js +2 -1
- package/dist/esm/pds-drawer-content.entry.js +3 -2
- package/dist/esm/pds-drawer-footer.entry.js +3 -2
- package/dist/esm/pds-drawer-header.entry.js +3 -2
- package/dist/esm/pds-drawer.entry.js +4 -3
- package/dist/esm/pds-dropdown-menu-item.entry.js +2 -1
- package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -1
- package/dist/esm/pds-dropdown-menu.entry.js +41 -10
- package/dist/esm/pds-filter.entry.js +2 -1
- package/dist/esm/pds-filters.entry.js +2 -1
- package/dist/esm/pds-icon.entry.js +2 -1
- package/dist/esm/pds-image.entry.js +2 -1
- package/dist/esm/pds-input.entry.js +3 -2
- package/dist/esm/pds-link.entry.js +2 -1
- package/dist/esm/pds-loader.entry.js +29 -2
- package/dist/esm/pds-modal-content.entry.js +4 -3
- package/dist/esm/pds-modal-footer.entry.js +3 -2
- package/dist/esm/pds-modal-header.entry.js +3 -2
- package/dist/esm/pds-modal.entry.js +137 -50
- package/dist/esm/pds-multiselect.entry.js +2 -1
- package/dist/esm/pds-popover.entry.js +83 -14
- package/dist/esm/pds-progress.entry.js +14 -2
- package/dist/esm/pds-property.entry.js +2 -1
- package/dist/esm/pds-radio-group.entry.js +5 -4
- package/dist/esm/pds-radio.entry.js +13 -4
- package/dist/esm/pds-row.entry.js +13 -2
- package/dist/esm/pds-select.entry.js +15 -2
- package/dist/esm/pds-sortable-item.entry.js +12 -2
- package/dist/esm/pds-sortable.entry.js +13 -2
- package/dist/esm/pds-switch.entry.js +14 -5
- package/dist/esm/pds-tab.entry.js +2 -1
- package/dist/esm/pds-table-body.entry.js +2 -1
- package/dist/esm/pds-table-cell.entry.js +2 -1
- package/dist/esm/pds-table-head-cell.entry.js +2 -1
- package/dist/esm/pds-table-head.entry.js +2 -1
- package/dist/esm/pds-table-row.entry.js +2 -1
- package/dist/esm/pds-table.entry.js +2 -1
- package/dist/esm/pds-tabpanel.entry.js +3 -2
- package/dist/esm/pds-tabs.entry.js +15 -2
- package/dist/esm/pds-text.entry.js +2 -1
- package/dist/esm/pds-textarea.entry.js +3 -2
- package/dist/esm/pds-toast.entry.js +2 -1
- package/dist/esm/pds-tooltip.entry.js +4 -3
- package/dist/esm/pine-core.js +4 -3
- package/dist/esm/reflected-attribute-default-t3idJwV0.js +42 -0
- package/dist/esm-es5/attributes-CF5K2pxn.js +1 -0
- package/dist/esm-es5/{index-bLhIfh0N.js → index-2HMD-zUO.js} +2 -2
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/keep-hydrated-Dv7ssOTc.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +2 -2
- package/dist/esm-es5/pds-container.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-datepicker.entry.js +1 -1
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
- package/dist/esm-es5/pds-drawer.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-filters.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-image.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-property.entry.js +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +2 -2
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/reflected-attribute-default-t3idJwV0.js +1 -0
- package/dist/pine-core/index.esm.js +1 -1
- package/dist/pine-core/p-0166c620.entry.js +1 -0
- package/dist/pine-core/p-02857936.entry.js +1 -0
- package/dist/pine-core/{p-5986f3c9.entry.js → p-04fe5da7.system.entry.js} +1 -1
- package/dist/pine-core/p-0de74105.entry.js +1 -0
- package/dist/pine-core/p-152245fa.system.entry.js +1 -0
- package/dist/pine-core/p-16c2aa63.entry.js +1 -0
- package/dist/pine-core/p-1b13f69c.system.entry.js +1 -0
- package/dist/pine-core/p-1cd0acf0.system.entry.js +1 -0
- package/dist/pine-core/p-1cf1fced.entry.js +1 -0
- package/dist/pine-core/p-1d75a9b1.system.entry.js +1 -0
- package/dist/pine-core/p-1e464117.entry.js +1 -0
- package/dist/pine-core/p-1ec4eeaf.system.entry.js +1 -0
- package/dist/pine-core/p-1f263c0b.system.entry.js +1 -0
- package/dist/pine-core/p-1f2e5958.entry.js +1 -0
- package/dist/pine-core/p-207c94da.entry.js +1 -0
- package/dist/pine-core/p-21115986.system.entry.js +1 -0
- package/dist/pine-core/p-22f041ee.system.entry.js +1 -0
- package/dist/pine-core/p-2357758d.system.entry.js +1 -0
- package/dist/pine-core/p-238e5171.system.entry.js +1 -0
- package/dist/pine-core/p-281efc69.entry.js +1 -0
- package/dist/pine-core/p-2ac9e90a.system.entry.js +1 -0
- package/dist/pine-core/p-2cb02706.entry.js +1 -0
- package/dist/pine-core/p-2f539379.system.entry.js +3 -0
- package/dist/pine-core/p-343546b1.system.entry.js +1 -0
- package/dist/pine-core/p-347ae53c.system.entry.js +1 -0
- package/dist/pine-core/p-34b575b6.entry.js +2 -0
- package/dist/pine-core/p-37d73369.system.entry.js +1 -0
- package/dist/pine-core/p-37d95be9.entry.js +1 -0
- package/dist/pine-core/p-3b1d8fae.entry.js +1 -0
- package/dist/pine-core/p-419f57c9.entry.js +1 -0
- package/dist/pine-core/p-4414d442.system.entry.js +1 -0
- package/dist/pine-core/p-45fcc5b7.entry.js +1 -0
- package/dist/pine-core/p-4c9cccdb.system.entry.js +8 -0
- package/dist/pine-core/p-4e05a4f0.entry.js +1 -0
- package/dist/pine-core/p-4e67e68e.entry.js +1 -0
- package/dist/pine-core/p-506d3e80.entry.js +1 -0
- package/dist/pine-core/p-5132b8a1.entry.js +1 -0
- package/dist/pine-core/p-51dff046.system.entry.js +1 -0
- package/dist/pine-core/p-539ef98c.entry.js +1 -0
- package/dist/pine-core/p-56576b6e.entry.js +1 -0
- package/dist/pine-core/p-5737182f.entry.js +1 -0
- package/dist/pine-core/p-585832b1.entry.js +1 -0
- package/dist/pine-core/p-59491f98.entry.js +1 -0
- package/dist/pine-core/p-5ac84b2f.entry.js +1 -0
- package/dist/pine-core/p-5b7f7760.entry.js +1 -0
- package/dist/pine-core/p-5bc670be.system.entry.js +1 -0
- package/dist/pine-core/p-5d014059.entry.js +1 -0
- package/dist/pine-core/p-5decd81f.entry.js +1 -0
- package/dist/pine-core/p-5e8d73d4.entry.js +1 -0
- package/dist/pine-core/p-622e91e3.entry.js +7 -0
- package/dist/pine-core/{p-d00c5b9c.system.entry.js → p-63119d23.entry.js} +1 -1
- package/dist/pine-core/p-63854c10.system.entry.js +1 -0
- package/dist/pine-core/p-650ccffb.entry.js +1 -0
- package/dist/pine-core/p-65e30a4c.entry.js +1 -0
- package/dist/pine-core/p-66cfef6d.system.entry.js +1 -0
- package/dist/pine-core/p-6d83ad2d.system.entry.js +1 -0
- package/dist/pine-core/p-70c6f0ed.system.entry.js +1 -0
- package/dist/pine-core/p-71e3a89e.system.entry.js +1 -0
- package/dist/pine-core/p-721297b5.system.entry.js +1 -0
- package/dist/pine-core/p-73bc6e9f.system.entry.js +1 -0
- package/dist/pine-core/p-798839f7.system.entry.js +1 -0
- package/dist/pine-core/p-7bbfb965.system.entry.js +1 -0
- package/dist/pine-core/p-7d01e719.entry.js +1 -0
- package/dist/pine-core/p-7e115d33.system.entry.js +1 -0
- package/dist/pine-core/p-8027db25.entry.js +1 -0
- package/dist/pine-core/p-834c678e.system.entry.js +1 -0
- package/dist/pine-core/p-87f91e02.system.entry.js +1 -0
- package/dist/pine-core/p-8b0fbeb3.entry.js +1 -0
- package/dist/pine-core/p-8b9d8fb5.system.entry.js +1 -0
- package/dist/pine-core/p-912487fa.entry.js +1 -0
- package/dist/pine-core/p-91f712f4.system.entry.js +1 -0
- package/dist/pine-core/p-93877d4a.entry.js +1 -0
- package/dist/pine-core/p-969488f5.system.entry.js +1 -0
- package/dist/pine-core/p-9835c74b.entry.js +1 -0
- package/dist/pine-core/p-99317375.system.entry.js +1 -0
- package/dist/pine-core/p-9a7ee7cb.system.entry.js +1 -0
- package/dist/pine-core/p-9b9f66b7.entry.js +1 -0
- package/dist/pine-core/p-9bcdfac2.entry.js +1 -0
- package/dist/pine-core/p-9d33bb05.entry.js +1 -0
- package/dist/pine-core/p-BJlg6wq7.system.js +2 -0
- package/dist/pine-core/p-BMFBF3sJ.system.js +1 -0
- package/dist/pine-core/p-Bkho_oFB.system.js +1 -0
- package/dist/pine-core/p-D2MUS7JO.js +1 -0
- package/dist/pine-core/p-D2yHYrxQ.system.js +1 -0
- package/dist/pine-core/p-DeIDZHrg.js +2 -0
- package/dist/pine-core/p-Dv7ssOTc.js +1 -0
- package/dist/pine-core/p-TyevV8iv.system.js +1 -0
- package/dist/pine-core/p-YQa3CeL9.system.js +1 -0
- package/dist/pine-core/p-a22091c4.system.entry.js +1 -0
- package/dist/pine-core/p-a6d09102.system.entry.js +1 -0
- package/dist/pine-core/p-a83a6618.system.entry.js +1 -0
- package/dist/pine-core/p-afd5e2d7.entry.js +1 -0
- package/dist/pine-core/p-b5838211.system.entry.js +1 -0
- package/dist/pine-core/p-ba1b79c7.system.entry.js +1 -0
- package/dist/pine-core/p-bd7da23e.system.entry.js +1 -0
- package/dist/pine-core/p-bde53290.system.entry.js +1 -0
- package/dist/pine-core/p-bdf68e53.system.entry.js +1 -0
- package/dist/pine-core/p-bef04e15.system.entry.js +1 -0
- package/dist/pine-core/p-bf1aea9f.system.entry.js +1 -0
- package/dist/pine-core/p-c00e46a5.system.entry.js +1 -0
- package/dist/pine-core/p-c8e89b61.system.entry.js +1 -0
- package/dist/pine-core/p-c9395f43.system.entry.js +1 -0
- package/dist/pine-core/p-d576e542.system.entry.js +1 -0
- package/dist/pine-core/p-d5dd5599.entry.js +1 -0
- package/dist/pine-core/p-d69cfaa4.entry.js +1 -0
- package/dist/pine-core/p-db4319fd.entry.js +1 -0
- package/dist/pine-core/p-dc81ffff.entry.js +1 -0
- package/dist/pine-core/p-e337f32c.system.entry.js +1 -0
- package/dist/pine-core/p-e46f7541.system.entry.js +1 -0
- package/dist/pine-core/p-e7ba30dd.system.entry.js +1 -0
- package/dist/pine-core/p-ed3dd3d2.entry.js +1 -0
- package/dist/pine-core/p-eee4f146.entry.js +1 -0
- package/dist/pine-core/p-f01e35e2.entry.js +1 -0
- package/dist/pine-core/p-f06ca8df.entry.js +1 -0
- package/dist/pine-core/p-f2e0da9a.entry.js +1 -0
- package/dist/pine-core/p-f30d6192.system.entry.js +1 -0
- package/dist/pine-core/p-fbea5703.entry.js +1 -0
- package/dist/pine-core/p-fc6ac917.entry.js +1 -0
- package/dist/pine-core/p-ffe276ef.entry.js +1 -0
- package/dist/pine-core/p-t3idJwV0.js +1 -0
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/pine-core/pine-core.js +1 -1
- package/dist/types/components/pds-avatar/pds-avatar.d.ts +3 -0
- package/dist/types/components/pds-box/pds-box.d.ts +7 -0
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +2 -0
- package/dist/types/components/pds-chip/pds-chip.d.ts +2 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +5 -0
- package/dist/types/components/pds-copytext/pds-copytext.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +1 -0
- package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer.d.ts +1 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +4 -0
- package/dist/types/components/pds-loader/pds-loader.d.ts +5 -0
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +3 -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 +9 -1
- package/dist/types/components/pds-popover/pds-popover.d.ts +15 -0
- package/dist/types/components/pds-progress/pds-progress.d.ts +4 -0
- package/dist/types/components/pds-radio/pds-radio.d.ts +3 -0
- package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +1 -0
- package/dist/types/components/pds-row/pds-row.d.ts +7 -0
- package/dist/types/components/pds-select/pds-select.d.ts +2 -0
- package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +4 -0
- package/dist/types/components/pds-sortable/pds-sortable.d.ts +6 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +2 -0
- package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +3 -0
- package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +3 -0
- package/dist/types/components/pds-tabs/pds-tabs.d.ts +3 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +199 -0
- package/dist/types/global/pine-global.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/attributes.d.ts +34 -0
- package/dist/types/utils/keep-hydrated.d.ts +29 -0
- package/dist/types/utils/reflected-attribute-default.d.ts +31 -0
- package/dist/types/utils/test/host-strip.d.ts +10 -0
- package/dist/vscode.html-data.json +7 -0
- package/hydrate/index.js +778 -202
- package/hydrate/index.mjs +778 -202
- package/package.json +2 -2
- package/dist/cjs/attributes-oNMnBEnP.js +0 -85
- package/dist/esm/attributes-C0M1gTKv.js +0 -82
- package/dist/esm-es5/attributes-C0M1gTKv.js +0 -1
- package/dist/pine-core/p-015d2ceb.entry.js +0 -1
- package/dist/pine-core/p-02a428af.system.entry.js +0 -1
- package/dist/pine-core/p-06534502.entry.js +0 -1
- package/dist/pine-core/p-0827c6a6.entry.js +0 -1
- package/dist/pine-core/p-085c92aa.system.entry.js +0 -1
- package/dist/pine-core/p-0af4685d.entry.js +0 -1
- package/dist/pine-core/p-0bfe152a.entry.js +0 -1
- package/dist/pine-core/p-0ce3bcf2.system.entry.js +0 -1
- package/dist/pine-core/p-1747c005.system.entry.js +0 -1
- package/dist/pine-core/p-1dd395d8.system.entry.js +0 -1
- package/dist/pine-core/p-2126b4e4.system.entry.js +0 -1
- package/dist/pine-core/p-23044953.system.entry.js +0 -1
- package/dist/pine-core/p-26d8c4f7.system.entry.js +0 -1
- package/dist/pine-core/p-28abc253.system.entry.js +0 -1
- package/dist/pine-core/p-2a00844f.entry.js +0 -1
- package/dist/pine-core/p-3653fd52.system.entry.js +0 -1
- package/dist/pine-core/p-3add97f7.system.entry.js +0 -1
- package/dist/pine-core/p-40928521.system.entry.js +0 -1
- package/dist/pine-core/p-40ebfe59.system.entry.js +0 -1
- package/dist/pine-core/p-468f0dab.system.entry.js +0 -1
- package/dist/pine-core/p-478e69d1.entry.js +0 -1
- package/dist/pine-core/p-495f791c.entry.js +0 -1
- package/dist/pine-core/p-4a43fbd9.entry.js +0 -1
- package/dist/pine-core/p-4d3f5098.system.entry.js +0 -1
- package/dist/pine-core/p-517e04f6.entry.js +0 -1
- package/dist/pine-core/p-517f9962.entry.js +0 -1
- package/dist/pine-core/p-563ba784.entry.js +0 -1
- package/dist/pine-core/p-569b07ed.system.entry.js +0 -1
- package/dist/pine-core/p-5bf397ca.entry.js +0 -1
- package/dist/pine-core/p-5c7c2ffa.entry.js +0 -1
- package/dist/pine-core/p-5e9396e2.system.entry.js +0 -1
- package/dist/pine-core/p-600be0e1.entry.js +0 -1
- package/dist/pine-core/p-601b646c.system.entry.js +0 -1
- package/dist/pine-core/p-60393d52.entry.js +0 -1
- package/dist/pine-core/p-60a15bf7.system.entry.js +0 -1
- package/dist/pine-core/p-60e687ac.entry.js +0 -1
- package/dist/pine-core/p-61ae5a4b.system.entry.js +0 -1
- package/dist/pine-core/p-62045f88.system.entry.js +0 -1
- package/dist/pine-core/p-62241978.entry.js +0 -1
- package/dist/pine-core/p-62974869.entry.js +0 -1
- package/dist/pine-core/p-63422f56.entry.js +0 -2
- package/dist/pine-core/p-63930a06.system.entry.js +0 -1
- package/dist/pine-core/p-6516adf7.system.entry.js +0 -1
- package/dist/pine-core/p-67227922.entry.js +0 -1
- package/dist/pine-core/p-686b526d.entry.js +0 -1
- package/dist/pine-core/p-69f60432.system.entry.js +0 -1
- package/dist/pine-core/p-6aaf945c.entry.js +0 -1
- package/dist/pine-core/p-6b25f349.system.entry.js +0 -1
- package/dist/pine-core/p-6eb2070a.entry.js +0 -1
- package/dist/pine-core/p-715b8e6b.entry.js +0 -1
- package/dist/pine-core/p-74b1b841.entry.js +0 -1
- package/dist/pine-core/p-7608e9b2.entry.js +0 -1
- package/dist/pine-core/p-773f5771.system.entry.js +0 -1
- package/dist/pine-core/p-77961987.system.entry.js +0 -1
- package/dist/pine-core/p-77e12080.system.entry.js +0 -1
- package/dist/pine-core/p-7a177548.system.entry.js +0 -1
- package/dist/pine-core/p-7fbb7037.entry.js +0 -1
- package/dist/pine-core/p-806f17de.system.entry.js +0 -1
- package/dist/pine-core/p-832cedb7.entry.js +0 -1
- package/dist/pine-core/p-847e5f00.system.entry.js +0 -1
- package/dist/pine-core/p-85981c5d.system.entry.js +0 -1
- package/dist/pine-core/p-86978a51.entry.js +0 -1
- package/dist/pine-core/p-871894e1.entry.js +0 -1
- package/dist/pine-core/p-893b02b7.entry.js +0 -1
- package/dist/pine-core/p-8961d112.system.entry.js +0 -3
- package/dist/pine-core/p-8d42f505.entry.js +0 -1
- package/dist/pine-core/p-9452adc4.entry.js +0 -1
- package/dist/pine-core/p-977db8b2.entry.js +0 -1
- package/dist/pine-core/p-9903eb37.system.entry.js +0 -1
- package/dist/pine-core/p-9b18314c.entry.js +0 -1
- package/dist/pine-core/p-9b262a9d.entry.js +0 -1
- package/dist/pine-core/p-9dbb8fe9.entry.js +0 -1
- package/dist/pine-core/p-BhQhw0S3.system.js +0 -1
- package/dist/pine-core/p-C0M1gTKv.js +0 -1
- package/dist/pine-core/p-CrXTJmBd.system.js +0 -2
- package/dist/pine-core/p-DO9XKAkv.system.js +0 -1
- package/dist/pine-core/p-G3CPPJEt.system.js +0 -1
- package/dist/pine-core/p-a44316ad.entry.js +0 -1
- package/dist/pine-core/p-ae125139.entry.js +0 -1
- package/dist/pine-core/p-af9bce53.entry.js +0 -1
- package/dist/pine-core/p-b2901e60.system.entry.js +0 -1
- package/dist/pine-core/p-b412473d.system.entry.js +0 -8
- package/dist/pine-core/p-b51cfa3b.entry.js +0 -1
- package/dist/pine-core/p-b62e08c2.system.entry.js +0 -1
- package/dist/pine-core/p-b802776b.system.entry.js +0 -1
- package/dist/pine-core/p-b823bde2.system.entry.js +0 -1
- package/dist/pine-core/p-b82a0693.entry.js +0 -1
- package/dist/pine-core/p-b852c82b.system.entry.js +0 -1
- package/dist/pine-core/p-b979105e.entry.js +0 -1
- package/dist/pine-core/p-bLhIfh0N.js +0 -2
- package/dist/pine-core/p-bb9d158c.system.entry.js +0 -1
- package/dist/pine-core/p-bd1bdb07.system.entry.js +0 -1
- package/dist/pine-core/p-c53e560a.system.entry.js +0 -1
- package/dist/pine-core/p-c5c46b65.entry.js +0 -1
- package/dist/pine-core/p-cbae27a4.system.entry.js +0 -1
- package/dist/pine-core/p-cd7deae5.entry.js +0 -1
- package/dist/pine-core/p-cd86ee3e.system.entry.js +0 -1
- package/dist/pine-core/p-cf5a484e.system.entry.js +0 -1
- package/dist/pine-core/p-cf99f7d8.system.entry.js +0 -1
- package/dist/pine-core/p-cff7013e.system.entry.js +0 -1
- package/dist/pine-core/p-d11e4956.entry.js +0 -1
- package/dist/pine-core/p-da7a7cca.entry.js +0 -1
- package/dist/pine-core/p-daaf653f.system.entry.js +0 -1
- package/dist/pine-core/p-de740b3e.system.entry.js +0 -1
- package/dist/pine-core/p-e1d541f7.entry.js +0 -1
- package/dist/pine-core/p-ea0e5253.entry.js +0 -7
- package/dist/pine-core/p-ea9468fb.entry.js +0 -1
- package/dist/pine-core/p-f22abb4d.system.entry.js +0 -1
- package/dist/pine-core/p-f2560935.entry.js +0 -1
- package/dist/pine-core/p-f279f435.system.entry.js +0 -1
- package/dist/pine-core/p-f5677949.system.entry.js +0 -1
- package/dist/pine-core/p-f6943cbf.entry.js +0 -1
- package/dist/pine-core/p-f794f7ad.entry.js +0 -1
- package/dist/pine-core/p-fe09b6fb.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as s,Host as n,transformTag as i}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as s,Host as n,transformTag as i}from"@stencil/core/internal/client";import{H as d}from"./attributes.js";import{f as p}from"./index2.js";import{r}from"./reflected-attribute-default.js";import{s as a}from"./truncation-tooltip.js";import{d as c}from"./pds-button2.js";import{d as h}from"./pds-icon2.js";import{d as l}from"./pds-loader2.js";const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pdsCopyTextClick=o(this,"pdsCopyTextClick",7),this.hostKeeper=new d,this.truncationCleanup=null,this.border=!0,this.fullWidth=!1,this.truncate=!1,this.copyToClipboard=async t=>{try{void 0!==navigator.clipboard&&(await navigator.clipboard.writeText(t),this.pdsCopyTextClick.emit("Copied to clipboard"))}catch(t){this.pdsCopyTextClick.emit("Error writing text to clipboard: "+t)}},this.handleClick=()=>{this.copyToClipboard(this.value)}}connectedCallback(){this.hostKeeper.connect(this.el)}restoreBorderDefault(t){this.border=r(this.el,"border",t,!0)}handleTruncateChange(t){t?this.initTruncationTooltip():this.destroyTruncationTooltip()}handleValueChange(){this.truncate&&this.initTruncationTooltip()}componentDidLoad(){this.truncate&&this.initTruncationTooltip()}disconnectedCallback(){this.hostKeeper.disconnect(),this.destroyTruncationTooltip()}initTruncationTooltip(){this.destroyTruncationTooltip(),this.valueSpanEl&&(this.truncationCleanup=a({hostEl:this.el,contentEl:this.valueSpanEl,getTooltipText:()=>this.value||"",manageTabIndex:!1}))}destroyTruncationTooltip(){this.truncationCleanup&&(this.truncationCleanup(),this.truncationCleanup=null)}classNames(){const t=["pds-copytext"];return this.border&&t.push("pds-copytext--bordered"),this.fullWidth&&t.push("pds-copytext--full-width"),this.truncate&&t.push("pds-copytext--truncated"),t.join(" ")}render(){const t=this.classNames();return this.hostKeeper.record(t),s(n,{key:"1c43941f808f58a53f1c445e0f5693985c793c35",class:t,id:this.componentId},s("pds-button",{key:"d771d2587a11f1b27bded17b5df5e649ea93cd90",type:"button",variant:"unstyled",onClick:this.handleClick},s("span",{key:"0d4fd25220cac636b328fd1ee1aba40d07296265",ref:t=>this.valueSpanEl=t},this.value),s("pds-icon",{key:"832a044c10843bb90833301cc3f3ea1f7b755f42","aria-hidden":"true",icon:p,size:"16px"})))}get el(){return this}static get watchers(){return{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}}static get style(){return":host(.pds-copytext){--copytext-color-background-hover:var(--pine-color-background-inset)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;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%}:host(.pds-copytext) pds-button::part(button){padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs)}: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) pds-button::part(button){padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button::part(button):hover{background-color:transparent}:host(.pds-copytext):host(.pds-copytext--bordered) span{background:var(--pine-color-secondary);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}"}},[1,"pds-copytext",{border:[1540],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]},void 0,{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}]),b=u,x=function(){"undefined"!=typeof customElements&&["pds-copytext","pds-button","pds-icon","pds-loader"].forEach((t=>{switch(t){case"pds-copytext":customElements.get(i(t))||customElements.define(i(t),u);break;case"pds-button":customElements.get(i(t))||c();break;case"pds-icon":customElements.get(i(t))||h();break;case"pds-loader":customElements.get(i(t))||l()}}))};export{b as PdsCopytext,x as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a,c as o,o as d,f as l,b as c,s as h,h as p}from"./floating-ui.dom.js";import{c as u,j as v,k as m,m as b,r as f,n as g}from"./index2.js";import{i as k}from"./form.js";import{r as _,f as y}from"./i18n-format.js";import{a as x}from"./closest.js";import{d as w}from"./pds-icon2.js";import{d as D}from"./pds-input2.js";const M=/^(\d{4})-(\d{2})-(\d{2})$/;function C(e){const t=M.exec((null!=e?e:"").trim());if(!t)return null;const[,i,s,r]=t.map(Number),n=new Date(Date.UTC(i,s-1,r));return n.getUTCFullYear()===i&&n.getUTCMonth()===s-1&&n.getUTCDate()===r?n:null}function $(e){return e.toISOString().slice(0,10)}function A(){const e=new Date;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}function T(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function L(e,t){const i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),s=j(i.getUTCFullYear(),i.getUTCMonth());return new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),Math.min(e.getUTCDate(),s)))}function j(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function P(e,t){return!!e&&!!t&&e.getTime()===t.getTime()}function H(e,t,i){return t&&e<t?t:i&&e>i?i:e}function Y(e,t,i){return!!t&&e<t||!!i&&e>i}function E(e,t){return(e.getUTCDay()-t+7)%7}function z(e,t){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},t),{timeZone:"UTC",calendar:"gregory"}))}function S(e,t,i){return z(t,i).format(e)}class N{constructor(e){this.datepicker=e,this.copiedProperties=[],this.host=document.createElement("div"),this.host.className=N.className,this.host.pdsDatepicker=e,this.host.style.display="contents",this.root=this.host.attachShadow({mode:"open"})}mount(e,t){this.host.isConnected?t!==this.locale&&this.copyContext(t):(function(e){const t=new Set;let i=e;for(;i&&!t.has(i);){if(t.add(i),i.nodeType===Node.ELEMENT_NODE&&F(i))return i;const e=i.nodeType===Node.ELEMENT_NODE?i.assignedSlot:null;if(e){i=e;continue}const s=i.parentNode;i=s instanceof ShadowRoot?s.host:s}return document.body}(this.datepicker).appendChild(this.host),this.copyContext(t)),e.parentNode!==this.root&&this.root.appendChild(e)}remove(){this.host.remove()}contains(e){return!!e&&(e===this.host||this.root.contains(e))}copyContext(e){var t,i;this.locale=e;const s=this.datepicker.shadowRoot;s&&((null===(t=s.adoptedStyleSheets)||void 0===t?void 0:t.length)?this.root.adoptedStyleSheets=s.adoptedStyleSheets:this.root.querySelector("style")||s.querySelectorAll("style").forEach((e=>this.root.appendChild(e.cloneNode(!0)))));const r=getComputedStyle(this.datepicker);this.host.dir=r.direction||"ltr",this.host.lang=e,this.copyCustomProperties(r);const n=null===(i=x("[data-theme]",this.datepicker)||null)||void 0===i?void 0:i.getAttribute("data-theme");n?this.host.setAttribute("data-theme",n):this.host.removeAttribute("data-theme")}copyCustomProperties(e){for(const e of this.copiedProperties)this.host.style.removeProperty(e);this.copiedProperties=[];const t=this.host.parentElement,i=t?getComputedStyle(t):null;for(let t=0;t<e.length;t++){const s=e[t];if(!s.startsWith("--"))continue;const r=e.getPropertyValue(s);i&&r===i.getPropertyValue(s)||(this.host.style.setProperty(s,r.trim()),this.copiedProperties.push(s))}}}function F(e){if("dialog"===e.localName)return e.open;if(!e.hasAttribute("popover"))return!1;try{return e.matches(":popover-open")}catch(e){return!1}}N.className="pds-datepicker-calendar-portal";const U={today:"Today",yesterday:"Yesterday","last-7-days":"Last 7 days","last-30-days":"Last 30 days","last-90-days":"Last 90 days","this-month":"This month","last-month":"Last month","this-quarter":"This quarter","last-quarter":"Last quarter","this-year":"This year","last-year":"Last year","year-to-date":"Year to date","last-12-months":"Last 12 months"},O=(e,t,i)=>new Date(Date.UTC(e,t,i));function q(e,t){const i=t.getUTCFullYear(),s=t.getUTCMonth(),r=s-s%3;switch(e){case"today":return[t,t];case"yesterday":return[T(t,-1),T(t,-1)];case"last-7-days":return[T(t,-6),t];case"last-30-days":return[T(t,-29),t];case"last-90-days":return[T(t,-89),t];case"this-month":return[O(i,s,1),O(i,s+1,0)];case"last-month":return[O(i,s-1,1),O(i,s,0)];case"this-quarter":return[O(i,r,1),O(i,r+3,0)];case"last-quarter":return[O(i,r-3,1),O(i,r,0)];case"this-year":return[O(i,0,1),O(i,11,31)];case"last-year":return[O(i-1,0,1),O(i-1,11,31)];case"year-to-date":return[O(i,0,1),t];case"last-12-months":return[L(t,-12),t];default:return null}}function I(e,t,i){if(t&&i)return e.find((e=>e.start.getTime()===t.getTime()&&e.end.getTime()===i.getTime()))}function R(e,t,i){return!Y(e.start,t,i)&&!Y(e.end,t,i)}const W=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2}))?$/;function K(e){const t=W.exec((null!=e?e:"").trim());if(!t)return null;const i=C(t[1]);return i?void 0===t[2]?{date:i,time:null}:Number(t[2])<24&&Number(t[3])<60?{date:i,time:`${t[2]}:${t[3]}`}:null:null}const V="YYYY-MM-DD",X=/\[([^\]]*)\]|YYYY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|A|a/g,Z=/HH|H|hh|h/,B=/hh|h/,G=/A|a/;function J(e,t,i=!1){const s=(null==e?void 0:e.trim())||V,r=(e=>e.replace(/\[[^\]]*\]/g,""))(s);return B.test(r)&&!G.test(r)?s+" A":!t||Z.test(r)?s:`${s} ${i?"h:mm A":"HH:mm"}`}const Q=(e,t=2)=>(e+"").padStart(t,"0"),ee=new Map;function te(e){let t=ee.get(e);if(!t){const i=t=>{const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC",calendar:"gregory"});return Array.from({length:12},((e,t)=>i.format(new Date(Date.UTC(2023,t,1)))))},s=ue(e);t={months:i("long"),shortMonths:i("short"),am:s.am,pm:s.pm},ee.set(e,t)}return t}const ie=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),se=e=>ie(e).replace(/\s+/g,"\\s*"),re=e=>`(${e.map(ie).join("|")})`;function ne(e,t=V,i="en-US"){var s;return null!==(s=function(e,t,i="en-US"){var s,r,n,a,o,d,l,c,h,p;const u=te(i),v=te("en-US"),m=[u.am,u.pm,v.am,v.pm],b={YYYY:"(\\d{4})",MMMM:re([...u.months,...v.months]),MMM:re([...u.shortMonths,...v.shortMonths]),MM:"(\\d{1,2})",M:"(\\d{1,2})",DD:"(\\d{1,2})",D:"(\\d{1,2})",HH:"(\\d{1,2})",H:"(\\d{1,2})",hh:"(\\d{1,2})",h:"(\\d{1,2})",mm:"(\\d{2})",A:re(m),a:re(m)},f=[],g=()=>{f.length=0;let e="",i=0;return t.replace(X,((s,r,n)=>(e+=se(t.slice(i,n)),void 0!==r?e+=se(r):(e+=b[s],f.push(s)),i=n+s.length,s))),RegExp(`^\\s*${e}${se(t.slice(i))}\\s*$`,"i")};let k=g().exec(null!=e?e:"");if(k||(b.mm="(\\d{1,2})",k=g().exec(null!=e?e:"")),!k)return null;const _=k,y={};f.forEach(((e,t)=>y[e]=_[t+1]));const x=(e,t)=>{if(void 0===e)return;const i=t?[u.months,v.months]:[u.shortMonths,v.shortMonths];for(const t of i){const i=t.findIndex((t=>t.toLowerCase()===e.toLowerCase()));if(i>=0)return i+1}},w=Number(y.YYYY),D=null!==(r=null!==(s=x(y.MMMM,!0))&&void 0!==s?s:x(y.MMM,!1))&&void 0!==r?r:Number(null!==(n=y.MM)&&void 0!==n?n:y.M),M=Number(null!==(a=y.DD)&&void 0!==a?a:y.D);if(!y.YYYY||!D||!M)return null;const $=C(`${Q(w,4)}-${Q(D)}-${Q(M)}`);if(!$)return null;const A=null!==(l=null!==(d=null!==(o=y.HH)&&void 0!==o?o:y.H)&&void 0!==d?d:y.hh)&&void 0!==l?l:y.h;if(void 0===A)return{date:$,time:null};let T=Number(A);const L=Number(null!==(c=y.mm)&&void 0!==c?c:0),j=null===(p=null!==(h=y.A)&&void 0!==h?h:y.a)||void 0===p?void 0:p.toLowerCase();if(void 0!==y.hh||void 0!==y.h){if(T<1||T>12)return null;T=T%12+(j===u.pm.toLowerCase()||j===v.pm.toLowerCase()?12:0)}return T<24&&L<60?{date:$,time:pe(T,L)}:null}(e,t,i))&&void 0!==s?s:K(e)}function ae(e,t=V,i="en-US"){const s=(null!=e?e:"").trim(),r=RegExp(`${ie(ce)}|\\s+(?:–|—|-|to)\\s+${t.includes("/")?"":"|\\s*/\\s*"}`,"gi");let n;for(;null!==(n=r.exec(s));){const e=ne(s.slice(0,n.index),t,i),r=ne(s.slice(n.index+n[0].length),t,i);if(e&&r)return oe(e,r)<=0?[e,r]:null}return null}function oe(e,t){var i,s;const r=e.date.getTime()-t.date.getTime();return 0!==r?r:(null!==(i=e.time)&&void 0!==i?i:"00:00").localeCompare(null!==(s=t.time)&&void 0!==s?s:"00:00")}function de(e){return e.time?`${$(e.date)}T${e.time}`:$(e.date)}function le(e,t,i="en-US"){return function(e,t,i="en-US"){var s;const r=te(i),[n,a]=he(null!==(s=e.time)&&void 0!==s?s:"00:00"),o=n%12||12,d=e.date.getUTCMonth(),l=n<12?r.am:r.pm,c={YYYY:Q(e.date.getUTCFullYear(),4),MMMM:r.months[d],MMM:r.shortMonths[d],MM:Q(d+1),M:d+1+"",DD:Q(e.date.getUTCDate()),D:e.date.getUTCDate()+"",HH:Q(n),H:n+"",hh:Q(o),h:o+"",mm:Q(a),A:l,a:l.toLowerCase()};return t.replace(X,((e,t)=>null!=t?t:c[e]))}(e,null!=t?t:J(V,!!e.time),i)}const ce=" – ";function he(e){const[t,i]=e.split(":").map(Number);return[t||0,i||0]}function pe(e,t){return`${(e+"").padStart(2,"0")}:${(t+"").padStart(2,"0")}`}function ue(e){var t,i;const s=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}),r=e=>{var t;return null===(t=s.formatToParts(new Date(Date.UTC(2023,0,1,e))).find((e=>"dayPeriod"===e.type)))||void 0===t?void 0:t.value};return{hour12:!!s.resolvedOptions().hour12,am:null!==(t=r(1))&&void 0!==t?t:"AM",pm:null!==(i=r(13))&&void 0!==i?i:"PM"}}const ve={weekday:"long",year:"numeric",month:"long",day:"numeric"},me="00:00",be="23:59";let fe=0;const ge=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ke=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsDatepickerChange=i(this,"pdsDatepickerChange",7),this.pdsBlur=i(this,"pdsBlur",7),this.pdsFocus=i(this,"pdsFocus",7),this.focusActiveDay=!1,this.fallbackId="pds-datepicker-"+ ++fe,this.skipForwardedClick=!1,this.presetByArrow=!1,this.valueAtOpen="",this.committing=!1,this.hasFocus=!1,this.applyLabel="Apply",this.autoApply=!1,this.cancelLabel="Cancel",this.clearable=!1,this.clearLabel="Clear",this.customRangeLabel="Custom range",this.endTimeLabel="End time",this.format="YYYY-MM-DD",this.hourLabel="Hour",this.invalidDateMessage="Enter a date in the format shown.",this.maxDateMessage="Choose {date} or earlier.",this.minDateMessage="Choose {date} or later.",this.minuteIncrement=1,this.minuteLabel="Minute",this.monthLabel="Month",this.nextMonthLabel="Next month",this.periodLabel="AM or PM",this.placement="bottom-start",this.presetsLabel="Presets",this.previousMonthLabel="Previous month",this.range=!1,this.showDropdowns=!1,this.startTimeLabel="Start time",this.timePicker=!1,this.timeLabel="Time",this.triggerLabel="Choose date",this.value="",this.yearLabel="Year",this.isOpen=!1,this.text="",this.textError="",this.activeDate="",this.viewMonth="",this.draftStart="",this.draftEnd="",this.startTime=me,this.endTime=be,this.previewDate="",this.onApply=()=>{const e=this.draftParts();e&&(this.commitParts(e),this.closeCalendar(!0))},this.onCancel=()=>{this.clearable?this.commitValue(""):this.restoreValueAtOpen(),this.closeCalendar(!0)},this.onPresetClick=(e,t)=>{this.draftStart=$(t.start),this.draftEnd=$(t.end),this.previewDate="",!this.appliesOnPick||this.presetByArrow?(this.showDate(t.end,!0),e.currentTarget.focus()):this.onApply()},this.onPresetsKeyDown=e=>{const t={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key],i={Home:"first",End:"last"}[e.key];if(!t&&!i)return;const s=Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not([disabled])')),r=s.indexOf(e.target),n="first"===i?s[0]:"last"===i?s[s.length-1]:s[(r+t+s.length)%s.length];n&&(e.preventDefault(),n.focus(),n.classList.contains("pds-datepicker__preset")&&n!==s[s.length-1]&&(this.presetByArrow=!0,n.click(),this.presetByArrow=!1))},this.onClearMouseDown=e=>{e.preventDefault()},this.onClearClick=()=>{var e;this.commitValue(""),this.closeCalendar(!1),null===(e=this.inputEl)||void 0===e||e.setFocus()},this.onCustomRangeClick=()=>{var e,t;null===(t=null===(e=this.dialogEl)||void 0===e?void 0:e.querySelector('[data-date][tabindex="0"]'))||void 0===t||t.focus()},this.onDocumentPointerDown=e=>{var t;const i=e.composedPath();i.includes(this.el)||this.portal&&i.includes(this.portal.host)||(this.closeCalendar(!1),"dialog"===(null===(t=i[0])||void 0===t?void 0:t.localName)&&function(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,{capture:!0,once:!0}),window.setTimeout((()=>document.removeEventListener("click",e,{capture:!0})),500)}())},this.onHostFocusIn=e=>{this.focusEntered(e)},this.onCalendarFocusIn=e=>{var t,i;this.focusEntered(e),null===(t=this.dialogEl)||void 0===t||t.setAttribute("aria-modal","true"),e.target===this.dialogEl&&(null===(i=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===i||i.focus({preventScroll:!0}))},this.onCalendarFocusOut=e=>{var t,i;const s=e.relatedTarget;s&&(null===(t=this.dialogEl)||void 0===t?void 0:t.contains(s))||null===(i=this.dialogEl)||void 0===i||i.removeAttribute("aria-modal"),this.checkFocusLeft(e,null!==s)},this.onHostFocusOut=e=>{const t=e.relatedTarget;t&&this.isInside(t)||this.checkFocusLeft(e,null!==t)},this.stopInnerEvent=e=>e.stopPropagation(),this.onFieldClick=e=>{var t,i;const s=e.composedPath();if(this.triggerEl&&s.includes(this.triggerEl)||this.clearEl&&s.includes(this.clearEl))return;const r=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("label");if(r&&s.includes(r))return this.skipForwardedClick=!0,void window.setTimeout((()=>this.skipForwardedClick=!1));if(this.skipForwardedClick)return void(this.skipForwardedClick=!1);const n=this.fieldReference();n&&n!==this.inputEl&&!s.includes(n)||this.openCalendar(!1)},this.onTextInput=e=>{var t,i;if(e.stopPropagation(),this.text=(null!==(t=e.detail.value)&&void 0!==t?t:"")+"",!this.isOpen)return;const s=this.parseText(this.text);if(!s)return;const[r,n]=[this.startTime,this.endTime];if(null!==(i=this.timesBeforeTyping)&&void 0!==i||(this.timesBeforeTyping=[r,n]),this.loadDraft(s),this.timePicker){const e=this.resolvedFormat,t=this.resolvedLocale,i=this.range?ae(this.text,e,t):[ne(this.text,e,t)],s=this.parsedValue(),a=e=>{var t,r,n;return!(null===(t=null==i?void 0:i[e])||void 0===t?void 0:t.time)||(null===(r=i[e])||void 0===r?void 0:r.time)===(null===(n=null==s?void 0:s[e])||void 0===n?void 0:n.time)};a(0)&&(this.startTime=r),this.range&&a(1)&&(this.endTime=n)}this.showDate(s[s.length-1].date)},this.onTextChange=e=>{e.stopPropagation(),this.isOpen&&this.hasFooter?window.setTimeout((()=>{var e;this.isOpen&&(this.el.matches(":focus-within")||(null===(e=this.portal)||void 0===e?void 0:e.host.matches(":focus-within")))||this.commitPendingText()})):this.commitText()},this.onTextKeyDown=e=>{e.stopPropagation();const t=e.detail;if(t.altKey&&"ArrowDown"===t.key)t.preventDefault(),this.isOpen?(this.focusActiveDay=!0,this.flushActiveDayFocus()):this.openCalendar(!0);else if("Enter"===t.key&&this.isOpen){if(!this.hasFooter||this.text!==this.fieldText()&&!this.parseText(this.text))this.commitText();else{const e=this.draftParts();e&&this.commitParts(e)}this.textError||this.closeCalendar(!1)}else"Escape"===t.key&&this.isOpen&&(t.preventDefault(),t.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!1))},this.onTriggerKeyDown=e=>{var t;if(this.isOpen)return"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),void this.closeCalendar(!1)):void("Tab"!==e.key||e.shiftKey||"visible"!==(null===(t=this.dialogEl)||void 0===t?void 0:t.style.visibility)||(e.preventDefault(),this.focusActiveDay=!0,this.flushActiveDayFocus()))},this.onTriggerClick=()=>{this.isOpen?this.closeCalendar(!0):this.openCalendar(!0)},this.onDialogKeyDown=e=>{"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!0)):"Tab"===e.key&&this.trapTab(e)},this.onGridKeyDown=e=>{const t=C(this.activeDate);if(!t)return;const i="rtl"===getComputedStyle(this.el).direction,s=E(t,this.weekStart);let r=null;switch(e.key){case"ArrowLeft":r=T(t,i?1:-1);break;case"ArrowRight":r=T(t,i?-1:1);break;case"ArrowUp":r=T(t,-7);break;case"ArrowDown":r=T(t,7);break;case"Home":r=T(t,-s);break;case"End":r=T(t,6-s);break;case"PageUp":r=L(t,e.shiftKey?-12:-1);break;case"PageDown":r=L(t,e.shiftKey?12:1);break;case"Enter":case" ":return e.preventDefault(),this.pickDate(t),void(this.hasFooter&&(this.focusActiveDay=!0));default:return}e.preventDefault();const n=H(r,this.minDate,this.maxDate);this.showDate(n),this.range&&(this.previewDate=$(n)),this.focusActiveDay=!0},this.onGridClick=e=>{const t=this.dayFromEvent(e);t&&this.pickDate(t)},this.onGridPointerOver=e=>{if(!this.range||!this.draftStart||this.draftEnd)return;const t=this.dayFromEvent(e),i=t&&$(t);i&&i!==this.previewDate&&(this.previewDate=i)}}async open(){this.openCalendar(!0)}async close(){this.closeCalendar(!1)}async setFocus(){var e;await(null===(e=this.inputEl)||void 0===e?void 0:e.setFocus())}valueChanged(){var e;this.committing||(this.valueAtOpen=null!==(e=this.value)&&void 0!==e?e:""),this.refreshFromValue()}contextChanged(){this.refreshFromValue()}placementChanged(){this.stopPositioning()}refreshFromValue(){var e;if(this.text=this.fieldText(),this.textError="",this.updateFormValue(),!this.isOpen)return;const t=this.parsedValue();this.loadDraft(t);const i=null!==(e=t&&t[t.length-1].date)&&void 0!==e?e:A();this.showDate(H(i,this.minDate,this.maxDate),!0)}requiredChanged(){this.updateFormValue()}componentWillLoad(){this.text=this.fieldText()}connectedCallback(){this.el.attachInternals&&!this.internals&&(this.internals=this.el.attachInternals())}componentDidLoad(){this.updateFormValue()}disconnectedCallback(){var e;this.closeCalendar(!1),null===(e=this.portal)||void 0===e||e.remove()}componentDidRender(){var e,t;this.isOpen&&this.dialogEl?(null!==(t=this.portal)&&void 0!==t||(this.portal=new N(this.el)),this.portal.mount(this.dialogEl,this.resolvedLocale),this.cleanupAutoUpdate||this.startPositioning(),this.flushActiveDayFocus()):null===(e=this.portal)||void 0===e||e.remove()}flushActiveDayFocus(){var e,t;this.focusActiveDay&&"visible"===(null===(e=this.dialogEl)||void 0===e?void 0:e.style.visibility)&&(this.focusActiveDay=!1,null===(t=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===t||t.focus())}get baseId(){return this.componentId||this.fallbackId}get resolvedLocale(){return function(e){var t;try{return null!==(t=Intl.DateTimeFormat.supportedLocalesOf(e)[0])&&void 0!==t?t:"en-US"}catch(e){return"en-US"}}(this.locale||_(this.el))}get weekStart(){const e=this.firstDayOfWeek;return"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=6?e:function(e){var t,i,s;const r=Intl.Locale;if(!r)return 0;try{const n=new r(e),a=null!==(i=null===(t=n.getWeekInfo)||void 0===t?void 0:t.call(n).firstDay)&&void 0!==i?i:null===(s=n.weekInfo)||void 0===s?void 0:s.firstDay;return"number"==typeof a?a%7:0}catch(e){return 0}}(this.resolvedLocale)}get minDate(){return C(this.min)}get maxDate(){return C(this.max)}get isInteractive(){return!this.disabled&&!this.readonly}get monthCount(){const e="undefined"!=typeof window&&window.innerWidth<640;return this.range&&!e?2:1}get appliesOnPick(){return this.range&&this.autoApply&&!this.timePicker}get hasFooter(){return(this.range||this.timePicker)&&!this.appliesOnPick}get resolvedPresets(){return this.range?function(e,t){const i="string"==typeof e?e.split(",").map((e=>e.trim())).filter(Boolean).map((e=>({key:e}))):Array.isArray(e)?e:[],s=[];for(const e of i){if(!e||"string"!=typeof e.key)continue;const i="string"==typeof e.start?C(e.start):null,r="string"==typeof e.end?C(e.end):null,n=i&&r&&i<=r?[i,r]:q(e.key,t),a="string"==typeof e.label?e.label:U[e.key];n&&a&&s.push({key:e.key,label:a,start:n[0],end:n[1]})}return s}(this.presets,A()):[]}parsedValue(e=this.value){if(this.range){const[t,i,s]=(null!=e?e:"").split("/"),r=K(t),n=K(i);return void 0===s&&r&&n&&oe(r,n)<=0?[r,n]:null}const t=K(e);return t?[t]:null}get resolvedFormat(){return J(this.format,this.timePicker,this.timePicker&&ue(this.resolvedLocale).hour12)}fieldText(){var e;const t=this.parsedValue();return t?t.map((e=>le(this.withTimePicker(e),this.resolvedFormat,this.resolvedLocale))).join(ce):null!==(e=this.value)&&void 0!==e?e:""}withTimePicker(e,t=me){var i;return{date:e.date,time:this.timePicker?null!==(i=e.time)&&void 0!==i?i:t:null}}get fieldPlaceholder(){if(this.placeholder)return this.placeholder;const e=this.resolvedFormat;return this.range?`${e}${ce}${e}`:e}loadDraft(e){var t,i;const[s,r]=null!=e?e:[];this.draftStart=s?$(s.date):"",this.draftEnd=this.range&&r?$(r.date):"",this.startTime=null!==(t=null==s?void 0:s.time)&&void 0!==t?t:me,this.endTime=null!==(i=null==r?void 0:r.time)&&void 0!==i?i:be,this.previewDate=""}openCalendar(e){var t,i;if(!this.isInteractive||this.isOpen)return;const s=this.parsedValue();this.loadDraft(s),this.valueAtOpen=null!==(t=this.value)&&void 0!==t?t:"";const r=null!==(i=s&&s[s.length-1].date)&&void 0!==i?i:A();this.showDate(H(r,this.minDate,this.maxDate),!0),this.focusActiveDay=e,this.isOpen=!0,document.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}closeCalendar(e){var t;this.isOpen&&(this.commitPendingText(),this.timesBeforeTyping=void 0,this.isOpen=!1,this.stopPositioning(),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),e&&(null===(t=this.triggerEl)||void 0===t||t.focus()))}showDate(e,t=!1){const i=ge(e),s=C(this.viewMonth),r=s&&L(s,this.monthCount-1);t||!s||i<s?this.viewMonth=$(t?L(i,1-this.monthCount):i):r&&i>r&&(this.viewMonth=$(L(i,1-this.monthCount))),this.activeDate=$(e)}pickDate(e){Y(e,this.minDate,this.maxDate)||(this.dropTypedText(),this.range?this.pickRangeDay(e):this.timePicker?(this.draftStart=$(e),this.activeDate=this.draftStart):(this.commitValue($(e)),this.closeCalendar(!0)))}pickRangeDay(e){const t=C(this.draftStart),i=$(e);!t||this.draftEnd?(this.draftStart=i,this.draftEnd=""):e<t?this.draftStart=i:this.draftEnd=i,this.previewDate="",this.activeDate=i,this.draftEnd&&this.appliesOnPick&&this.onApply()}commitValue(e,t={}){var i;const s=e!==(null!==(i=this.value)&&void 0!==i?i:"");this.timesBeforeTyping=void 0,this.committing=!0,this.value=e,this.committing=!1,this.text=this.fieldText(),this.textError="",this.updateFormValue(),s&&this.pdsDatepickerChange.emit(Object.assign({value:e},t))}commitParts(e){if(!this.range)return void this.commitValue(de(e[0]));const[t,i]=e,s=I(this.resolvedPresets,t.date,i.date);this.commitValue(`${de(t)}/${de(i)}`,Object.assign({start:de(t),end:de(i)},s?{preset:s.key}:{}))}draftParts(){var e;const t=C(this.draftStart);if(!t)return null;const i=this.withTimePicker({date:t,time:this.startTime});if(!this.range)return[i];const s=this.withTimePicker({date:null!==(e=C(this.draftEnd))&&void 0!==e?e:t,time:this.endTime});return[i,oe(s,i)<0?Object.assign(Object.assign({},s),{time:i.time}):s]}restoreValueAtOpen(){var e;if(this.valueAtOpen===(null!==(e=this.value)&&void 0!==e?e:""))return void this.dropTypedText();const t=this.parsedValue(this.valueAtOpen);t?this.commitParts(t):this.commitValue(this.valueAtOpen)}isInside(e){var t,i;return!!e&&(e===this.el||this.el.contains(e)||!!(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.contains(e))||!!(null===(i=this.portal)||void 0===i?void 0:i.contains(e)))}focusEntered(e){this.hasFocus||(this.hasFocus=!0,this.pdsFocus.emit(e))}checkFocusLeft(e,t){window.setTimeout((()=>{var i;this.el.matches(":focus-within")||(null===(i=this.portal)||void 0===i?void 0:i.host.matches(":focus-within"))||(t&&this.closeCalendar(!1),this.hasFocus&&(this.hasFocus=!1,this.pdsBlur.emit(e)))}))}startPositioning(){const e=this.fieldReference(),t=this.dialogEl;e&&t&&(this.cleanupAutoUpdate=a(e,t,(()=>{o(e,t,{placement:this.placement,strategy:"fixed",middleware:[d(4),l({padding:8}),c({padding:8,apply({availableWidth:e,availableHeight:t,elements:i}){const s=window.innerHeight-16;Object.assign(i.floating.style,{maxHeight:Math.max(0,Math.max(t,Math.min(s,480)))+"px",maxWidth:Math.max(0,e)+"px"})}}),h({padding:8,crossAxis:!0}),p()]}).then((({x:e,y:i,middlewareData:s})=>{var r;const n=!!(null===(r=s.hide)||void 0===r?void 0:r.referenceHidden);Object.assign(t.style,{left:e+"px",top:i+"px",visibility:n?"hidden":"visible"}),this.flushActiveDayFocus()}))})))}stopPositioning(){var e;null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.cleanupAutoUpdate=void 0}fieldReference(){var e,t,i;return null!==(i=null===(t=null===(e=this.inputEl)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".pds-input__field-wrapper"))&&void 0!==i?i:this.inputEl}commitPendingText(){if(this.text===this.fieldText())return;const e=this.parseText(this.text)?this.draftParts():null;e?this.commitParts(e):this.commitText()}readText(e){const t=this.resolvedFormat,i=this.resolvedLocale,s=this.range?ae(e,t,i):[ne(e,t,i)];return!s||s.some((e=>!e))?null:s.map(((e,t)=>this.withTimePicker(e,1===t?be:me)))}parseText(e){const t=this.readText(e);return t&&!this.rangeError(t)?t:null}rangeError(e){return this.minDate&&e.some((e=>e.date<this.minDate))?"min":this.maxDate&&e.some((e=>e.date>this.maxDate))?"max":""}valueError(){if(!this.value)return"";const e=this.parsedValue();return e?this.rangeError(e):"format"}commitText(){const e=this.text.trim();if(""===e)return void this.commitValue("");const t=this.readText(e),i=t?this.rangeError(t):"format";t&&!i?this.commitParts(t):(this.textError=i,this.updateFormValue())}canShowMonth(e){var t;const i=null!==(t=C(this.viewMonth))&&void 0!==t?t:A();return e<0?!this.minDate||T(i,-1)>=this.minDate:!this.maxDate||L(i,this.monthCount)<=this.maxDate}showMonth(e,t){var i,s;const r=null!==(i=C(this.viewMonth))&&void 0!==i?i:A(),n=null!==(s=C(this.activeDate))&&void 0!==s?s:A();this.viewMonth=$(L(r,t)),this.activeDate=$(H(L(n,t),this.minDate,this.maxDate)),this.canShowMonth(t)?e.currentTarget.focus():this.focusActiveDay=!0}jumpTo(e,t,i){var s;const r=H(new Date(Date.UTC(t,i,1)),this.minDate,this.maxDate);this.viewMonth=$(L(ge(r),-e));const n=null!==(s=C(this.activeDate))&&void 0!==s?s:r,a=Math.min(n.getUTCDate(),new Date(Date.UTC(t,i+1,0)).getUTCDate());this.activeDate=$(H(new Date(Date.UTC(t,i,a)),this.minDate,this.maxDate))}dropTypedText(){this.timesBeforeTyping&&([this.startTime,this.endTime]=this.timesBeforeTyping),this.timesBeforeTyping=void 0,(this.text!==this.fieldText()||this.textError)&&(this.text=this.fieldText(),this.inputEl&&(this.inputEl.value=this.text),this.textError="",this.updateFormValue())}trapTab(e){var t,i,s,r;const n=Array.from(null!==(i=null===(t=this.dialogEl)||void 0===t?void 0:t.querySelectorAll('button:not([disabled]):not([tabindex="-1"]), select:not([disabled]), [data-date][tabindex="0"]'))&&void 0!==i?i:[]);if(0===n.length)return;const a=null===(r=null===(s=this.dialogEl)||void 0===s?void 0:s.getRootNode())||void 0===r?void 0:r.activeElement,o=n[0],d=n[n.length-1];e.shiftKey&&a===o?(e.preventDefault(),d.focus()):e.shiftKey||a!==d||(e.preventDefault(),o.focus())}dayFromEvent(e){var t,i;const s=null===(i=null===(t=e.target)||void 0===t?void 0:t.closest)||void 0===i?void 0:i.call(t,"[data-date]");return C(null==s?void 0:s.dataset.date)}updateFormValue(){var e,t,i,s;if(k()||!(null===(e=this.internals)||void 0===e?void 0:e.setFormValue))return;if(this.internals.setFormValue(this.value||null),!this.internals.setValidity)return;const r=null!==(s=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input"))&&void 0!==s?s:void 0,n=this.textError||this.valueError();"format"===n?this.internals.setValidity({badInput:!0},this.invalidDateMessage,r):"min"===n?this.internals.setValidity({rangeUnderflow:!0},this.boundMessage(this.minDateMessage,this.minDate),r):"max"===n?this.internals.setValidity({rangeOverflow:!0},this.boundMessage(this.maxDateMessage,this.maxDate),r):this.required&&!this.value?this.internals.setValidity({valueMissing:!0},(null==r?void 0:r.validationMessage)||this.invalidDateMessage,r):this.internals.setValidity({})}boundMessage(e,t){const i=t?le({date:t,time:null},this.format||void 0,this.resolvedLocale):"";return y(e,{date:i})}formResetCallback(){this.value="",this.text="",this.textError="",this.closeCalendar(!1),this.updateFormValue()}interactivityChanged(){this.isInteractive||this.closeCalendar(!1)}formDisabledCallback(e){this.disabled=e,e&&this.closeCalendar(!1)}formStateRestoreCallback(e){"string"==typeof e&&(this.value=e)}triggerAccessibleName(e){const t=this.parsedValue();if(!t)return this.triggerLabel;const i=t.map((t=>S(t.date,e,ve)));return`${this.triggerLabel}, ${i.join(ce)}`}highlightedRange(){const e=C(this.draftStart),t=C(this.draftEnd);if(!e||t)return[e,t];const i=C(this.previewDate);return[e,i&&i>e?i:null]}selectedDay(){return this.range?null:C(this.draftStart)}renderMonthHeading(e,t,i,r){const n=S(e,i,{month:"long",year:"numeric"}),a=0===t?"polite":null;if(!this.showDropdowns)return s("div",{class:"pds-datepicker__heading",id:r,"aria-live":a},n);const o=e.getUTCFullYear(),d=e.getUTCMonth(),l=this.minDate,c=this.maxDate,h=A().getUTCFullYear(),p=l?l.getUTCFullYear():h-100,v=c?c.getUTCFullYear():h+100,m=z(i,{month:"long"}),b=z(i,{year:"numeric"});return s("div",{class:"pds-datepicker__dropdowns"},s("span",{class:"visually-hidden",id:r,"aria-live":a},n),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.monthLabel,onChange:e=>this.jumpTo(t,o,Number(e.target.value))},Array.from({length:12},((e,t)=>{const i=!!l&&new Date(Date.UTC(o,t+1,0))<l||!!c&&new Date(Date.UTC(o,t,1))>c;return s("option",{value:t+"",selected:t===d,disabled:i},m.format(new Date(Date.UTC(o,t,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.yearLabel,onChange:e=>this.jumpTo(t,Number(e.target.value),d)},Array.from({length:Math.max(v,o)-Math.min(p,o)+1},((e,t)=>{const i=Math.min(p,o)+t;return s("option",{value:i+"",selected:i===o},b.format(new Date(Date.UTC(i,0,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})))}renderMonth(e,t,i){const r=e.getUTCFullYear(),n=e.getUTCMonth(),a=this.minDate,o=this.maxDate,d=this.selectedDay(),[l,c]=this.range?this.highlightedRange():[null,null],h=A(),p=z(i,ve),u=z(i,{day:"numeric"}),b=`${this.baseId}-calendar-heading-${t}`,f=t===this.monthCount-1;return s("div",{class:"pds-datepicker__month"},s("div",{class:"pds-datepicker__header"},0===t?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--previous","aria-label":this.previousMonthLabel,disabled:!this.canShowMonth(-1),onClick:e=>this.showMonth(e,-1)},s("pds-icon",{icon:v,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"}),this.renderMonthHeading(e,t,i,b),f?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--next","aria-label":this.nextMonthLabel,disabled:!this.canShowMonth(1),onClick:e=>this.showMonth(e,1)},s("pds-icon",{icon:m,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"})),s("table",{class:"pds-datepicker__grid",role:"grid","aria-labelledby":b,"aria-multiselectable":this.range?"true":null,onKeyDown:this.onGridKeyDown,onClick:this.onGridClick,onPointerOver:this.onGridPointerOver},s("thead",null,s("tr",null,function(e,t){const i=z(e,{weekday:"short"}),s=z(e,{weekday:"long"}),r=Array.from({length:7},((e,i)=>new Date(Date.UTC(2023,0,1+(t+i)%7)))),n=r.map((e=>i.format(e).replace(/\.$/,""))),a=n.every((e=>/^[A-Za-z\u00C0-\u024F]+$/.test(e))),o=n.map((e=>e.slice(0,2))),d=a&&7===new Set(o.map((e=>e.toLowerCase()))).size;return r.map(((e,t)=>({short:d?o[t]:i.format(e),long:s.format(e)})))}(i,this.weekStart).map((e=>s("th",{scope:"col",class:"pds-datepicker__weekday"},s("span",{"aria-hidden":"true"},e.short),s("span",{class:"visually-hidden"},e.long)))))),s("tbody",null,function(e,t,i){const s=new Date(Date.UTC(e,t,1)),r=Array(E(s,i)).fill(null);for(let i=1;i<=j(e,t);i++)r.push(new Date(Date.UTC(e,t,i)));for(;r.length%7!=0;)r.push(null);const n=[];for(let e=0;e<r.length;e+=7)n.push(r.slice(e,e+7));return n}(r,n,this.weekStart).map((e=>s("tr",null,e.map(((e,t)=>{if(!e)return s("td",{class:"pds-datepicker__day pds-datepicker__day--empty"});const i=$(e),r=Y(e,a,o),n=P(e,l)||P(e,c),v=!!l&&!!c&&!P(l,c),m=!!l&&!!c&&e>=l&&e<=c,b=P(e,d)||n||m,f=P(e,h);return s("td",{class:{"pds-datepicker__day":!0,"pds-datepicker__day--selected":P(e,d)||n,"pds-datepicker__day--in-range":m&&!n,"pds-datepicker__day--range-start":v&&P(e,l),"pds-datepicker__day--range-end":v&&P(e,c),"pds-datepicker__day--row-start":m&&0===t,"pds-datepicker__day--row-end":m&&6===t,"pds-datepicker__day--today":f,"pds-datepicker__day--disabled":r},"data-date":i,tabindex:i===this.activeDate?"0":"-1","aria-label":p.format(e),"aria-selected":b?"true":null,"aria-current":f?"date":null,"aria-disabled":r?"true":null},((e,t)=>{var i,s;return null!==(s=null===(i=e.formatToParts(t).find((e=>"day"===e.type)))||void 0===i?void 0:i.value)&&void 0!==s?s:e.format(t)})(u,e))}))))))),this.timePicker&&this.timesUnderMonth(t).map((e=>this.renderTime(e,i))))}timesUnderMonth(e){return this.range?1===this.monthCount?["start","end"]:[0===e?"start":"end"]:["start"]}renderTime(e,t){var i,r,n;const a="start"===e?this.startTime:null!==(n=null===(r=null===(i=this.draftParts())||void 0===i?void 0:i[1])||void 0===r?void 0:r.time)&&void 0!==n?n:this.endTime,[o,d]=he(a),l=ue(t),c=Math.max(1,Math.min(60,Math.floor(this.minuteIncrement)||1)),h=(t,i)=>{const s=pe(t,i);"start"===e?this.startTime=s:this.endTime=s,this.timesBeforeTyping&&(this.timesBeforeTyping["start"===e?0:1]=s)},p=this.range?"start"===e?this.startTimeLabel:this.endTimeLabel:this.timeLabel,u=o>=12,v=l.hour12?Array.from({length:12},((e,t)=>t+1)):Array.from({length:24},((e,t)=>t)),m=l.hour12?o%12||12:o,b=Array.from({length:Math.ceil(60/c)},((e,t)=>t*c));b.includes(d)||b.push(d),b.sort(((e,t)=>e-t));const f=`${this.baseId}-time-${e}`;return s("div",{class:"pds-datepicker__time",role:"group","aria-labelledby":f},s("span",{class:"pds-datepicker__time-label",id:f},p),s("span",{class:"pds-datepicker__time-field"},s("select",{class:"pds-datepicker__time-select","aria-label":this.hourLabel,onChange:e=>{const t=Number(e.target.value);h(l.hour12?t%12+(u?12:0):t,d)}},v.map((e=>s("option",{value:e+"",selected:e===m},l.hour12?e+"":(e+"").padStart(2,"0"))))),s("span",{class:"pds-datepicker__time-separator","aria-hidden":"true"},":"),s("select",{class:"pds-datepicker__time-select","aria-label":this.minuteLabel,onChange:e=>h(o,Number(e.target.value))},b.map((e=>s("option",{value:e+"",selected:e===d},(e+"").padStart(2,"0"))))),l.hour12&&s("select",{class:"pds-datepicker__time-select pds-datepicker__time-select--period","aria-label":this.periodLabel,onChange:e=>{h(o%12+("pm"===e.target.value?12:0),d)}},s("option",{value:"am",selected:!u},l.am),s("option",{value:"pm",selected:u},l.pm))))}renderPresets(){var e;const t=this.resolvedPresets;if(0===t.length)return null;const i=I(t,C(this.draftStart),C(this.draftEnd)),r=!i&&!!this.draftStart,n=e=>R(e,this.minDate,this.maxDate),a=i&&n(i)?i:r?"custom":null!==(e=t.find(n))&&void 0!==e?e:"custom";return s("div",{class:"pds-datepicker__presets-column"},s("ul",{class:"pds-datepicker__presets",part:"presets",role:"radiogroup","aria-label":this.presetsLabel,onKeyDown:this.onPresetsKeyDown},t.map((e=>{const t=e===i;return s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":t},"aria-checked":t?"true":"false",tabindex:e===a?"0":"-1",disabled:!R(e,this.minDate,this.maxDate),onClick:t=>this.onPresetClick(t,e)},s("span",null,e.label),t&&s("pds-icon",{icon:b,"aria-hidden":"true"})))})),s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":r},"aria-checked":r?"true":"false",tabindex:"custom"===a?"0":"-1",onClick:this.onCustomRangeClick},s("span",null,this.customRangeLabel),r&&s("pds-icon",{icon:b,"aria-hidden":"true"})))))}selectionText(){const e=this.draftParts();if(!e)return"";const t=this.resolvedFormat,i=this.resolvedLocale;return this.range&&!this.draftEnd?`${le(e[0],t,i)}${ce}`:e.map((e=>le(e,t,i))).join(ce)}renderFooter(){const e=this.draftParts(),t=this.selectionText();return s("div",{class:"pds-datepicker__footer"},s("span",{class:"pds-datepicker__selection","aria-live":"polite"},t),s("button",{type:"button",class:"pds-datepicker__action",onClick:this.onCancel},this.clearable?this.clearLabel:this.cancelLabel),s("button",{type:"button",class:"pds-datepicker__action pds-datepicker__action--primary",disabled:!e,onClick:this.onApply},this.applyLabel))}renderCalendar(e){var t;const i=null!==(t=C(this.viewMonth))&&void 0!==t?t:A(),r=Array.from({length:this.monthCount},((e,t)=>L(i,t)));return s("div",{class:{"pds-datepicker__dialog":!0,"pds-datepicker__dialog--range":this.range},id:this.baseId+"-calendar",role:"dialog",tabindex:"-1","aria-labelledby":this.range?null:this.baseId+"-calendar-heading-0","aria-label":this.range?this.label||this.triggerLabel:null,part:"calendar",ref:e=>this.dialogEl=e,onKeyDown:this.onDialogKeyDown,onFocusin:this.onCalendarFocusIn,onFocusout:this.onCalendarFocusOut},this.range&&this.renderPresets(),s("div",{class:"pds-datepicker__panel"},s("div",{class:"pds-datepicker__months"},r.map(((t,i)=>this.renderMonth(t,i,e)))),this.hasFooter&&this.renderFooter(),this.appliesOnPick&&s("span",{class:"visually-hidden","aria-live":"polite"},this.selectionText())))}render(){const e=this.resolvedLocale;return s(r,{key:"a761f0ca6eeedcac3e4bd90760aa9781cd37dcdc",class:{"pds-datepicker--range":this.range,"pds-datepicker--time":this.timePicker},"full-width":this.fullWidth?"true":null,onFocusin:this.onHostFocusIn,onFocusout:this.onHostFocusOut},s("pds-input",{key:"2eb04f9fd4e2f7a2437145d250c629c2cc8a0bf6",ref:e=>this.inputEl=e,componentId:this.baseId,label:this.label,hideLabel:this.hideLabel,helperMessage:this.helperMessage,errorMessage:this.errorMessage,invalid:this.invalid||!!this.textError||!!this.valueError(),disabled:this.disabled,readonly:this.readonly,required:this.required,placeholder:this.fieldPlaceholder,fullWidth:this.fullWidth,autocomplete:"off",value:this.text,onClick:this.onFieldClick,onPdsInput:this.onTextInput,onPdsChange:this.onTextChange,onPdsKeyDown:this.onTextKeyDown,onPdsFocus:this.stopInnerEvent,onPdsBlur:this.stopInnerEvent},this.clearable&&!!this.value&&this.isInteractive&&s("button",{key:"clear",slot:"suffix",type:"button",class:"pds-datepicker__clear",ref:e=>this.clearEl=e,"aria-label":this.label?`${this.clearLabel} ${this.label}`:this.clearLabel,tabindex:"-1",onMouseDown:this.onClearMouseDown,onClick:this.onClearClick},s("pds-icon",{key:"98c325fbba8ea78b2d409bc77099db3206738508",icon:f,"aria-hidden":"true"})),s("button",{key:"trigger",slot:"suffix",type:"button",class:"pds-datepicker__trigger",ref:e=>this.triggerEl=e,"aria-label":this.triggerAccessibleName(e),"aria-haspopup":"dialog","aria-expanded":this.isOpen?"true":"false",disabled:!this.isInteractive,onClick:this.onTriggerClick,onKeyDown:this.onTriggerKeyDown},s("pds-icon",{key:"cb8483febe1b485058b7bb4271b749981a7747a1",icon:g,"aria-hidden":"true"}))),this.isOpen&&this.renderCalendar(e))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}}static get style(){return':host{--pds-datepicker-day-size:var(--pine-dimension-500);--pds-datepicker-presets-width:200px;display:inline-block}:host([full-width]){display:block}pds-input{display:block}:host(.pds-datepicker--time) pds-input{min-width:220px}:host(.pds-datepicker--range) pds-input{min-width:260px}:host(.pds-datepicker--range.pds-datepicker--time) pds-input{min-width:min(380px, 100%)}.pds-datepicker__trigger,.pds-datepicker__clear{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-2xs)}.pds-datepicker__trigger:hover:not(:disabled),.pds-datepicker__clear:hover:not(:disabled){background:var(--pine-color-background-muted);color:var(--pine-color-text-strong)}.pds-datepicker__trigger:focus-visible,.pds-datepicker__clear:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__trigger:disabled,.pds-datepicker__clear:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__clear{-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs)}.pds-datepicker__nav{-ms-flex-align:center;align-items:center;background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;height:var(--pine-dimension-400);-ms-flex-pack:center;justify-content:center;padding:0;width:var(--pine-dimension-400)}.pds-datepicker__nav:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__nav:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__nav:disabled{border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__nav:dir(rtl) pds-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.pds-datepicker__dialog:focus{outline:none}.pds-datepicker__dialog{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-150);-webkit-box-shadow:var(--pine-box-shadow-200);box-shadow:var(--pine-box-shadow-200);-webkit-box-sizing:border-box;box-sizing:border-box;left:0;max-height:calc(100vh - var(--pine-dimension-sm));max-height:calc(100dvh - var(--pine-dimension-sm));max-width:calc(100vw - var(--pine-dimension-sm));overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;padding:var(--pine-dimension-sm);pointer-events:auto;position:fixed;top:0;visibility:hidden;z-index:var(--pine-z-index-priority)}:host-context([data-theme=dark]) .pds-datepicker__dialog{border:var(--pine-border)}.pds-datepicker__header{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-datepicker__nav-spacer{-ms-flex:none;flex:none;width:var(--pine-dimension-400)}.pds-datepicker__heading{color:var(--pine-color-text);font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold)}.pds-datepicker__grid{border-collapse:collapse;border-spacing:0}.pds-datepicker__weekday{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm);height:var(--pds-datepicker-day-size);padding:0;text-align:center;width:var(--pds-datepicker-day-size)}.pds-datepicker__day{border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body);height:var(--pds-datepicker-day-size);padding:0;position:relative;text-align:center;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:var(--pds-datepicker-day-size)}.pds-datepicker__day:hover{background:var(--pine-color-background-muted)}.pds-datepicker__day:focus-visible{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width-thick) * -1)}.pds-datepicker__day--empty{cursor:default;pointer-events:none}.pds-datepicker__day--today::after{background:var(--pine-color-primary);border-radius:var(--pine-border-radius-full);content:"";height:var(--pine-dimension-050);inset-block-end:var(--pine-dimension-050);inset-inline-start:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pine-dimension-050)}.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:var(--pine-color-primary);border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-primary)}.pds-datepicker__day--selected:focus-visible{outline-offset:var(--pine-border-width)}.pds-datepicker__day--range-start{border-end-end-radius:0;border-start-end-radius:0}.pds-datepicker__day--range-end{border-end-start-radius:0;border-start-start-radius:0}.pds-datepicker__day--range-start.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--range-end.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:var(--pine-color-text-primary)}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-muted);border-radius:0;color:var(--pine-color-text-secondary)}.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--disabled,.pds-datepicker__day--disabled:hover{background:transparent;color:var(--pine-color-text-disabled);cursor:not-allowed;text-decoration:line-through}.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-inset)}.pds-datepicker__dialog--range{display:-ms-flexbox;display:flex;padding:0}.pds-datepicker__panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0}.pds-datepicker__dialog--range .pds-datepicker__panel{padding:var(--pine-dimension-sm)}.pds-datepicker__months{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-lg)}.pds-datepicker__presets-column{-webkit-border-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-inline-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-ms-flex:none;flex:none;position:relative;width:var(--pds-datepicker-presets-width)}.pds-datepicker__presets{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pine-dimension-2xs);inset:0;list-style:none;margin:0;overflow-y:auto;padding:var(--pine-dimension-150);position:absolute}.pds-datepicker__preset{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body);gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-xs) var(--pine-dimension-sm);text-align:start;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:100%}.pds-datepicker__preset:hover:not(:disabled){background:var(--pine-color-background-muted)}.pds-datepicker__preset:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__preset:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__preset--selected{background:var(--pine-color-background-muted);color:var(--pine-color-text-active)}.pds-datepicker__footer{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-overlay);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-xs);inset-block-end:calc(var(--pine-dimension-sm) * -1);-ms-flex-pack:end;justify-content:flex-end;margin-block:var(--pine-dimension-sm) calc(var(--pine-dimension-sm) * -1);padding-block:var(--pine-dimension-sm);position:-webkit-sticky;position:sticky}.pds-datepicker__selection{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);-webkit-margin-end:auto;margin-inline-end:auto}.pds-datepicker__dropdowns{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-datepicker__select-wrap{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;position:relative}.pds-datepicker__heading-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text);cursor:pointer;field-sizing:content;font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold);padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs) calc(var(--pine-dimension-xs) + var(--pine-dimension-sm))}.pds-datepicker__heading-select:hover{background:var(--pine-color-background-muted)}.pds-datepicker__heading-select:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__select-caret{color:var(--pine-color-text-secondary);inset-inline-end:var(--pine-dimension-xs);pointer-events:none;position:absolute}.pds-datepicker__time{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-before:var(--pine-dimension-sm);margin-block-start:var(--pine-dimension-sm);padding-inline:var(--pine-dimension-xs)}.pds-datepicker__time-label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium)}.pds-datepicker__time-field{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-md);display:-ms-inline-flexbox;display:inline-flex;min-height:var(--pine-dimension-400);padding-inline:var(--pine-dimension-2xs)}.pds-datepicker__time-field:hover{border-color:var(--pine-color-border-hover)}.pds-datepicker__time-field:focus-within{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__time-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-strong);cursor:pointer;font:var(--pine-typography-body);font-variant-numeric:tabular-nums;padding:var(--pine-dimension-2xs);text-align:center}.pds-datepicker__time-select:focus-visible{background:var(--pine-color-background-muted);outline:none}.pds-datepicker__time-select--period{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-datepicker__time-separator{color:var(--pine-color-text-secondary)}:host-context([data-theme=dark]) select{color-scheme:dark}.pds-datepicker__action{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body-medium);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-sm)}.pds-datepicker__action:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__action:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__action:disabled{background:var(--pine-color-secondary-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__action--primary{background:var(--pine-color-primary);border-color:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__action--primary:hover:not(:disabled){background:var(--pine-color-primary-hover);border-color:var(--pine-color-primary-hover)}.pds-datepicker__action--primary:disabled{background:var(--pine-color-primary-disabled);border-color:var(--pine-color-primary-disabled);color:var(--pine-color-text-primary-disabled)}@media (max-width: 600px){.pds-datepicker__dialog--range{-ms-flex-direction:column;flex-direction:column}.pds-datepicker__presets-column{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-end:0;border-inline-end:0;width:auto}.pds-datepicker__presets{-ms-flex-direction:row;flex-direction:row;overflow-x:auto;position:static}.pds-datepicker__preset{white-space:nowrap}.pds-datepicker__selection{-ms-flex-preferred-size:100%;flex-basis:100%}}.pds-datepicker__trigger,.pds-datepicker__clear,.pds-datepicker__nav,.pds-datepicker__weekday,.pds-datepicker__day,.pds-datepicker__preset,.pds-datepicker__action{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (forced-colors: active){.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:Highlight;color:HighlightText;forced-color-adjust:none}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{border-block:var(--pine-border-width-thin) solid Highlight}.pds-datepicker__day--today::after{background:CanvasText;forced-color-adjust:none}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:HighlightText}.pds-datepicker__day--disabled{color:GrayText}}.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}'}},[65,"pds-datepicker",{applyLabel:[1,"apply-label"],autoApply:[4,"auto-apply"],cancelLabel:[1,"cancel-label"],clearable:[4],clearLabel:[1,"clear-label"],componentId:[1,"component-id"],customRangeLabel:[1,"custom-range-label"],disabled:[4],endTimeLabel:[1,"end-time-label"],errorMessage:[1,"error-message"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],fullWidth:[4,"full-width"],helperMessage:[1,"helper-message"],hideLabel:[4,"hide-label"],hourLabel:[1,"hour-label"],invalid:[4],invalidDateMessage:[1,"invalid-date-message"],maxDateMessage:[1,"max-date-message"],minDateMessage:[1,"min-date-message"],label:[1],locale:[1],max:[1],min:[1],minuteIncrement:[2,"minute-increment"],minuteLabel:[1,"minute-label"],monthLabel:[1,"month-label"],name:[1],nextMonthLabel:[1,"next-month-label"],periodLabel:[1,"period-label"],placeholder:[1],placement:[1],presets:[1],presetsLabel:[1,"presets-label"],previousMonthLabel:[1,"previous-month-label"],range:[4],readonly:[4],required:[4],showDropdowns:[4,"show-dropdowns"],startTimeLabel:[1,"start-time-label"],timePicker:[4,"time-picker"],timeLabel:[1,"time-label"],triggerLabel:[1,"trigger-label"],value:[1025],yearLabel:[1,"year-label"],isOpen:[32],text:[32],textError:[32],activeDate:[32],viewMonth:[32],draftStart:[32],draftEnd:[32],startTime:[32],endTime:[32],previewDate:[32],open:[64],close:[64],setFocus:[64]},void 0,{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}]),_e=ke,ye=function(){"undefined"!=typeof customElements&&["pds-datepicker","pds-icon","pds-input"].forEach((e=>{switch(e){case"pds-datepicker":customElements.get(n(e))||customElements.define(n(e),ke);break;case"pds-icon":customElements.get(n(e))||w();break;case"pds-input":customElements.get(n(e))||D()}}))};export{_e as PdsDatepicker,ye as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a,c as o,o as d,f as l,b as c,s as h,h as p}from"./floating-ui.dom.js";import{c as u,j as v,k as m,m as b,r as f,n as g}from"./index2.js";import{i as k}from"./form.js";import{r as _,f as y}from"./i18n-format.js";import{c as x}from"./closest.js";import{d as w}from"./pds-icon2.js";import{d as D}from"./pds-input2.js";const M=/^(\d{4})-(\d{2})-(\d{2})$/;function C(e){const t=M.exec((null!=e?e:"").trim());if(!t)return null;const[,i,s,r]=t.map(Number),n=new Date(Date.UTC(i,s-1,r));return n.getUTCFullYear()===i&&n.getUTCMonth()===s-1&&n.getUTCDate()===r?n:null}function $(e){return e.toISOString().slice(0,10)}function A(){const e=new Date;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}function T(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function L(e,t){const i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),s=j(i.getUTCFullYear(),i.getUTCMonth());return new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),Math.min(e.getUTCDate(),s)))}function j(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function P(e,t){return!!e&&!!t&&e.getTime()===t.getTime()}function H(e,t,i){return t&&e<t?t:i&&e>i?i:e}function Y(e,t,i){return!!t&&e<t||!!i&&e>i}function E(e,t){return(e.getUTCDay()-t+7)%7}function z(e,t){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},t),{timeZone:"UTC",calendar:"gregory"}))}function S(e,t,i){return z(t,i).format(e)}class N{constructor(e){this.datepicker=e,this.copiedProperties=[],this.host=document.createElement("div"),this.host.className=N.className,this.host.pdsDatepicker=e,this.host.style.display="contents",this.root=this.host.attachShadow({mode:"open"})}mount(e,t){this.host.isConnected?t!==this.locale&&this.copyContext(t):(function(e){const t=new Set;let i=e;for(;i&&!t.has(i);){if(t.add(i),i.nodeType===Node.ELEMENT_NODE&&F(i))return i;const e=i.nodeType===Node.ELEMENT_NODE?i.assignedSlot:null;if(e){i=e;continue}const s=i.parentNode;i=s instanceof ShadowRoot?s.host:s}return document.body}(this.datepicker).appendChild(this.host),this.copyContext(t)),e.parentNode!==this.root&&this.root.appendChild(e)}remove(){this.host.remove()}contains(e){return!!e&&(e===this.host||this.root.contains(e))}copyContext(e){var t,i;this.locale=e;const s=this.datepicker.shadowRoot;s&&((null===(t=s.adoptedStyleSheets)||void 0===t?void 0:t.length)?this.root.adoptedStyleSheets=s.adoptedStyleSheets:this.root.querySelector("style")||s.querySelectorAll("style").forEach((e=>this.root.appendChild(e.cloneNode(!0)))));const r=getComputedStyle(this.datepicker);this.host.dir=r.direction||"ltr",this.host.lang=e,this.copyCustomProperties(r);const n=null===(i=x("[data-theme]",this.datepicker)||null)||void 0===i?void 0:i.getAttribute("data-theme");n?this.host.setAttribute("data-theme",n):this.host.removeAttribute("data-theme")}copyCustomProperties(e){for(const e of this.copiedProperties)this.host.style.removeProperty(e);this.copiedProperties=[];const t=this.host.parentElement,i=t?getComputedStyle(t):null;for(let t=0;t<e.length;t++){const s=e[t];if(!s.startsWith("--"))continue;const r=e.getPropertyValue(s);i&&r===i.getPropertyValue(s)||(this.host.style.setProperty(s,r.trim()),this.copiedProperties.push(s))}}}function F(e){if("dialog"===e.localName)return e.open;if(!e.hasAttribute("popover"))return!1;try{return e.matches(":popover-open")}catch(e){return!1}}N.className="pds-datepicker-calendar-portal";const U={today:"Today",yesterday:"Yesterday","last-7-days":"Last 7 days","last-30-days":"Last 30 days","last-90-days":"Last 90 days","this-month":"This month","last-month":"Last month","this-quarter":"This quarter","last-quarter":"Last quarter","this-year":"This year","last-year":"Last year","year-to-date":"Year to date","last-12-months":"Last 12 months"},O=(e,t,i)=>new Date(Date.UTC(e,t,i));function q(e,t){const i=t.getUTCFullYear(),s=t.getUTCMonth(),r=s-s%3;switch(e){case"today":return[t,t];case"yesterday":return[T(t,-1),T(t,-1)];case"last-7-days":return[T(t,-6),t];case"last-30-days":return[T(t,-29),t];case"last-90-days":return[T(t,-89),t];case"this-month":return[O(i,s,1),O(i,s+1,0)];case"last-month":return[O(i,s-1,1),O(i,s,0)];case"this-quarter":return[O(i,r,1),O(i,r+3,0)];case"last-quarter":return[O(i,r-3,1),O(i,r,0)];case"this-year":return[O(i,0,1),O(i,11,31)];case"last-year":return[O(i-1,0,1),O(i-1,11,31)];case"year-to-date":return[O(i,0,1),t];case"last-12-months":return[L(t,-12),t];default:return null}}function I(e,t,i){if(t&&i)return e.find((e=>e.start.getTime()===t.getTime()&&e.end.getTime()===i.getTime()))}function R(e,t,i){return!Y(e.start,t,i)&&!Y(e.end,t,i)}const W=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2}))?$/;function K(e){const t=W.exec((null!=e?e:"").trim());if(!t)return null;const i=C(t[1]);return i?void 0===t[2]?{date:i,time:null}:Number(t[2])<24&&Number(t[3])<60?{date:i,time:`${t[2]}:${t[3]}`}:null:null}const V="YYYY-MM-DD",X=/\[([^\]]*)\]|YYYY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|A|a/g,Z=/HH|H|hh|h/,B=/hh|h/,G=/A|a/;function J(e,t,i=!1){const s=(null==e?void 0:e.trim())||V,r=(e=>e.replace(/\[[^\]]*\]/g,""))(s);return B.test(r)&&!G.test(r)?s+" A":!t||Z.test(r)?s:`${s} ${i?"h:mm A":"HH:mm"}`}const Q=(e,t=2)=>(e+"").padStart(t,"0"),ee=new Map;function te(e){let t=ee.get(e);if(!t){const i=t=>{const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC",calendar:"gregory"});return Array.from({length:12},((e,t)=>i.format(new Date(Date.UTC(2023,t,1)))))},s=ue(e);t={months:i("long"),shortMonths:i("short"),am:s.am,pm:s.pm},ee.set(e,t)}return t}const ie=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),se=e=>ie(e).replace(/\s+/g,"\\s*"),re=e=>`(${e.map(ie).join("|")})`;function ne(e,t=V,i="en-US"){var s;return null!==(s=function(e,t,i="en-US"){var s,r,n,a,o,d,l,c,h,p;const u=te(i),v=te("en-US"),m=[u.am,u.pm,v.am,v.pm],b={YYYY:"(\\d{4})",MMMM:re([...u.months,...v.months]),MMM:re([...u.shortMonths,...v.shortMonths]),MM:"(\\d{1,2})",M:"(\\d{1,2})",DD:"(\\d{1,2})",D:"(\\d{1,2})",HH:"(\\d{1,2})",H:"(\\d{1,2})",hh:"(\\d{1,2})",h:"(\\d{1,2})",mm:"(\\d{2})",A:re(m),a:re(m)},f=[],g=()=>{f.length=0;let e="",i=0;return t.replace(X,((s,r,n)=>(e+=se(t.slice(i,n)),void 0!==r?e+=se(r):(e+=b[s],f.push(s)),i=n+s.length,s))),RegExp(`^\\s*${e}${se(t.slice(i))}\\s*$`,"i")};let k=g().exec(null!=e?e:"");if(k||(b.mm="(\\d{1,2})",k=g().exec(null!=e?e:"")),!k)return null;const _=k,y={};f.forEach(((e,t)=>y[e]=_[t+1]));const x=(e,t)=>{if(void 0===e)return;const i=t?[u.months,v.months]:[u.shortMonths,v.shortMonths];for(const t of i){const i=t.findIndex((t=>t.toLowerCase()===e.toLowerCase()));if(i>=0)return i+1}},w=Number(y.YYYY),D=null!==(r=null!==(s=x(y.MMMM,!0))&&void 0!==s?s:x(y.MMM,!1))&&void 0!==r?r:Number(null!==(n=y.MM)&&void 0!==n?n:y.M),M=Number(null!==(a=y.DD)&&void 0!==a?a:y.D);if(!y.YYYY||!D||!M)return null;const $=C(`${Q(w,4)}-${Q(D)}-${Q(M)}`);if(!$)return null;const A=null!==(l=null!==(d=null!==(o=y.HH)&&void 0!==o?o:y.H)&&void 0!==d?d:y.hh)&&void 0!==l?l:y.h;if(void 0===A)return{date:$,time:null};let T=Number(A);const L=Number(null!==(c=y.mm)&&void 0!==c?c:0),j=null===(p=null!==(h=y.A)&&void 0!==h?h:y.a)||void 0===p?void 0:p.toLowerCase();if(void 0!==y.hh||void 0!==y.h){if(T<1||T>12)return null;T=T%12+(j===u.pm.toLowerCase()||j===v.pm.toLowerCase()?12:0)}return T<24&&L<60?{date:$,time:pe(T,L)}:null}(e,t,i))&&void 0!==s?s:K(e)}function ae(e,t=V,i="en-US"){const s=(null!=e?e:"").trim(),r=RegExp(`${ie(ce)}|\\s+(?:–|—|-|to)\\s+${t.includes("/")?"":"|\\s*/\\s*"}`,"gi");let n;for(;null!==(n=r.exec(s));){const e=ne(s.slice(0,n.index),t,i),r=ne(s.slice(n.index+n[0].length),t,i);if(e&&r)return oe(e,r)<=0?[e,r]:null}return null}function oe(e,t){var i,s;const r=e.date.getTime()-t.date.getTime();return 0!==r?r:(null!==(i=e.time)&&void 0!==i?i:"00:00").localeCompare(null!==(s=t.time)&&void 0!==s?s:"00:00")}function de(e){return e.time?`${$(e.date)}T${e.time}`:$(e.date)}function le(e,t,i="en-US"){return function(e,t,i="en-US"){var s;const r=te(i),[n,a]=he(null!==(s=e.time)&&void 0!==s?s:"00:00"),o=n%12||12,d=e.date.getUTCMonth(),l=n<12?r.am:r.pm,c={YYYY:Q(e.date.getUTCFullYear(),4),MMMM:r.months[d],MMM:r.shortMonths[d],MM:Q(d+1),M:d+1+"",DD:Q(e.date.getUTCDate()),D:e.date.getUTCDate()+"",HH:Q(n),H:n+"",hh:Q(o),h:o+"",mm:Q(a),A:l,a:l.toLowerCase()};return t.replace(X,((e,t)=>null!=t?t:c[e]))}(e,null!=t?t:J(V,!!e.time),i)}const ce=" – ";function he(e){const[t,i]=e.split(":").map(Number);return[t||0,i||0]}function pe(e,t){return`${(e+"").padStart(2,"0")}:${(t+"").padStart(2,"0")}`}function ue(e){var t,i;const s=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}),r=e=>{var t;return null===(t=s.formatToParts(new Date(Date.UTC(2023,0,1,e))).find((e=>"dayPeriod"===e.type)))||void 0===t?void 0:t.value};return{hour12:!!s.resolvedOptions().hour12,am:null!==(t=r(1))&&void 0!==t?t:"AM",pm:null!==(i=r(13))&&void 0!==i?i:"PM"}}const ve={weekday:"long",year:"numeric",month:"long",day:"numeric"},me="00:00",be="23:59";let fe=0;const ge=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ke=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsDatepickerChange=i(this,"pdsDatepickerChange",7),this.pdsBlur=i(this,"pdsBlur",7),this.pdsFocus=i(this,"pdsFocus",7),this.focusActiveDay=!1,this.fallbackId="pds-datepicker-"+ ++fe,this.skipForwardedClick=!1,this.presetByArrow=!1,this.valueAtOpen="",this.committing=!1,this.hasFocus=!1,this.applyLabel="Apply",this.autoApply=!1,this.cancelLabel="Cancel",this.clearable=!1,this.clearLabel="Clear",this.customRangeLabel="Custom range",this.endTimeLabel="End time",this.format="YYYY-MM-DD",this.hourLabel="Hour",this.invalidDateMessage="Enter a date in the format shown.",this.maxDateMessage="Choose {date} or earlier.",this.minDateMessage="Choose {date} or later.",this.minuteIncrement=1,this.minuteLabel="Minute",this.monthLabel="Month",this.nextMonthLabel="Next month",this.periodLabel="AM or PM",this.placement="bottom-start",this.presetsLabel="Presets",this.previousMonthLabel="Previous month",this.range=!1,this.showDropdowns=!1,this.startTimeLabel="Start time",this.timePicker=!1,this.timeLabel="Time",this.triggerLabel="Choose date",this.value="",this.yearLabel="Year",this.isOpen=!1,this.text="",this.textError="",this.activeDate="",this.viewMonth="",this.draftStart="",this.draftEnd="",this.startTime=me,this.endTime=be,this.previewDate="",this.onApply=()=>{const e=this.draftParts();e&&(this.commitParts(e),this.closeCalendar(!0))},this.onCancel=()=>{this.clearable?this.commitValue(""):this.restoreValueAtOpen(),this.closeCalendar(!0)},this.onPresetClick=(e,t)=>{this.draftStart=$(t.start),this.draftEnd=$(t.end),this.previewDate="",!this.appliesOnPick||this.presetByArrow?(this.showDate(t.end,!0),e.currentTarget.focus()):this.onApply()},this.onPresetsKeyDown=e=>{const t={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key],i={Home:"first",End:"last"}[e.key];if(!t&&!i)return;const s=Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not([disabled])')),r=s.indexOf(e.target),n="first"===i?s[0]:"last"===i?s[s.length-1]:s[(r+t+s.length)%s.length];n&&(e.preventDefault(),n.focus(),n.classList.contains("pds-datepicker__preset")&&n!==s[s.length-1]&&(this.presetByArrow=!0,n.click(),this.presetByArrow=!1))},this.onClearMouseDown=e=>{e.preventDefault()},this.onClearClick=()=>{var e;this.commitValue(""),this.closeCalendar(!1),null===(e=this.inputEl)||void 0===e||e.setFocus()},this.onCustomRangeClick=()=>{var e,t;null===(t=null===(e=this.dialogEl)||void 0===e?void 0:e.querySelector('[data-date][tabindex="0"]'))||void 0===t||t.focus()},this.onDocumentPointerDown=e=>{var t;const i=e.composedPath();i.includes(this.el)||this.portal&&i.includes(this.portal.host)||(this.closeCalendar(!1),"dialog"===(null===(t=i[0])||void 0===t?void 0:t.localName)&&function(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,{capture:!0,once:!0}),window.setTimeout((()=>document.removeEventListener("click",e,{capture:!0})),500)}())},this.onHostFocusIn=e=>{this.focusEntered(e)},this.onCalendarFocusIn=e=>{var t,i;this.focusEntered(e),null===(t=this.dialogEl)||void 0===t||t.setAttribute("aria-modal","true"),e.target===this.dialogEl&&(null===(i=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===i||i.focus({preventScroll:!0}))},this.onCalendarFocusOut=e=>{var t,i;const s=e.relatedTarget;s&&(null===(t=this.dialogEl)||void 0===t?void 0:t.contains(s))||null===(i=this.dialogEl)||void 0===i||i.removeAttribute("aria-modal"),this.checkFocusLeft(e,null!==s)},this.onHostFocusOut=e=>{const t=e.relatedTarget;t&&this.isInside(t)||this.checkFocusLeft(e,null!==t)},this.stopInnerEvent=e=>e.stopPropagation(),this.onFieldClick=e=>{var t,i;const s=e.composedPath();if(this.triggerEl&&s.includes(this.triggerEl)||this.clearEl&&s.includes(this.clearEl))return;const r=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("label");if(r&&s.includes(r))return this.skipForwardedClick=!0,void window.setTimeout((()=>this.skipForwardedClick=!1));if(this.skipForwardedClick)return void(this.skipForwardedClick=!1);const n=this.fieldReference();n&&n!==this.inputEl&&!s.includes(n)||this.openCalendar(!1)},this.onTextInput=e=>{var t,i;if(e.stopPropagation(),this.text=(null!==(t=e.detail.value)&&void 0!==t?t:"")+"",!this.isOpen)return;const s=this.parseText(this.text);if(!s)return;const[r,n]=[this.startTime,this.endTime];if(null!==(i=this.timesBeforeTyping)&&void 0!==i||(this.timesBeforeTyping=[r,n]),this.loadDraft(s),this.timePicker){const e=this.resolvedFormat,t=this.resolvedLocale,i=this.range?ae(this.text,e,t):[ne(this.text,e,t)],s=this.parsedValue(),a=e=>{var t,r,n;return!(null===(t=null==i?void 0:i[e])||void 0===t?void 0:t.time)||(null===(r=i[e])||void 0===r?void 0:r.time)===(null===(n=null==s?void 0:s[e])||void 0===n?void 0:n.time)};a(0)&&(this.startTime=r),this.range&&a(1)&&(this.endTime=n)}this.showDate(s[s.length-1].date)},this.onTextChange=e=>{e.stopPropagation(),this.isOpen&&this.hasFooter?window.setTimeout((()=>{var e;this.isOpen&&(this.el.matches(":focus-within")||(null===(e=this.portal)||void 0===e?void 0:e.host.matches(":focus-within")))||this.commitPendingText()})):this.commitText()},this.onTextKeyDown=e=>{e.stopPropagation();const t=e.detail;if(t.altKey&&"ArrowDown"===t.key)t.preventDefault(),this.isOpen?(this.focusActiveDay=!0,this.flushActiveDayFocus()):this.openCalendar(!0);else if("Enter"===t.key&&this.isOpen){if(!this.hasFooter||this.text!==this.fieldText()&&!this.parseText(this.text))this.commitText();else{const e=this.draftParts();e&&this.commitParts(e)}this.textError||this.closeCalendar(!1)}else"Escape"===t.key&&this.isOpen&&(t.preventDefault(),t.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!1))},this.onTriggerKeyDown=e=>{var t;if(this.isOpen)return"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),void this.closeCalendar(!1)):void("Tab"!==e.key||e.shiftKey||"visible"!==(null===(t=this.dialogEl)||void 0===t?void 0:t.style.visibility)||(e.preventDefault(),this.focusActiveDay=!0,this.flushActiveDayFocus()))},this.onTriggerClick=()=>{this.isOpen?this.closeCalendar(!0):this.openCalendar(!0)},this.onDialogKeyDown=e=>{"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!0)):"Tab"===e.key&&this.trapTab(e)},this.onGridKeyDown=e=>{const t=C(this.activeDate);if(!t)return;const i="rtl"===getComputedStyle(this.el).direction,s=E(t,this.weekStart);let r=null;switch(e.key){case"ArrowLeft":r=T(t,i?1:-1);break;case"ArrowRight":r=T(t,i?-1:1);break;case"ArrowUp":r=T(t,-7);break;case"ArrowDown":r=T(t,7);break;case"Home":r=T(t,-s);break;case"End":r=T(t,6-s);break;case"PageUp":r=L(t,e.shiftKey?-12:-1);break;case"PageDown":r=L(t,e.shiftKey?12:1);break;case"Enter":case" ":return e.preventDefault(),this.pickDate(t),void(this.hasFooter&&(this.focusActiveDay=!0));default:return}e.preventDefault();const n=H(r,this.minDate,this.maxDate);this.showDate(n),this.range&&(this.previewDate=$(n)),this.focusActiveDay=!0},this.onGridClick=e=>{const t=this.dayFromEvent(e);t&&this.pickDate(t)},this.onGridPointerOver=e=>{if(!this.range||!this.draftStart||this.draftEnd)return;const t=this.dayFromEvent(e),i=t&&$(t);i&&i!==this.previewDate&&(this.previewDate=i)}}async open(){this.openCalendar(!0)}async close(){this.closeCalendar(!1)}async setFocus(){var e;await(null===(e=this.inputEl)||void 0===e?void 0:e.setFocus())}valueChanged(){var e;this.committing||(this.valueAtOpen=null!==(e=this.value)&&void 0!==e?e:""),this.refreshFromValue()}contextChanged(){this.refreshFromValue()}placementChanged(){this.stopPositioning()}refreshFromValue(){var e;if(this.text=this.fieldText(),this.textError="",this.updateFormValue(),!this.isOpen)return;const t=this.parsedValue();this.loadDraft(t);const i=null!==(e=t&&t[t.length-1].date)&&void 0!==e?e:A();this.showDate(H(i,this.minDate,this.maxDate),!0)}requiredChanged(){this.updateFormValue()}componentWillLoad(){this.text=this.fieldText()}connectedCallback(){this.el.attachInternals&&!this.internals&&(this.internals=this.el.attachInternals())}componentDidLoad(){this.updateFormValue()}disconnectedCallback(){var e;this.closeCalendar(!1),null===(e=this.portal)||void 0===e||e.remove()}componentDidRender(){var e,t;this.isOpen&&this.dialogEl?(null!==(t=this.portal)&&void 0!==t||(this.portal=new N(this.el)),this.portal.mount(this.dialogEl,this.resolvedLocale),this.cleanupAutoUpdate||this.startPositioning(),this.flushActiveDayFocus()):null===(e=this.portal)||void 0===e||e.remove()}flushActiveDayFocus(){var e,t;this.focusActiveDay&&"visible"===(null===(e=this.dialogEl)||void 0===e?void 0:e.style.visibility)&&(this.focusActiveDay=!1,null===(t=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===t||t.focus())}get baseId(){return this.componentId||this.fallbackId}get resolvedLocale(){return function(e){var t;try{return null!==(t=Intl.DateTimeFormat.supportedLocalesOf(e)[0])&&void 0!==t?t:"en-US"}catch(e){return"en-US"}}(this.locale||_(this.el))}get weekStart(){const e=this.firstDayOfWeek;return"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=6?e:function(e){var t,i,s;const r=Intl.Locale;if(!r)return 0;try{const n=new r(e),a=null!==(i=null===(t=n.getWeekInfo)||void 0===t?void 0:t.call(n).firstDay)&&void 0!==i?i:null===(s=n.weekInfo)||void 0===s?void 0:s.firstDay;return"number"==typeof a?a%7:0}catch(e){return 0}}(this.resolvedLocale)}get minDate(){return C(this.min)}get maxDate(){return C(this.max)}get isInteractive(){return!this.disabled&&!this.readonly}get monthCount(){const e="undefined"!=typeof window&&window.innerWidth<640;return this.range&&!e?2:1}get appliesOnPick(){return this.range&&this.autoApply&&!this.timePicker}get hasFooter(){return(this.range||this.timePicker)&&!this.appliesOnPick}get resolvedPresets(){return this.range?function(e,t){const i="string"==typeof e?e.split(",").map((e=>e.trim())).filter(Boolean).map((e=>({key:e}))):Array.isArray(e)?e:[],s=[];for(const e of i){if(!e||"string"!=typeof e.key)continue;const i="string"==typeof e.start?C(e.start):null,r="string"==typeof e.end?C(e.end):null,n=i&&r&&i<=r?[i,r]:q(e.key,t),a="string"==typeof e.label?e.label:U[e.key];n&&a&&s.push({key:e.key,label:a,start:n[0],end:n[1]})}return s}(this.presets,A()):[]}parsedValue(e=this.value){if(this.range){const[t,i,s]=(null!=e?e:"").split("/"),r=K(t),n=K(i);return void 0===s&&r&&n&&oe(r,n)<=0?[r,n]:null}const t=K(e);return t?[t]:null}get resolvedFormat(){return J(this.format,this.timePicker,this.timePicker&&ue(this.resolvedLocale).hour12)}fieldText(){var e;const t=this.parsedValue();return t?t.map((e=>le(this.withTimePicker(e),this.resolvedFormat,this.resolvedLocale))).join(ce):null!==(e=this.value)&&void 0!==e?e:""}withTimePicker(e,t=me){var i;return{date:e.date,time:this.timePicker?null!==(i=e.time)&&void 0!==i?i:t:null}}get fieldPlaceholder(){if(this.placeholder)return this.placeholder;const e=this.resolvedFormat;return this.range?`${e}${ce}${e}`:e}loadDraft(e){var t,i;const[s,r]=null!=e?e:[];this.draftStart=s?$(s.date):"",this.draftEnd=this.range&&r?$(r.date):"",this.startTime=null!==(t=null==s?void 0:s.time)&&void 0!==t?t:me,this.endTime=null!==(i=null==r?void 0:r.time)&&void 0!==i?i:be,this.previewDate=""}openCalendar(e){var t,i;if(!this.isInteractive||this.isOpen)return;const s=this.parsedValue();this.loadDraft(s),this.valueAtOpen=null!==(t=this.value)&&void 0!==t?t:"";const r=null!==(i=s&&s[s.length-1].date)&&void 0!==i?i:A();this.showDate(H(r,this.minDate,this.maxDate),!0),this.focusActiveDay=e,this.isOpen=!0,document.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}closeCalendar(e){var t;this.isOpen&&(this.commitPendingText(),this.timesBeforeTyping=void 0,this.isOpen=!1,this.stopPositioning(),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),e&&(null===(t=this.triggerEl)||void 0===t||t.focus()))}showDate(e,t=!1){const i=ge(e),s=C(this.viewMonth),r=s&&L(s,this.monthCount-1);t||!s||i<s?this.viewMonth=$(t?L(i,1-this.monthCount):i):r&&i>r&&(this.viewMonth=$(L(i,1-this.monthCount))),this.activeDate=$(e)}pickDate(e){Y(e,this.minDate,this.maxDate)||(this.dropTypedText(),this.range?this.pickRangeDay(e):this.timePicker?(this.draftStart=$(e),this.activeDate=this.draftStart):(this.commitValue($(e)),this.closeCalendar(!0)))}pickRangeDay(e){const t=C(this.draftStart),i=$(e);!t||this.draftEnd?(this.draftStart=i,this.draftEnd=""):e<t?this.draftStart=i:this.draftEnd=i,this.previewDate="",this.activeDate=i,this.draftEnd&&this.appliesOnPick&&this.onApply()}commitValue(e,t={}){var i;const s=e!==(null!==(i=this.value)&&void 0!==i?i:"");this.timesBeforeTyping=void 0,this.committing=!0,this.value=e,this.committing=!1,this.text=this.fieldText(),this.textError="",this.updateFormValue(),s&&this.pdsDatepickerChange.emit(Object.assign({value:e},t))}commitParts(e){if(!this.range)return void this.commitValue(de(e[0]));const[t,i]=e,s=I(this.resolvedPresets,t.date,i.date);this.commitValue(`${de(t)}/${de(i)}`,Object.assign({start:de(t),end:de(i)},s?{preset:s.key}:{}))}draftParts(){var e;const t=C(this.draftStart);if(!t)return null;const i=this.withTimePicker({date:t,time:this.startTime});if(!this.range)return[i];const s=this.withTimePicker({date:null!==(e=C(this.draftEnd))&&void 0!==e?e:t,time:this.endTime});return[i,oe(s,i)<0?Object.assign(Object.assign({},s),{time:i.time}):s]}restoreValueAtOpen(){var e;if(this.valueAtOpen===(null!==(e=this.value)&&void 0!==e?e:""))return void this.dropTypedText();const t=this.parsedValue(this.valueAtOpen);t?this.commitParts(t):this.commitValue(this.valueAtOpen)}isInside(e){var t,i;return!!e&&(e===this.el||this.el.contains(e)||!!(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.contains(e))||!!(null===(i=this.portal)||void 0===i?void 0:i.contains(e)))}focusEntered(e){this.hasFocus||(this.hasFocus=!0,this.pdsFocus.emit(e))}checkFocusLeft(e,t){window.setTimeout((()=>{var i;this.el.matches(":focus-within")||(null===(i=this.portal)||void 0===i?void 0:i.host.matches(":focus-within"))||(t&&this.closeCalendar(!1),this.hasFocus&&(this.hasFocus=!1,this.pdsBlur.emit(e)))}))}startPositioning(){const e=this.fieldReference(),t=this.dialogEl;e&&t&&(this.cleanupAutoUpdate=a(e,t,(()=>{o(e,t,{placement:this.placement,strategy:"fixed",middleware:[d(4),l({padding:8}),c({padding:8,apply({availableWidth:e,availableHeight:t,elements:i}){const s=window.innerHeight-16;Object.assign(i.floating.style,{maxHeight:Math.max(0,Math.max(t,Math.min(s,480)))+"px",maxWidth:Math.max(0,e)+"px"})}}),h({padding:8,crossAxis:!0}),p()]}).then((({x:e,y:i,middlewareData:s})=>{var r;const n=!!(null===(r=s.hide)||void 0===r?void 0:r.referenceHidden);Object.assign(t.style,{left:e+"px",top:i+"px",visibility:n?"hidden":"visible"}),this.flushActiveDayFocus()}))})))}stopPositioning(){var e;null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.cleanupAutoUpdate=void 0}fieldReference(){var e,t,i;return null!==(i=null===(t=null===(e=this.inputEl)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".pds-input__field-wrapper"))&&void 0!==i?i:this.inputEl}commitPendingText(){if(this.text===this.fieldText())return;const e=this.parseText(this.text)?this.draftParts():null;e?this.commitParts(e):this.commitText()}readText(e){const t=this.resolvedFormat,i=this.resolvedLocale,s=this.range?ae(e,t,i):[ne(e,t,i)];return!s||s.some((e=>!e))?null:s.map(((e,t)=>this.withTimePicker(e,1===t?be:me)))}parseText(e){const t=this.readText(e);return t&&!this.rangeError(t)?t:null}rangeError(e){return this.minDate&&e.some((e=>e.date<this.minDate))?"min":this.maxDate&&e.some((e=>e.date>this.maxDate))?"max":""}valueError(){if(!this.value)return"";const e=this.parsedValue();return e?this.rangeError(e):"format"}commitText(){const e=this.text.trim();if(""===e)return void this.commitValue("");const t=this.readText(e),i=t?this.rangeError(t):"format";t&&!i?this.commitParts(t):(this.textError=i,this.updateFormValue())}canShowMonth(e){var t;const i=null!==(t=C(this.viewMonth))&&void 0!==t?t:A();return e<0?!this.minDate||T(i,-1)>=this.minDate:!this.maxDate||L(i,this.monthCount)<=this.maxDate}showMonth(e,t){var i,s;const r=null!==(i=C(this.viewMonth))&&void 0!==i?i:A(),n=null!==(s=C(this.activeDate))&&void 0!==s?s:A();this.viewMonth=$(L(r,t)),this.activeDate=$(H(L(n,t),this.minDate,this.maxDate)),this.canShowMonth(t)?e.currentTarget.focus():this.focusActiveDay=!0}jumpTo(e,t,i){var s;const r=H(new Date(Date.UTC(t,i,1)),this.minDate,this.maxDate);this.viewMonth=$(L(ge(r),-e));const n=null!==(s=C(this.activeDate))&&void 0!==s?s:r,a=Math.min(n.getUTCDate(),new Date(Date.UTC(t,i+1,0)).getUTCDate());this.activeDate=$(H(new Date(Date.UTC(t,i,a)),this.minDate,this.maxDate))}dropTypedText(){this.timesBeforeTyping&&([this.startTime,this.endTime]=this.timesBeforeTyping),this.timesBeforeTyping=void 0,(this.text!==this.fieldText()||this.textError)&&(this.text=this.fieldText(),this.inputEl&&(this.inputEl.value=this.text),this.textError="",this.updateFormValue())}trapTab(e){var t,i,s,r;const n=Array.from(null!==(i=null===(t=this.dialogEl)||void 0===t?void 0:t.querySelectorAll('button:not([disabled]):not([tabindex="-1"]), select:not([disabled]), [data-date][tabindex="0"]'))&&void 0!==i?i:[]);if(0===n.length)return;const a=null===(r=null===(s=this.dialogEl)||void 0===s?void 0:s.getRootNode())||void 0===r?void 0:r.activeElement,o=n[0],d=n[n.length-1];e.shiftKey&&a===o?(e.preventDefault(),d.focus()):e.shiftKey||a!==d||(e.preventDefault(),o.focus())}dayFromEvent(e){var t,i;const s=null===(i=null===(t=e.target)||void 0===t?void 0:t.closest)||void 0===i?void 0:i.call(t,"[data-date]");return C(null==s?void 0:s.dataset.date)}updateFormValue(){var e,t,i,s;if(k()||!(null===(e=this.internals)||void 0===e?void 0:e.setFormValue))return;if(this.internals.setFormValue(this.value||null),!this.internals.setValidity)return;const r=null!==(s=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input"))&&void 0!==s?s:void 0,n=this.textError||this.valueError();"format"===n?this.internals.setValidity({badInput:!0},this.invalidDateMessage,r):"min"===n?this.internals.setValidity({rangeUnderflow:!0},this.boundMessage(this.minDateMessage,this.minDate),r):"max"===n?this.internals.setValidity({rangeOverflow:!0},this.boundMessage(this.maxDateMessage,this.maxDate),r):this.required&&!this.value?this.internals.setValidity({valueMissing:!0},(null==r?void 0:r.validationMessage)||this.invalidDateMessage,r):this.internals.setValidity({})}boundMessage(e,t){const i=t?le({date:t,time:null},this.format||void 0,this.resolvedLocale):"";return y(e,{date:i})}formResetCallback(){this.value="",this.text="",this.textError="",this.closeCalendar(!1),this.updateFormValue()}interactivityChanged(){this.isInteractive||this.closeCalendar(!1)}formDisabledCallback(e){this.disabled=e,e&&this.closeCalendar(!1)}formStateRestoreCallback(e){"string"==typeof e&&(this.value=e)}triggerAccessibleName(e){const t=this.parsedValue();if(!t)return this.triggerLabel;const i=t.map((t=>S(t.date,e,ve)));return`${this.triggerLabel}, ${i.join(ce)}`}highlightedRange(){const e=C(this.draftStart),t=C(this.draftEnd);if(!e||t)return[e,t];const i=C(this.previewDate);return[e,i&&i>e?i:null]}selectedDay(){return this.range?null:C(this.draftStart)}renderMonthHeading(e,t,i,r){const n=S(e,i,{month:"long",year:"numeric"}),a=0===t?"polite":null;if(!this.showDropdowns)return s("div",{class:"pds-datepicker__heading",id:r,"aria-live":a},n);const o=e.getUTCFullYear(),d=e.getUTCMonth(),l=this.minDate,c=this.maxDate,h=A().getUTCFullYear(),p=l?l.getUTCFullYear():h-100,v=c?c.getUTCFullYear():h+100,m=z(i,{month:"long"}),b=z(i,{year:"numeric"});return s("div",{class:"pds-datepicker__dropdowns"},s("span",{class:"visually-hidden",id:r,"aria-live":a},n),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.monthLabel,onChange:e=>this.jumpTo(t,o,Number(e.target.value))},Array.from({length:12},((e,t)=>{const i=!!l&&new Date(Date.UTC(o,t+1,0))<l||!!c&&new Date(Date.UTC(o,t,1))>c;return s("option",{value:t+"",selected:t===d,disabled:i},m.format(new Date(Date.UTC(o,t,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.yearLabel,onChange:e=>this.jumpTo(t,Number(e.target.value),d)},Array.from({length:Math.max(v,o)-Math.min(p,o)+1},((e,t)=>{const i=Math.min(p,o)+t;return s("option",{value:i+"",selected:i===o},b.format(new Date(Date.UTC(i,0,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})))}renderMonth(e,t,i){const r=e.getUTCFullYear(),n=e.getUTCMonth(),a=this.minDate,o=this.maxDate,d=this.selectedDay(),[l,c]=this.range?this.highlightedRange():[null,null],h=A(),p=z(i,ve),u=z(i,{day:"numeric"}),b=`${this.baseId}-calendar-heading-${t}`,f=t===this.monthCount-1;return s("div",{class:"pds-datepicker__month"},s("div",{class:"pds-datepicker__header"},0===t?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--previous","aria-label":this.previousMonthLabel,disabled:!this.canShowMonth(-1),onClick:e=>this.showMonth(e,-1)},s("pds-icon",{icon:v,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"}),this.renderMonthHeading(e,t,i,b),f?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--next","aria-label":this.nextMonthLabel,disabled:!this.canShowMonth(1),onClick:e=>this.showMonth(e,1)},s("pds-icon",{icon:m,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"})),s("table",{class:"pds-datepicker__grid",role:"grid","aria-labelledby":b,"aria-multiselectable":this.range?"true":null,onKeyDown:this.onGridKeyDown,onClick:this.onGridClick,onPointerOver:this.onGridPointerOver},s("thead",null,s("tr",null,function(e,t){const i=z(e,{weekday:"short"}),s=z(e,{weekday:"long"}),r=Array.from({length:7},((e,i)=>new Date(Date.UTC(2023,0,1+(t+i)%7)))),n=r.map((e=>i.format(e).replace(/\.$/,""))),a=n.every((e=>/^[A-Za-z\u00C0-\u024F]+$/.test(e))),o=n.map((e=>e.slice(0,2))),d=a&&7===new Set(o.map((e=>e.toLowerCase()))).size;return r.map(((e,t)=>({short:d?o[t]:i.format(e),long:s.format(e)})))}(i,this.weekStart).map((e=>s("th",{scope:"col",class:"pds-datepicker__weekday"},s("span",{"aria-hidden":"true"},e.short),s("span",{class:"visually-hidden"},e.long)))))),s("tbody",null,function(e,t,i){const s=new Date(Date.UTC(e,t,1)),r=Array(E(s,i)).fill(null);for(let i=1;i<=j(e,t);i++)r.push(new Date(Date.UTC(e,t,i)));for(;r.length%7!=0;)r.push(null);const n=[];for(let e=0;e<r.length;e+=7)n.push(r.slice(e,e+7));return n}(r,n,this.weekStart).map((e=>s("tr",null,e.map(((e,t)=>{if(!e)return s("td",{class:"pds-datepicker__day pds-datepicker__day--empty"});const i=$(e),r=Y(e,a,o),n=P(e,l)||P(e,c),v=!!l&&!!c&&!P(l,c),m=!!l&&!!c&&e>=l&&e<=c,b=P(e,d)||n||m,f=P(e,h);return s("td",{class:{"pds-datepicker__day":!0,"pds-datepicker__day--selected":P(e,d)||n,"pds-datepicker__day--in-range":m&&!n,"pds-datepicker__day--range-start":v&&P(e,l),"pds-datepicker__day--range-end":v&&P(e,c),"pds-datepicker__day--row-start":m&&0===t,"pds-datepicker__day--row-end":m&&6===t,"pds-datepicker__day--today":f,"pds-datepicker__day--disabled":r},"data-date":i,tabindex:i===this.activeDate?"0":"-1","aria-label":p.format(e),"aria-selected":b?"true":null,"aria-current":f?"date":null,"aria-disabled":r?"true":null},((e,t)=>{var i,s;return null!==(s=null===(i=e.formatToParts(t).find((e=>"day"===e.type)))||void 0===i?void 0:i.value)&&void 0!==s?s:e.format(t)})(u,e))}))))))),this.timePicker&&this.timesUnderMonth(t).map((e=>this.renderTime(e,i))))}timesUnderMonth(e){return this.range?1===this.monthCount?["start","end"]:[0===e?"start":"end"]:["start"]}renderTime(e,t){var i,r,n;const a="start"===e?this.startTime:null!==(n=null===(r=null===(i=this.draftParts())||void 0===i?void 0:i[1])||void 0===r?void 0:r.time)&&void 0!==n?n:this.endTime,[o,d]=he(a),l=ue(t),c=Math.max(1,Math.min(60,Math.floor(this.minuteIncrement)||1)),h=(t,i)=>{const s=pe(t,i);"start"===e?this.startTime=s:this.endTime=s,this.timesBeforeTyping&&(this.timesBeforeTyping["start"===e?0:1]=s)},p=this.range?"start"===e?this.startTimeLabel:this.endTimeLabel:this.timeLabel,u=o>=12,v=l.hour12?Array.from({length:12},((e,t)=>t+1)):Array.from({length:24},((e,t)=>t)),m=l.hour12?o%12||12:o,b=Array.from({length:Math.ceil(60/c)},((e,t)=>t*c));b.includes(d)||b.push(d),b.sort(((e,t)=>e-t));const f=`${this.baseId}-time-${e}`;return s("div",{class:"pds-datepicker__time",role:"group","aria-labelledby":f},s("span",{class:"pds-datepicker__time-label",id:f},p),s("span",{class:"pds-datepicker__time-field"},s("select",{class:"pds-datepicker__time-select","aria-label":this.hourLabel,onChange:e=>{const t=Number(e.target.value);h(l.hour12?t%12+(u?12:0):t,d)}},v.map((e=>s("option",{value:e+"",selected:e===m},l.hour12?e+"":(e+"").padStart(2,"0"))))),s("span",{class:"pds-datepicker__time-separator","aria-hidden":"true"},":"),s("select",{class:"pds-datepicker__time-select","aria-label":this.minuteLabel,onChange:e=>h(o,Number(e.target.value))},b.map((e=>s("option",{value:e+"",selected:e===d},(e+"").padStart(2,"0"))))),l.hour12&&s("select",{class:"pds-datepicker__time-select pds-datepicker__time-select--period","aria-label":this.periodLabel,onChange:e=>{h(o%12+("pm"===e.target.value?12:0),d)}},s("option",{value:"am",selected:!u},l.am),s("option",{value:"pm",selected:u},l.pm))))}renderPresets(){var e;const t=this.resolvedPresets;if(0===t.length)return null;const i=I(t,C(this.draftStart),C(this.draftEnd)),r=!i&&!!this.draftStart,n=e=>R(e,this.minDate,this.maxDate),a=i&&n(i)?i:r?"custom":null!==(e=t.find(n))&&void 0!==e?e:"custom";return s("div",{class:"pds-datepicker__presets-column"},s("ul",{class:"pds-datepicker__presets",part:"presets",role:"radiogroup","aria-label":this.presetsLabel,onKeyDown:this.onPresetsKeyDown},t.map((e=>{const t=e===i;return s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":t},"aria-checked":t?"true":"false",tabindex:e===a?"0":"-1",disabled:!R(e,this.minDate,this.maxDate),onClick:t=>this.onPresetClick(t,e)},s("span",null,e.label),t&&s("pds-icon",{icon:b,"aria-hidden":"true"})))})),s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":r},"aria-checked":r?"true":"false",tabindex:"custom"===a?"0":"-1",onClick:this.onCustomRangeClick},s("span",null,this.customRangeLabel),r&&s("pds-icon",{icon:b,"aria-hidden":"true"})))))}selectionText(){const e=this.draftParts();if(!e)return"";const t=this.resolvedFormat,i=this.resolvedLocale;return this.range&&!this.draftEnd?`${le(e[0],t,i)}${ce}`:e.map((e=>le(e,t,i))).join(ce)}renderFooter(){const e=this.draftParts(),t=this.selectionText();return s("div",{class:"pds-datepicker__footer"},s("span",{class:"pds-datepicker__selection","aria-live":"polite"},t),s("button",{type:"button",class:"pds-datepicker__action",onClick:this.onCancel},this.clearable?this.clearLabel:this.cancelLabel),s("button",{type:"button",class:"pds-datepicker__action pds-datepicker__action--primary",disabled:!e,onClick:this.onApply},this.applyLabel))}renderCalendar(e){var t;const i=null!==(t=C(this.viewMonth))&&void 0!==t?t:A(),r=Array.from({length:this.monthCount},((e,t)=>L(i,t)));return s("div",{class:{"pds-datepicker__dialog":!0,"pds-datepicker__dialog--range":this.range},id:this.baseId+"-calendar",role:"dialog",tabindex:"-1","aria-labelledby":this.range?null:this.baseId+"-calendar-heading-0","aria-label":this.range?this.label||this.triggerLabel:null,part:"calendar",ref:e=>this.dialogEl=e,onKeyDown:this.onDialogKeyDown,onFocusin:this.onCalendarFocusIn,onFocusout:this.onCalendarFocusOut},this.range&&this.renderPresets(),s("div",{class:"pds-datepicker__panel"},s("div",{class:"pds-datepicker__months"},r.map(((t,i)=>this.renderMonth(t,i,e)))),this.hasFooter&&this.renderFooter(),this.appliesOnPick&&s("span",{class:"visually-hidden","aria-live":"polite"},this.selectionText())))}render(){const e=this.resolvedLocale;return s(r,{key:"a761f0ca6eeedcac3e4bd90760aa9781cd37dcdc",class:{"pds-datepicker--range":this.range,"pds-datepicker--time":this.timePicker},"full-width":this.fullWidth?"true":null,onFocusin:this.onHostFocusIn,onFocusout:this.onHostFocusOut},s("pds-input",{key:"2eb04f9fd4e2f7a2437145d250c629c2cc8a0bf6",ref:e=>this.inputEl=e,componentId:this.baseId,label:this.label,hideLabel:this.hideLabel,helperMessage:this.helperMessage,errorMessage:this.errorMessage,invalid:this.invalid||!!this.textError||!!this.valueError(),disabled:this.disabled,readonly:this.readonly,required:this.required,placeholder:this.fieldPlaceholder,fullWidth:this.fullWidth,autocomplete:"off",value:this.text,onClick:this.onFieldClick,onPdsInput:this.onTextInput,onPdsChange:this.onTextChange,onPdsKeyDown:this.onTextKeyDown,onPdsFocus:this.stopInnerEvent,onPdsBlur:this.stopInnerEvent},this.clearable&&!!this.value&&this.isInteractive&&s("button",{key:"clear",slot:"suffix",type:"button",class:"pds-datepicker__clear",ref:e=>this.clearEl=e,"aria-label":this.label?`${this.clearLabel} ${this.label}`:this.clearLabel,tabindex:"-1",onMouseDown:this.onClearMouseDown,onClick:this.onClearClick},s("pds-icon",{key:"98c325fbba8ea78b2d409bc77099db3206738508",icon:f,"aria-hidden":"true"})),s("button",{key:"trigger",slot:"suffix",type:"button",class:"pds-datepicker__trigger",ref:e=>this.triggerEl=e,"aria-label":this.triggerAccessibleName(e),"aria-haspopup":"dialog","aria-expanded":this.isOpen?"true":"false",disabled:!this.isInteractive,onClick:this.onTriggerClick,onKeyDown:this.onTriggerKeyDown},s("pds-icon",{key:"cb8483febe1b485058b7bb4271b749981a7747a1",icon:g,"aria-hidden":"true"}))),this.isOpen&&this.renderCalendar(e))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}}static get style(){return':host{--pds-datepicker-day-size:var(--pine-dimension-500);--pds-datepicker-presets-width:200px;display:inline-block}:host([full-width]){display:block}pds-input{display:block}:host(.pds-datepicker--time) pds-input{min-width:220px}:host(.pds-datepicker--range) pds-input{min-width:260px}:host(.pds-datepicker--range.pds-datepicker--time) pds-input{min-width:min(380px, 100%)}.pds-datepicker__trigger,.pds-datepicker__clear{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-2xs)}.pds-datepicker__trigger:hover:not(:disabled),.pds-datepicker__clear:hover:not(:disabled){background:var(--pine-color-background-muted);color:var(--pine-color-text-strong)}.pds-datepicker__trigger:focus-visible,.pds-datepicker__clear:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__trigger:disabled,.pds-datepicker__clear:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__clear{-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs)}.pds-datepicker__nav{-ms-flex-align:center;align-items:center;background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;height:var(--pine-dimension-400);-ms-flex-pack:center;justify-content:center;padding:0;width:var(--pine-dimension-400)}.pds-datepicker__nav:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__nav:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__nav:disabled{border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__nav:dir(rtl) pds-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.pds-datepicker__dialog:focus{outline:none}.pds-datepicker__dialog{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-150);-webkit-box-shadow:var(--pine-box-shadow-200);box-shadow:var(--pine-box-shadow-200);-webkit-box-sizing:border-box;box-sizing:border-box;left:0;max-height:calc(100vh - var(--pine-dimension-sm));max-height:calc(100dvh - var(--pine-dimension-sm));max-width:calc(100vw - var(--pine-dimension-sm));overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;padding:var(--pine-dimension-sm);pointer-events:auto;position:fixed;top:0;visibility:hidden;z-index:var(--pine-z-index-priority)}:host-context([data-theme=dark]) .pds-datepicker__dialog{border:var(--pine-border)}.pds-datepicker__header{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-datepicker__nav-spacer{-ms-flex:none;flex:none;width:var(--pine-dimension-400)}.pds-datepicker__heading{color:var(--pine-color-text);font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold)}.pds-datepicker__grid{border-collapse:collapse;border-spacing:0}.pds-datepicker__weekday{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm);height:var(--pds-datepicker-day-size);padding:0;text-align:center;width:var(--pds-datepicker-day-size)}.pds-datepicker__day{border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body);height:var(--pds-datepicker-day-size);padding:0;position:relative;text-align:center;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:var(--pds-datepicker-day-size)}.pds-datepicker__day:hover{background:var(--pine-color-background-muted)}.pds-datepicker__day:focus-visible{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width-thick) * -1)}.pds-datepicker__day--empty{cursor:default;pointer-events:none}.pds-datepicker__day--today::after{background:var(--pine-color-primary);border-radius:var(--pine-border-radius-full);content:"";height:var(--pine-dimension-050);inset-block-end:var(--pine-dimension-050);inset-inline-start:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pine-dimension-050)}.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__day--selected:focus-visible{outline-offset:var(--pine-border-width)}.pds-datepicker__day--range-start{border-end-end-radius:0;border-start-end-radius:0}.pds-datepicker__day--range-end{border-end-start-radius:0;border-start-start-radius:0}.pds-datepicker__day--range-start.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--range-end.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:var(--pine-color-text-primary)}.pds-datepicker__day--in-range{border-radius:0}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-muted);color:var(--pine-color-text-secondary)}.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--disabled,.pds-datepicker__day--disabled:hover{background:transparent;color:var(--pine-color-text-disabled);cursor:not-allowed;text-decoration:line-through}.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-inset)}.pds-datepicker__dialog--range{display:-ms-flexbox;display:flex;padding:0}.pds-datepicker__panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0}.pds-datepicker__dialog--range .pds-datepicker__panel{padding:var(--pine-dimension-sm)}.pds-datepicker__months{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-lg)}.pds-datepicker__presets-column{-webkit-border-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-inline-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-ms-flex:none;flex:none;position:relative;width:var(--pds-datepicker-presets-width)}.pds-datepicker__presets{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pine-dimension-2xs);inset:0;list-style:none;margin:0;overflow-y:auto;padding:var(--pine-dimension-150);position:absolute}.pds-datepicker__preset{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body);gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-xs) var(--pine-dimension-sm);text-align:start;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:100%}.pds-datepicker__preset:hover:not(:disabled){background:var(--pine-color-background-muted)}.pds-datepicker__preset:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__preset:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__preset--selected{background:var(--pine-color-background-muted);color:var(--pine-color-text-active)}.pds-datepicker__footer{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-overlay);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-xs);inset-block-end:calc(var(--pine-dimension-sm) * -1);-ms-flex-pack:end;justify-content:flex-end;margin-block:var(--pine-dimension-sm) calc(var(--pine-dimension-sm) * -1);padding-block:var(--pine-dimension-sm);position:-webkit-sticky;position:sticky}.pds-datepicker__selection{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);-webkit-margin-end:auto;margin-inline-end:auto}.pds-datepicker__dropdowns{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-datepicker__select-wrap{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;position:relative}.pds-datepicker__heading-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text);cursor:pointer;field-sizing:content;font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold);padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs) calc(var(--pine-dimension-xs) + var(--pine-dimension-sm))}.pds-datepicker__heading-select:hover{background:var(--pine-color-background-muted)}.pds-datepicker__heading-select:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__select-caret{color:var(--pine-color-text-secondary);inset-inline-end:var(--pine-dimension-xs);pointer-events:none;position:absolute}.pds-datepicker__time{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-before:var(--pine-dimension-sm);margin-block-start:var(--pine-dimension-sm);padding-inline:var(--pine-dimension-xs)}.pds-datepicker__time-label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium)}.pds-datepicker__time-field{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-md);display:-ms-inline-flexbox;display:inline-flex;min-height:var(--pine-dimension-400);padding-inline:var(--pine-dimension-2xs)}.pds-datepicker__time-field:hover{border-color:var(--pine-color-border-hover)}.pds-datepicker__time-field:focus-within{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__time-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-strong);cursor:pointer;font:var(--pine-typography-body);font-variant-numeric:tabular-nums;padding:var(--pine-dimension-2xs);text-align:center}.pds-datepicker__time-select:focus-visible{background:var(--pine-color-background-muted);outline:none}.pds-datepicker__time-select--period{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-datepicker__time-separator{color:var(--pine-color-text-secondary)}:host-context([data-theme=dark]) select{color-scheme:dark}.pds-datepicker__action{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body-medium);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-sm)}.pds-datepicker__action:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__action:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__action:disabled{background:var(--pine-color-secondary-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__action--primary{background:var(--pine-color-primary);border-color:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__action--primary:hover:not(:disabled){background:var(--pine-color-primary-hover);border-color:var(--pine-color-primary-hover)}.pds-datepicker__action--primary:disabled{background:var(--pine-color-primary-disabled);border-color:var(--pine-color-primary-disabled);color:var(--pine-color-text-primary-disabled)}@media (max-width: 600px){.pds-datepicker__dialog--range{-ms-flex-direction:column;flex-direction:column}.pds-datepicker__presets-column{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-end:0;border-inline-end:0;width:auto}.pds-datepicker__presets{-ms-flex-direction:row;flex-direction:row;overflow-x:auto;position:static}.pds-datepicker__preset{white-space:nowrap}.pds-datepicker__selection{-ms-flex-preferred-size:100%;flex-basis:100%}}.pds-datepicker__trigger,.pds-datepicker__clear,.pds-datepicker__nav,.pds-datepicker__weekday,.pds-datepicker__day,.pds-datepicker__preset,.pds-datepicker__action{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (forced-colors: active){.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:Highlight;color:HighlightText;forced-color-adjust:none}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{border-block:var(--pine-border-width-thin) solid Highlight}.pds-datepicker__day--today::after{background:CanvasText;forced-color-adjust:none}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:HighlightText}.pds-datepicker__day--disabled{color:GrayText}}.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}'}},[65,"pds-datepicker",{applyLabel:[1,"apply-label"],autoApply:[4,"auto-apply"],cancelLabel:[1,"cancel-label"],clearable:[4],clearLabel:[1,"clear-label"],componentId:[1,"component-id"],customRangeLabel:[1,"custom-range-label"],disabled:[4],endTimeLabel:[1,"end-time-label"],errorMessage:[1,"error-message"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],fullWidth:[4,"full-width"],helperMessage:[1,"helper-message"],hideLabel:[4,"hide-label"],hourLabel:[1,"hour-label"],invalid:[4],invalidDateMessage:[1,"invalid-date-message"],maxDateMessage:[1,"max-date-message"],minDateMessage:[1,"min-date-message"],label:[1],locale:[1],max:[1],min:[1],minuteIncrement:[2,"minute-increment"],minuteLabel:[1,"minute-label"],monthLabel:[1,"month-label"],name:[1],nextMonthLabel:[1,"next-month-label"],periodLabel:[1,"period-label"],placeholder:[1],placement:[1],presets:[1],presetsLabel:[1,"presets-label"],previousMonthLabel:[1,"previous-month-label"],range:[4],readonly:[4],required:[4],showDropdowns:[4,"show-dropdowns"],startTimeLabel:[1,"start-time-label"],timePicker:[4,"time-picker"],timeLabel:[1,"time-label"],triggerLabel:[1,"trigger-label"],value:[1025],yearLabel:[1,"year-label"],isOpen:[32],text:[32],textError:[32],activeDate:[32],viewMonth:[32],draftStart:[32],draftEnd:[32],startTime:[32],endTime:[32],previewDate:[32],open:[64],close:[64],setFocus:[64]},void 0,{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}]),_e=ke,ye=function(){"undefined"!=typeof customElements&&["pds-datepicker","pds-icon","pds-input"].forEach((e=>{switch(e){case"pds-datepicker":customElements.get(n(e))||customElements.define(n(e),ke);break;case"pds-icon":customElements.get(n(e))||w();break;case"pds-input":customElements.get(n(e))||D()}}))};export{_e as PdsDatepicker,ye as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as n,transformTag as o}from"@stencil/core/internal/client";import{u as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as n,transformTag as o}from"@stencil/core/internal/client";import{u as r}from"./reconnected-content.js";const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){r(this.el.querySelector(".pds-drawer-content"),".pds-drawer-content")}render(){return n("div",{key:"b15b087506c1292f9d67e531e8d935069749c09d",class:"pds-drawer-content"},n("slot",{key:"9c60ca75c7905e7e994f9c41eee213b962afb833"}))}get el(){return this}static get style(){return"pds-drawer-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;width:100%}.pds-drawer-content{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;height:100%;padding:var(--pine-dimension-md);width:100%}.pds-modal--scrollable pds-drawer-content{overflow-y:auto}.pds-modal:not(.pds-modal--scrollable) pds-drawer-content{overflow-y:visible}"}},[260,"pds-drawer-content"]),s=d,c=function(){"undefined"!=typeof customElements&&["pds-drawer-content"].forEach((e=>{"pds-drawer-content"===e&&(customElements.get(o(e))||customElements.define(o(e),d))}))};export{s as PdsDrawerContent,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as r,h as o,transformTag as t}from"@stencil/core/internal/client";import{u as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,h as o,transformTag as t}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const s=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){d(this.el.querySelector(".pds-drawer__footer"),".pds-drawer__footer")}render(){return o("footer",{key:"a4eec0aff617c605b94f8d3b9ec1e2d98cded6fb",class:"pds-drawer__footer"},o("slot",{key:"6dc379c940e37edfd05d99728be9dff58ca1d717"}))}get el(){return this}static get style(){return"pds-drawer-footer{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__footer{-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-sm);-ms-flex-pack:end;justify-content:flex-end;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-footer"]),n=s,i=function(){"undefined"!=typeof customElements&&["pds-drawer-footer"].forEach((e=>{"pds-drawer-footer"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))};export{n as PdsDrawerFooter,i as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as r,h as d,transformTag as t}from"@stencil/core/internal/client";import{u as s}from"./reconnected-content.js";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){s(this.el.querySelector(".pds-drawer__header"),".pds-drawer__header")}render(){return d("header",{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,h as d,transformTag as t}from"@stencil/core/internal/client";import{u as s}from"./reconnected-content.js";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){s(this.el.querySelector(".pds-drawer__header"),".pds-drawer__header")}render(){return d("header",{key:"6b9338e5dbf7a7e580c11b28c95ca53693528382",class:"pds-drawer__header"},d("slot",{key:"0990fbcf94c0c438b98cf1e8945f1e2fd9aa33dc"}))}get el(){return this}static get style(){return"pds-drawer-header{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__header{-ms-flex-align:center;align-items:center;-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-header"]),n=o,a=function(){"undefined"!=typeof customElements&&["pds-drawer-header"].forEach((e=>{"pds-drawer-header"===e&&(customElements.get(t(e))||customElements.define(t(e),o))}))};export{n as PdsDrawerHeader,a as defineCustomElement}
|
package/components/pds-drawer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as d,HTMLElement as s,createEvent as e,h as r,Host as t,transformTag as a}from"@stencil/core/internal/client";import{
|
|
1
|
+
import{proxyCustomElement as d,HTMLElement as s,createEvent as e,h as r,Host as t,transformTag as a}from"@stencil/core/internal/client";import{a as o,c as p}from"./closest.js";import{u as i}from"./reconnected-content.js";import{d as n}from"./pds-modal2.js";const l=".pds-popover, .pds-tooltip, .pds-combobox-dropdown-portal",c=d(class extends s{constructor(d){super(),!1!==d&&this.__registerHost(),this.pdsDrawerOpen=e(this,"pdsDrawerOpen",7),this.pdsDrawerClose=e(this,"pdsDrawerClose",7),this.open=!1,this.side="end",this.size="md",this.scrollable=!0,this.lightDismiss=!0,this.initialFocus="auto"}componentDidRender(){i(this.el.querySelector("pds-modal.pds-drawer__modal .pds-modal"),"pds-modal.pds-drawer__modal",".pds-modal")}handleModalClose(d){d.target===this.modalEl&&(this.open=!1,this.pdsDrawerClose.emit())}handleModalOpen(d){d.target===this.modalEl&&this.pdsDrawerOpen.emit()}handleOutsidePointerDown(d){if(!this.lightDismiss||!this.open)return;const s=d.target;if(!s)return;if(this.el.contains(s))return;if(s.closest(l))return;const e=s.closest(".pds-datepicker-calendar-portal"),r=null==e?void 0:e.pdsDatepicker;r&&(o(this.el,r)||p(l,r))||s.closest("pds-modal")||(this.open=!1)}render(){return r(t,{key:"166bc90b45d29f64f11b6840e7c6ae798bf14261",class:{"pds-drawer":!0,["pds-drawer--"+this.side]:!0,["pds-drawer--"+this.size]:!0}},r("pds-modal",{key:"2faa1cee1f34a85e9df0cabb8e78803982414982",class:"pds-drawer__modal",ref:d=>this.modalEl=d,componentId:this.componentId,open:this.open,scrollable:this.scrollable,disableTopLayer:!0,backdropDismiss:this.lightDismiss,disableInitialFocus:"none"===this.initialFocus},r("slot",{key:"93968e612756c398f6d1faf9383f6c88c420da28"})))}get el(){return this}static get style(){return".pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch;background-color:transparent;pointer-events:none}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-drawer__modal>.pds-modal__backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}.pds-drawer__modal>.pds-modal__backdrop[aria-modal]::before{content:none}.pds-drawer__modal>.pds-modal__backdrop>.pds-modal{border-radius:0;height:100%;margin:0;max-height:100%;max-width:100%;pointer-events:auto;width:var(--pds-drawer-width, 500px)}.pds-drawer{display:contents}.pds-drawer.pds-drawer--end .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:end;justify-content:flex-end}.pds-drawer.pds-drawer--start .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:start;justify-content:flex-start}.pds-drawer.pds-drawer--sm{--pds-drawer-width:360px}.pds-drawer.pds-drawer--md{--pds-drawer-width:500px}"}},[260,"pds-drawer",{componentId:[1,"component-id"],open:[1028],side:[1],size:[1],scrollable:[4],lightDismiss:[4,"light-dismiss"],initialFocus:[1,"initial-focus"]},[[0,"pdsModalClose","handleModalClose"],[0,"pdsModalOpen","handleModalOpen"],[5,"pointerdown","handleOutsidePointerDown"]]]),m=c,h=function(){"undefined"!=typeof customElements&&["pds-drawer","pds-modal"].forEach((d=>{switch(d){case"pds-drawer":customElements.get(a(d))||customElements.define(a(d),c);break;case"pds-modal":customElements.get(a(d))||n()}}))};export{m as PdsDrawer,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as i,h as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,h as s,Host as e,transformTag as n}from"@stencil/core/internal/client";import{s as o}from"./attributes.js";import{a as d,c as r,o as a,f as h,s as l}from"./floating-ui.dom.js";import{d as c}from"./pds-box2.js";const p=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.menuItems=[],this.cleanupAutoUpdate=null,this.triggerObserver=null,this.currentFocusIndex=-1,this.placement="bottom-start",this.handleTriggerSlotChange=t=>{this.slotEl=t.target;const i=this.slotEl.assignedElements();this.triggerEl=i[0],this.triggerEl&&(this.triggerEl.onclick=this.handleClick,this.syncTriggerAria()),this.observeTrigger()},this.syncTriggerAria=()=>{this.triggerEl&&o(this.triggerEl,{"aria-haspopup":"menu","aria-expanded":this.isOpen+""})},this.handleSlotChange=t=>{this.slotEl=t.target;const i=this.slotEl.assignedElements(),s=["pds-dropdown-menu-item","pds-dropdown-menu-separator","a","button"],e=i.filter((t=>!s.includes(t.tagName.toLowerCase())));if(e.length>0){const t=e.map((t=>t.tagName.toLowerCase())).join(", ");console.warn(`pds-dropdown-menu: Unexpected element(s) found: ${t}. Expected: `+s.join(", "))}this.menuItems=i.filter((t=>{const i=t.tagName.toLowerCase();return"pds-dropdown-menu-item"===i||"a"===i||"button"===i}))},this.toggleDropdown=()=>{this.isOpen=!this.isOpen,this.isOpen?this.openDropdown():this.closeDropdown()},this.openDropdown=()=>{var t;const i=()=>{r(this.triggerEl,this.panelEl,{placement:this.placement,strategy:"fixed",middleware:[a(6),h(),l({padding:5})]}).then((({x:t,y:i})=>{Object.assign(this.panelEl.style,{left:t+"px",top:i+"px"})}))};i(),this.cleanupAutoUpdate=d(this.triggerEl,this.panelEl,i),null===(t=this.host.shadowRoot)||void 0===t||t.querySelector("pds-box").classList.remove("is-hidden"),this.isOpen=!0,this.syncTriggerAria()},this.closeDropdown=()=>{var t;null===(t=this.host.shadowRoot)||void 0===t||t.querySelector("pds-box").classList.add("is-hidden"),this.isOpen=!1,this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.syncTriggerAria(),this.currentFocusIndex=-1,this.isFocusInMenu()&&this.triggerEl.focus()},this.handleClick=()=>{this.toggleDropdown()}}componentDidRender(){var t;this.panelEl=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("pds-box")}connectedCallback(){this.observeTrigger(),this.syncTriggerAria()}disconnectedCallback(){var t;this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),null===(t=this.triggerObserver)||void 0===t||t.disconnect(),this.triggerObserver=null}observeTrigger(){var t;null===(t=this.triggerObserver)||void 0===t||t.disconnect(),this.triggerObserver=null,this.triggerEl&&"undefined"!=typeof MutationObserver&&(this.triggerObserver=new MutationObserver(this.syncTriggerAria),this.triggerObserver.observe(this.triggerEl,{attributes:!0,attributeFilter:["aria-haspopup","aria-expanded"]}))}isFocusInMenu(){const t=this.host.getRootNode().activeElement;return null!=t&&this.host.contains(t)}isItemDisabled(t){const i=t.tagName.toLowerCase();return"pds-dropdown-menu-item"===i||"button"===i?t.disabled:"a"===i&&"true"===t.getAttribute("aria-disabled")}getFocusedItemIndex(){const t=document.activeElement;return t?this.menuItems.findIndex((i=>{if(i===t)return!0;if("pds-dropdown-menu-item"===i.tagName.toLowerCase()){const s=i.shadowRoot;if(null==s?void 0:s.contains(t))return!0}return!1})):-1}focusItemByIndex(t){var i,s,e,n,o;if(t>=0&&t<this.menuItems.length){this.currentFocusIndex=t;const d=this.menuItems[t];if("pds-dropdown-menu-item"===d.tagName.toLowerCase()){const t=d,r=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("button"),a=(null===(n=null===(e=null===(s=t.shadowRoot)||void 0===s?void 0:s.querySelector("pds-link"))||void 0===e?void 0:e.shadowRoot)||void 0===n?void 0:n.querySelector("a"))||(null===(o=t.shadowRoot)||void 0===o?void 0:o.querySelector("a"));r?r.focus():a?a.focus():t.focus()}else d.focus()}}focusNextItem(){let t=(this.currentFocusIndex+1)%this.menuItems.length,i=0;const s=this.menuItems.length;for(;i<s&&this.isItemDisabled(this.menuItems[t]);)t=(t+1)%this.menuItems.length,i++;i<s&&this.focusItemByIndex(t)}focusPreviousItem(){let t=this.currentFocusIndex<=0?this.menuItems.length-1:this.currentFocusIndex-1,i=0;const s=this.menuItems.length;for(;i<s&&this.isItemDisabled(this.menuItems[t]);)t=t<=0?this.menuItems.length-1:t-1,i++;i<s&&this.focusItemByIndex(t)}handleKeyDown(t){if(this.isOpen)switch(t.key){case"Escape":t.preventDefault(),this.closeDropdown();break;case"ArrowDown":t.preventDefault(),this.focusNextItem();break;case"ArrowUp":t.preventDefault(),this.focusPreviousItem();break;case"Home":if(t.preventDefault(),this.menuItems.length>0){let t=0;for(;t<this.menuItems.length&&this.isItemDisabled(this.menuItems[t]);)t++;t<this.menuItems.length&&this.focusItemByIndex(t)}break;case"End":if(t.preventDefault(),this.menuItems.length>0){let t=this.menuItems.length-1;for(;t>=0&&this.isItemDisabled(this.menuItems[t]);)t--;t>=0&&this.focusItemByIndex(t)}break;case"Tab":if(t.shiftKey)this.getFocusedItemIndex()>0&&(t.preventDefault(),this.focusPreviousItem());else{const i=document.activeElement===this.triggerEl,s=this.getFocusedItemIndex();if(i&&this.menuItems.length>0){t.preventDefault();let i=0;for(;i<this.menuItems.length&&this.isItemDisabled(this.menuItems[i]);)i++;i<this.menuItems.length&&this.focusItemByIndex(i)}else if(-1===s&&this.menuItems.length>0){t.preventDefault();let i=0;for(;i<this.menuItems.length&&this.isItemDisabled(this.menuItems[i]);)i++;i<this.menuItems.length&&this.focusItemByIndex(i)}else-1!==s&&(t.preventDefault(),this.focusNextItem())}}}handleWindowClick(t){this.isOpen&&!this.host.contains(t.target)&&t.target!==this.triggerEl&&this.closeDropdown()}render(){return s(e,{key:"9d67972cf15c22bc666c32b86dcd8f143160ee0a",id:this.componentId},s("slot",{key:"e9cbc0612ce0e8c2bf55e1dc7930eda075fcc173",name:"trigger",onSlotchange:this.handleTriggerSlotChange}),s("pds-box",{key:"6fed3f11cf962a97f8ebb3cc69bd76efb425c464","border-radius":"sm",display:"flex",direction:"column",class:"pds-dropdown-menu--panel is-hidden",shadow:"100",role:"menu","aria-orientation":"vertical",part:"menu-panel"},s("slot",{key:"b8757512713b913f3ee56d9518897e7ed3c3b830",onSlotchange:this.handleSlotChange})))}get host(){return this}static get style(){return":host{display:block}.is-hidden{display:none}.pds-dropdown-menu--panel{background-color:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-xs);left:var(--pine-dimension-none);min-width:170px;padding:var(--pine-dimension-xs);position:fixed;z-index:var(--pine-z-index-overlay)}:host-context([data-theme=dark]) .pds-dropdown-menu--panel{border:var(--pine-border)}::slotted(a),::slotted(button){-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) !important;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text) !important;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium) !important;gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px) !important;padding:var(--pine-dimension-xs) !important;text-align:start;text-decoration:none !important;width:calc(100% - (var(--pine-border-width) + 2px) * 2)}::slotted(.destructive){color:var(--pine-color-danger) !important}::slotted([aria-disabled=true]),::slotted([disabled]:not([disabled=false])){cursor:not-allowed;opacity:0.5;pointer-events:none}"}},[257,"pds-dropdown-menu",{componentId:[1,"component-id"],placement:[1],currentFocusIndex:[32]},[[8,"keydown","handleKeyDown"],[8,"click","handleWindowClick"]]]),u=p,m=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu","pds-box"].forEach((t=>{switch(t){case"pds-dropdown-menu":customElements.get(n(t))||customElements.define(n(t),p);break;case"pds-box":customElements.get(n(t))||c()}}))};export{u as PdsDropdownMenu,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,h as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,h as t,Host as a,transformTag as n}from"@stencil/core/internal/client";import{H as r}from"./attributes.js";import{r as o}from"./reflected-attribute-default.js";const s=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.hostKeeper=new r,this.isLoading=!0,this.showLabel=!1,this.size="md",this.variant="spinner",this.getSvgStyle=()=>{if(void 0!==this.size)return{height:this.loaderSize(),width:this.loaderSize()}}}connectedCallback(){this.hostKeeper.connect(this.el)}disconnectedCallback(){this.hostKeeper.disconnect()}restoreSizeDefault(e){this.size=o(this.el,"size",e,"md")}loaderSize(){const e={xs:"24px",sm:"32px",md:"48px",lg:"64px",xl:"80px"};return e[this.size]?e[this.size]:this.size}render(){const e="pds-loader "+(this.isLoading?"":"pds-loader--hidden"),i={"aria-hidden":this.isLoading?null:"true","aria-busy":this.isLoading?"true":null,"aria-live":"polite"};return this.hostKeeper.record(e,{},i),t(a,Object.assign({key:"81f97b8a6adf4d2c0e5516aa2af9054e200629e1",class:e},i),"spinner"===this.variant&&t("div",{key:"6e25806c83d6ddeb1141acdd083654867c6ff8a2",class:"pds-loader--spinner"},t("svg",{key:"4798f27facfcf57da8d408319527fc6083489107",style:this.getSvgStyle(),viewBox:"0 0 200 200",fill:"none",part:"loader-svg"},t("defs",{key:"0c64abfabc18ccd51ef41017e088f6ec10736d61"},t("linearGradient",{key:"3aa61edf6250dc827bf925938b69008860f96596",id:"spinner-secondHalf"},t("stop",{key:"2693d8a866492ef4ca98cbc4beb5f9f1a34a8b52",offset:"0%","stop-opacity":"0","stop-color":"currentColor"}),t("stop",{key:"ae229fdc73733e4d6ab15a6663e67b574bd49b40",offset:"100%","stop-opacity":"0.5","stop-color":"currentColor"})),t("linearGradient",{key:"8ddbb46a1a387113d74a82cc4e3e0e9c7e12d573",id:"spinner-firstHalf"},t("stop",{key:"d166a3c1ae37c3afa898351683b07f5c4d0ee906",offset:"0%","stop-opacity":"1","stop-color":"currentColor"}),t("stop",{key:"e4c9790bc9a645d752aa56c238fb8708310208b5",offset:"100%","stop-opacity":"0.5","stop-color":"currentColor"}))),t("g",{key:"8b3897ff925d4207f9060e2fb69afa657b1b8fe3",class:"pds-loader__spinner-path"},t("path",{key:"603ef195d1fc64d2059d9fbfeb9b14e2bdb1cabe",stroke:"url(#spinner-secondHalf)",d:"M 4 100 A 96 96 0 0 1 196 100"}),t("path",{key:"a649ac9538248f5a22d48008377e18f4407efad9",stroke:"url(#spinner-firstHalf)",d:"M 196 100 A 96 96 0 0 1 4 100"}),t("path",{key:"37f3772b61d1459959cc4d8c0b5c729dbd6953ff",stroke:"currentColor","stroke-linecap":"round",d:"M 4 100 A 96 96 0 0 1 4 98"})))),"typing"===this.variant&&t("div",{key:"e510c2e6498a5542ce6e6573fdc03e8770121cd7",class:"pds-loader--typing"},t("span",{key:"bbf4f5a328175f06b221d9abc73118505a09455d"}),t("span",{key:"9a7e80b28e1455ef9d0c1bdb330a6425a3037709"}),t("span",{key:"f8aa1eb4f822a6d0e2a14a982bbe99866a97815b"})),t("div",{key:"3492189495798a2ea861d0dcb460f1b25d43d565",class:"pds-loader__label "+(this.showLabel?"":"pds-loader--hidden")},t("slot",{key:"c1a19415b513a2a5f76a53d64b0ef5fbb4a5d100",name:"label"},"Loading...")))}get el(){return this}static get watchers(){return{size:[{restoreSizeDefault:0}]}}static get style(){return":host{--loader-color:var(--pine-color-primary);-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-muted);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)}"}},[257,"pds-loader",{isLoading:[4,"is-loading"],showLabel:[4,"show-label"],size:[1537],variant:[1]},void 0,{size:[{restoreSizeDefault:0}]}]);function d(){"undefined"!=typeof customElements&&["pds-loader"].forEach((e=>{"pds-loader"===e&&(customElements.get(n(e))||customElements.define(n(e),s))}))}export{s as P,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as o,h as e,Host as s,transformTag as n}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const i=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.border="none",this.contentMaxHeight="none",this.userSetBorder=!1}componentDidRender(){d(this.el.querySelector(".pds-modal-content"),".pds-modal-content")}componentWillLoad(){const t=this.el.getAttribute("border");this.userSetBorder=null!==t||"none"!==this.border}componentDidLoad(){this.calculateMaxHeight(),window.addEventListener("resize",this.handleResize.bind(this)),this.userSetBorder||setTimeout((()=>{this.el.addEventListener("scroll",this.handleScroll.bind(this)),setTimeout((()=>this.updateBorders()),100)}),100)}disconnectedCallback(){window.removeEventListener("resize",this.handleResize.bind(this)),this.userSetBorder||this.el.removeEventListener("scroll",this.handleScroll.bind(this)),this.mutationObserver&&this.mutationObserver.disconnect()}handleScroll(){this.updateBorders()}handleResize(){this.calculateMaxHeight(),setTimeout((()=>this.updateBorders()),50)}updateBorders(){if(this.userSetBorder)return;const t=this.el.closest("pds-modal");if(!t)return;if(!1===t.scrollable)return void(this.border="none");const o=this.el;if(!(o.scrollHeight>o.clientHeight))return void(this.border="none");const{scrollTop:e,scrollHeight:s,clientHeight:n}=o,d=e<=3,i=e+n>=s-3;this.border=d&&i?"none":d&&!i?"bottom":!d&&i?"top":"both"}calculateMaxHeight(){const t=this.el.closest("pds-modal");if(!t)return;const o=!1!==t.scrollable;setTimeout((()=>{if(!o){this.contentMaxHeight="none";const t=this.el.querySelector(".pds-modal-content");return void(t&&(t.style.maxHeight="none"))}const e=t.querySelector("pds-modal-header"),s=t.querySelector("pds-modal-footer"),n=e?e.offsetHeight:0,d=s?s.offsetHeight:0;if(n>0||d>0){const t=Math.round(.06*window.innerHeight);this.contentMaxHeight=`calc(100vh - ${n+d+48+t+50}px)`;const o=this.el.querySelector(".pds-modal-content");o&&(o.style.maxHeight=this.contentMaxHeight)}else this.contentMaxHeight="none";setTimeout((()=>this.updateBorders()),150)}),100),!this.mutationObserver&&t&&(this.mutationObserver=new MutationObserver((()=>{this.calculateMaxHeight()})),this.mutationObserver.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}))}render(){const t="none"!==this.contentMaxHeight?{maxHeight:this.contentMaxHeight}:{};return e(s,{key:"f66dbdd08d6af3f87b0a6e8f30e1948b2f674e34"},e("div",{key:"ac0469cbfe48002d5bc7f401e0dc30926cfd4421",class:{"pds-modal-content":!0,["pds-modal-content--border-"+this.border]:!0},style:t,tabindex:"-1"},e("slot",{key:"26a8a45ab4dcd0349da68304fa3cacc64603208a"})))}get el(){return this}static get style(){return"pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;width:100%}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-none){border:0}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-both){-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle);-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle)}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-top){-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle)}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-bottom){-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle)}.pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;width:100%}"}},[260,"pds-modal-content",{border:[1537],contentMaxHeight:[32]}]),r=i,l=function(){"undefined"!=typeof customElements&&["pds-modal-content"].forEach((t=>{"pds-modal-content"===t&&(customElements.get(n(t))||customElements.define(n(t),i))}))};export{r as PdsModalContent,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as o,h as t,transformTag as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as o,h as t,transformTag as d}from"@stencil/core/internal/client";import{u as s}from"./reconnected-content.js";const r=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){s(this.el.querySelector(".pds-modal__footer"),".pds-modal__footer")}render(){return t("footer",{key:"1148892c2d6b9a461f6c04a670fceda76c1be53a",class:"pds-modal__footer"},t("slot",{key:"ccd754674c82c415f8c056c9dda6327df35dbd03"}))}get el(){return this}static get style(){return"pds-modal-footer{display:block;width:100%}.pds-modal__footer{width:100%}"}},[260,"pds-modal-footer"]),c=r,n=function(){"undefined"!=typeof customElements&&["pds-modal-footer"].forEach((e=>{"pds-modal-footer"===e&&(customElements.get(d(e))||customElements.define(d(e),r))}))};export{c as PdsModalFooter,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as d,h as t,transformTag as s}from"@stencil/core/internal/client";import{u as r}from"./reconnected-content.js";const o=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){r(this.el.querySelector(".pds-modal__header"),".pds-modal__header")}render(){return t("header",{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as d,h as t,transformTag as s}from"@stencil/core/internal/client";import{u as r}from"./reconnected-content.js";const o=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){r(this.el.querySelector(".pds-modal__header"),".pds-modal__header")}render(){return t("header",{key:"030153b84f1ea1cb133c9ccec3ad86583995974f",class:"pds-modal__header"},t("slot",{key:"3a479e7047f3e845a65c37d60539648c8ff78602"}))}get el(){return this}static get style(){return"pds-modal-header{display:block;width:100%}.pds-modal__header{width:100%}"}},[260,"pds-modal-header"]),a=o,c=function(){"undefined"!=typeof customElements&&["pds-modal-header"].forEach((e=>{"pds-modal-header"===e&&(customElements.get(s(e))||customElements.define(s(e),o))}))};export{a as PdsModalHeader,c as defineCustomElement}
|
package/components/pds-modal2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as i,HTMLElement as t,createEvent as o,h as e,transformTag as s}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const a=["sm","md","lg","fullscreen"],n=i(class extends t{constructor(i){super(),!1!==i&&this.__registerHost(),this.pdsModalOpen=o(this,"pdsModalOpen",7),this.pdsModalClose=o(this,"pdsModalClose",7),this.focusableElements=[],this.backdropDismiss=!0,this.open=!1,this.size="md",this.scrollable=!0,this.disableTopLayer=!1,this.disableInitialFocus=!1,this.focusableElementsArray=[],this.handleBackdropClick=i=>{this.backdropDismiss&&this.open&&i.target.classList.contains("pds-modal__backdrop")&&(i.stopPropagation(),this.isInnermostModal()&&this.hideModal())},this.handleKeyDown=i=>{var t,o,e;if(this.open){if("Escape"===i.key){const s=i;if(!("__pdsActiveElementAtEscape"in s)){const i=document.activeElement;s.__pdsActiveElementAtEscape=i;const o=null!==(t=null==i?void 0:i.closest("dialog"))&&void 0!==t?t:null;s.__pdsTopLayerDialogAtEscape=o,s.__pdsTopLayerDialogWasModalAtEscape=!(!o||!o.matches(":modal"))}const d=s.__pdsActiveElementAtEscape;if(this.disableTopLayer&&d&&d!==document.body&&!this.el.contains(d)&&this.isStackedAboveOverlay(d,null!==(o=s.__pdsTopLayerDialogAtEscape)&&void 0!==o?o:null,null!==(e=s.__pdsTopLayerDialogWasModalAtEscape)&&void 0!==e&&e))return;return i.preventDefault(),void(this.backdropDismiss&&this.isInnermostModal()&&this.hideModal())}if("Tab"===i.key){if(this.disableTopLayer)return;if(this.updateFocusableElements(),0===this.focusableElements.length)return;const t=this.focusableElements[0],o=this.focusableElements[this.focusableElements.length-1],e=document.activeElement,s=e===t||t.contains(e),d=e===o||o.contains(e);i.shiftKey&&s?(i.preventDefault(),this.focusElement(o)):!i.shiftKey&&d&&(i.preventDefault(),this.focusElement(t))}}}}componentWillLoad(){this.warnOnInvalidSize()}sizeChanged(){this.warnOnInvalidSize()}componentDidLoad(){this.modalRef=this.el.querySelector(".pds-modal__backdrop"),document.addEventListener("keydown",this.handleKeyDown),this.open&&this.showModal()}componentDidRender(){d(this.el.querySelector(".pds-modal"),"dialog.pds-modal__backdrop",".pds-modal")}disconnectedCallback(){document.removeEventListener("keydown",this.handleKeyDown)}handleOpenChange(i){i?this.showModal():this.hideModal()}updateFocusableElements(){if(!this.modalRef)return;const i=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"pds-button:not([disabled])","pds-link:not([disabled])","pds-input:not([disabled])","pds-checkbox:not([disabled])","pds-radio:not([disabled])","pds-switch:not([disabled])","pds-select:not([disabled])"].join(",");this.focusableElements=Array.from(this.modalRef.querySelectorAll(i)),this.focusableElements=this.focusableElements.filter((i=>{if("function"==typeof i.checkVisibility)return i.checkVisibility({checkVisibilityCSS:!0});const t=window.getComputedStyle(i);return"none"!==t.display&&"hidden"!==t.visibility}))}setInitialFocus(){0!==this.focusableElements.length&&this.focusElement(this.focusableElements[0])}focusElement(i){if(i)try{i.focus(),setTimeout((()=>{if(document.activeElement!==i&&i.shadowRoot){const t=i.shadowRoot.querySelector("button, [tabindex], input, a[href]");t&&t.focus()}}),0)}catch(i){console.error("Error focusing element:",i)}}async showModal(){if(this.modalRef)try{this.previousActiveElement=document.activeElement,this.disableTopLayer?this.modalRef.show():this.modalRef.showModal(),this.open=!0,setTimeout((()=>{var i,o;if(this.updateFocusableElements(),this.disableInitialFocus){const e=document.activeElement;null!==e&&e!==document.body&&!(null===(i=this.modalRef)||void 0===i?void 0:i.contains(e))||(this.previousActiveElement!==document.body&&"function"==typeof(null===(o=this.previousActiveElement)||void 0===o?void 0:o.focus)?this.previousActiveElement.focus():e instanceof t&&e.blur())}else this.setInitialFocus();this.pdsModalOpen.emit()}),100)}catch(i){console.error("Failed to show modal:",i)}}async hideModal(){if(this.modalRef)try{const i=document.activeElement,t=null!==i&&i!==document.body&&!this.modalRef.contains(i);this.modalRef.close(),this.open=!1,!t&&this.previousActiveElement&&"function"==typeof this.previousActiveElement.focus&&this.previousActiveElement.focus(),this.pdsModalClose.emit()}catch(i){console.error("Failed to hide modal:",i)}}getBackdropZIndex(i){const t=i.querySelector(".pds-modal__backdrop");return t?parseInt(getComputedStyle(t).zIndex,10):-1}isStackedAboveOverlay(i,t,o){if(t&&t!==this.modalRef&&o)return!0;const e=this.getBackdropZIndex(this.el);let s=i;for(;s&&s!==document.body;){const i=getComputedStyle(s),t=parseInt(i.zIndex,10);if("static"!==i.position&&!isNaN(t)&&t>e)return!0;s=s.parentElement}return!1}isInnermostModal(){const i=Array.from(document.querySelectorAll("pds-modal")).filter((i=>i.open));if(0===i.length)return!1;if(!this.el.querySelector(".pds-modal__backdrop"))return!1;const t=i.map((i=>this.getBackdropZIndex(i))),o=Math.max(...t);return this.getBackdropZIndex(this.el)===o}resolveSize(){var i;const t=(null!==(i=this.size)&&void 0!==i?i:"").trim()||"md";return a.includes(t)?[t]:/^[a-z0-9.%+\-*/(), ]+$/i.test(o=t)&&/\d/.test(o)&&("undefined"==typeof CSS||CSS.supports("max-width",o))?["custom",t]:[void 0];var o}warnOnInvalidSize(){void 0===this.resolveSize()[0]&&console.warn(`pds-modal: invalid size "${String(this.size).slice(0,50)}", using md`)}render(){const[i="md",t]=this.resolveSize();return e("dialog",{key:"aa352ccc057e4d6183f8c17349bc71857208a928",class:{"pds-modal__backdrop":!0,open:this.open},"aria-modal":this.disableTopLayer?"false":"true","aria-labelledby":`${this.componentId}-heading`,onClick:this.handleBackdropClick},e("div",{key:"12799824edbeea42a6f7f91e0172c6ecbde93337",class:{"pds-modal":!0,[`pds-modal--${i}`]:!0,"pds-modal--scrollable":this.scrollable},style:void 0!==t?{"--pds-modal-max-width":t}:void 0,part:"modal"},e("slot",{key:"f517c6466d65f141fba2d41cfe36d1b8d5f29930"})))}get el(){return this}static get watchers(){return{size:[{sizeChanged:0}],open:[{handleOpenChange:0}]}}static get style(){return'.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 var(--pine-motion-duration-base) var(--pine-motion-easing-in), visibility var(--pine-motion-duration-base) var(--pine-motion-easing-in);transition:opacity var(--pine-motion-duration-base) var(--pine-motion-easing-in), visibility var(--pine-motion-duration-base) var(--pine-motion-easing-in);visibility:hidden;width:100%;z-index:var(--pine-z-index-modal)}@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:var(--pine-z-index-priority)}.pds-modal__backdrop::-webkit-backdrop{background:transparent}.pds-modal__backdrop::-ms-backdrop{background:transparent}.pds-modal__backdrop::backdrop{background:transparent}.pds-modal__backdrop[aria-modal=false]{overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-modal__backdrop[aria-modal=false]{-webkit-backdrop-filter:none;backdrop-filter:none}.pds-modal__backdrop[aria-modal=false]::before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);content:"";inset:0;position:fixed;z-index:-1}}.pds-modal__backdrop.open{opacity:1;-webkit-transition-timing-function:var(--pine-motion-easing-out);transition-timing-function:var(--pine-motion-easing-out);visibility:visible}.pds-modal{background:var(--pine-color-background-overlay);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:none;width:100%}.pds-modal.pds-modal--scrollable{max-height:calc(100vh - (5vh + 96px))}@supports (height: 100dvh){.pds-modal.pds-modal--scrollable{max-height:calc(100dvh - (5dvh + 96px))}}@media (min-width: 992px){.pds-modal{-webkit-margin-before:6vh;margin-block-start:6vh}@supports (height: 100dvh){.pds-modal{-webkit-margin-before:6dvh;margin-block-start:6dvh}}}@media (min-width: 1200px){.pds-modal{-webkit-margin-before:8vh;margin-block-start:8vh}@supports (height: 100dvh){.pds-modal{-webkit-margin-before:8dvh;margin-block-start:8dvh}}}.pds-modal--sm{max-width:520px}.pds-modal--md{max-width:700px}.pds-modal--lg{max-width:900px}.pds-modal--custom{max-width:var(--pds-modal-max-width, 700px)}.pds-modal--fullscreen{border-radius:0;height:100%;margin:0;max-height:100vh;max-width:100%}@supports (height: 100dvh){.pds-modal--fullscreen{max-height:100dvh}}.pds-modal--fullscreen.pds-modal--scrollable{max-height:100vh}@supports (height: 100dvh){.pds-modal--fullscreen.pds-modal--scrollable{max-height:100dvh}}.pds-modal--fullscreen .pds-modal-content{-ms-flex:1;flex:1}.pds-modal--scrollable pds-modal-content{-webkit-border-after:1px solid transparent;border-block-end:1px solid transparent;-webkit-border-before:1px solid transparent;border-block-start:1px solid transparent;overflow-y:auto}.pds-modal:not(.pds-modal--scrollable) pds-modal-content{overflow-y:visible}'}},[260,"pds-modal",{backdropDismiss:[4,"backdrop-dismiss"],componentId:[1,"component-id"],open:[1028],size:[1],scrollable:[4],disableTopLayer:[4,"disable-top-layer"],disableInitialFocus:[4,"disable-initial-focus"],focusableElementsArray:[32],showModal:[64],hideModal:[64]},void 0,{size:[{sizeChanged:0}],open:[{handleOpenChange:0}]}]);function l(){"undefined"!=typeof customElements&&["pds-modal"].forEach((i=>{"pds-modal"===i&&(customElements.get(s(i))||customElements.define(s(i),n))}))}export{n as P,l as d}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,createEvent as o,h as e,transformTag as s}from"@stencil/core/internal/client";import{c as n}from"./closest.js";import{u as d}from"./reconnected-content.js";const a=["sm","md","lg","fullscreen"],r=["a[href]","area[href]","button",'input:not([type="hidden"])',"select","textarea","iframe","summary",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function l(t,i){for(const o of Array.from(t.children))p(o,i)}const c=t=>{var i;return t.tabIndex>=0||t.isContentEditable&&!t.hasAttribute("tabindex")&&!(null===(i=t.parentElement)||void 0===i?void 0:i.isContentEditable)};function p(t,o){var e,s,n,d;if(t.hasAttribute("inert"))return;if("slot"===t.localName){const i=t;if(0===(null!==(s=null===(e=i.assignedNodes)||void 0===e?void 0:e.call(i,{flatten:!0}))&&void 0!==s?s:[]).length)return l(t,o);for(const t of i.assignedElements({flatten:!0}))p(t,o);return}const a=!0===(null===(n=t.shadowRoot)||void 0===n?void 0:n.delegatesFocus);t instanceof i&&!a&&c(t)&&t.matches(r)&&!t.matches(":disabled")&&o.push(t),l(null!==(d=t.shadowRoot)&&void 0!==d?d:t,o)}const h=t=>t instanceof HTMLInputElement&&"radio"===t.type&&""!==t.name?t:null;function m(t,i){for(let o=i;o;o=o instanceof ShadowRoot?o.host:o.parentNode)if(o===t)return!0;return!1}const u=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.pdsModalOpen=o(this,"pdsModalOpen",7),this.pdsModalClose=o(this,"pdsModalClose",7),this.focusableElements=[],this.backdropDismiss=!0,this.open=!1,this.size="md",this.scrollable=!0,this.disableTopLayer=!1,this.disableInitialFocus=!1,this.focusableElementsArray=[],this.handleBackdropClick=t=>{this.backdropDismiss&&this.open&&t.target.classList.contains("pds-modal__backdrop")&&(t.stopPropagation(),this.isInnermostModal()&&this.hideModal())},this.handleKeyDown=t=>{var i,o,e;if(this.open){if("Escape"===t.key){const s=t;if(!("__pdsActiveElementAtEscape"in s)){const t=document.activeElement;s.__pdsActiveElementAtEscape=t;const o=null!==(i=null==t?void 0:t.closest("dialog"))&&void 0!==i?i:null;s.__pdsTopLayerDialogAtEscape=o,s.__pdsTopLayerDialogWasModalAtEscape=!(!o||!o.matches(":modal"))}const n=s.__pdsActiveElementAtEscape;if(this.disableTopLayer&&n&&n!==document.body&&!this.el.contains(n)&&this.isStackedAboveOverlay(n,null!==(o=s.__pdsTopLayerDialogAtEscape)&&void 0!==o?o:null,null!==(e=s.__pdsTopLayerDialogWasModalAtEscape)&&void 0!==e&&e))return;return t.preventDefault(),void(this.backdropDismiss&&this.isInnermostModal()&&this.hideModal())}if("Tab"===t.key){if(this.disableTopLayer)return;if(t.defaultPrevented)return;const i=function(){var t;let i=document.activeElement;for(;null===(t=null==i?void 0:i.shadowRoot)||void 0===t?void 0:t.activeElement;)i=i.shadowRoot.activeElement;return i}();if(!i||this.modalDialogAbove(i))return;if(this.updateFocusableElements(),0===this.focusableElements.length)return;const o=this.focusableElements[0],e=this.focusableElements[this.focusableElements.length-1],s=this.stopIndex(i),n=s===this.focusableElements.length-1;t.shiftKey&&0===s?(t.preventDefault(),this.focusElement(e)):!t.shiftKey&&n&&(t.preventDefault(),this.focusElement(o))}}}}componentWillLoad(){this.warnOnInvalidSize()}sizeChanged(){this.warnOnInvalidSize()}componentDidLoad(){this.modalRef=this.el.querySelector(".pds-modal__backdrop"),document.addEventListener("keydown",this.handleKeyDown),this.open&&this.showModal()}componentDidRender(){d(this.el.querySelector(".pds-modal"),"dialog.pds-modal__backdrop",".pds-modal")}disconnectedCallback(){document.removeEventListener("keydown",this.handleKeyDown)}handleOpenChange(t){t?this.showModal():this.hideModal()}updateFocusableElements(){this.modalRef&&(this.focusableElements=[],l(this.modalRef,this.focusableElements),this.focusableElements=this.focusableElements.filter((t=>{if("function"==typeof t.checkVisibility)return t.checkVisibility({checkVisibilityCSS:!0});const i=window.getComputedStyle(t);return"none"!==i.display&&"hidden"!==i.visibility})),this.focusableElements=function(t){const i=[];for(const o of t){const t=h(o);if(null===t)continue;const e=i.find((([i])=>i.name===t.name&&i.form===t.form&&i.getRootNode()===t.getRootNode()));e?e.push(t):i.push([t])}const o=new Set(i.map((t=>{var i;return null!==(i=t.find((t=>t.checked)))&&void 0!==i?i:t[0]})));return t.filter((t=>null===h(t)||o.has(t)))}(this.focusableElements))}setInitialFocus(){0!==this.focusableElements.length&&this.focusElement(this.focusableElements[0])}focusElement(t){null==t||t.focus()}async showModal(){if(this.modalRef)try{this.previousActiveElement=document.activeElement,this.disableTopLayer?this.modalRef.show():this.modalRef.showModal(),this.open=!0,setTimeout((()=>{var t,o;if(this.updateFocusableElements(),this.disableInitialFocus){const e=document.activeElement;null!==e&&e!==document.body&&!(null===(t=this.modalRef)||void 0===t?void 0:t.contains(e))||(this.previousActiveElement!==document.body&&"function"==typeof(null===(o=this.previousActiveElement)||void 0===o?void 0:o.focus)?this.previousActiveElement.focus():e instanceof i&&e.blur())}else this.setInitialFocus();this.pdsModalOpen.emit()}),100)}catch(t){console.error("Failed to show modal:",t)}}async hideModal(){if(this.modalRef)try{const t=document.activeElement,i=null!==t&&t!==document.body&&!this.modalRef.contains(t);this.modalRef.close(),this.open=!1,!i&&this.previousActiveElement&&"function"==typeof this.previousActiveElement.focus&&this.previousActiveElement.focus(),this.pdsModalClose.emit()}catch(t){console.error("Failed to hide modal:",t)}}getBackdropZIndex(t){const i=t.querySelector(".pds-modal__backdrop");return i?parseInt(getComputedStyle(i).zIndex,10):-1}isStackedAboveOverlay(t,i,o){if(i&&i!==this.modalRef&&o)return!0;const e=this.getBackdropZIndex(this.el);let s=t;for(;s&&s!==document.body;){const t=getComputedStyle(s),i=parseInt(t.zIndex,10);if("static"!==t.position&&!isNaN(i)&&i>e)return!0;s=s.parentElement}return!1}isInnermostModal(){const t=Array.from(document.querySelectorAll("pds-modal")).filter((t=>t.open));if(0===t.length)return!1;if(!this.el.querySelector(".pds-modal__backdrop"))return!1;const i=t.map((t=>this.getBackdropZIndex(t))),o=Math.max(...i);return this.getBackdropZIndex(this.el)===o}modalDialogAbove(t){var o;for(let e=n("dialog[open]",t);e instanceof i;){if(e===this.modalRef)return!1;if(e.matches(":modal"))return!0;e=n("dialog[open]",null!==(o=e.parentElement)&&void 0!==o?o:e.getRootNode().host)}return!1}stopIndex(t){const i=this.focusableElements.indexOf(t);if(i>=0)return i;for(let i=this.focusableElements.length-1;i>=0;i--)if(m(this.focusableElements[i],t))return i;return-1}resolveSize(){var t;const i=(null!==(t=this.size)&&void 0!==t?t:"").trim()||"md";return a.includes(i)?[i]:/^[a-z0-9.%+\-*/(), ]+$/i.test(o=i)&&/\d/.test(o)&&("undefined"==typeof CSS||CSS.supports("max-width",o))?["custom",i]:[void 0];var o}warnOnInvalidSize(){void 0===this.resolveSize()[0]&&console.warn(`pds-modal: invalid size "${String(this.size).slice(0,50)}", using md`)}render(){const[t="md",i]=this.resolveSize();return e("dialog",{key:"b6714c7e77d80bf2370f2170ffce029abe147d81",class:{"pds-modal__backdrop":!0,open:this.open},"aria-modal":this.disableTopLayer?"false":"true","aria-labelledby":`${this.componentId}-heading`,onClick:this.handleBackdropClick},e("div",{key:"8c3319f53dd8c79c9e952785277e9e82e28b651e",class:{"pds-modal":!0,[`pds-modal--${t}`]:!0,"pds-modal--scrollable":this.scrollable},style:void 0!==i?{"--pds-modal-max-width":i}:void 0,part:"modal"},e("slot",{key:"8c6f9cc1a20b515659344ad041512de52761800d"})))}get el(){return this}static get watchers(){return{size:[{sizeChanged:0}],open:[{handleOpenChange:0}]}}static get style(){return'.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 var(--pine-motion-duration-base) var(--pine-motion-easing-in), visibility var(--pine-motion-duration-base) var(--pine-motion-easing-in);transition:opacity var(--pine-motion-duration-base) var(--pine-motion-easing-in), visibility var(--pine-motion-duration-base) var(--pine-motion-easing-in);visibility:hidden;width:100%;z-index:var(--pine-z-index-modal)}@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:var(--pine-z-index-priority)}.pds-modal__backdrop::-webkit-backdrop{background:transparent}.pds-modal__backdrop::-ms-backdrop{background:transparent}.pds-modal__backdrop::backdrop{background:transparent}.pds-modal__backdrop[aria-modal=false]{overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-modal__backdrop[aria-modal=false]{-webkit-backdrop-filter:none;backdrop-filter:none}.pds-modal__backdrop[aria-modal=false]::before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);content:"";inset:0;position:fixed;z-index:-1}}.pds-modal__backdrop.open{opacity:1;-webkit-transition-timing-function:var(--pine-motion-easing-out);transition-timing-function:var(--pine-motion-easing-out);visibility:visible}.pds-modal{background:var(--pine-color-background-overlay);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:none;width:100%}.pds-modal.pds-modal--scrollable{max-height:calc(100vh - (5vh + 96px))}@supports (height: 100dvh){.pds-modal.pds-modal--scrollable{max-height:calc(100dvh - (5dvh + 96px))}}@media (min-width: 992px){.pds-modal{-webkit-margin-before:6vh;margin-block-start:6vh}@supports (height: 100dvh){.pds-modal{-webkit-margin-before:6dvh;margin-block-start:6dvh}}}@media (min-width: 1200px){.pds-modal{-webkit-margin-before:8vh;margin-block-start:8vh}@supports (height: 100dvh){.pds-modal{-webkit-margin-before:8dvh;margin-block-start:8dvh}}}.pds-modal--sm{max-width:520px}.pds-modal--md{max-width:700px}.pds-modal--lg{max-width:900px}.pds-modal--custom{max-width:var(--pds-modal-max-width, 700px)}.pds-modal--fullscreen{border-radius:0;height:100%;margin:0;max-height:100vh;max-width:100%}@supports (height: 100dvh){.pds-modal--fullscreen{max-height:100dvh}}.pds-modal--fullscreen.pds-modal--scrollable{max-height:100vh}@supports (height: 100dvh){.pds-modal--fullscreen.pds-modal--scrollable{max-height:100dvh}}.pds-modal--fullscreen .pds-modal-content{-ms-flex:1;flex:1}.pds-modal--scrollable pds-modal-content{-webkit-border-after:1px solid transparent;border-block-end:1px solid transparent;-webkit-border-before:1px solid transparent;border-block-start:1px solid transparent;overflow-y:auto}.pds-modal:not(.pds-modal--scrollable) pds-modal-content{overflow-y:visible}'}},[260,"pds-modal",{backdropDismiss:[4,"backdrop-dismiss"],componentId:[1,"component-id"],open:[1028],size:[1],scrollable:[4],disableTopLayer:[4,"disable-top-layer"],disableInitialFocus:[4,"disable-initial-focus"],focusableElementsArray:[32],showModal:[64],hideModal:[64]},void 0,{size:[{sizeChanged:0}],open:[{handleOpenChange:0}]}]);function b(){"undefined"!=typeof customElements&&["pds-modal"].forEach((t=>{"pds-modal"===t&&(customElements.get(s(t))||customElements.define(s(t),u))}))}export{u as P,b as d}
|