@pine-ds/core 3.7.0 → 3.8.1
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/form.js +16 -1
- package/components/form.js.map +1 -1
- package/components/index2.js +1 -1
- package/components/index2.js.map +1 -1
- package/components/mock-pds-modal.js +1 -1
- package/components/mock-pds-modal.js.map +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-button2.js.map +1 -1
- package/components/pds-checkbox2.js +7 -4
- package/components/pds-checkbox2.js.map +1 -1
- package/components/pds-chip.js +1 -100
- package/components/pds-chip.js.map +1 -1
- package/components/pds-chip2.js +105 -0
- package/components/pds-chip2.js.map +1 -0
- package/components/pds-combobox.js +414 -43
- package/components/pds-combobox.js.map +1 -1
- package/components/pds-copytext.js +3 -3
- package/components/pds-copytext.js.map +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-dropdown-menu.js.map +1 -1
- package/components/pds-filter.js +3 -3
- package/components/pds-filter.js.map +1 -1
- package/components/pds-input.js +1 -1
- package/components/pds-input.js.map +1 -1
- package/components/pds-modal.js +1 -1
- package/components/pds-modal.js.map +1 -1
- package/components/pds-popover.js +123 -15
- package/components/pds-popover.js.map +1 -1
- package/components/pds-radio.js +10 -4
- package/components/pds-radio.js.map +1 -1
- package/components/pds-select.js +21 -5
- package/components/pds-select.js.map +1 -1
- package/components/pds-switch.js +7 -4
- package/components/pds-switch.js.map +1 -1
- package/components/pds-tab.js +1 -1
- package/components/pds-tab.js.map +1 -1
- package/components/pds-table-cell2.js +1 -1
- package/components/pds-table-cell2.js.map +1 -1
- package/components/pds-table-head-cell2.js +1 -1
- package/components/pds-table-head-cell2.js.map +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-head.js.map +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-table-row.js.map +1 -1
- package/components/pds-table.js +1 -1
- package/components/pds-table.js.map +1 -1
- package/components/pds-tabs.js +14 -4
- package/components/pds-tabs.js.map +1 -1
- package/components/pds-textarea.js +9 -6
- package/components/pds-textarea.js.map +1 -1
- package/components/pds-tooltip.js +4 -4
- package/components/pds-tooltip.js.map +1 -1
- package/dist/cjs/{form-Bx4nzJBo.js → form-hmpgbT1I.js} +18 -2
- package/dist/cjs/form-hmpgbT1I.js.map +1 -0
- package/dist/cjs/{index-CTirFLR-.js → index-DtnvzYhe.js} +3 -3
- package/dist/cjs/index-DtnvzYhe.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mock-pds-modal.cjs.entry.js +1 -1
- package/dist/cjs/mock-pds-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/mock-pds-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
- package/dist/cjs/pds-button.cjs.entry.js +2 -2
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +8 -5
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-chip.cjs.entry.js +3 -3
- package/dist/cjs/pds-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +398 -40
- package/dist/cjs/pds-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +4 -4
- package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-copytext.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-dropdown-menu.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-filter.cjs.entry.js +4 -4
- package/dist/cjs/pds-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-filter.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +3 -3
- package/dist/cjs/pds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-input.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-link.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-popover.cjs.entry.js +117 -12
- package/dist/cjs/pds-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +11 -5
- package/dist/cjs/pds-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +20 -5
- package/dist/cjs/pds-select.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-select.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +8 -5
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-tab.cjs.entry.js +1 -1
- package/dist/cjs/pds-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-tab.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-head.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-table.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +14 -4
- package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-tabs.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +10 -7
- package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/collection/components/pds-button/pds-button.css +6 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +7 -4
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -1
- package/dist/collection/components/pds-chip/pds-chip.css +2 -2
- package/dist/collection/components/pds-chip/pds-chip.js +17 -5
- package/dist/collection/components/pds-chip/pds-chip.js.map +1 -1
- package/dist/collection/components/pds-combobox/pds-combobox.css +175 -4
- package/dist/collection/components/pds-combobox/pds-combobox.js +516 -43
- package/dist/collection/components/pds-combobox/pds-combobox.js.map +1 -1
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +79 -2
- package/dist/collection/components/pds-copytext/pds-copytext.css +6 -3
- package/dist/collection/components/pds-copytext/pds-copytext.js +2 -2
- package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -1
- package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +1 -1
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.css +1 -1
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +2 -2
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js.map +1 -1
- package/dist/collection/components/pds-input/pds-input.css +18 -3
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +42 -0
- package/dist/collection/components/pds-modal/pds-modal.css +2 -2
- package/dist/collection/components/pds-popover/pds-popover.css +3 -0
- package/dist/collection/components/pds-popover/pds-popover.js +226 -17
- package/dist/collection/components/pds-popover/pds-popover.js.map +1 -1
- package/dist/collection/components/pds-popover/popover-interface.js +2 -0
- package/dist/collection/components/pds-popover/popover-interface.js.map +1 -0
- package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +10 -4
- package/dist/collection/components/pds-radio/pds-radio.js.map +1 -1
- package/dist/collection/components/pds-select/pds-select.css +1 -1
- package/dist/collection/components/pds-select/pds-select.js +19 -2
- package/dist/collection/components/pds-select/pds-select.js.map +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +7 -4
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +1 -1
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.css +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +1 -1
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.css +1 -1
- package/dist/collection/components/pds-table/pds-table.css +1 -1
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +1 -2
- package/dist/collection/components/pds-tabs/pds-tabs.js +14 -4
- package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -1
- package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.css +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +8 -5
- package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +1 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +3 -3
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -1
- package/dist/collection/utils/form.js +15 -0
- package/dist/collection/utils/form.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/docs.json +341 -17
- package/dist/esm/form-DwjNklzi.js +47 -0
- package/dist/esm/form-DwjNklzi.js.map +1 -0
- package/dist/esm/{index-D4MkIUXU.js → index-D4zJBIgl.js} +3 -3
- package/dist/esm/index-D4zJBIgl.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mock-pds-modal.entry.js +1 -1
- package/dist/esm/mock-pds-modal.entry.js.map +1 -1
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +1 -1
- package/dist/esm/pds-button.entry.js +2 -2
- package/dist/esm/pds-button.entry.js.map +1 -1
- package/dist/esm/pds-checkbox.entry.js +8 -5
- package/dist/esm/pds-checkbox.entry.js.map +1 -1
- package/dist/esm/pds-chip.entry.js +3 -3
- package/dist/esm/pds-chip.entry.js.map +1 -1
- package/dist/esm/pds-combobox.entry.js +398 -40
- package/dist/esm/pds-combobox.entry.js.map +1 -1
- package/dist/esm/pds-copytext.entry.js +4 -4
- package/dist/esm/pds-copytext.entry.js.map +1 -1
- package/dist/esm/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu.entry.js.map +1 -1
- package/dist/esm/pds-filter.entry.js +4 -4
- package/dist/esm/pds-filter.entry.js.map +1 -1
- package/dist/esm/pds-input.entry.js +3 -3
- package/dist/esm/pds-input.entry.js.map +1 -1
- package/dist/esm/pds-link.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js.map +1 -1
- package/dist/esm/pds-popover.entry.js +118 -13
- package/dist/esm/pds-popover.entry.js.map +1 -1
- package/dist/esm/pds-radio.entry.js +12 -6
- package/dist/esm/pds-radio.entry.js.map +1 -1
- package/dist/esm/pds-select.entry.js +20 -5
- package/dist/esm/pds-select.entry.js.map +1 -1
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +8 -5
- package/dist/esm/pds-switch.entry.js.map +1 -1
- package/dist/esm/pds-tab.entry.js +1 -1
- package/dist/esm/pds-tab.entry.js.map +1 -1
- package/dist/esm/pds-table-cell.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js.map +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +2 -2
- package/dist/esm/pds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-head.entry.js.map +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js.map +1 -1
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-table.entry.js.map +1 -1
- package/dist/esm/pds-tabs.entry.js +14 -4
- package/dist/esm/pds-tabs.entry.js.map +1 -1
- package/dist/esm/pds-textarea.entry.js +10 -7
- package/dist/esm/pds-textarea.entry.js.map +1 -1
- package/dist/esm/pds-tooltip.entry.js +4 -4
- package/dist/esm/pds-tooltip.entry.js.map +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm-es5/form-DwjNklzi.js +2 -0
- package/dist/esm-es5/form-DwjNklzi.js.map +1 -0
- package/dist/esm-es5/{index-D4MkIUXU.js → index-D4zJBIgl.js} +1 -1
- package/dist/esm-es5/index-D4zJBIgl.js.map +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/mock-pds-modal.entry.js.map +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js.map +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js.map +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js.map +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js.map +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-filter.entry.js.map +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js.map +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js.map +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js.map +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js.map +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js.map +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js.map +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-tab.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js.map +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js.map +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js.map +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js.map +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/pine-core/mock-pds-modal.entry.esm.js.map +1 -1
- package/dist/pine-core/p-00346c62.system.entry.js +2 -0
- package/dist/pine-core/p-00346c62.system.entry.js.map +1 -0
- package/dist/pine-core/{p-8ded79aa.system.entry.js → p-0486ecc6.system.entry.js} +2 -2
- package/dist/pine-core/{p-8ded79aa.system.entry.js.map → p-0486ecc6.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-af56cb57.entry.js → p-100de2b7.entry.js} +2 -2
- package/dist/pine-core/p-1b932ee3.entry.js +2 -0
- package/dist/pine-core/p-1b932ee3.entry.js.map +1 -0
- package/dist/pine-core/p-20466115.entry.js +2 -0
- package/dist/pine-core/p-20466115.entry.js.map +1 -0
- package/dist/pine-core/{p-72d87dc6.system.entry.js → p-2054b5cb.system.entry.js} +2 -2
- package/dist/pine-core/{p-c0601420.system.entry.js → p-2aab28b1.system.entry.js} +2 -2
- package/dist/pine-core/p-3dce3bc0.system.entry.js +2 -0
- package/dist/pine-core/p-3dce3bc0.system.entry.js.map +1 -0
- package/dist/pine-core/p-45d574f1.system.entry.js +2 -0
- package/dist/pine-core/p-45d574f1.system.entry.js.map +1 -0
- package/dist/pine-core/p-465e3418.system.entry.js +2 -0
- package/dist/pine-core/p-465e3418.system.entry.js.map +1 -0
- package/dist/pine-core/p-4xv5UVkx.system.js.map +1 -0
- package/dist/pine-core/p-538b3902.system.entry.js +2 -0
- package/dist/pine-core/p-538b3902.system.entry.js.map +1 -0
- package/dist/pine-core/p-61a25ab2.entry.js +2 -0
- package/dist/pine-core/p-61a25ab2.entry.js.map +1 -0
- package/dist/pine-core/p-6381a811.system.entry.js +4 -0
- package/dist/pine-core/p-6381a811.system.entry.js.map +1 -0
- package/dist/pine-core/p-6c36cab6.entry.js +2 -0
- package/dist/pine-core/p-6c36cab6.entry.js.map +1 -0
- package/dist/pine-core/p-6ed297cb.entry.js +2 -0
- package/dist/pine-core/p-6ed297cb.entry.js.map +1 -0
- package/dist/pine-core/p-708e963c.system.entry.js +2 -0
- package/dist/pine-core/p-708e963c.system.entry.js.map +1 -0
- package/dist/pine-core/{p-896e2f1b.entry.js → p-725c350c.entry.js} +2 -2
- package/dist/pine-core/{p-896e2f1b.entry.js.map → p-725c350c.entry.js.map} +1 -1
- package/dist/pine-core/p-75187352.system.entry.js +2 -0
- package/dist/pine-core/p-75187352.system.entry.js.map +1 -0
- package/dist/pine-core/p-79422986.entry.js +2 -0
- package/dist/pine-core/p-79422986.entry.js.map +1 -0
- package/dist/pine-core/p-81bc089e.entry.js +2 -0
- package/dist/pine-core/p-81bc089e.entry.js.map +1 -0
- package/dist/pine-core/p-85c41629.entry.js +2 -0
- package/dist/pine-core/p-85c41629.entry.js.map +1 -0
- package/dist/pine-core/p-86263a62.entry.js +2 -0
- package/dist/pine-core/p-86263a62.entry.js.map +1 -0
- package/dist/pine-core/p-87ed43d5.entry.js +2 -0
- package/dist/pine-core/p-87ed43d5.entry.js.map +1 -0
- package/dist/pine-core/{p-a54d6a53.entry.js → p-88773b86.entry.js} +2 -2
- package/dist/pine-core/p-8b5fc4b4.system.entry.js +2 -0
- package/dist/pine-core/p-8b5fc4b4.system.entry.js.map +1 -0
- package/dist/pine-core/p-94183716.entry.js +2 -0
- package/dist/pine-core/p-94183716.entry.js.map +1 -0
- package/dist/pine-core/p-9766923f.entry.js +2 -0
- package/dist/pine-core/p-9766923f.entry.js.map +1 -0
- package/dist/pine-core/p-9b335a9f.entry.js +2 -0
- package/dist/pine-core/p-9b335a9f.entry.js.map +1 -0
- package/dist/pine-core/p-9c579956.system.entry.js +2 -0
- package/dist/pine-core/p-9c579956.system.entry.js.map +1 -0
- package/dist/pine-core/p-9cf2b7a6.entry.js +2 -0
- package/dist/pine-core/p-9cf2b7a6.entry.js.map +1 -0
- package/dist/pine-core/{p-COwpA8ab.system.js.map → p-B-Doh1Wu.system.js.map} +1 -1
- package/dist/pine-core/{p-BSkbMuB5.system.js → p-BG99uNIQ.system.js} +1 -1
- package/dist/pine-core/p-BG99uNIQ.system.js.map +1 -0
- package/dist/pine-core/p-BHavepTY.system.js +2 -0
- package/dist/pine-core/p-BHavepTY.system.js.map +1 -0
- package/dist/pine-core/p-BLC5kuro.system.js.map +1 -0
- package/dist/pine-core/p-BPjnTOEL.system.js +1 -1
- package/dist/pine-core/{p-X5M4eshC.system.js.map → p-BRIdBthP.system.js.map} +1 -1
- package/dist/pine-core/p-BVDuy7iI.system.js.map +1 -0
- package/dist/pine-core/{p-B57Bybw-.system.js.map → p-BkPtASB1.system.js.map} +1 -1
- package/dist/pine-core/p-Bkfqi7zE.system.js.map +1 -0
- package/dist/pine-core/p-C1KChp5Q.system.js.map +1 -0
- package/dist/pine-core/p-C2W-sHx5.system.js.map +1 -0
- package/dist/pine-core/p-CIBXMJd-.system.js.map +1 -0
- package/dist/pine-core/p-CJNB_wrl.system.js.map +1 -0
- package/dist/pine-core/p-CSa_b_JX.system.js.map +1 -0
- package/dist/pine-core/p-Cid662up.system.js.map +1 -0
- package/dist/pine-core/p-Cqzmj3D8.system.js.map +1 -0
- package/dist/pine-core/p-Cxlv_2hD.system.js.map +1 -0
- package/dist/pine-core/p-D0foS5EP.system.js.map +1 -0
- package/dist/pine-core/{p-D4MkIUXU.js → p-D4zJBIgl.js} +1 -1
- package/dist/pine-core/p-D4zJBIgl.js.map +1 -0
- package/dist/pine-core/p-DCjZr2HA.system.js.map +1 -0
- package/dist/pine-core/p-DN3VK2yy.system.js.map +1 -0
- package/dist/pine-core/{p-DgE9ds9o.system.js.map → p-DOqVoXeA.system.js.map} +1 -1
- package/dist/pine-core/p-DW3lkDNz.system.js.map +1 -0
- package/dist/pine-core/p-DfrSuf6X.system.js.map +1 -0
- package/dist/pine-core/p-DpemOPFJ.system.js.map +1 -0
- package/dist/pine-core/p-DpzRSULT.system.js.map +1 -0
- package/dist/pine-core/p-DtdXdmNp.system.js.map +1 -0
- package/dist/pine-core/p-DwjNklzi.js +2 -0
- package/dist/pine-core/p-DwjNklzi.js.map +1 -0
- package/dist/pine-core/p-GrmqKqN8.system.js.map +1 -0
- package/dist/pine-core/p-HHZU8rBT.system.js.map +1 -0
- package/dist/pine-core/p-a2708028.entry.js +2 -0
- package/dist/pine-core/p-a2708028.entry.js.map +1 -0
- package/dist/pine-core/{p-46820152.entry.js → p-a3785977.entry.js} +2 -2
- package/dist/pine-core/p-a707a7da.system.entry.js +2 -0
- package/dist/pine-core/p-a707a7da.system.entry.js.map +1 -0
- package/dist/pine-core/p-acd87a10.entry.js +2 -0
- package/dist/pine-core/p-acd87a10.entry.js.map +1 -0
- package/dist/pine-core/p-ae4ec5cf.system.entry.js +2 -0
- package/dist/pine-core/p-ae4ec5cf.system.entry.js.map +1 -0
- package/dist/pine-core/p-b23dd01c.entry.js +2 -0
- package/dist/pine-core/p-b23dd01c.entry.js.map +1 -0
- package/dist/pine-core/p-b9aafec7.system.entry.js +2 -0
- package/dist/pine-core/p-b9aafec7.system.entry.js.map +1 -0
- package/dist/pine-core/p-bac9fcfa.entry.js +2 -0
- package/dist/pine-core/p-bac9fcfa.entry.js.map +1 -0
- package/dist/pine-core/p-c3579585.system.entry.js +2 -0
- package/dist/pine-core/p-c3579585.system.entry.js.map +1 -0
- package/dist/pine-core/p-cffc98ae.entry.js +3 -0
- package/dist/pine-core/p-cffc98ae.entry.js.map +1 -0
- package/dist/pine-core/{p-559b4ebc.entry.js → p-d1b27fa4.entry.js} +2 -2
- package/dist/pine-core/p-d2b15290.system.entry.js +2 -0
- package/dist/pine-core/p-d2b15290.system.entry.js.map +1 -0
- package/dist/pine-core/p-d4d22aee.entry.js +2 -0
- package/dist/pine-core/p-d4d22aee.entry.js.map +1 -0
- package/dist/pine-core/p-d69f0f51.system.entry.js +2 -0
- package/dist/pine-core/p-d69f0f51.system.entry.js.map +1 -0
- package/dist/pine-core/{p-c63e7909.system.entry.js → p-dace69e7.system.entry.js} +2 -2
- package/dist/pine-core/p-e34c1224.system.entry.js +2 -0
- package/dist/pine-core/p-e34c1224.system.entry.js.map +1 -0
- package/dist/pine-core/p-e5adbf74.system.entry.js +2 -0
- package/dist/pine-core/p-e5adbf74.system.entry.js.map +1 -0
- package/dist/pine-core/p-e6085566.system.entry.js +2 -0
- package/dist/pine-core/p-e6085566.system.entry.js.map +1 -0
- package/dist/pine-core/p-e683e197.system.entry.js +2 -0
- package/dist/pine-core/p-e683e197.system.entry.js.map +1 -0
- package/dist/pine-core/p-e6b051e8.system.entry.js +2 -0
- package/dist/pine-core/p-e6b051e8.system.entry.js.map +1 -0
- package/dist/pine-core/{p-ab4307c7.system.entry.js → p-e702a8dc.system.entry.js} +2 -2
- package/dist/pine-core/p-f15cd180.entry.js +2 -0
- package/dist/pine-core/p-f15cd180.entry.js.map +1 -0
- package/dist/pine-core/p-f6d0bd39.entry.js +2 -0
- package/dist/pine-core/p-f6d0bd39.entry.js.map +1 -0
- package/dist/pine-core/p-f92d7570.system.entry.js +2 -0
- package/dist/pine-core/p-f92d7570.system.entry.js.map +1 -0
- package/dist/pine-core/{p-d325287b.entry.js.map → p-ozqEY4Zc.system.js.map} +1 -1
- package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-checkbox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-chip.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-combobox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-copytext.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-dropdown-menu.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-filter.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-input.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-modal.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-popover.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-radio.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-select.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-switch.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-tab.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-cell.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-head-cell.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-head.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-row.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-tabs.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-textarea.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-tooltip.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.css +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +1 -0
- package/dist/types/components/pds-chip/pds-chip.d.ts +3 -2
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +56 -2
- package/dist/types/components/pds-popover/pds-popover.d.ts +33 -2
- package/dist/types/components/pds-popover/popover-interface.d.ts +8 -0
- package/dist/types/components/pds-radio/pds-radio.d.ts +3 -0
- package/dist/types/components/pds-select/pds-select.d.ts +6 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +1 -0
- package/dist/types/components/pds-textarea/pds-textarea.d.ts +1 -0
- package/dist/types/components.d.ts +94 -10
- package/dist/types/utils/form.d.ts +9 -0
- package/dist/types/utils/types.d.ts +2 -0
- package/hydrate/index.js +629 -101
- package/hydrate/index.mjs +629 -101
- package/package.json +2 -2
- package/dist/cjs/form-Bx4nzJBo.js.map +0 -1
- package/dist/cjs/index-CTirFLR-.js.map +0 -1
- package/dist/esm/form-DTL_39D_.js +0 -32
- package/dist/esm/form-DTL_39D_.js.map +0 -1
- package/dist/esm/index-D4MkIUXU.js.map +0 -1
- package/dist/esm-es5/form-DTL_39D_.js +0 -2
- package/dist/esm-es5/form-DTL_39D_.js.map +0 -1
- package/dist/esm-es5/index-D4MkIUXU.js.map +0 -1
- package/dist/pine-core/p-0075bbbe.system.entry.js +0 -2
- package/dist/pine-core/p-0075bbbe.system.entry.js.map +0 -1
- package/dist/pine-core/p-0975b749.system.entry.js +0 -2
- package/dist/pine-core/p-0975b749.system.entry.js.map +0 -1
- package/dist/pine-core/p-0befa8f0.entry.js +0 -2
- package/dist/pine-core/p-0befa8f0.entry.js.map +0 -1
- package/dist/pine-core/p-0d18171c.system.entry.js +0 -2
- package/dist/pine-core/p-0d18171c.system.entry.js.map +0 -1
- package/dist/pine-core/p-1773aeac.system.entry.js +0 -2
- package/dist/pine-core/p-1773aeac.system.entry.js.map +0 -1
- package/dist/pine-core/p-265372d3.entry.js +0 -2
- package/dist/pine-core/p-265372d3.entry.js.map +0 -1
- package/dist/pine-core/p-29b2af94.entry.js +0 -2
- package/dist/pine-core/p-29b2af94.entry.js.map +0 -1
- package/dist/pine-core/p-2b452883.system.entry.js +0 -2
- package/dist/pine-core/p-2b452883.system.entry.js.map +0 -1
- package/dist/pine-core/p-30e8c3ea.entry.js +0 -2
- package/dist/pine-core/p-30e8c3ea.entry.js.map +0 -1
- package/dist/pine-core/p-31f6fcc1.entry.js +0 -2
- package/dist/pine-core/p-31f6fcc1.entry.js.map +0 -1
- package/dist/pine-core/p-3b20aa93.system.entry.js +0 -2
- package/dist/pine-core/p-3b20aa93.system.entry.js.map +0 -1
- package/dist/pine-core/p-3e7933bf.entry.js +0 -2
- package/dist/pine-core/p-3e7933bf.entry.js.map +0 -1
- package/dist/pine-core/p-4534e8cc.system.entry.js +0 -2
- package/dist/pine-core/p-4534e8cc.system.entry.js.map +0 -1
- package/dist/pine-core/p-4b3a8cab.entry.js +0 -2
- package/dist/pine-core/p-4b3a8cab.entry.js.map +0 -1
- package/dist/pine-core/p-4c8bebd8.system.entry.js +0 -2
- package/dist/pine-core/p-4c8bebd8.system.entry.js.map +0 -1
- package/dist/pine-core/p-4dda1edf.entry.js +0 -2
- package/dist/pine-core/p-4dda1edf.entry.js.map +0 -1
- package/dist/pine-core/p-4e55730d.entry.js +0 -2
- package/dist/pine-core/p-4e55730d.entry.js.map +0 -1
- package/dist/pine-core/p-56f6f106.entry.js +0 -2
- package/dist/pine-core/p-56f6f106.entry.js.map +0 -1
- package/dist/pine-core/p-5cc0244d.system.entry.js +0 -2
- package/dist/pine-core/p-5cc0244d.system.entry.js.map +0 -1
- package/dist/pine-core/p-74f03e75.entry.js +0 -2
- package/dist/pine-core/p-74f03e75.entry.js.map +0 -1
- package/dist/pine-core/p-7b0517e5.system.entry.js +0 -2
- package/dist/pine-core/p-7b0517e5.system.entry.js.map +0 -1
- package/dist/pine-core/p-7b66bc50.entry.js +0 -3
- package/dist/pine-core/p-7b66bc50.entry.js.map +0 -1
- package/dist/pine-core/p-7eb22880.entry.js +0 -2
- package/dist/pine-core/p-7eb22880.entry.js.map +0 -1
- package/dist/pine-core/p-8501429f.entry.js +0 -2
- package/dist/pine-core/p-8501429f.entry.js.map +0 -1
- package/dist/pine-core/p-94fe15b0.system.entry.js +0 -2
- package/dist/pine-core/p-94fe15b0.system.entry.js.map +0 -1
- package/dist/pine-core/p-95aee0b1.entry.js +0 -2
- package/dist/pine-core/p-95aee0b1.entry.js.map +0 -1
- package/dist/pine-core/p-B02VgXkx.system.js.map +0 -1
- package/dist/pine-core/p-BFiM1S8V.system.js.map +0 -1
- package/dist/pine-core/p-BG7_qxVr.system.js +0 -2
- package/dist/pine-core/p-BG7_qxVr.system.js.map +0 -1
- package/dist/pine-core/p-BJhtHwq5.system.js.map +0 -1
- package/dist/pine-core/p-BQFgzIQT.system.js.map +0 -1
- package/dist/pine-core/p-BSkbMuB5.system.js.map +0 -1
- package/dist/pine-core/p-BigOVPun.system.js.map +0 -1
- package/dist/pine-core/p-BmFGXXkm.system.js.map +0 -1
- package/dist/pine-core/p-CHVzHNgU.system.js.map +0 -1
- package/dist/pine-core/p-CV0Lw9gs.system.js.map +0 -1
- package/dist/pine-core/p-CZqgW7e3.system.js.map +0 -1
- package/dist/pine-core/p-Cc1q-FuD.system.js.map +0 -1
- package/dist/pine-core/p-D3SrjYeb.system.js.map +0 -1
- package/dist/pine-core/p-D4MkIUXU.js.map +0 -1
- package/dist/pine-core/p-D9veIL-g.system.js.map +0 -1
- package/dist/pine-core/p-DGFR-x7P.system.js.map +0 -1
- package/dist/pine-core/p-DTL_39D_.js +0 -2
- package/dist/pine-core/p-DTL_39D_.js.map +0 -1
- package/dist/pine-core/p-DeR0sSWy.system.js.map +0 -1
- package/dist/pine-core/p-Df597YUK.system.js.map +0 -1
- package/dist/pine-core/p-Ek6vvXfI.system.js.map +0 -1
- package/dist/pine-core/p-WO5h6NYA.system.js.map +0 -1
- package/dist/pine-core/p-Z5rOSkoA.system.js.map +0 -1
- package/dist/pine-core/p-a5cf0088.system.entry.js +0 -2
- package/dist/pine-core/p-a5cf0088.system.entry.js.map +0 -1
- package/dist/pine-core/p-aa2782b9.system.entry.js +0 -2
- package/dist/pine-core/p-aa2782b9.system.entry.js.map +0 -1
- package/dist/pine-core/p-b32d34d0.entry.js +0 -2
- package/dist/pine-core/p-b32d34d0.entry.js.map +0 -1
- package/dist/pine-core/p-b378ca03.entry.js +0 -2
- package/dist/pine-core/p-b378ca03.entry.js.map +0 -1
- package/dist/pine-core/p-b699a14f.system.entry.js +0 -2
- package/dist/pine-core/p-b699a14f.system.entry.js.map +0 -1
- package/dist/pine-core/p-c2d2fe64.system.entry.js +0 -2
- package/dist/pine-core/p-c2d2fe64.system.entry.js.map +0 -1
- package/dist/pine-core/p-d325287b.entry.js +0 -2
- package/dist/pine-core/p-d52d96b5.system.entry.js +0 -4
- package/dist/pine-core/p-d52d96b5.system.entry.js.map +0 -1
- package/dist/pine-core/p-d5c63517.system.entry.js +0 -2
- package/dist/pine-core/p-d5c63517.system.entry.js.map +0 -1
- package/dist/pine-core/p-d65d252d.entry.js +0 -2
- package/dist/pine-core/p-d65d252d.entry.js.map +0 -1
- package/dist/pine-core/p-dbe41087.system.entry.js +0 -2
- package/dist/pine-core/p-dbe41087.system.entry.js.map +0 -1
- package/dist/pine-core/p-e03b7f4a.system.entry.js +0 -2
- package/dist/pine-core/p-e03b7f4a.system.entry.js.map +0 -1
- package/dist/pine-core/p-f6b269ac.entry.js +0 -2
- package/dist/pine-core/p-f6b269ac.entry.js.map +0 -1
- package/dist/pine-core/p-f70aef6e.system.entry.js +0 -2
- package/dist/pine-core/p-f70aef6e.system.entry.js.map +0 -1
- package/dist/pine-core/p-fd3d548f.entry.js +0 -2
- package/dist/pine-core/p-fd3d548f.entry.js.map +0 -1
- package/dist/pine-core/p-fddf82f8.entry.js +0 -2
- package/dist/pine-core/p-fddf82f8.entry.js.map +0 -1
- package/dist/pine-core/p-fdf22be1.system.entry.js +0 -2
- package/dist/pine-core/p-fdf22be1.system.entry.js.map +0 -1
- package/dist/pine-core/p-fe7ece91.system.entry.js +0 -2
- package/dist/pine-core/p-fe7ece91.system.entry.js.map +0 -1
- package/dist/pine-core/p-iM8w34Dq.system.js.map +0 -1
- package/dist/pine-core/p-kbAzjMDU.system.js.map +0 -1
- package/dist/pine-core/p-nawkAoxk.system.js.map +0 -1
- package/dist/pine-core/p-oDk-2Jyq.system.js.map +0 -1
- package/dist/pine-core/p-wlxYjeBe.system.js.map +0 -1
- /package/dist/pine-core/{p-af56cb57.entry.js.map → p-100de2b7.entry.js.map} +0 -0
- /package/dist/pine-core/{p-72d87dc6.system.entry.js.map → p-2054b5cb.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c0601420.system.entry.js.map → p-2aab28b1.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a54d6a53.entry.js.map → p-88773b86.entry.js.map} +0 -0
- /package/dist/pine-core/{p-46820152.entry.js.map → p-a3785977.entry.js.map} +0 -0
- /package/dist/pine-core/{p-559b4ebc.entry.js.map → p-d1b27fa4.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c63e7909.system.entry.js.map → p-dace69e7.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ab4307c7.system.entry.js.map → p-e702a8dc.system.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { assignDescription, isRequired, messageId } from "../../utils/form";
|
|
2
|
+
import { assignDescription, isRequired, messageId, exposeTypeProperty } from "../../utils/form";
|
|
3
3
|
import { debounceEvent } from "../../utils/utils";
|
|
4
4
|
import { inheritAttributes, inheritAriaAttributes } from "../../utils/attributes";
|
|
5
5
|
import { danger } from "@pine-ds/icons/icons";
|
|
@@ -9,6 +9,7 @@ import { danger } from "@pine-ds/icons/icons";
|
|
|
9
9
|
export class PdsTextarea {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.inheritedAttributes = {};
|
|
12
|
+
this._type = 'textarea';
|
|
12
13
|
/**
|
|
13
14
|
* Determines whether or not the textarea is disabled.
|
|
14
15
|
* @defaultValue false
|
|
@@ -172,6 +173,8 @@ export class PdsTextarea {
|
|
|
172
173
|
this.updateFormValue();
|
|
173
174
|
// Setup ResizeObserver for character counter positioning
|
|
174
175
|
this.setupResizeObserver();
|
|
176
|
+
// Expose type property on the element instance to match native form element behavior
|
|
177
|
+
exposeTypeProperty(this.el, () => this._type);
|
|
175
178
|
}
|
|
176
179
|
/**
|
|
177
180
|
* Sets up ResizeObserver to track textarea resize for character counter positioning
|
|
@@ -286,10 +289,10 @@ export class PdsTextarea {
|
|
|
286
289
|
}
|
|
287
290
|
render() {
|
|
288
291
|
const value = this.getValue();
|
|
289
|
-
return (h(Host, { key: '
|
|
290
|
-
h("div", { key: '
|
|
291
|
-
h("p", { key: '
|
|
292
|
-
h("p", { key: '
|
|
292
|
+
return (h(Host, { key: '5ca3fed52ff7fd0b0497d01412bb7ca3746b2e7e', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null, "has-action": this.hasAction && !this.hideLabel ? 'true' : null }, h("div", { key: '3761f27f234f9667ce8dffc77c5ede89159afaea', class: "pds-textarea" }, this.label &&
|
|
293
|
+
h("div", { key: 'db533228166be7a303969703b2e92327e02e0b88', class: "pds-textarea__label-wrapper" }, h("label", { key: '6e215f009e9297f5a1a415419f40064fd3168ad8', htmlFor: this.componentId }, h("span", { key: 'b48b3427bfdff3cef0ed18799cf64547b7e77e97', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), !this.hideLabel && this.renderAction()), h("div", { key: '23c4a2231dfd1b42e45d04f35e9dc2772d2df2fb', class: "pds-textarea__field-wrapper" }, h("textarea", Object.assign({ key: '7081f83eacc8dd5fdef8774b3887eb6109281aa6', ref: (el) => this.nativeTextarea = el, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, class: this.textareaClassNames(), disabled: this.disabled, id: this.componentId, maxlength: this.maxLength, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, rows: this.rows, onBlur: this.onBlur, onChange: this.onTextareaChange, onFocus: this.onFocus, onInput: this.onInput }, this.inheritedAttributes), value), this.renderCharacterCounter()), this.helperMessage &&
|
|
294
|
+
h("p", { key: '237e251d35403fc4225123ac56476b656ab9ad48', class: "pds-textarea__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.invalid &&
|
|
295
|
+
h("p", { key: 'f4102e758212c00074bfbd144d311fa4fedf5b49', "aria-live": "assertive", class: "pds-textarea__error-message", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: '92535a264a990ff133a1e6dde709236b3157b2d0', icon: danger, size: "small" }), this.errorMessage))));
|
|
293
296
|
}
|
|
294
297
|
static get is() { return "pds-textarea"; }
|
|
295
298
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-textarea.js","sourceRoot":"","sources":["../../../src/components/pds-textarea/pds-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;GAEG;AAWH,MAAM,OAAO,WAAW;IAVxB;QAcU,wBAAmB,GAAe,EAAE,CAAC;QAwD7C;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAiBzB;;;WAGG;QACoB,YAAO,GAAG,KAAK,CAAC,CAAO,wDAAwD;QAatG;;WAEG;QACK,SAAI,GAAW,IAAI,CAAC,WAAW,CAAC;QAOxC;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAYzB;;WAEG;QACoB,UAAK,GAAmB,EAAE,CAAC;QAEzC,aAAQ,GAAG,KAAK,CAAC;QAE1B;;WAEG;QACM,cAAS,GAAG,KAAK,CAAC;QA+EnB,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;gBACrC,IAAI,CAAC,eAAe,CAAC,EAAE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Host, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, isRequired, messageId } from '../../utils/form';\nimport { TextareaChangeEventDetail, TextareaInputEventDetail } from './textarea-interface';\nimport { debounceEvent } from '@utils/utils';\nimport type { Attributes } from '@utils/attributes';\nimport { inheritAttributes, inheritAriaAttributes } from '@utils/attributes';\nimport { danger } from '@pine-ds/icons/icons';\n\n/**\n * @slot action - Content to be displayed in the label area, typically for help icons or links\n */\n@Component({\n tag: 'pds-textarea',\n styleUrls: [\n '../../global/styles/utils/label.scss',\n '../pds-input/pds-input.tokens.scss',\n 'pds-textarea.scss'\n ],\n shadow: true,\n formAssociated: true,\n})\nexport class PdsTextarea {\n\n private nativeTextarea?: HTMLTextAreaElement\n private focusedValue?: string | null;\n private inheritedAttributes: Attributes = {};\n private originalPdsInput?: EventEmitter<TextareaInputEventDetail>;\n private internals?: ElementInternals;\n private resizeObserver?: ResizeObserver;\n private characterCounter?: HTMLElement;\n\n @Element() el: HTMLPdsTextareaElement;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() pdsInput: EventEmitter<TextareaInputEventDetail>;\n\n /**\n * Event emitted whenever the value of the textarea changes.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsTextareaChange: EventEmitter<TextareaChangeEventDetail>;\n\n /**\n * Sets focus on the native `textarea` in the `pds-textarea`. Use this method instead of the global\n * `textarea.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeTextarea) {\n this.nativeTextarea.focus();\n }\n }\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Determines whether or not the textarea is disabled.\n * @defaultValue false\n */\n @Prop() disabled = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the event after each keystroke.\n */\n @Prop() debounce?: number;\n\n /**\n * Displays an error message below the textarea field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the textarea field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the textarea is invalid or throws an error.\n * @defaultValue false\n */\n @Prop({mutable: true}) invalid = false; // eslint-disable-line @stencil-community/strict-mutable\n\n /**\n * Text to be displayed as the textarea label.\n */\n @Prop() label?: string;\n\n /**\n * Visually hides the label text for instances where only the textarea should be displayed. Label remains accessible to assistive technology such as screen readers.\n * Note: When true, the action slot is also hidden to maintain a minimal UI.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Specifies the name. Submitted with the form name/value pair. This value will mirror the componentId.\n */\n @Prop() name: string = this.componentId;\n\n /**\n * Specifies a short hint that describes the expected value of the textarea.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the textarea is readonly.\n * @defaultValue false\n */\n @Prop() readonly = false;\n\n /**\n * Determines whether or not the textarea is required.\n * @defaultValue false\n */\n @Prop() required = false;\n\n /**\n * Sets number of rows of text visible without needing to scroll in the textarea.\n */\n @Prop() rows?: number;\n\n /**\n * Specifies the maximum number of characters allowed in the textarea. When set, displays a character counter.\n */\n @Prop({ reflect: true }) maxLength?: number;\n\n /**\n * The value of the textarea.\n */\n @Prop({mutable: true}) value?: string | null = '';\n\n @State() hasFocus = false;\n\n /**\n * If true, the textarea has action content in the label area\n */\n @State() hasAction = false;\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeTextarea = this.nativeTextarea;\n const value = this.getValue();\n\n if (nativeTextarea && nativeTextarea.value !== value) {\n nativeTextarea.value = value;\n }\n\n // Update form value for Form Associated Custom Elements API\n this.updateFormValue();\n\n // Update character counter position in case content changes affect sizing\n if (this.maxLength && typeof ResizeObserver !== 'undefined') {\n this.updateCharacterCounterPosition();\n }\n }\n\n @Watch('maxLength')\n protected maxLengthChanged() {\n // Setup or teardown ResizeObserver based on maxLength\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n\n if (this.maxLength && this.nativeTextarea) {\n this.setupResizeObserver();\n }\n\n // Update ElementInternals validity when maxLength changes\n if (this.internals && this.internals.setValidity && this.nativeTextarea) {\n const isTooLong = this.nativeTextarea.value.length > (this.maxLength || 0);\n this.internals.setValidity(\n { tooLong: isTooLong },\n isTooLong ? 'Value exceeds maxLength' : '',\n this.nativeTextarea\n );\n }\n }\n\n /**\n * Emits an `pdsInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n this.pdsInput.emit({ value, event });\n }\n\n /**\n * Emits an `pdsTextareaChange` event.\n */\n private emitValueChange(event?: Event) {\n const textarea = event.target as HTMLTextAreaElement;\n isRequired(textarea, this);\n\n const { value } = textarea;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n this.focusedValue = newValue;\n this.pdsTextareaChange.emit({ value: newValue, event });\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLTextAreaElement | null;\n if (input) {\n // Handle maxLength validation\n if (this.maxLength && input.value.length > this.maxLength) {\n // Prevent input beyond maxLength\n input.value = input.value.substring(0, this.maxLength);\n }\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n\n // Update counter position when content changes\n if (this.maxLength && typeof ResizeObserver !== 'undefined') {\n // Use requestAnimationFrame to ensure DOM is updated\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n }\n };\n\n private onTextareaChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private textareaClassNames() {\n const classNames = ['pds-textarea__field'];\n\n if (this.invalid && this.invalid === true) {\n classNames.push('is-invalid');\n }\n\n return classNames.join(' ');\n }\n\n connectedCallback() {\n this.debounceChanged();\n // Initialize ElementInternals for form association\n if (this.el.attachInternals) {\n this.internals = this.el.attachInternals();\n }\n }\n\n disconnectedCallback() {\n // Clean up ResizeObserver\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el),\n };\n this.hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n }\n\n componentDidLoad() {\n this.originalPdsInput = this.pdsInput;\n // Set initial form value\n this.updateFormValue();\n\n // Setup ResizeObserver for character counter positioning\n this.setupResizeObserver();\n }\n\n /**\n * Sets up ResizeObserver to track textarea resize for character counter positioning\n */\n private setupResizeObserver() {\n if (!this.maxLength || !this.nativeTextarea) return;\n\n // ResizeObserver may not be available in test environments\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n // Use requestAnimationFrame to ensure DOM updates are complete\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n });\n\n this.resizeObserver.observe(this.nativeTextarea);\n\n // Initial positioning with a small delay to ensure counter is rendered\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n }\n }\n\n /**\n * Updates character counter position to stay within textarea boundaries during resize\n */\n private updateCharacterCounterPosition() {\n if (!this.characterCounter || !this.nativeTextarea) return;\n\n // Skip positioning in test environments where ResizeObserver isn't available\n if (typeof ResizeObserver === 'undefined') return;\n\n // Ensure the character counter has been rendered and has dimensions\n if (this.characterCounter.offsetWidth === 0 || this.characterCounter.offsetHeight === 0) {\n // Counter not ready or component hidden - return and let resize/input observers handle positioning later\n return;\n }\n\n // Position based on textarea's actual dimensions (which change during manual resize)\n const textareaWidth = this.nativeTextarea.offsetWidth;\n const textareaHeight = this.nativeTextarea.offsetHeight;\n const counterWidth = this.characterCounter.offsetWidth;\n const counterHeight = this.characterCounter.offsetHeight;\n\n // Calculate position within textarea boundaries with padding from edges\n const rightPosition = textareaWidth - counterWidth - 8;\n const bottomPosition = textareaHeight - counterHeight - 8;\n\n // Ensure counter stays within textarea boundaries even when resized very small\n const finalLeft = Math.max(8, Math.min(rightPosition, textareaWidth - counterWidth - 8));\n const finalTop = Math.max(8, Math.min(bottomPosition, textareaHeight - counterHeight - 8));\n\n // Apply absolute positioning within the field wrapper\n this.characterCounter.style.position = 'absolute';\n this.characterCounter.style.left = `${finalLeft}px`;\n this.characterCounter.style.top = `${finalTop}px`;\n this.characterCounter.style.right = 'auto';\n this.characterCounter.style.bottom = 'auto';\n }\n\n /**\n * Renders the character counter when maxLength is set\n */\n private renderCharacterCounter() {\n if (!this.maxLength) {\n return null;\n }\n\n const currentLength = this.getValue().length;\n return (\n <div\n class=\"pds-textarea__character-counter\"\n ref={(el) => this.characterCounter = el}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={`${currentLength} of ${this.maxLength} characters`}\n >\n {currentLength} / {this.maxLength}\n </div>\n );\n }\n\n private renderAction() {\n const hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n if (hasAction) {\n return (\n <div class=\"pds-textarea__action\" part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n );\n }\n return null;\n }\n\n /**\n * Updates the form value using ElementInternals API\n */\n private updateFormValue() {\n if (this.internals && this.internals.setFormValue) {\n const value = this.getValue();\n this.internals.setFormValue(value || null);\n\n // Set validity based on native textarea validation\n if (this.nativeTextarea && this.internals && this.internals.setValidity) {\n this.internals.setValidity(\n this.nativeTextarea.validity,\n this.nativeTextarea.validationMessage,\n this.nativeTextarea\n );\n }\n }\n }\n\n\n /**\n * Form Associated Custom Elements API: Called when the form is reset\n */\n formResetCallback() {\n this.value = '';\n this.updateFormValue();\n }\n\n /**\n * Form Associated Custom Elements API: Called when the form is disabled\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Form Associated Custom Elements API: Called to restore form state\n */\n formStateRestoreCallback(state: string | FormData | null) {\n if (typeof state === 'string') {\n this.value = state;\n } else if (state instanceof FormData && this.name) {\n // Extract value from FormData using the textarea's name\n const value = state.get(this.name);\n if (typeof value === 'string') {\n this.value = value;\n }\n }\n }\n\n render() {\n const value = this.getValue();\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n has-action={this.hasAction && !this.hideLabel ? 'true' : null}\n >\n <div class=\"pds-textarea\">\n {this.label &&\n <div class=\"pds-textarea__label-wrapper\">\n <label htmlFor={this.componentId}>\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {!this.hideLabel && this.renderAction()}\n </div>\n }\n <div class=\"pds-textarea__field-wrapper\">\n <textarea\n ref={(el) => this.nativeTextarea = el }\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n class={this.textareaClassNames()}\n disabled={this.disabled}\n id={this.componentId}\n maxlength={this.maxLength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n onBlur={this.onBlur}\n onChange={this.onTextareaChange}\n onFocus={this.onFocus}\n onInput={this.onInput}\n {...this.inheritedAttributes}\n >\n {value}\n </textarea>\n {this.renderCharacterCounter()}\n </div>\n {this.helperMessage &&\n <p\n class=\"pds-textarea__helper-message\"\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </p>\n }\n {this.invalid &&\n <p\n aria-live=\"assertive\"\n class=\"pds-textarea__error-message\"\n id={messageId(this.componentId, 'error')}\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </p>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-textarea.js","sourceRoot":"","sources":["../../../src/components/pds-textarea/pds-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;GAEG;AAWH,MAAM,OAAO,WAAW;IAVxB;QAcU,wBAAmB,GAAe,EAAE,CAAC;QAK5B,UAAK,GAAG,UAAmB,CAAC;QAoD7C;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAiBzB;;;WAGG;QACoB,YAAO,GAAG,KAAK,CAAC,CAAO,wDAAwD;QAatG;;WAEG;QACK,SAAI,GAAW,IAAI,CAAC,WAAW,CAAC;QAOxC;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAYzB;;WAEG;QACoB,UAAK,GAAmB,EAAE,CAAC;QAEzC,aAAQ,GAAG,KAAK,CAAC;QAG1B;;WAEG;QACM,cAAS,GAAG,KAAK,CAAC;QA+EnB,WAAM,GAAG,CAAC,EAAc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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, isRequired, messageId, exposeTypeProperty } from '../../utils/form';\nimport { TextareaChangeEventDetail, TextareaInputEventDetail } from './textarea-interface';\nimport { debounceEvent } from '@utils/utils';\nimport type { Attributes } from '@utils/attributes';\nimport { inheritAttributes, inheritAriaAttributes } from '@utils/attributes';\nimport { danger } from '@pine-ds/icons/icons';\n\n/**\n * @slot action - Content to be displayed in the label area, typically for help icons or links\n */\n@Component({\n tag: 'pds-textarea',\n styleUrls: [\n '../../global/styles/utils/label.scss',\n '../pds-input/pds-input.tokens.scss',\n 'pds-textarea.scss'\n ],\n shadow: true,\n formAssociated: true,\n})\nexport class PdsTextarea {\n\n private nativeTextarea?: HTMLTextAreaElement\n private focusedValue?: string | null;\n private inheritedAttributes: Attributes = {};\n private originalPdsInput?: EventEmitter<TextareaInputEventDetail>;\n private internals?: ElementInternals;\n private resizeObserver?: ResizeObserver;\n private characterCounter?: HTMLElement;\n private readonly _type = 'textarea' as const;\n\n @Element() el: HTMLPdsTextareaElement;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() pdsInput: EventEmitter<TextareaInputEventDetail>;\n\n /**\n * Event emitted whenever the value of the textarea changes.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsTextareaChange: EventEmitter<TextareaChangeEventDetail>;\n\n /**\n * Sets focus on the native `textarea` in the `pds-textarea`. Use this method instead of the global\n * `textarea.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeTextarea) {\n this.nativeTextarea.focus();\n }\n }\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Determines whether or not the textarea is disabled.\n * @defaultValue false\n */\n @Prop() disabled = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the event after each keystroke.\n */\n @Prop() debounce?: number;\n\n /**\n * Displays an error message below the textarea field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the textarea field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the textarea is invalid or throws an error.\n * @defaultValue false\n */\n @Prop({mutable: true}) invalid = false; // eslint-disable-line @stencil-community/strict-mutable\n\n /**\n * Text to be displayed as the textarea label.\n */\n @Prop() label?: string;\n\n /**\n * Visually hides the label text for instances where only the textarea should be displayed. Label remains accessible to assistive technology such as screen readers.\n * Note: When true, the action slot is also hidden to maintain a minimal UI.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Specifies the name. Submitted with the form name/value pair. This value will mirror the componentId.\n */\n @Prop() name: string = this.componentId;\n\n /**\n * Specifies a short hint that describes the expected value of the textarea.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the textarea is readonly.\n * @defaultValue false\n */\n @Prop() readonly = false;\n\n /**\n * Determines whether or not the textarea is required.\n * @defaultValue false\n */\n @Prop() required = false;\n\n /**\n * Sets number of rows of text visible without needing to scroll in the textarea.\n */\n @Prop() rows?: number;\n\n /**\n * Specifies the maximum number of characters allowed in the textarea. When set, displays a character counter.\n */\n @Prop({ reflect: true }) maxLength?: number;\n\n /**\n * The value of the textarea.\n */\n @Prop({mutable: true}) value?: string | null = '';\n\n @State() hasFocus = false;\n\n\n /**\n * If true, the textarea has action content in the label area\n */\n @State() hasAction = false;\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeTextarea = this.nativeTextarea;\n const value = this.getValue();\n\n if (nativeTextarea && nativeTextarea.value !== value) {\n nativeTextarea.value = value;\n }\n\n // Update form value for Form Associated Custom Elements API\n this.updateFormValue();\n\n // Update character counter position in case content changes affect sizing\n if (this.maxLength && typeof ResizeObserver !== 'undefined') {\n this.updateCharacterCounterPosition();\n }\n }\n\n @Watch('maxLength')\n protected maxLengthChanged() {\n // Setup or teardown ResizeObserver based on maxLength\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n\n if (this.maxLength && this.nativeTextarea) {\n this.setupResizeObserver();\n }\n\n // Update ElementInternals validity when maxLength changes\n if (this.internals && this.internals.setValidity && this.nativeTextarea) {\n const isTooLong = this.nativeTextarea.value.length > (this.maxLength || 0);\n this.internals.setValidity(\n { tooLong: isTooLong },\n isTooLong ? 'Value exceeds maxLength' : '',\n this.nativeTextarea\n );\n }\n }\n\n /**\n * Emits an `pdsInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n this.pdsInput.emit({ value, event });\n }\n\n /**\n * Emits an `pdsTextareaChange` event.\n */\n private emitValueChange(event?: Event) {\n const textarea = event.target as HTMLTextAreaElement;\n isRequired(textarea, this);\n\n const { value } = textarea;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n this.focusedValue = newValue;\n this.pdsTextareaChange.emit({ value: newValue, event });\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLTextAreaElement | null;\n if (input) {\n // Handle maxLength validation\n if (this.maxLength && input.value.length > this.maxLength) {\n // Prevent input beyond maxLength\n input.value = input.value.substring(0, this.maxLength);\n }\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n\n // Update counter position when content changes\n if (this.maxLength && typeof ResizeObserver !== 'undefined') {\n // Use requestAnimationFrame to ensure DOM is updated\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n }\n };\n\n private onTextareaChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private textareaClassNames() {\n const classNames = ['pds-textarea__field'];\n\n if (this.invalid && this.invalid === true) {\n classNames.push('is-invalid');\n }\n\n return classNames.join(' ');\n }\n\n connectedCallback() {\n this.debounceChanged();\n // Initialize ElementInternals for form association\n if (this.el.attachInternals) {\n this.internals = this.el.attachInternals();\n }\n }\n\n disconnectedCallback() {\n // Clean up ResizeObserver\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el),\n };\n this.hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n }\n\n componentDidLoad() {\n this.originalPdsInput = this.pdsInput;\n // Set initial form value\n this.updateFormValue();\n\n // Setup ResizeObserver for character counter positioning\n this.setupResizeObserver();\n\n // Expose type property on the element instance to match native form element behavior\n exposeTypeProperty(this.el, () => this._type);\n }\n\n /**\n * Sets up ResizeObserver to track textarea resize for character counter positioning\n */\n private setupResizeObserver() {\n if (!this.maxLength || !this.nativeTextarea) return;\n\n // ResizeObserver may not be available in test environments\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n // Use requestAnimationFrame to ensure DOM updates are complete\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n });\n\n this.resizeObserver.observe(this.nativeTextarea);\n\n // Initial positioning with a small delay to ensure counter is rendered\n requestAnimationFrame(() => {\n this.updateCharacterCounterPosition();\n });\n }\n }\n\n /**\n * Updates character counter position to stay within textarea boundaries during resize\n */\n private updateCharacterCounterPosition() {\n if (!this.characterCounter || !this.nativeTextarea) return;\n\n // Skip positioning in test environments where ResizeObserver isn't available\n if (typeof ResizeObserver === 'undefined') return;\n\n // Ensure the character counter has been rendered and has dimensions\n if (this.characterCounter.offsetWidth === 0 || this.characterCounter.offsetHeight === 0) {\n // Counter not ready or component hidden - return and let resize/input observers handle positioning later\n return;\n }\n\n // Position based on textarea's actual dimensions (which change during manual resize)\n const textareaWidth = this.nativeTextarea.offsetWidth;\n const textareaHeight = this.nativeTextarea.offsetHeight;\n const counterWidth = this.characterCounter.offsetWidth;\n const counterHeight = this.characterCounter.offsetHeight;\n\n // Calculate position within textarea boundaries with padding from edges\n const rightPosition = textareaWidth - counterWidth - 8;\n const bottomPosition = textareaHeight - counterHeight - 8;\n\n // Ensure counter stays within textarea boundaries even when resized very small\n const finalLeft = Math.max(8, Math.min(rightPosition, textareaWidth - counterWidth - 8));\n const finalTop = Math.max(8, Math.min(bottomPosition, textareaHeight - counterHeight - 8));\n\n // Apply absolute positioning within the field wrapper\n this.characterCounter.style.position = 'absolute';\n this.characterCounter.style.left = `${finalLeft}px`;\n this.characterCounter.style.top = `${finalTop}px`;\n this.characterCounter.style.right = 'auto';\n this.characterCounter.style.bottom = 'auto';\n }\n\n /**\n * Renders the character counter when maxLength is set\n */\n private renderCharacterCounter() {\n if (!this.maxLength) {\n return null;\n }\n\n const currentLength = this.getValue().length;\n return (\n <div\n class=\"pds-textarea__character-counter\"\n ref={(el) => this.characterCounter = el}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={`${currentLength} of ${this.maxLength} characters`}\n >\n {currentLength} / {this.maxLength}\n </div>\n );\n }\n\n private renderAction() {\n const hasAction = this.el.querySelector('[slot=\"action\"]') !== null;\n if (hasAction) {\n return (\n <div class=\"pds-textarea__action\" part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n );\n }\n return null;\n }\n\n /**\n * Updates the form value using ElementInternals API\n */\n private updateFormValue() {\n if (this.internals && this.internals.setFormValue) {\n const value = this.getValue();\n this.internals.setFormValue(value || null);\n\n // Set validity based on native textarea validation\n if (this.nativeTextarea && this.internals && this.internals.setValidity) {\n this.internals.setValidity(\n this.nativeTextarea.validity,\n this.nativeTextarea.validationMessage,\n this.nativeTextarea\n );\n }\n }\n }\n\n\n /**\n * Form Associated Custom Elements API: Called when the form is reset\n */\n formResetCallback() {\n this.value = '';\n this.updateFormValue();\n }\n\n /**\n * Form Associated Custom Elements API: Called when the form is disabled\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Form Associated Custom Elements API: Called to restore form state\n */\n formStateRestoreCallback(state: string | FormData | null) {\n if (typeof state === 'string') {\n this.value = state;\n } else if (state instanceof FormData && this.name) {\n // Extract value from FormData using the textarea's name\n const value = state.get(this.name);\n if (typeof value === 'string') {\n this.value = value;\n }\n }\n }\n\n render() {\n const value = this.getValue();\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n has-action={this.hasAction && !this.hideLabel ? 'true' : null}\n >\n <div class=\"pds-textarea\">\n {this.label &&\n <div class=\"pds-textarea__label-wrapper\">\n <label htmlFor={this.componentId}>\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {!this.hideLabel && this.renderAction()}\n </div>\n }\n <div class=\"pds-textarea__field-wrapper\">\n <textarea\n ref={(el) => this.nativeTextarea = el }\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n class={this.textareaClassNames()}\n disabled={this.disabled}\n id={this.componentId}\n maxlength={this.maxLength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n onBlur={this.onBlur}\n onChange={this.onTextareaChange}\n onFocus={this.onFocus}\n onInput={this.onInput}\n {...this.inheritedAttributes}\n >\n {value}\n </textarea>\n {this.renderCharacterCounter()}\n </div>\n {this.helperMessage &&\n <p\n class=\"pds-textarea__helper-message\"\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </p>\n }\n {this.invalid &&\n <p\n aria-live=\"assertive\"\n class=\"pds-textarea__error-message\"\n id={messageId(this.componentId, 'error')}\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </p>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -212,7 +212,7 @@ export class PdsTooltip {
|
|
|
212
212
|
this.portalEl = document.createElement('div');
|
|
213
213
|
this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;
|
|
214
214
|
this.portalEl.style.position = 'fixed';
|
|
215
|
-
this.portalEl.style.zIndex = '
|
|
215
|
+
this.portalEl.style.zIndex = 'var(--pine-z-index-nuclear)';
|
|
216
216
|
if (this.portalEl.id === '') {
|
|
217
217
|
const suffix = PdsTooltip.instanceCounter++;
|
|
218
218
|
const baseId = this.componentId || this.el.id || 'pds-tooltip';
|
|
@@ -312,9 +312,9 @@ export class PdsTooltip {
|
|
|
312
312
|
}
|
|
313
313
|
render() {
|
|
314
314
|
const hostId = this.componentId || undefined;
|
|
315
|
-
return (h(Host, { key: '
|
|
315
|
+
return (h(Host, { key: 'ef40605b8ed95b1920caa425a021b900bdaef847', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: '953a0ddd6070fa99e89307f6ddb9bacfa6932b5c', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide,
|
|
316
316
|
/* focusin/out bubble; ensure keyboard users see tooltips */
|
|
317
|
-
onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '
|
|
317
|
+
onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '9fa52468a1d99d4dd5af8a8c07d11b1591c5204c' })), h("div", { key: 'c4dfe98893fc2abacff788177d1f143afb2aa502', class: "pds-tooltip__content-slot-wrapper", hidden: true }, h("slot", { key: '468d06248f384f727517de3fd4c15af8d6e7b118', name: "content" }))));
|
|
318
318
|
}
|
|
319
319
|
static get is() { return "pds-tooltip"; }
|
|
320
320
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-tooltip.js","sourceRoot":"","sources":["../../../src/components/pds-tooltip/pds-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,EACL,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AAQH,MAAM,OAAO,UAAU;IANvB;QASE;;;WAGG;QACc,uBAAkB,GAAG,KAAK,CAAC;QAEpC,aAAQ,GAAuB,IAAI,CAAC;QACpC,sBAAiB,GAAkB,OAAO,CAAC;QAC3C,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAAuB,IAAI,CAAC;QACtC,yBAAoB,GAA4B,IAAI,CAAC;QACrD,oBAAe,GAAW,EAAE,CAAC;QAC7B,0BAAqB,GAA0C,IAAI,CAAC;QACpE,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CAAC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC;QAE7C,OAAO,CACL,EAAC,IAAI,qDAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,sBAAsB,EAAE,IAAI,CAAC,MAAM,EAAE;YAC9D,6DACE,KAAK,EAAC,sBAAsB,EAC5B,YAAY,EAAE,IAAI,CAAC,UAAU,EAC7B,YAAY,EAAE,IAAI,CAAC,UAAU;gBAC7B,4DAA4D;gBAC5D,SAAS,EAAE,IAAI,CAAC,UAAiB,EACjC,UAAU,EAAE,IAAI,CAAC,UAAiB,EAClC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;gBAE9B,8DAAQ,CACH;YACP,4DAAK,KAAK,EAAC,mCAAmC,EAAC,MAAM;gBACnD,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApZc,0BAAe,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport { PlacementType } from '@utils/types';\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\n\n/**\n * @slot (default) - The tooltip's target element\n * @slot content - HTML content for the tooltip\n */\n\n@Component({\n tag: 'pds-tooltip',\n styleUrls: ['pds-tooltip.scss'],\n shadow: false,\n})\n\nexport class PdsTooltip {\n private static instanceCounter = 0;\n\n /**\n * Internal state: true if the tooltip was opened by user interaction (hover/focus),\n * false if opened via the `opened` prop or currently closed.\n */\n @State() private _isInteractiveOpen = false;\n\n private portalEl: HTMLElement | null = null;\n private resolvedPlacement: PlacementType = 'right';\n private triggerEl: HTMLElement | null = null;\n private contentDiv: HTMLElement | null = null;\n private slotMutationObserver: MutationObserver | null = null;\n private currentPathname: string = '';\n private pathnameCheckInterval: ReturnType<typeof setInterval> | null = null;\n private stopAutoUpdate: (() => void) | null = null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Content for the tooltip. If HTML is required, use the content slot\n */\n @Prop() content: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether or not the tooltip has an arrow\n * @defaultValue true\n */\n @Prop() hasArrow = true;\n\n /**\n * Enable this option when using the content slot\n * @defaultValue false\n */\n @Prop() htmlContent = false;\n\n /**\n * Determines the preferred position of the tooltip\n * @defaultValue \"right\"\n */\n @Prop({ reflect: true }) placement: PlacementType = 'right';\n\n /**\n * Sets the maximum width of the tooltip content\n * @defaultValue \"352px\"\n */\n @Prop() maxWidth: string = '352px';\n\n /**\n * Determines whether or not the tooltip is visible\n * @defaultValue false\n */\n @Prop({mutable: true, reflect: true}) opened = false;\n\n @Watch('opened')\n\n handleOpenToggle(newValue: boolean, oldValue: boolean) {\n if (newValue === false && oldValue === true) {\n this._isInteractiveOpen = false;\n }\n }\n\n componentWillLoad() {\n this._isInteractiveOpen = false;\n this.resolvedPlacement = this.placement;\n }\n\n componentDidLoad() {\n window.addEventListener('pageshow', this.handlePageShow);\n this.currentPathname = window.location.pathname;\n this.triggerEl = this.el.querySelector('.pds-tooltip__trigger') as HTMLElement;\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n\n if (contentSlotWrapper !== null) {\n this.slotMutationObserver = new MutationObserver(() => {\n if (this.opened && this.portalEl !== null) {\n this.removePortal();\n this.createPortal();\n }\n });\n this.slotMutationObserver.observe(contentSlotWrapper, { childList: true, subtree: false });\n }\n\n // no return; Stencil ignores teardown functions here\n }\n\n disconnectedCallback() {\n window.removeEventListener('pageshow', this.handlePageShow);\n if (this.slotMutationObserver !== null) {\n this.slotMutationObserver.disconnect();\n this.slotMutationObserver = null;\n }\n // Ensure global listeners/intervals are removed if still present\n if (this.portalEl !== null) {\n this.removePortal();\n }\n if (this.pathnameCheckInterval !== null) {\n clearInterval(this.pathnameCheckInterval);\n this.pathnameCheckInterval = null;\n }\n // Ensure autoUpdate is stopped if still present\n if (this.stopAutoUpdate !== null) {\n this.stopAutoUpdate();\n this.stopAutoUpdate = null;\n }\n }\n\n componentDidRender() {\n if (this.opened && this.portalEl === null) {\n this.createPortal();\n } else if (!this.opened && this.portalEl !== null) {\n this.removePortal();\n }\n\n // Update portal class when opened state changes\n if (this.portalEl !== null) {\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n\n // Update ARIA attributes to stay in sync with visual open state\n this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n }\n }\n\n /**\n * Shows the tooltip by enabling the opened property\n */\n @Method()\n async showTooltip() {\n this.opened = true;\n }\n\n /**\n * Hides the tooltip by disabling the opened property\n */\n @Method()\n async hideTooltip() {\n this.opened = false;\n }\n\n private handleHide = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n private handleShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this._isInteractiveOpen = true;\n this.showTooltip();\n };\n\n private handlePageShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.opened = false;\n this._isInteractiveOpen = false;\n };\n\n\n private handleSpaNavigation = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n private checkPathnameChange = () => {\n if (window.location.pathname !== this.currentPathname) {\n this.currentPathname = window.location.pathname;\n this.handleSpaNavigation();\n }\n };\n\n /**\n * Determines the most accurate HTML element to use as the anchor for positioning the tooltip.\n * If `htmlContent` is false, it attempts to find the actual element slotted as the trigger.\n * Otherwise, or if no specific element is found, it defaults to the span wrapper around the trigger slot.\n * This helps with precise alignment.\n */\n private determinePositioningAnchor(): HTMLElement | null {\n let positioningAnchor: HTMLElement | null = this.triggerEl;\n\n if (this.triggerEl !== null) {\n const children = this.triggerEl.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n const childNode = children[i];\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n positioningAnchor = childNode as HTMLElement;\n break; // Found the first element, use it as the anchor\n }\n }\n }\n\n // If no ELEMENT_NODE is found within this.triggerEl (e.g., if trigger is just text),\n // positioningAnchor will correctly remain this.triggerEl (the span).\n return positioningAnchor;\n }\n\n /**\n * Centralized method to calculate and apply the tooltip's position using floating UI.\n * Uses the determined anchor element and applies computePosition with flip, offset, and shift.\n */\n private async repositionPortal() {\n const anchor = this.determinePositioningAnchor();\n\n if (anchor !== null && this.portalEl !== null) {\n try {\n const { x, y, placement: computedPlacement } = await computePosition(anchor, this.portalEl, {\n placement: this.placement,\n strategy: 'fixed',\n middleware: [offset(8), flip(), shift({ padding: 5 })],\n });\n\n this.resolvedPlacement = computedPlacement as PlacementType;\n\n Object.assign(this.portalEl.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed',\n });\n\n // Update CSS classes to match the resolved placement\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n } catch (error) {\n console.warn('Failed to position tooltip:', error);\n this.resolvedPlacement = this.placement; // Fallback to requested placement\n // Fallback to basic positioning if floating UI fails\n const anchorRect = anchor.getBoundingClientRect();\n this.portalEl.style.left = `${anchorRect.right + 8}px`;\n this.portalEl.style.top = `${anchorRect.top}px`;\n this.portalEl.style.position = 'fixed';\n }\n }\n }\n\n private createPortal() {\n if (this.portalEl !== null) return;\n\n this.portalEl = document.createElement('div');\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n this.portalEl.style.position = 'fixed';\n this.portalEl.style.zIndex = '9999';\n\n if (this.portalEl.id === '') {\n const suffix = PdsTooltip.instanceCounter++;\n const baseId = this.componentId || this.el.id || 'pds-tooltip';\n this.portalEl.id = `${baseId}-portal-${suffix}`;\n }\n\n if (this.portalEl.getAttribute('id') !== this.portalEl.id) {\n this.portalEl.setAttribute('id', this.portalEl.id);\n }\n\n this.portalEl.setAttribute('role', 'tooltip');\n this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n this.portalEl.style.maxWidth = this.maxWidth;\n\n this.contentDiv = document.createElement('div');\n this.contentDiv.className = 'pds-tooltip__content';\n this.contentDiv.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.contentDiv.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n const slottedContentContainer = contentSlotWrapper?.querySelector('[slot=\"content\"]') as HTMLElement | null;\n let hasSlottedContent = false;\n\n if (slottedContentContainer !== null) {\n const childrenToClone = Array.from(slottedContentContainer.childNodes);\n\n if (childrenToClone.length > 0) {\n const hasMeaningfulNode = childrenToClone.some(node =>\n node.nodeType === Node.ELEMENT_NODE ||\n (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')\n );\n\n if (hasMeaningfulNode) {\n hasSlottedContent = true;\n childrenToClone.forEach((node /*, index*/) => {\n if (node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')) {\n this.contentDiv.appendChild(node.cloneNode(true));\n }\n });\n }\n }\n }\n\n if (!hasSlottedContent && typeof this.content === 'string' && this.content.trim() !== '') {\n this.contentDiv.textContent = this.content;\n }\n\n this.portalEl.appendChild(this.contentDiv);\n document.body.appendChild(this.portalEl);\n\n this.repositionPortal().catch(error => {\n console.warn('Failed to position tooltip on creation:', error);\n });\n\n // Use Floating UI's autoUpdate to handle scroll/resize automatically\n if (this.triggerEl && this.portalEl) {\n this.stopAutoUpdate = autoUpdate(\n this.triggerEl,\n this.portalEl,\n () => {\n this.repositionPortal().catch(error => {\n console.warn('Failed to reposition tooltip on auto update:', error);\n });\n }\n );\n }\n\n // Keep only SPA navigation listeners (not handled by autoUpdate)\n window.addEventListener('popstate', this.handleSpaNavigation, true);\n window.addEventListener('hashchange', this.handleSpaNavigation, true);\n\n // Start pathname change detection\n this.pathnameCheckInterval = setInterval(this.checkPathnameChange, 100);\n\n // Add ARIA attribute to trigger, now that portalEl and its ID are confirmed\n if (this.triggerEl !== null && this.portalEl.id !== '') {\n this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);\n }\n }\n\n private removePortal() {\n // Stop Floating UI's autoUpdate\n if (this.stopAutoUpdate !== null) {\n this.stopAutoUpdate();\n this.stopAutoUpdate = null;\n }\n\n // Stop pathname change detection\n if (this.pathnameCheckInterval !== null) {\n clearInterval(this.pathnameCheckInterval);\n this.pathnameCheckInterval = null;\n }\n\n if (this.portalEl !== null) {\n // Remove only SPA navigation listeners (scroll/resize handled by autoUpdate)\n window.removeEventListener('popstate', this.handleSpaNavigation, true);\n window.removeEventListener('hashchange', this.handleSpaNavigation, true);\n\n // Safely remove portal from DOM\n try {\n if (this.portalEl.parentNode) {\n this.portalEl.parentNode.removeChild(this.portalEl);\n }\n } catch (error) {\n // Portal might have already been removed by test cleanup\n console.warn('Portal element could not be removed from DOM:', error);\n }\n\n this.portalEl = null;\n }\n\n // Remove ARIA attribute from trigger\n if (this.triggerEl !== null) {\n this.triggerEl.removeAttribute('aria-describedby');\n }\n this.contentDiv = null;\n }\n\n render() {\n const hostId = this.componentId || undefined;\n\n return (\n <Host id={hostId} class={{ 'pds-tooltip--is-open': this.opened }}>\n <span\n class=\"pds-tooltip__trigger\"\n onMouseEnter={this.handleShow}\n onMouseLeave={this.handleHide}\n /* focusin/out bubble; ensure keyboard users see tooltips */\n onFocusin={this.handleShow as any}\n onFocusout={this.handleHide as any}\n ref={el => this.triggerEl = el}\n >\n <slot />\n </span>\n <div class=\"pds-tooltip__content-slot-wrapper\" hidden>\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-tooltip.js","sourceRoot":"","sources":["../../../src/components/pds-tooltip/pds-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,EACL,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AAQH,MAAM,OAAO,UAAU;IANvB;QASE;;;WAGG;QACc,uBAAkB,GAAG,KAAK,CAAC;QAEpC,aAAQ,GAAuB,IAAI,CAAC;QACpC,sBAAiB,GAAkB,OAAO,CAAC;QAC3C,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAAuB,IAAI,CAAC;QACtC,yBAAoB,GAA4B,IAAI,CAAC;QACrD,oBAAe,GAAW,EAAE,CAAC;QAC7B,0BAAqB,GAA0C,IAAI,CAAC;QACpE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rD,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC;QAE7C,OAAO,CACL,EAAC,IAAI,qDAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,sBAAsB,EAAE,IAAI,CAAC,MAAM,EAAE;YAC9D,6DACE,KAAK,EAAC,sBAAsB,EAC5B,YAAY,EAAE,IAAI,CAAC,UAAU,EAC7B,YAAY,EAAE,IAAI,CAAC,UAAU;gBAC7B,4DAA4D;gBAC5D,SAAS,EAAE,IAAI,CAAC,UAAiB,EACjC,UAAU,EAAE,IAAI,CAAC,UAAiB,EAClC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;gBAE9B,8DAAQ,CACH;YACP,4DAAK,KAAK,EAAC,mCAAmC,EAAC,MAAM;gBACnD,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApZc,0BAAe,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport { PlacementType } from '@utils/types';\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\n\n/**\n * @slot (default) - The tooltip's target element\n * @slot content - HTML content for the tooltip\n */\n\n@Component({\n tag: 'pds-tooltip',\n styleUrls: ['pds-tooltip.scss'],\n shadow: false,\n})\n\nexport class PdsTooltip {\n private static instanceCounter = 0;\n\n /**\n * Internal state: true if the tooltip was opened by user interaction (hover/focus),\n * false if opened via the `opened` prop or currently closed.\n */\n @State() private _isInteractiveOpen = false;\n\n private portalEl: HTMLElement | null = null;\n private resolvedPlacement: PlacementType = 'right';\n private triggerEl: HTMLElement | null = null;\n private contentDiv: HTMLElement | null = null;\n private slotMutationObserver: MutationObserver | null = null;\n private currentPathname: string = '';\n private pathnameCheckInterval: ReturnType<typeof setInterval> | null = null;\n private stopAutoUpdate: (() => void) | null = null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Content for the tooltip. If HTML is required, use the content slot\n */\n @Prop() content: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether or not the tooltip has an arrow\n * @defaultValue true\n */\n @Prop() hasArrow = true;\n\n /**\n * Enable this option when using the content slot\n * @defaultValue false\n */\n @Prop() htmlContent = false;\n\n /**\n * Determines the preferred position of the tooltip\n * @defaultValue \"right\"\n */\n @Prop({ reflect: true }) placement: PlacementType = 'right';\n\n /**\n * Sets the maximum width of the tooltip content\n * @defaultValue \"352px\"\n */\n @Prop() maxWidth: string = '352px';\n\n /**\n * Determines whether or not the tooltip is visible\n * @defaultValue false\n */\n @Prop({mutable: true, reflect: true}) opened = false;\n\n @Watch('opened')\n\n handleOpenToggle(newValue: boolean, oldValue: boolean) {\n if (newValue === false && oldValue === true) {\n this._isInteractiveOpen = false;\n }\n }\n\n componentWillLoad() {\n this._isInteractiveOpen = false;\n this.resolvedPlacement = this.placement;\n }\n\n componentDidLoad() {\n window.addEventListener('pageshow', this.handlePageShow);\n this.currentPathname = window.location.pathname;\n this.triggerEl = this.el.querySelector('.pds-tooltip__trigger') as HTMLElement;\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n\n if (contentSlotWrapper !== null) {\n this.slotMutationObserver = new MutationObserver(() => {\n if (this.opened && this.portalEl !== null) {\n this.removePortal();\n this.createPortal();\n }\n });\n this.slotMutationObserver.observe(contentSlotWrapper, { childList: true, subtree: false });\n }\n\n // no return; Stencil ignores teardown functions here\n }\n\n disconnectedCallback() {\n window.removeEventListener('pageshow', this.handlePageShow);\n if (this.slotMutationObserver !== null) {\n this.slotMutationObserver.disconnect();\n this.slotMutationObserver = null;\n }\n // Ensure global listeners/intervals are removed if still present\n if (this.portalEl !== null) {\n this.removePortal();\n }\n if (this.pathnameCheckInterval !== null) {\n clearInterval(this.pathnameCheckInterval);\n this.pathnameCheckInterval = null;\n }\n // Ensure autoUpdate is stopped if still present\n if (this.stopAutoUpdate !== null) {\n this.stopAutoUpdate();\n this.stopAutoUpdate = null;\n }\n }\n\n componentDidRender() {\n if (this.opened && this.portalEl === null) {\n this.createPortal();\n } else if (!this.opened && this.portalEl !== null) {\n this.removePortal();\n }\n\n // Update portal class when opened state changes\n if (this.portalEl !== null) {\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n\n // Update ARIA attributes to stay in sync with visual open state\n this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n }\n }\n\n /**\n * Shows the tooltip by enabling the opened property\n */\n @Method()\n async showTooltip() {\n this.opened = true;\n }\n\n /**\n * Hides the tooltip by disabling the opened property\n */\n @Method()\n async hideTooltip() {\n this.opened = false;\n }\n\n private handleHide = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n private handleShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this._isInteractiveOpen = true;\n this.showTooltip();\n };\n\n private handlePageShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.opened = false;\n this._isInteractiveOpen = false;\n };\n\n\n private handleSpaNavigation = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n private checkPathnameChange = () => {\n if (window.location.pathname !== this.currentPathname) {\n this.currentPathname = window.location.pathname;\n this.handleSpaNavigation();\n }\n };\n\n /**\n * Determines the most accurate HTML element to use as the anchor for positioning the tooltip.\n * If `htmlContent` is false, it attempts to find the actual element slotted as the trigger.\n * Otherwise, or if no specific element is found, it defaults to the span wrapper around the trigger slot.\n * This helps with precise alignment.\n */\n private determinePositioningAnchor(): HTMLElement | null {\n let positioningAnchor: HTMLElement | null = this.triggerEl;\n\n if (this.triggerEl !== null) {\n const children = this.triggerEl.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n const childNode = children[i];\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n positioningAnchor = childNode as HTMLElement;\n break; // Found the first element, use it as the anchor\n }\n }\n }\n\n // If no ELEMENT_NODE is found within this.triggerEl (e.g., if trigger is just text),\n // positioningAnchor will correctly remain this.triggerEl (the span).\n return positioningAnchor;\n }\n\n /**\n * Centralized method to calculate and apply the tooltip's position using floating UI.\n * Uses the determined anchor element and applies computePosition with flip, offset, and shift.\n */\n private async repositionPortal() {\n const anchor = this.determinePositioningAnchor();\n\n if (anchor !== null && this.portalEl !== null) {\n try {\n const { x, y, placement: computedPlacement } = await computePosition(anchor, this.portalEl, {\n placement: this.placement,\n strategy: 'fixed',\n middleware: [offset(8), flip(), shift({ padding: 5 })],\n });\n\n this.resolvedPlacement = computedPlacement as PlacementType;\n\n Object.assign(this.portalEl.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed',\n });\n\n // Update CSS classes to match the resolved placement\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n } catch (error) {\n console.warn('Failed to position tooltip:', error);\n this.resolvedPlacement = this.placement; // Fallback to requested placement\n // Fallback to basic positioning if floating UI fails\n const anchorRect = anchor.getBoundingClientRect();\n this.portalEl.style.left = `${anchorRect.right + 8}px`;\n this.portalEl.style.top = `${anchorRect.top}px`;\n this.portalEl.style.position = 'fixed';\n }\n }\n }\n\n private createPortal() {\n if (this.portalEl !== null) return;\n\n this.portalEl = document.createElement('div');\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.resolvedPlacement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n this.portalEl.style.position = 'fixed';\n this.portalEl.style.zIndex = 'var(--pine-z-index-nuclear)';\n\n if (this.portalEl.id === '') {\n const suffix = PdsTooltip.instanceCounter++;\n const baseId = this.componentId || this.el.id || 'pds-tooltip';\n this.portalEl.id = `${baseId}-portal-${suffix}`;\n }\n\n if (this.portalEl.getAttribute('id') !== this.portalEl.id) {\n this.portalEl.setAttribute('id', this.portalEl.id);\n }\n\n this.portalEl.setAttribute('role', 'tooltip');\n this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n this.portalEl.style.maxWidth = this.maxWidth;\n\n this.contentDiv = document.createElement('div');\n this.contentDiv.className = 'pds-tooltip__content';\n this.contentDiv.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.contentDiv.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n const slottedContentContainer = contentSlotWrapper?.querySelector('[slot=\"content\"]') as HTMLElement | null;\n let hasSlottedContent = false;\n\n if (slottedContentContainer !== null) {\n const childrenToClone = Array.from(slottedContentContainer.childNodes);\n\n if (childrenToClone.length > 0) {\n const hasMeaningfulNode = childrenToClone.some(node =>\n node.nodeType === Node.ELEMENT_NODE ||\n (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')\n );\n\n if (hasMeaningfulNode) {\n hasSlottedContent = true;\n childrenToClone.forEach((node /*, index*/) => {\n if (node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')) {\n this.contentDiv.appendChild(node.cloneNode(true));\n }\n });\n }\n }\n }\n\n if (!hasSlottedContent && typeof this.content === 'string' && this.content.trim() !== '') {\n this.contentDiv.textContent = this.content;\n }\n\n this.portalEl.appendChild(this.contentDiv);\n document.body.appendChild(this.portalEl);\n\n this.repositionPortal().catch(error => {\n console.warn('Failed to position tooltip on creation:', error);\n });\n\n // Use Floating UI's autoUpdate to handle scroll/resize automatically\n if (this.triggerEl && this.portalEl) {\n this.stopAutoUpdate = autoUpdate(\n this.triggerEl,\n this.portalEl,\n () => {\n this.repositionPortal().catch(error => {\n console.warn('Failed to reposition tooltip on auto update:', error);\n });\n }\n );\n }\n\n // Keep only SPA navigation listeners (not handled by autoUpdate)\n window.addEventListener('popstate', this.handleSpaNavigation, true);\n window.addEventListener('hashchange', this.handleSpaNavigation, true);\n\n // Start pathname change detection\n this.pathnameCheckInterval = setInterval(this.checkPathnameChange, 100);\n\n // Add ARIA attribute to trigger, now that portalEl and its ID are confirmed\n if (this.triggerEl !== null && this.portalEl.id !== '') {\n this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);\n }\n }\n\n private removePortal() {\n // Stop Floating UI's autoUpdate\n if (this.stopAutoUpdate !== null) {\n this.stopAutoUpdate();\n this.stopAutoUpdate = null;\n }\n\n // Stop pathname change detection\n if (this.pathnameCheckInterval !== null) {\n clearInterval(this.pathnameCheckInterval);\n this.pathnameCheckInterval = null;\n }\n\n if (this.portalEl !== null) {\n // Remove only SPA navigation listeners (scroll/resize handled by autoUpdate)\n window.removeEventListener('popstate', this.handleSpaNavigation, true);\n window.removeEventListener('hashchange', this.handleSpaNavigation, true);\n\n // Safely remove portal from DOM\n try {\n if (this.portalEl.parentNode) {\n this.portalEl.parentNode.removeChild(this.portalEl);\n }\n } catch (error) {\n // Portal might have already been removed by test cleanup\n console.warn('Portal element could not be removed from DOM:', error);\n }\n\n this.portalEl = null;\n }\n\n // Remove ARIA attribute from trigger\n if (this.triggerEl !== null) {\n this.triggerEl.removeAttribute('aria-describedby');\n }\n this.contentDiv = null;\n }\n\n render() {\n const hostId = this.componentId || undefined;\n\n return (\n <Host id={hostId} class={{ 'pds-tooltip--is-open': this.opened }}>\n <span\n class=\"pds-tooltip__trigger\"\n onMouseEnter={this.handleShow}\n onMouseLeave={this.handleHide}\n /* focusin/out bubble; ensure keyboard users see tooltips */\n onFocusin={this.handleShow as any}\n onFocusout={this.handleHide as any}\n ref={el => this.triggerEl = el}\n >\n <slot />\n </span>\n <div class=\"pds-tooltip__content-slot-wrapper\" hidden>\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -25,4 +25,19 @@ export const isRequired = (target, component) => {
|
|
|
25
25
|
(target.checkValidity() === false) ? component.invalid = true : component.invalid = false;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Exposes a readonly type property on a custom form element to match native form element behavior.
|
|
30
|
+
* This makes the type property enumerable and accessible via element.type, matching native HTML elements.
|
|
31
|
+
* The property is non-configurable, preventing it from being redefined or deleted at runtime.
|
|
32
|
+
*
|
|
33
|
+
* @param element - The custom element to add the type property to
|
|
34
|
+
* @param type - The type value (string literal) or a getter function that returns the type
|
|
35
|
+
*/
|
|
36
|
+
export function exposeTypeProperty(element, type) {
|
|
37
|
+
Object.defineProperty(element, 'type', {
|
|
38
|
+
get: typeof type === 'function' ? type : () => type,
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: false
|
|
41
|
+
});
|
|
42
|
+
}
|
|
28
43
|
//# sourceMappingURL=form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/utils/form.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAU,EAAE,WAAmB,EAAE,EAAE;IAC3D,OAAO,GAAG,EAAE,KAAK,WAAW,UAAU,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAU,EAAE,OAAgB,EAAE,aAAqB,EAAE,EAAE;IACvF,IAAI,CAAC,aAAa;QAAE,OAAM;IAE1B,IAAI,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAEvC,IAAI,OAAO;QAAE,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAEhD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE;IAC9C,IAAK,CAAC,MAAM,IAAI,CAAC,SAAS;QAAG,OAAO;IACpC,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAChC,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IAC5F,CAAC;AACH,CAAC,CAAA","sourcesContent":["/**\n * Create id for messaging\n */\nexport const messageId = (id: string, messageType: string) => {\n return `${id}__${messageType}-message`;\n};\n\n/**\n * Assign aria-description id to relate messages with form element\n */\nexport const assignDescription = (id: string, invalid: boolean, helperMessage: string) => {\n if (!helperMessage) return\n\n let relatedId = messageId(id, 'helper')\n\n if (invalid) relatedId = messageId(id, 'error');\n\n return relatedId;\n};\n\n/**\n * Updates the `invalid` prop of a form element based on it's values validity\n */\nexport const isRequired = (target, component) => {\n if ( !target || !component ) return;\n if (component.required === true) {\n (target.checkValidity() === false) ? component.invalid = true : component.invalid = false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/utils/form.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAU,EAAE,WAAmB,EAAE,EAAE;IAC3D,OAAO,GAAG,EAAE,KAAK,WAAW,UAAU,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAU,EAAE,OAAgB,EAAE,aAAqB,EAAE,EAAE;IACvF,IAAI,CAAC,aAAa;QAAE,OAAM;IAE1B,IAAI,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAEvC,IAAI,OAAO;QAAE,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAEhD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE;IAC9C,IAAK,CAAC,MAAM,IAAI,CAAC,SAAS;QAAG,OAAO;IACpC,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAChC,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IAC5F,CAAC;AACH,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoB,EAAE,IAA6B;IACpF,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE;QACrC,GAAG,EAAE,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI;QACnD,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Create id for messaging\n */\nexport const messageId = (id: string, messageType: string) => {\n return `${id}__${messageType}-message`;\n};\n\n/**\n * Assign aria-description id to relate messages with form element\n */\nexport const assignDescription = (id: string, invalid: boolean, helperMessage: string) => {\n if (!helperMessage) return\n\n let relatedId = messageId(id, 'helper')\n\n if (invalid) relatedId = messageId(id, 'error');\n\n return relatedId;\n};\n\n/**\n * Updates the `invalid` prop of a form element based on it's values validity\n */\nexport const isRequired = (target, component) => {\n if ( !target || !component ) return;\n if (component.required === true) {\n (target.checkValidity() === false) ? component.invalid = true : component.invalid = false;\n }\n}\n\n/**\n * Exposes a readonly type property on a custom form element to match native form element behavior.\n * This makes the type property enumerable and accessible via element.type, matching native HTML elements.\n * The property is non-configurable, preventing it from being redefined or deleted at runtime.\n * \n * @param element - The custom element to add the type property to\n * @param type - The type value (string literal) or a getter function that returns the type\n */\nexport function exposeTypeProperty(element: HTMLElement, type: string | (() => string)) {\n Object.defineProperty(element, 'type', {\n get: typeof type === 'function' ? type : () => type,\n enumerable: true,\n configurable: false\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PlacementType =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end';\n\nexport type BoxColumnType =\n '0'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | '10'\n | '11'\n | '12';\n\n export type BoxTShirtSizeType =\n 'none'\n | 'xxs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'xxl'\n\n export type BoxShadowSizeType =\n 'none'\n | '050'\n | '100'\n | '150'\n | '200'\n | '300'\n | '400'\n | '500'"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PlacementType =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end';\n\nexport type BoxColumnType =\n '0'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | '10'\n | '11'\n | '12';\n\n export type BoxTShirtSizeType =\n 'none'\n | 'xxs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'xxl'\n\n export type BoxShadowSizeType =\n 'none'\n | '050'\n | '100'\n | '150'\n | '200'\n | '300'\n | '400'\n | '500'\n\nexport type ChipSentimentType =\n 'accent'\n | 'brand'\n | 'danger'\n | 'info'\n | 'neutral'\n | 'success'\n | 'warning';\n\nexport type ChipVariantType =\n 'text'\n | 'tag'\n | 'dropdown';"]}
|