@pine-ds/core 4.3.0 → 4.4.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/closest.js +1 -1
- package/components/floating-ui.dom.js +1 -1
- package/components/i18n-format.js +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -1
- package/components/index2.js +1 -1
- package/components/mock-pds-modal.js +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +2 -2
- package/components/pds-container.js +1 -1
- package/components/pds-copytext.js +1 -1
- package/components/pds-datepicker.d.ts +11 -0
- package/components/pds-datepicker.js +1 -0
- package/components/pds-divider.js +1 -1
- package/components/pds-drawer-content.js +1 -1
- package/components/pds-drawer-footer.js +1 -1
- package/components/pds-drawer-header.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu-item.js +1 -1
- package/components/pds-dropdown-menu-separator.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-filter.js +1 -1
- package/components/pds-filters.js +1 -1
- package/components/pds-image.js +1 -1
- package/components/pds-input.js +1 -1
- package/components/pds-input2.js +1 -0
- package/components/pds-link2.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-multiselect.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-property.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-body.js +1 -1
- package/components/pds-table-cell2.js +1 -1
- package/components/pds-table-head-cell2.js +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text2.js +1 -1
- package/components/pds-textarea.js +1 -1
- package/components/pds-toast.js +1 -1
- package/components/pds-tooltip.js +1 -1
- package/components/utils.js +1 -1
- package/dist/cjs/closest-D0qyYtJ3.js +20 -0
- package/dist/cjs/{floating-ui.dom-BZk7Blsu.js → floating-ui.dom-Dc8Anyel.js} +79 -0
- package/dist/cjs/{i18n-format-CrpIhahc.js → i18n-format-BD0PmYzT.js} +1 -0
- package/dist/cjs/{index-CaLa1zy9.js → index-Bl5KnQay.js} +4 -1
- package/dist/cjs/{index-DYvijwA6.js → index-D-QQKB0y.js} +8 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mock-pds-modal.cjs.entry.js +3 -3
- package/dist/cjs/pds-accordion.cjs.entry.js +2 -2
- package/dist/cjs/pds-alert.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +2 -2
- package/dist/cjs/pds-box.cjs.entry.js +2 -2
- package/dist/cjs/pds-button.cjs.entry.js +53 -4
- package/dist/cjs/pds-checkbox.cjs.entry.js +14 -6
- package/dist/cjs/pds-chip.cjs.entry.js +6 -6
- package/dist/cjs/pds-combobox.cjs.entry.js +1225 -117
- package/dist/cjs/pds-container.cjs.entry.js +2 -2
- package/dist/cjs/pds-copytext.cjs.entry.js +5 -5
- package/dist/cjs/pds-datepicker.cjs.entry.js +1962 -0
- package/dist/cjs/pds-divider.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-content.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer-header.cjs.entry.js +2 -2
- package/dist/cjs/pds-drawer.cjs.entry.js +11 -4
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +11 -4
- package/dist/cjs/pds-filter.cjs.entry.js +3 -3
- package/dist/cjs/pds-filters.cjs.entry.js +2 -2
- package/dist/cjs/pds-icon.cjs.entry.js +1 -1
- package/dist/cjs/pds-image.cjs.entry.js +3 -3
- package/dist/cjs/pds-input.cjs.entry.js +8 -5
- package/dist/cjs/pds-link.cjs.entry.js +5 -5
- package/dist/cjs/pds-loader.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-content.cjs.entry.js +3 -3
- package/dist/cjs/pds-modal-footer.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-header.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal.cjs.entry.js +12 -6
- package/dist/cjs/pds-multiselect.cjs.entry.js +264 -51
- package/dist/cjs/pds-popover.cjs.entry.js +30 -12
- package/dist/cjs/pds-progress.cjs.entry.js +3 -3
- package/dist/cjs/pds-property.cjs.entry.js +2 -2
- package/dist/cjs/pds-radio-group.cjs.entry.js +5 -5
- package/dist/cjs/pds-radio.cjs.entry.js +5 -5
- package/dist/cjs/pds-row.cjs.entry.js +2 -2
- package/dist/cjs/pds-select.cjs.entry.js +3 -3
- package/dist/cjs/pds-sortable-item.cjs.entry.js +3 -3
- package/dist/cjs/pds-sortable.cjs.entry.js +2 -2
- package/dist/cjs/pds-switch.cjs.entry.js +14 -6
- package/dist/cjs/pds-tab.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-cell.cjs.entry.js +5 -5
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +4 -4
- package/dist/cjs/pds-table-head.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +2 -2
- package/dist/cjs/pds-tabs.cjs.entry.js +2 -2
- package/dist/cjs/pds-text.cjs.entry.js +5 -5
- package/dist/cjs/pds-textarea.cjs.entry.js +14 -9
- package/dist/cjs/pds-toast.cjs.entry.js +4 -4
- package/dist/cjs/pds-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/pine-core.cjs.js +2 -2
- package/dist/cjs/{truncation-tooltip-Bps7_rUy.js → truncation-tooltip-CYgQfBLt.js} +1 -1
- package/dist/cjs/{utils-KWALOgy9.js → utils-BhRmyxT8.js} +35 -4
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/pds-button/pds-button.js +53 -2
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +7 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +19 -3
- package/dist/collection/components/pds-chip/pds-chip.js +1 -1
- package/dist/collection/components/pds-combobox/grouped-options-panel.js +262 -0
- package/dist/collection/components/pds-combobox/pds-combobox.css +242 -13
- package/dist/collection/components/pds-combobox/pds-combobox.js +1128 -114
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +240 -0
- package/dist/collection/components/pds-container/pds-container.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
- package/dist/collection/components/pds-datepicker/calendar-portal.js +136 -0
- package/dist/collection/components/pds-datepicker/date-utils.js +132 -0
- package/dist/collection/components/pds-datepicker/datepicker-interface.js +1 -0
- package/dist/collection/components/pds-datepicker/pds-datepicker.css +545 -0
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +2406 -0
- package/dist/collection/components/pds-datepicker/presets.js +96 -0
- package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +195 -0
- package/dist/collection/components/pds-datepicker/value.js +238 -0
- package/dist/collection/components/pds-divider/pds-divider.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer.css +4 -0
- package/dist/collection/components/pds-drawer/pds-drawer.js +9 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +9 -2
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +1 -1
- package/dist/collection/components/pds-filters/pds-filters.js +1 -1
- package/dist/collection/components/pds-image/pds-image.js +2 -2
- package/dist/collection/components/pds-input/pds-input.js +6 -3
- package/dist/collection/components/pds-link/pds-link.js +2 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +2 -2
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal.css +16 -0
- package/dist/collection/components/pds-modal/pds-modal.js +10 -4
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.css +19 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +390 -47
- package/dist/collection/components/pds-multiselect/stories/pds-multiselect.stories.js +136 -1
- package/dist/collection/components/pds-popover/pds-popover.js +29 -11
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-property/pds-property.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +3 -3
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +3 -3
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.css +3 -0
- package/dist/collection/components/pds-switch/pds-switch.js +20 -4
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +11 -6
- package/dist/collection/components/pds-toast/pds-toast.js +3 -3
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +2 -2
- package/dist/collection/utils/closest.js +8 -0
- package/dist/collection/utils/utils.js +33 -4
- package/dist/docs.json +1933 -59
- package/dist/esm/closest-DHPzKMVS.js +17 -0
- package/dist/esm/{floating-ui.dom-DDtwbwIl.js → floating-ui.dom-BPqJgIq6.js} +79 -1
- package/dist/esm/{i18n-format-BKsJZTyn.js → i18n-format-BJgZHCWe.js} +1 -1
- package/dist/esm/{index-DcT8--Dn.js → index-CB8Yh0Nt.js} +4 -1
- package/dist/esm/{index-BU1hN5Vy.js → index-DxI-61GK.js} +5 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mock-pds-modal.entry.js +3 -3
- package/dist/esm/pds-accordion.entry.js +2 -2
- package/dist/esm/pds-alert.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +2 -2
- package/dist/esm/pds-box.entry.js +2 -2
- package/dist/esm/pds-button.entry.js +53 -4
- package/dist/esm/pds-checkbox.entry.js +14 -6
- package/dist/esm/pds-chip.entry.js +6 -6
- package/dist/esm/pds-combobox.entry.js +1225 -117
- package/dist/esm/pds-container.entry.js +2 -2
- package/dist/esm/pds-copytext.entry.js +5 -5
- package/dist/esm/pds-datepicker.entry.js +1960 -0
- package/dist/esm/pds-divider.entry.js +2 -2
- package/dist/esm/pds-drawer-content.entry.js +2 -2
- package/dist/esm/pds-drawer-footer.entry.js +2 -2
- package/dist/esm/pds-drawer-header.entry.js +2 -2
- package/dist/esm/pds-drawer.entry.js +11 -4
- package/dist/esm/pds-dropdown-menu-item.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu.entry.js +11 -4
- package/dist/esm/pds-filter.entry.js +3 -3
- package/dist/esm/pds-filters.entry.js +2 -2
- package/dist/esm/pds-icon.entry.js +1 -1
- package/dist/esm/pds-image.entry.js +3 -3
- package/dist/esm/pds-input.entry.js +8 -5
- package/dist/esm/pds-link.entry.js +5 -5
- package/dist/esm/pds-loader.entry.js +2 -2
- package/dist/esm/pds-modal-content.entry.js +3 -3
- package/dist/esm/pds-modal-footer.entry.js +2 -2
- package/dist/esm/pds-modal-header.entry.js +2 -2
- package/dist/esm/pds-modal.entry.js +12 -6
- package/dist/esm/pds-multiselect.entry.js +264 -51
- package/dist/esm/pds-popover.entry.js +30 -12
- package/dist/esm/pds-progress.entry.js +3 -3
- package/dist/esm/pds-property.entry.js +2 -2
- package/dist/esm/pds-radio-group.entry.js +5 -5
- package/dist/esm/pds-radio.entry.js +5 -5
- package/dist/esm/pds-row.entry.js +2 -2
- package/dist/esm/pds-select.entry.js +3 -3
- package/dist/esm/pds-sortable-item.entry.js +3 -3
- package/dist/esm/pds-sortable.entry.js +2 -2
- package/dist/esm/pds-switch.entry.js +14 -6
- package/dist/esm/pds-tab.entry.js +1 -1
- package/dist/esm/pds-table-body.entry.js +2 -2
- package/dist/esm/pds-table-cell.entry.js +5 -5
- package/dist/esm/pds-table-head-cell.entry.js +4 -4
- package/dist/esm/pds-table-head.entry.js +3 -3
- package/dist/esm/pds-table-row.entry.js +3 -3
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-tabpanel.entry.js +2 -2
- package/dist/esm/pds-tabs.entry.js +2 -2
- package/dist/esm/pds-text.entry.js +5 -5
- package/dist/esm/pds-textarea.entry.js +14 -9
- package/dist/esm/pds-toast.entry.js +4 -4
- package/dist/esm/pds-tooltip.entry.js +4 -4
- package/dist/esm/pine-core.js +3 -3
- package/dist/esm/{truncation-tooltip-CdtEBn_5.js → truncation-tooltip-_902ENWC.js} +1 -1
- package/dist/esm/{utils-u_0lxWnH.js → utils-OYK5-nwe.js} +34 -5
- package/dist/esm-es5/closest-DHPzKMVS.js +1 -0
- package/dist/esm-es5/floating-ui.dom-BPqJgIq6.js +1 -0
- package/dist/esm-es5/{i18n-format-BKsJZTyn.js → i18n-format-BJgZHCWe.js} +1 -1
- package/dist/esm-es5/index-CB8Yh0Nt.js +2 -0
- package/dist/esm-es5/index-DxI-61GK.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 -0
- 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/{truncation-tooltip-CdtEBn_5.js → truncation-tooltip-_902ENWC.js} +1 -1
- package/dist/esm-es5/utils-OYK5-nwe.js +1 -0
- package/dist/pine-core/p-0414092a.system.entry.js +1 -0
- package/dist/pine-core/p-04807201.entry.js +1 -0
- package/dist/pine-core/{p-cfcb89d1.system.entry.js → p-07f0d168.system.entry.js} +1 -1
- package/dist/pine-core/p-08f5d19c.entry.js +1 -0
- package/dist/pine-core/{p-d70aa0c7.system.entry.js → p-0aaf8faa.system.entry.js} +1 -1
- package/dist/pine-core/p-0bad5955.entry.js +1 -0
- package/dist/pine-core/{p-99f300ef.system.entry.js → p-0c3bf377.system.entry.js} +1 -1
- package/dist/pine-core/p-0ce79cd0.entry.js +1 -0
- package/dist/pine-core/{p-f682f08a.system.entry.js → p-1057b8c3.system.entry.js} +1 -1
- package/dist/pine-core/{p-089606b8.system.entry.js → p-108c910a.system.entry.js} +1 -1
- package/dist/pine-core/{p-ea986474.system.entry.js → p-166f61a6.system.entry.js} +1 -1
- package/dist/pine-core/{p-95defb53.entry.js → p-16c8f5e3.entry.js} +1 -1
- package/dist/pine-core/p-16e258d1.entry.js +1 -0
- package/dist/pine-core/{p-a8f1a48d.entry.js → p-1be33c95.entry.js} +1 -1
- package/dist/pine-core/{p-70fb83d4.entry.js → p-1e3a31da.entry.js} +1 -1
- package/dist/pine-core/{p-12941e0d.entry.js → p-1f228db9.entry.js} +1 -1
- package/dist/pine-core/p-257c6ef9.entry.js +1 -0
- package/dist/pine-core/p-26415245.system.entry.js +1 -0
- package/dist/pine-core/p-26e1e5bb.entry.js +1 -0
- package/dist/pine-core/p-27c06bf8.entry.js +2 -0
- package/dist/pine-core/p-31aee437.entry.js +1 -0
- package/dist/pine-core/p-330a76f6.system.entry.js +1 -0
- package/dist/pine-core/{p-4ebdb90b.system.entry.js → p-33c63be6.system.entry.js} +1 -1
- package/dist/pine-core/{p-c5b6b545.entry.js → p-344609f9.entry.js} +2 -2
- package/dist/pine-core/{p-2dbc90ba.entry.js → p-3a1711c1.entry.js} +1 -1
- package/dist/pine-core/p-3a9c58bd.system.entry.js +1 -0
- package/dist/pine-core/{p-32fc82c2.entry.js → p-3ebd543f.entry.js} +1 -1
- package/dist/pine-core/p-3fbcb0c8.system.entry.js +1 -0
- package/dist/pine-core/{p-e08e4ca7.entry.js → p-427b4aeb.entry.js} +1 -1
- package/dist/pine-core/{p-f5cf98be.system.entry.js → p-42bd87ea.system.entry.js} +1 -1
- package/dist/pine-core/{p-8d1e7b3c.system.entry.js → p-43c691bf.system.entry.js} +1 -1
- package/dist/pine-core/p-4566d659.system.entry.js +1 -0
- package/dist/pine-core/{p-b9a857fc.system.entry.js → p-4b8cf04a.system.entry.js} +1 -1
- package/dist/pine-core/p-4d6f471c.entry.js +1 -0
- package/dist/pine-core/{p-ec04d4c3.entry.js → p-4e7580c4.entry.js} +1 -1
- package/dist/pine-core/{p-fbb72e66.system.entry.js → p-4f4a2d2a.system.entry.js} +1 -1
- package/dist/pine-core/{p-b8a5597d.entry.js → p-5211aba7.entry.js} +1 -1
- package/dist/pine-core/{p-7e4729e0.entry.js → p-524b7d3f.entry.js} +1 -1
- package/dist/pine-core/{p-c08b1697.entry.js → p-5613c64c.entry.js} +1 -1
- package/dist/pine-core/{p-5a8345e2.entry.js → p-5bb24cb4.entry.js} +1 -1
- package/dist/pine-core/{p-73c3a73f.entry.js → p-5bb80b3c.entry.js} +1 -1
- package/dist/pine-core/{p-e039ebb6.system.entry.js → p-5c6e0a26.system.entry.js} +1 -1
- package/dist/pine-core/{p-b53d9620.system.entry.js → p-5db57551.system.entry.js} +1 -1
- package/dist/pine-core/{p-6b260a97.entry.js → p-5eb00ba5.entry.js} +1 -1
- package/dist/pine-core/p-61756414.system.entry.js +1 -0
- package/dist/pine-core/{p-08196d6c.entry.js → p-682e9e8f.entry.js} +1 -1
- package/dist/pine-core/p-6965db1d.entry.js +1 -0
- package/dist/pine-core/{p-317337e4.entry.js → p-6b180ee2.entry.js} +1 -1
- package/dist/pine-core/{p-d33d65f6.entry.js → p-6c53962f.entry.js} +1 -1
- package/dist/pine-core/p-6da6520b.system.entry.js +3 -0
- package/dist/pine-core/{p-bd9b2931.system.entry.js → p-6e3bf862.system.entry.js} +1 -1
- package/dist/pine-core/{p-9d77f2f8.system.entry.js → p-71c9f866.system.entry.js} +1 -1
- package/dist/pine-core/{p-a616385b.system.entry.js → p-7265b94c.system.entry.js} +1 -1
- package/dist/pine-core/{p-55532d56.system.entry.js → p-74229b5e.system.entry.js} +1 -1
- package/dist/pine-core/p-7512c2d4.system.entry.js +1 -0
- package/dist/pine-core/p-76db406d.system.entry.js +1 -0
- package/dist/pine-core/{p-3b555f06.system.entry.js → p-79aa5f43.system.entry.js} +1 -1
- package/dist/pine-core/{p-77082557.system.entry.js → p-7bbcda0f.system.entry.js} +1 -1
- package/dist/pine-core/p-7c8946e6.entry.js +1 -0
- package/dist/pine-core/p-7c98c90a.system.entry.js +1 -0
- package/dist/pine-core/p-81292c03.system.entry.js +1 -0
- package/dist/pine-core/p-81300046.system.entry.js +1 -0
- package/dist/pine-core/{p-93c52e2b.system.entry.js → p-8252cd84.system.entry.js} +1 -1
- package/dist/pine-core/p-84ba0e6a.system.entry.js +1 -0
- package/dist/pine-core/{p-45d55983.entry.js → p-86fc0bfa.entry.js} +1 -1
- package/dist/pine-core/p-90692bb6.entry.js +1 -0
- package/dist/pine-core/{p-67fc26e5.system.entry.js → p-90ea812c.system.entry.js} +1 -1
- package/dist/pine-core/p-948826db.entry.js +1 -0
- package/dist/pine-core/{p-35edd8b0.entry.js → p-9b66642d.entry.js} +1 -1
- package/dist/pine-core/p-BJgZHCWe.js +1 -0
- package/dist/pine-core/p-BPqJgIq6.js +1 -0
- package/dist/pine-core/p-BSRFZB4I.system.js +1 -0
- package/dist/pine-core/p-BZsj6eAn.system.js +1 -0
- package/dist/pine-core/p-CB8Yh0Nt.js +2 -0
- package/dist/pine-core/{p-B2qvvB3q.system.js → p-CBu9UrXr.system.js} +1 -1
- package/dist/pine-core/p-COtCa1Md.system.js +1 -0
- package/dist/pine-core/p-CTQZ2fkv.system.js +1 -0
- package/dist/pine-core/{p-B2nn1gSd.js → p-CnM3cCof.js} +1 -1
- package/dist/pine-core/p-CnO10OxH.system.js +1 -0
- package/dist/pine-core/p-D-akEPIU.system.js +2 -0
- package/dist/pine-core/p-DHPzKMVS.js +1 -0
- package/dist/pine-core/p-Dx8tEj0U.system.js +1 -0
- package/dist/pine-core/p-DxI-61GK.js +1 -0
- package/dist/pine-core/p-OYK5-nwe.js +1 -0
- package/dist/pine-core/p-a10af84b.system.entry.js +1 -0
- package/dist/pine-core/p-a21b530a.system.entry.js +1 -0
- package/dist/pine-core/{p-b0becff3.system.entry.js → p-a85535a4.system.entry.js} +1 -1
- package/dist/pine-core/p-abc0fe2f.system.entry.js +1 -0
- package/dist/pine-core/p-ac6a5bf0.entry.js +1 -0
- package/dist/pine-core/{p-5f5339ab.entry.js → p-b0526f98.entry.js} +1 -1
- package/dist/pine-core/p-b130b716.entry.js +1 -0
- package/dist/pine-core/{p-4cbb691f.entry.js → p-b195d345.entry.js} +1 -1
- package/dist/pine-core/{p-5c5bd609.entry.js → p-b4923acf.entry.js} +1 -1
- package/dist/pine-core/{p-15a0fa0a.system.entry.js → p-b4e440e3.system.entry.js} +1 -1
- package/dist/pine-core/p-b8693a87.entry.js +1 -0
- package/dist/pine-core/{p-bf025e38.entry.js → p-b8ada1eb.entry.js} +1 -1
- package/dist/pine-core/{p-a6a269da.system.entry.js → p-bb85bbb5.system.entry.js} +1 -1
- package/dist/pine-core/{p-fa8d3155.system.entry.js → p-bbc539bc.system.entry.js} +2 -2
- package/dist/pine-core/{p-f26dcbc2.system.entry.js → p-bf833976.system.entry.js} +1 -1
- package/dist/pine-core/{p-e055c543.entry.js → p-c23097af.entry.js} +1 -1
- package/dist/pine-core/p-c2dd84bd.system.entry.js +1 -0
- package/dist/pine-core/{p-441682f4.system.entry.js → p-c4520b04.system.entry.js} +1 -1
- package/dist/pine-core/{p-f1365550.entry.js → p-c4f68dfc.entry.js} +1 -1
- package/dist/pine-core/{p-fa2a786d.system.entry.js → p-c6fa6744.system.entry.js} +1 -1
- package/dist/pine-core/p-c7dba815.entry.js +1 -0
- package/dist/pine-core/p-cb6f55ff.entry.js +1 -0
- package/dist/pine-core/p-cfb8fa7c.system.entry.js +1 -0
- package/dist/pine-core/{p-2bb101c2.entry.js → p-d0d7d1d4.entry.js} +1 -1
- package/dist/pine-core/{p-4f5aacd9.entry.js → p-d1112c8a.entry.js} +1 -1
- package/dist/pine-core/{p-5f3d0c86.system.entry.js → p-d4e91ad9.system.entry.js} +1 -1
- package/dist/pine-core/{p-44222439.entry.js → p-da018dcb.entry.js} +1 -1
- package/dist/pine-core/{p-57784f2f.system.entry.js → p-dc27abe6.system.entry.js} +1 -1
- package/dist/pine-core/{p-f9f7101e.entry.js → p-dc343b6d.entry.js} +1 -1
- package/dist/pine-core/{p-fb774f89.system.entry.js → p-dde753e7.system.entry.js} +1 -1
- package/dist/pine-core/{p-558ac401.entry.js → p-dea3a582.entry.js} +1 -1
- package/dist/pine-core/p-df29fd41.entry.js +1 -0
- package/dist/pine-core/{p-c6426e16.system.entry.js → p-e4e2eae2.system.entry.js} +1 -1
- package/dist/pine-core/{p-1abae35f.entry.js → p-e8668178.entry.js} +1 -1
- package/dist/pine-core/{p-20753e42.system.entry.js → p-eb28d21d.system.entry.js} +1 -1
- package/dist/pine-core/p-eb71a82d.system.entry.js +1 -0
- package/dist/pine-core/{p-13bb89ff.entry.js → p-ed63873c.entry.js} +1 -1
- package/dist/pine-core/{p-5d2f95bd.entry.js → p-f4f6dc36.entry.js} +1 -1
- package/dist/pine-core/{p-6b3d8c2b.system.entry.js → p-f67a0ca8.system.entry.js} +1 -1
- package/dist/pine-core/{p-003df3b3.entry.js → p-fc455968.entry.js} +1 -1
- package/dist/pine-core/{p-02452806.system.entry.js → p-fe3e2ebd.system.entry.js} +1 -1
- package/dist/pine-core/pine-core.css +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/pine-core/pine-core.js +1 -1
- package/dist/types/components/pds-button/pds-button.d.ts +10 -0
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +5 -0
- package/dist/types/components/pds-combobox/combobox-interface.d.ts +17 -0
- package/dist/types/components/pds-combobox/grouped-options-panel.d.ts +105 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +235 -3
- package/dist/types/components/pds-datepicker/calendar-portal.d.ts +43 -0
- package/dist/types/components/pds-datepicker/date-utils.d.ts +48 -0
- package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +30 -0
- package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +489 -0
- package/dist/types/components/pds-datepicker/presets.d.ts +23 -0
- package/dist/types/components/pds-datepicker/value.d.ts +47 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +1 -0
- package/dist/types/components/pds-multiselect/multiselect-interface.d.ts +19 -0
- package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +56 -1
- package/dist/types/components/pds-popover/pds-popover.d.ts +1 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +5 -0
- package/dist/types/components.d.ts +677 -4
- package/dist/types/utils/closest.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +9 -1
- package/dist/vscode.html-data.json +467 -3
- package/hydrate/index.js +3973 -362
- package/hydrate/index.mjs +3973 -362
- package/package.json +2 -2
- package/dist/cjs/closest-BZXvuB_Y.js +0 -11
- package/dist/esm/closest-DnUJodVd.js +0 -9
- package/dist/esm-es5/closest-DnUJodVd.js +0 -1
- package/dist/esm-es5/floating-ui.dom-DDtwbwIl.js +0 -1
- package/dist/esm-es5/index-BU1hN5Vy.js +0 -1
- package/dist/esm-es5/index-DcT8--Dn.js +0 -2
- package/dist/esm-es5/utils-u_0lxWnH.js +0 -1
- package/dist/pine-core/p-026ee6de.entry.js +0 -1
- package/dist/pine-core/p-03f3fc92.system.entry.js +0 -1
- package/dist/pine-core/p-06375326.system.entry.js +0 -1
- package/dist/pine-core/p-1df5e088.entry.js +0 -1
- package/dist/pine-core/p-24214ab9.system.entry.js +0 -1
- package/dist/pine-core/p-250011ba.entry.js +0 -1
- package/dist/pine-core/p-2b420257.entry.js +0 -1
- package/dist/pine-core/p-375eb7f4.entry.js +0 -1
- package/dist/pine-core/p-3b796898.entry.js +0 -1
- package/dist/pine-core/p-3c5489ce.entry.js +0 -1
- package/dist/pine-core/p-3e868906.system.entry.js +0 -1
- package/dist/pine-core/p-464f23e6.entry.js +0 -1
- package/dist/pine-core/p-49c6112a.entry.js +0 -1
- package/dist/pine-core/p-4bd57896.system.entry.js +0 -1
- package/dist/pine-core/p-6a6a767b.system.entry.js +0 -1
- package/dist/pine-core/p-6dabeebc.system.entry.js +0 -3
- package/dist/pine-core/p-70891202.entry.js +0 -1
- package/dist/pine-core/p-73fa955a.system.entry.js +0 -1
- package/dist/pine-core/p-755e0b3c.system.entry.js +0 -1
- package/dist/pine-core/p-8b051229.entry.js +0 -1
- package/dist/pine-core/p-8d8a8550.system.entry.js +0 -1
- package/dist/pine-core/p-93486f2e.entry.js +0 -1
- package/dist/pine-core/p-93ae562d.entry.js +0 -1
- package/dist/pine-core/p-95b8bece.system.entry.js +0 -1
- package/dist/pine-core/p-9d902000.system.entry.js +0 -1
- package/dist/pine-core/p-9ef355b7.entry.js +0 -1
- package/dist/pine-core/p-BI7Ml0VF.system.js +0 -1
- package/dist/pine-core/p-BKsJZTyn.js +0 -1
- package/dist/pine-core/p-BU1hN5Vy.js +0 -1
- package/dist/pine-core/p-BrLs99ML.system.js +0 -1
- package/dist/pine-core/p-CJ8t3EBJ.system.js +0 -2
- package/dist/pine-core/p-Cr7-rJtJ.system.js +0 -1
- package/dist/pine-core/p-DDtwbwIl.js +0 -1
- package/dist/pine-core/p-D_I-k33A.system.js +0 -1
- package/dist/pine-core/p-DcT8--Dn.js +0 -2
- package/dist/pine-core/p-DnUJodVd.js +0 -1
- package/dist/pine-core/p-a009ab10.system.entry.js +0 -1
- package/dist/pine-core/p-a8cd2ab5.entry.js +0 -1
- package/dist/pine-core/p-b45b8f8b.system.entry.js +0 -1
- package/dist/pine-core/p-b85bb61d.system.entry.js +0 -1
- package/dist/pine-core/p-bdded57a.system.entry.js +0 -1
- package/dist/pine-core/p-c1a65082.entry.js +0 -1
- package/dist/pine-core/p-c1d1befb.system.entry.js +0 -1
- package/dist/pine-core/p-ctdGub9B.system.js +0 -1
- package/dist/pine-core/p-d9c1ee36.system.entry.js +0 -1
- package/dist/pine-core/p-df285ece.system.entry.js +0 -1
- package/dist/pine-core/p-ee114aef.entry.js +0 -1
- package/dist/pine-core/p-ee997fbf.entry.js +0 -2
- package/dist/pine-core/p-f89197c9.entry.js +0 -1
- package/dist/pine-core/p-kYMYDfJY.system.js +0 -1
- package/dist/pine-core/p-u_0lxWnH.js +0 -1
|
@@ -11,6 +11,9 @@ export default {
|
|
|
11
11
|
dropdownMount: 'host',
|
|
12
12
|
dropdownWidth: '236px',
|
|
13
13
|
errorMessage: null,
|
|
14
|
+
flyoutMaxWidth: '380px',
|
|
15
|
+
flyoutMinWidth: '280px',
|
|
16
|
+
groupDisplay: 'inline',
|
|
14
17
|
helperMessage: null,
|
|
15
18
|
hideLabel: false,
|
|
16
19
|
invalid: false,
|
|
@@ -378,6 +381,243 @@ OptionGroupsOptgroup.args = {
|
|
|
378
381
|
maxHeight: '280px',
|
|
379
382
|
};
|
|
380
383
|
|
|
384
|
+
export const OptionGroupsWithIcons = (args) => html`
|
|
385
|
+
<pds-combobox
|
|
386
|
+
component-id="combobox-optgroup-icons"
|
|
387
|
+
label=${args.label}
|
|
388
|
+
placeholder=${args.placeholder}
|
|
389
|
+
trigger=${args.trigger}
|
|
390
|
+
mode=${args.mode}
|
|
391
|
+
trigger-width=${args.triggerWidth}
|
|
392
|
+
dropdown-width=${args.dropdownWidth}
|
|
393
|
+
>
|
|
394
|
+
<optgroup label="Tag" data-icon="hashtag">
|
|
395
|
+
<option value="tag-add">Add a tag</option>
|
|
396
|
+
<option value="tag-remove">Remove a tag</option>
|
|
397
|
+
</optgroup>
|
|
398
|
+
<optgroup label="Email" data-icon="mail">
|
|
399
|
+
<option value="email-send">Send an email</option>
|
|
400
|
+
</optgroup>
|
|
401
|
+
<optgroup label="Coupon" data-icon="coupon">
|
|
402
|
+
<option value="coupon-send">Send a coupon</option>
|
|
403
|
+
</optgroup>
|
|
404
|
+
</pds-combobox>`;
|
|
405
|
+
|
|
406
|
+
OptionGroupsWithIcons.args = {
|
|
407
|
+
label: 'Action',
|
|
408
|
+
placeholder: 'Select an action',
|
|
409
|
+
trigger: 'button',
|
|
410
|
+
mode: 'select-only',
|
|
411
|
+
triggerWidth: '280px',
|
|
412
|
+
dropdownWidth: '280px',
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export const OptionGroupsFromOptions = (args) => html`
|
|
416
|
+
<pds-combobox
|
|
417
|
+
component-id="combobox-grouped-options"
|
|
418
|
+
label=${args.label}
|
|
419
|
+
placeholder=${args.placeholder}
|
|
420
|
+
trigger=${args.trigger}
|
|
421
|
+
mode=${args.mode}
|
|
422
|
+
trigger-width=${args.triggerWidth}
|
|
423
|
+
dropdown-width=${args.dropdownWidth}
|
|
424
|
+
.options=${args.options}
|
|
425
|
+
></pds-combobox>`;
|
|
426
|
+
|
|
427
|
+
OptionGroupsFromOptions.args = {
|
|
428
|
+
label: 'Action',
|
|
429
|
+
placeholder: 'Select an action',
|
|
430
|
+
trigger: 'button',
|
|
431
|
+
mode: 'select-only',
|
|
432
|
+
triggerWidth: '280px',
|
|
433
|
+
dropdownWidth: '280px',
|
|
434
|
+
// Tag's options are split by Email on purpose: each group still renders together.
|
|
435
|
+
options: [
|
|
436
|
+
{ id: 'tag-add', text: 'Add a tag', group: 'Tag', groupIcon: 'hashtag' },
|
|
437
|
+
{ id: 'email-send', text: 'Send an email', group: 'Email', groupIcon: 'mail' },
|
|
438
|
+
{ id: 'tag-remove', text: 'Remove a tag', group: 'Tag' },
|
|
439
|
+
{ id: 'coupon-send', text: 'Send a coupon', group: 'Coupon', groupIcon: 'coupon' },
|
|
440
|
+
],
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
export const GroupDisplayFlyout = (args) => html`
|
|
444
|
+
<div style="min-height: 420px;">
|
|
445
|
+
<pds-combobox
|
|
446
|
+
component-id="combobox-group-flyout"
|
|
447
|
+
label=${args.label}
|
|
448
|
+
placeholder=${args.placeholder}
|
|
449
|
+
trigger=${args.trigger}
|
|
450
|
+
mode=${args.mode}
|
|
451
|
+
group-display="flyout"
|
|
452
|
+
trigger-width=${args.triggerWidth}
|
|
453
|
+
dropdown-width=${args.dropdownWidth}
|
|
454
|
+
flyout-min-width=${args.flyoutMinWidth}
|
|
455
|
+
flyout-max-width=${args.flyoutMaxWidth}
|
|
456
|
+
.options=${args.options}
|
|
457
|
+
></pds-combobox>
|
|
458
|
+
</div>`;
|
|
459
|
+
|
|
460
|
+
GroupDisplayFlyout.args = {
|
|
461
|
+
label: 'Action',
|
|
462
|
+
placeholder: 'Select an action',
|
|
463
|
+
trigger: 'input',
|
|
464
|
+
mode: 'filter',
|
|
465
|
+
// Narrower than the old 408px default (matches Action Catalog's trigger/dropdown width),
|
|
466
|
+
// leaving more room for the flyout on typical viewports. This alone doesn't guarantee a flyout
|
|
467
|
+
// on a cramped canvas (e.g. Storybook with the Controls panel docked): the room check compares
|
|
468
|
+
// available space against flyout-min-width (280px), not dropdown-width, so a narrow enough
|
|
469
|
+
// canvas still falls back to drill-in — correctly, there's genuinely no room for both.
|
|
470
|
+
triggerWidth: '280px',
|
|
471
|
+
dropdownWidth: '280px',
|
|
472
|
+
flyoutMinWidth: '280px',
|
|
473
|
+
flyoutMaxWidth: '380px',
|
|
474
|
+
options: [
|
|
475
|
+
{ id: 'offer-grant', text: 'Grant an offer', group: 'Offer', groupIcon: 'grant-offer' },
|
|
476
|
+
{ id: 'offer-revoke', text: 'Revoke an offer', group: 'Offer' },
|
|
477
|
+
{ id: 'tag-add', text: 'Add a tag', group: 'Tag', groupIcon: 'hashtag' },
|
|
478
|
+
{ id: 'tag-remove', text: 'Remove a tag', group: 'Tag' },
|
|
479
|
+
{ id: 'email-send', text: 'Send an email', group: 'Email', groupIcon: 'mail' },
|
|
480
|
+
{ id: 'coupon-send', text: 'Send a coupon', group: 'Coupon', groupIcon: 'coupon' },
|
|
481
|
+
],
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
export const GroupDisplayDrillInWithPanelSearch = (args) => html`
|
|
485
|
+
<div style="min-height: 360px;">
|
|
486
|
+
<pds-combobox
|
|
487
|
+
component-id="combobox-group-drill-in"
|
|
488
|
+
label=${args.label}
|
|
489
|
+
placeholder=${args.placeholder}
|
|
490
|
+
trigger="button"
|
|
491
|
+
mode="select-only"
|
|
492
|
+
group-display="drill-in"
|
|
493
|
+
?panel-search=${args.panelSearch}
|
|
494
|
+
search-placeholder=${args.searchPlaceholder}
|
|
495
|
+
search-options-label=${args.searchOptionsLabel}
|
|
496
|
+
drill-in-back-label=${args.drillInBackLabel}
|
|
497
|
+
trigger-width=${args.triggerWidth}
|
|
498
|
+
dropdown-width=${args.dropdownWidth}
|
|
499
|
+
.options=${args.options}
|
|
500
|
+
></pds-combobox>
|
|
501
|
+
</div>`;
|
|
502
|
+
|
|
503
|
+
GroupDisplayDrillInWithPanelSearch.args = {
|
|
504
|
+
panelSearch: true,
|
|
505
|
+
label: 'Filter',
|
|
506
|
+
placeholder: 'Choose a filter',
|
|
507
|
+
searchPlaceholder: 'Search filters',
|
|
508
|
+
searchOptionsLabel: 'Search filters',
|
|
509
|
+
drillInBackLabel: 'Back',
|
|
510
|
+
triggerWidth: '320px',
|
|
511
|
+
dropdownWidth: '320px',
|
|
512
|
+
options: [
|
|
513
|
+
{ id: 'email-status', text: 'Marketing status', group: 'Email', groupIcon: 'mail' },
|
|
514
|
+
{ id: 'email-activity', text: 'Email activity', group: 'Email' },
|
|
515
|
+
{ id: 'email-broadcasts', text: 'Broadcasts', group: 'Email' },
|
|
516
|
+
{ id: 'contact-added', text: 'Was added', group: 'Contact', groupIcon: 'hashtag' },
|
|
517
|
+
{ id: 'contact-hidden', text: 'Is hidden', group: 'Contact' },
|
|
518
|
+
],
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
// A large action catalog: many groups, a button trigger and panel search. The narrower widths
|
|
522
|
+
// leave room for the flyout beside the dropdown on a narrow canvas.
|
|
523
|
+
export const GroupDisplayActionCatalog = (args) => html`
|
|
524
|
+
<div style="min-height: 520px;">
|
|
525
|
+
<pds-combobox
|
|
526
|
+
component-id="combobox-action-catalog"
|
|
527
|
+
label=${args.label}
|
|
528
|
+
placeholder=${args.placeholder}
|
|
529
|
+
trigger="button"
|
|
530
|
+
mode="select-only"
|
|
531
|
+
group-display=${args.groupDisplay}
|
|
532
|
+
?panel-search=${args.panelSearch}
|
|
533
|
+
search-placeholder=${args.searchPlaceholder}
|
|
534
|
+
search-options-label=${args.searchOptionsLabel}
|
|
535
|
+
drill-in-back-label=${args.drillInBackLabel}
|
|
536
|
+
trigger-width=${args.triggerWidth}
|
|
537
|
+
dropdown-width=${args.dropdownWidth}
|
|
538
|
+
.options=${args.options}
|
|
539
|
+
></pds-combobox>
|
|
540
|
+
</div>`;
|
|
541
|
+
|
|
542
|
+
GroupDisplayActionCatalog.args = {
|
|
543
|
+
panelSearch: true,
|
|
544
|
+
label: 'Action',
|
|
545
|
+
placeholder: 'Choose an action',
|
|
546
|
+
groupDisplay: 'flyout',
|
|
547
|
+
searchPlaceholder: 'Search actions',
|
|
548
|
+
searchOptionsLabel: 'Search actions',
|
|
549
|
+
drillInBackLabel: 'Back',
|
|
550
|
+
triggerWidth: '280px',
|
|
551
|
+
dropdownWidth: '280px',
|
|
552
|
+
options: [
|
|
553
|
+
{ id: 'contact_tag_add', text: 'Add a tag', group: 'Contact', groupIcon: 'contact' },
|
|
554
|
+
{ id: 'contact_tag_remove', text: 'Remove a tag', group: 'Contact' },
|
|
555
|
+
{ id: 'enroll_in_workflow', text: 'Enroll in an automation', group: 'Contact' },
|
|
556
|
+
{ id: 'email_send', text: 'Send an email', group: 'Communication', groupIcon: 'mail' },
|
|
557
|
+
{ id: 'email_sequence_subscribe', text: 'Subscribe to a sequence', group: 'Communication' },
|
|
558
|
+
{ id: 'email_sequence_unsubscribe', text: 'Unsubscribe from a sequence', group: 'Communication' },
|
|
559
|
+
{ id: 'sms_send', text: 'Send a text message', group: 'Communication' },
|
|
560
|
+
{ id: 'offer_send', text: 'Send an offer', group: 'Communication' },
|
|
561
|
+
{ id: 'event_register', text: 'Register for an event', group: 'Communication' },
|
|
562
|
+
{ id: 'event_deregister', text: 'Deregister from an event', group: 'Communication' },
|
|
563
|
+
{ id: 'offer_grant', text: 'Grant an offer', group: 'Membership', groupIcon: 'product' },
|
|
564
|
+
{ id: 'offer_revoke', text: 'Revoke an offer', group: 'Membership' },
|
|
565
|
+
{ id: 'offer_cancel_payment_and_access', text: 'Cancel payment and access', group: 'Membership' },
|
|
566
|
+
{ id: 'coupon_send', text: 'Send a coupon', group: 'Membership' },
|
|
567
|
+
{ id: 'certificate_send', text: 'Send a certificate', group: 'Membership' },
|
|
568
|
+
{ id: 'community_channel_member_add', text: 'Add to a channel', group: 'Communities', groupIcon: 'users' },
|
|
569
|
+
{ id: 'community_channel_member_remove', text: 'Remove from a channel', group: 'Communities' },
|
|
570
|
+
{ id: 'community_post_to_channel', text: 'Post to a channel', group: 'Communities' },
|
|
571
|
+
{ id: 'community_send_dm', text: 'Send a community message', group: 'Communities' },
|
|
572
|
+
{ id: 'coaching_invoice_reminder', text: 'Send an invoice reminder', group: 'Coaching', groupIcon: 'one-off-session' },
|
|
573
|
+
{ id: 'coaching_sessions_cancel', text: 'Cancel sessions', group: 'Coaching' },
|
|
574
|
+
{ id: 'coaching_sessions_remove', text: 'Remove sessions', group: 'Coaching' },
|
|
575
|
+
{ id: 'instagram_direct_message', text: 'Send an Instagram message', group: 'Instagram', groupIcon: 'logo-instagram' },
|
|
576
|
+
{ id: 'instagram_reply', text: 'Reply to an Instagram comment', group: 'Instagram' },
|
|
577
|
+
{ id: 'facebook_direct_message', text: 'Send a Facebook message', group: 'Facebook', groupIcon: 'logo-facebook' },
|
|
578
|
+
{ id: 'facebook_reply', text: 'Reply to a Facebook comment', group: 'Facebook' },
|
|
579
|
+
],
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
GroupDisplayActionCatalog.argTypes = {
|
|
583
|
+
groupDisplay: { control: 'inline-radio', options: ['inline', 'flyout', 'drill-in'] },
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
export const DisabledOptions = (args) => html`
|
|
587
|
+
<div style="min-height: 320px;">
|
|
588
|
+
<pds-combobox
|
|
589
|
+
component-id="combobox-disabled-options"
|
|
590
|
+
label=${args.label}
|
|
591
|
+
placeholder=${args.placeholder}
|
|
592
|
+
helper-message=${args.helperMessage}
|
|
593
|
+
trigger="button"
|
|
594
|
+
mode="select-only"
|
|
595
|
+
group-display=${args.groupDisplay}
|
|
596
|
+
trigger-width="280px"
|
|
597
|
+
dropdown-width="280px"
|
|
598
|
+
.options=${args.options}
|
|
599
|
+
></pds-combobox>
|
|
600
|
+
</div>`;
|
|
601
|
+
|
|
602
|
+
DisabledOptions.args = {
|
|
603
|
+
label: 'Action',
|
|
604
|
+
placeholder: 'Choose an action',
|
|
605
|
+
helperMessage: 'Text messages and coaching actions need the Pro plan.',
|
|
606
|
+
groupDisplay: 'flyout',
|
|
607
|
+
options: [
|
|
608
|
+
{ id: 'contact_tag_add', text: 'Add a tag', group: 'Contact', groupIcon: 'contact' },
|
|
609
|
+
{ id: 'contact_tag_remove', text: 'Remove a tag', group: 'Contact' },
|
|
610
|
+
{ id: 'email_send', text: 'Send an email', group: 'Communication', groupIcon: 'mail' },
|
|
611
|
+
{ id: 'sms_send', text: 'Send a text message', group: 'Communication', disabled: true },
|
|
612
|
+
{ id: 'coaching_invoice_reminder', text: 'Send an invoice reminder', group: 'Coaching', groupIcon: 'one-off-session', disabled: true },
|
|
613
|
+
{ id: 'coaching_sessions_cancel', text: 'Cancel sessions', group: 'Coaching', disabled: true },
|
|
614
|
+
],
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
DisabledOptions.argTypes = {
|
|
618
|
+
groupDisplay: { control: 'inline-radio', options: ['inline', 'flyout', 'drill-in'] },
|
|
619
|
+
};
|
|
620
|
+
|
|
381
621
|
export const OptionGroupsPdsText = (args) => html`
|
|
382
622
|
<pds-combobox
|
|
383
623
|
component-id="combobox-pds-text-groups"
|
|
@@ -25,7 +25,7 @@ export class PdsContainer {
|
|
|
25
25
|
hostStyle['--pine-container-max-width'] = customSize;
|
|
26
26
|
if (!this.centered)
|
|
27
27
|
hostStyle['margin-inline'] = '0';
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: '8a01369c4d1817dd083b1ac714ff7c02920f817e', class: { [`pds-container--${this.size}`]: isNamed }, style: Object.keys(hostStyle).length ? hostStyle : undefined }, h(Tag, { key: '7428cb0040896dc11004065cf91ae9d3c3a99c49', part: "container" }, h("slot", { key: '5a5b5bbc87c03afc23f1c9a0523fced8c0795efb' }))));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "pds-container"; }
|
|
31
31
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,7 +90,7 @@ export class PdsCopytext {
|
|
|
90
90
|
return classNames.join(' ');
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: '5a72c4f71f1d5573b6e708a8a0e0e003a7915935', class: this.classNames(), id: this.componentId }, h("pds-button", { key: 'eb14f7f0137a9ba13d4ce8f54edda0f5aedd1be0', type: "button", variant: "unstyled", onClick: this.handleClick }, h("span", { key: 'aaa00e1272559dc2b808757b6323753ff45574b0', ref: (el) => this.valueSpanEl = el }, this.value), h("pds-icon", { key: '4c383f7f4b7d696bda724989c6462d0c8aafcbc1', "aria-hidden": "true", icon: copyIcon, size: "16px" }))));
|
|
94
94
|
}
|
|
95
95
|
static get is() { return "pds-copytext"; }
|
|
96
96
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { closest } from "../../utils/closest";
|
|
2
|
+
/**
|
|
3
|
+
* Where the open calendar lives: a `div` in `document.body`, or in the nearest `<dialog>` so it
|
|
4
|
+
* shares a modal's top layer, outside any `overflow: hidden` or transformed ancestor that would
|
|
5
|
+
* clip or misplace a fixed-position popup. The portal has its own shadow root carrying the
|
|
6
|
+
* datepicker's styles, so the calendar looks the same there without any global CSS.
|
|
7
|
+
*/
|
|
8
|
+
export class CalendarPortal {
|
|
9
|
+
constructor(datepicker) {
|
|
10
|
+
this.datepicker = datepicker;
|
|
11
|
+
/** The custom properties copyContext set on the host, cleared before it copies again. */
|
|
12
|
+
this.copiedProperties = [];
|
|
13
|
+
this.host = document.createElement('div');
|
|
14
|
+
this.host.className = CalendarPortal.className;
|
|
15
|
+
// So an overlay can tell whether a click in this calendar belongs to a datepicker inside it.
|
|
16
|
+
this.host.pdsDatepicker = datepicker;
|
|
17
|
+
// The shared stylesheet's `:host` rules match this div too; keep it out of layout, so it never
|
|
18
|
+
// adds a line to the page, while it still passes `dir`, `lang` and the theme down.
|
|
19
|
+
this.host.style.display = 'contents';
|
|
20
|
+
this.root = this.host.attachShadow({ mode: 'open' });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Moves the calendar into the portal, mounting the portal first. Context is copied when the portal
|
|
24
|
+
* is attached or the locale changes, not on every render while it's open (in range mode, every
|
|
25
|
+
* hovered day). A theme set on an ancestor while the calendar is open applies when it next opens.
|
|
26
|
+
*/
|
|
27
|
+
mount(calendar, locale) {
|
|
28
|
+
if (!this.host.isConnected) {
|
|
29
|
+
findPortalTarget(this.datepicker).appendChild(this.host);
|
|
30
|
+
this.copyContext(locale);
|
|
31
|
+
}
|
|
32
|
+
else if (locale !== this.locale) {
|
|
33
|
+
this.copyContext(locale);
|
|
34
|
+
}
|
|
35
|
+
if (calendar.parentNode !== this.root)
|
|
36
|
+
this.root.appendChild(calendar);
|
|
37
|
+
}
|
|
38
|
+
remove() {
|
|
39
|
+
this.host.remove();
|
|
40
|
+
}
|
|
41
|
+
/** Whether a node is the portal or inside it, as a focus or pointer target. */
|
|
42
|
+
contains(node) {
|
|
43
|
+
return !!node && (node === this.host || this.root.contains(node));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Carries over what the calendar would otherwise inherit from the datepicker: its styles, the
|
|
47
|
+
* reading direction and language, a theme set on an ancestor, and size overrides.
|
|
48
|
+
*/
|
|
49
|
+
copyContext(locale) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
this.locale = locale;
|
|
52
|
+
const source = this.datepicker.shadowRoot;
|
|
53
|
+
if (source) {
|
|
54
|
+
if ((_a = source.adoptedStyleSheets) === null || _a === void 0 ? void 0 : _a.length) {
|
|
55
|
+
this.root.adoptedStyleSheets = source.adoptedStyleSheets;
|
|
56
|
+
}
|
|
57
|
+
else if (!this.root.querySelector('style')) {
|
|
58
|
+
source.querySelectorAll('style').forEach((style) => this.root.appendChild(style.cloneNode(true)));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const computed = getComputedStyle(this.datepicker);
|
|
62
|
+
this.host.dir = computed.direction || 'ltr';
|
|
63
|
+
// So assistive tech reads the month and day names in the calendar's own language.
|
|
64
|
+
this.host.lang = locale;
|
|
65
|
+
this.copyCustomProperties(computed);
|
|
66
|
+
// Across shadow boundaries: a theme set above an enclosing component still applies.
|
|
67
|
+
const theme = (_b = (closest('[data-theme]', this.datepicker) || null)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-theme');
|
|
68
|
+
if (theme) {
|
|
69
|
+
this.host.setAttribute('data-theme', theme);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.host.removeAttribute('data-theme');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Custom properties set on an ancestor of the datepicker that isn't an ancestor of the portal,
|
|
77
|
+
* as a token override on a card or panel, or the datepicker's own size properties: each one whose
|
|
78
|
+
* value at the datepicker differs from where the portal mounts is set on the portal host.
|
|
79
|
+
*/
|
|
80
|
+
copyCustomProperties(computed) {
|
|
81
|
+
for (const property of this.copiedProperties)
|
|
82
|
+
this.host.style.removeProperty(property);
|
|
83
|
+
this.copiedProperties = [];
|
|
84
|
+
const parent = this.host.parentElement;
|
|
85
|
+
const outside = parent ? getComputedStyle(parent) : null;
|
|
86
|
+
for (let i = 0; i < computed.length; i++) {
|
|
87
|
+
const property = computed[i];
|
|
88
|
+
if (!property.startsWith('--'))
|
|
89
|
+
continue;
|
|
90
|
+
const value = computed.getPropertyValue(property);
|
|
91
|
+
if (outside && value === outside.getPropertyValue(property))
|
|
92
|
+
continue;
|
|
93
|
+
this.host.style.setProperty(property, value.trim());
|
|
94
|
+
this.copiedProperties.push(property);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
CalendarPortal.className = 'pds-datepicker-calendar-portal';
|
|
99
|
+
/**
|
|
100
|
+
* The native `<dialog>` or open `popover` (as pds-filter's) the datepicker sits in, so the
|
|
101
|
+
* calendar shares its top layer and a click in it isn't outside it; otherwise `document.body`.
|
|
102
|
+
* `closest()` stops at shadow boundaries and misses one that only wraps slotted content, so this
|
|
103
|
+
* walks assigned slots and shadow hosts, as pds-combobox does.
|
|
104
|
+
*/
|
|
105
|
+
export function findPortalTarget(from) {
|
|
106
|
+
const seen = new Set();
|
|
107
|
+
let current = from;
|
|
108
|
+
while (current && !seen.has(current)) {
|
|
109
|
+
seen.add(current);
|
|
110
|
+
if (current.nodeType === Node.ELEMENT_NODE && isTopLayerHost(current)) {
|
|
111
|
+
return current;
|
|
112
|
+
}
|
|
113
|
+
const assigned = current.nodeType === Node.ELEMENT_NODE ? current.assignedSlot : null;
|
|
114
|
+
if (assigned) {
|
|
115
|
+
current = assigned;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const parent = current.parentNode;
|
|
119
|
+
current = parent instanceof ShadowRoot ? parent.host : parent;
|
|
120
|
+
}
|
|
121
|
+
return document.body;
|
|
122
|
+
}
|
|
123
|
+
function isTopLayerHost(el) {
|
|
124
|
+
// Only an open dialog: inside a closed one, the calendar would be hidden with it.
|
|
125
|
+
if (el.localName === 'dialog')
|
|
126
|
+
return el.open;
|
|
127
|
+
if (!el.hasAttribute('popover'))
|
|
128
|
+
return false;
|
|
129
|
+
try {
|
|
130
|
+
return el.matches(':popover-open');
|
|
131
|
+
}
|
|
132
|
+
catch (_a) {
|
|
133
|
+
// A browser without the Popover API: no top layer to share.
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date-only helpers for pds-datepicker. Dates are `YYYY-MM-DD` strings and all arithmetic runs in
|
|
3
|
+
* UTC, so a date never shifts by a day with the viewer's time zone or a daylight-saving change.
|
|
4
|
+
*/
|
|
5
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
6
|
+
/** Parses a `YYYY-MM-DD` string to a UTC `Date`, or `null` when it isn't a real calendar date. */
|
|
7
|
+
export function parseIsoDate(value) {
|
|
8
|
+
const match = ISO_DATE.exec((value !== null && value !== void 0 ? value : '').trim());
|
|
9
|
+
if (!match)
|
|
10
|
+
return null;
|
|
11
|
+
const [, year, month, day] = match.map(Number);
|
|
12
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
13
|
+
// Rejects dates like 2026-02-30, which Date.UTC would roll into March.
|
|
14
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day ? date : null;
|
|
15
|
+
}
|
|
16
|
+
export function toIsoDate(date) {
|
|
17
|
+
return date.toISOString().slice(0, 10);
|
|
18
|
+
}
|
|
19
|
+
/** Today in the viewer's time zone, as a UTC date. */
|
|
20
|
+
export function today() {
|
|
21
|
+
const now = new Date();
|
|
22
|
+
return new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
23
|
+
}
|
|
24
|
+
export function addDays(date, days) {
|
|
25
|
+
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate() + days));
|
|
26
|
+
}
|
|
27
|
+
/** Moves by whole months, keeping the day where it exists (Jan 31 + 1 month is Feb 28 or 29). */
|
|
28
|
+
export function addMonths(date, months) {
|
|
29
|
+
const first = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1));
|
|
30
|
+
const lastDay = daysInMonth(first.getUTCFullYear(), first.getUTCMonth());
|
|
31
|
+
return new Date(Date.UTC(first.getUTCFullYear(), first.getUTCMonth(), Math.min(date.getUTCDate(), lastDay)));
|
|
32
|
+
}
|
|
33
|
+
export function daysInMonth(year, month) {
|
|
34
|
+
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
|
|
35
|
+
}
|
|
36
|
+
export function isSameDay(a, b) {
|
|
37
|
+
return !!a && !!b && a.getTime() === b.getTime();
|
|
38
|
+
}
|
|
39
|
+
/** Clamps a date into the `[min, max]` range; either bound may be missing. */
|
|
40
|
+
export function clampDate(date, min, max) {
|
|
41
|
+
if (min && date < min)
|
|
42
|
+
return min;
|
|
43
|
+
if (max && date > max)
|
|
44
|
+
return max;
|
|
45
|
+
return date;
|
|
46
|
+
}
|
|
47
|
+
export function isOutOfRange(date, min, max) {
|
|
48
|
+
return (!!min && date < min) || (!!max && date > max);
|
|
49
|
+
}
|
|
50
|
+
/** The column (0–6) a date falls in, for a week starting on `firstDayOfWeek` (0 = Sunday). */
|
|
51
|
+
export function weekdayColumn(date, firstDayOfWeek) {
|
|
52
|
+
return (date.getUTCDay() - firstDayOfWeek + 7) % 7;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The month's weeks, each seven cells long. Days from the neighbouring months are `null`, so the
|
|
56
|
+
* grid only offers dates in the month on view.
|
|
57
|
+
*/
|
|
58
|
+
export function monthWeeks(year, month, firstDayOfWeek) {
|
|
59
|
+
const first = new Date(Date.UTC(year, month, 1));
|
|
60
|
+
const cells = Array(weekdayColumn(first, firstDayOfWeek)).fill(null);
|
|
61
|
+
for (let day = 1; day <= daysInMonth(year, month); day++) {
|
|
62
|
+
cells.push(new Date(Date.UTC(year, month, day)));
|
|
63
|
+
}
|
|
64
|
+
while (cells.length % 7 !== 0)
|
|
65
|
+
cells.push(null);
|
|
66
|
+
const weeks = [];
|
|
67
|
+
for (let i = 0; i < cells.length; i += 7)
|
|
68
|
+
weeks.push(cells.slice(i, i + 7));
|
|
69
|
+
return weeks;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The locale's first day of the week (0 = Sunday), from `Intl.Locale` week info where the browser
|
|
73
|
+
* has it. Falls back to Sunday.
|
|
74
|
+
*/
|
|
75
|
+
export function localeFirstDayOfWeek(locale) {
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
// Intl.Locale is newer than the library's ES2017 typings.
|
|
78
|
+
const IntlLocale = Intl.Locale;
|
|
79
|
+
if (!IntlLocale)
|
|
80
|
+
return 0;
|
|
81
|
+
try {
|
|
82
|
+
const intlLocale = new IntlLocale(locale);
|
|
83
|
+
const firstDay = (_b = (_a = intlLocale.getWeekInfo) === null || _a === void 0 ? void 0 : _a.call(intlLocale).firstDay) !== null && _b !== void 0 ? _b : (_c = intlLocale.weekInfo) === null || _c === void 0 ? void 0 : _c.firstDay;
|
|
84
|
+
// Intl numbers the days 1 (Monday) to 7 (Sunday).
|
|
85
|
+
return typeof firstDay === 'number' ? firstDay % 7 : 0;
|
|
86
|
+
}
|
|
87
|
+
catch (_d) {
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Weekday names, starting from `firstDayOfWeek`: a short form for the column heading and the long
|
|
93
|
+
* form for assistive tech. Latin-script names shorten to two letters (Su Mo, lu ma, Mo Di), as the
|
|
94
|
+
* admin date picker does, while the seven stay distinct; other scripts keep the locale's short form,
|
|
95
|
+
* which is already compact.
|
|
96
|
+
*/
|
|
97
|
+
export function weekdayNames(locale, firstDayOfWeek) {
|
|
98
|
+
const shortFormat = dateFormatter(locale, { weekday: 'short' });
|
|
99
|
+
const longFormat = dateFormatter(locale, { weekday: 'long' });
|
|
100
|
+
// 2023-01-01 was a Sunday.
|
|
101
|
+
const days = Array.from({ length: 7 }, (_, i) => new Date(Date.UTC(2023, 0, 1 + ((firstDayOfWeek + i) % 7))));
|
|
102
|
+
const shorts = days.map((date) => shortFormat.format(date).replace(/\.$/, ''));
|
|
103
|
+
const latin = shorts.every((name) => /^[A-Za-z\u00C0-\u024F]+$/.test(name));
|
|
104
|
+
const twoLetters = shorts.map((name) => name.slice(0, 2));
|
|
105
|
+
const useTwoLetters = latin && new Set(twoLetters.map((name) => name.toLowerCase())).size === 7;
|
|
106
|
+
return days.map((date, i) => ({
|
|
107
|
+
short: useTwoLetters ? twoLetters[i] : shortFormat.format(date),
|
|
108
|
+
long: longFormat.format(date),
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
/** The locale if the browser supports it, otherwise `en-US`, so a bad tag never throws while rendering. */
|
|
112
|
+
export function supportedLocale(locale) {
|
|
113
|
+
var _a;
|
|
114
|
+
try {
|
|
115
|
+
return (_a = Intl.DateTimeFormat.supportedLocalesOf(locale || [])[0]) !== null && _a !== void 0 ? _a : 'en-US';
|
|
116
|
+
}
|
|
117
|
+
catch (_b) {
|
|
118
|
+
return 'en-US';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A formatter for the UTC dates these helpers return. Build it once per render, not per day.
|
|
123
|
+
* Always on the Gregorian calendar the grid is laid out in, while keeping the locale's language and
|
|
124
|
+
* digits: some locales default to another calendar (Persian for `fa`, Buddhist for `th`).
|
|
125
|
+
*/
|
|
126
|
+
export function dateFormatter(locale, options) {
|
|
127
|
+
// `calendar` is newer than the library's ES2017 typings.
|
|
128
|
+
return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, options), { timeZone: 'UTC', calendar: 'gregory' }));
|
|
129
|
+
}
|
|
130
|
+
export function formatDate(date, locale, options) {
|
|
131
|
+
return dateFormatter(locale, options).format(date);
|
|
132
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|