@pine-ds/core 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/index2.js +1 -1
- package/components/index2.js.map +1 -1
- package/components/mock-pds-modal.js +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-button2.js.map +1 -1
- package/components/pds-chip.js +21 -6
- package/components/pds-chip.js.map +1 -1
- package/components/pds-input.js +98 -21
- package/components/pds-input.js.map +1 -1
- package/components/pds-link2.js +2 -2
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.js +2 -2
- package/components/pds-modal-footer.js +1 -1
- package/components/pds-modal-header.js +1 -1
- package/components/pds-modal.js +2 -2
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-radio.js +3 -3
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +3 -3
- package/components/pds-select.js.map +1 -1
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +1 -1
- package/components/pds-switch.js +3 -3
- package/components/pds-tab.js +3 -3
- package/components/pds-table-body.js +1 -1
- package/components/pds-table-cell2.js +2 -2
- package/components/pds-table-head-cell2.js +2 -2
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-table.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text2.js +1 -1
- package/components/pds-textarea.js +4 -4
- package/components/pds-toast.js +3 -3
- package/components/pds-tooltip.js +17 -1
- package/components/pds-tooltip.js.map +1 -1
- package/dist/cjs/{index-CG2Rr2io.js → index-B0qLG6KJ.js} +3 -3
- package/dist/cjs/index-B0qLG6KJ.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/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 +1 -1
- package/dist/cjs/pds-chip.cjs.entry.js +21 -7
- 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-copytext.cjs.entry.js +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +88 -21
- 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 +3 -3
- package/dist/cjs/pds-loader.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js +2 -2
- package/dist/cjs/pds-popover.cjs.entry.js +1 -1
- package/dist/cjs/pds-progress.cjs.entry.js +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +4 -4
- package/dist/cjs/pds-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +3 -4
- 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 +2 -2
- package/dist/cjs/pds-sortable.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +4 -4
- package/dist/cjs/pds-tab.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/pds-text.cjs.entry.js +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +5 -5
- package/dist/cjs/pds-toast.cjs.entry.js +3 -3
- package/dist/cjs/pds-tooltip.cjs.entry.js +17 -1
- 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 +17 -5
- package/dist/collection/components/pds-chip/pds-chip.css +48 -11
- package/dist/collection/components/pds-chip/pds-chip.js +42 -9
- package/dist/collection/components/pds-chip/pds-chip.js.map +1 -1
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +17 -0
- package/dist/collection/components/pds-input/pds-input.css +167 -43
- package/dist/collection/components/pds-input/pds-input.js +212 -21
- package/dist/collection/components/pds-input/pds-input.js.map +1 -1
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +84 -0
- package/dist/collection/components/pds-link/pds-link.js +2 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +2 -2
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal.js +2 -2
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
- package/dist/collection/components/pds-popover/pds-popover.js +1 -1
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +3 -3
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.css +34 -4
- package/dist/collection/components/pds-select/pds-select.js +20 -2
- package/dist/collection/components/pds-select/pds-select.js.map +1 -1
- package/dist/collection/components/pds-select/stories/pds-select.stories.js +2 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +3 -3
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-table/pds-table.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -3
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
- package/dist/collection/components/pds-toast/pds-toast.js +3 -3
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +17 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -1
- package/dist/docs.json +255 -11
- package/dist/esm/{index-_4gljHh-.js → index-DpOSrebJ.js} +3 -3
- package/dist/esm/index-DpOSrebJ.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mock-pds-modal.entry.js +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 +1 -1
- package/dist/esm/pds-chip.entry.js +21 -7
- package/dist/esm/pds-chip.entry.js.map +1 -1
- package/dist/esm/pds-copytext.entry.js +1 -1
- package/dist/esm/pds-input.entry.js +88 -21
- package/dist/esm/pds-input.entry.js.map +1 -1
- package/dist/esm/pds-link.entry.js +3 -3
- package/dist/esm/pds-loader.entry.js +1 -1
- package/dist/esm/pds-modal-content.entry.js +2 -2
- package/dist/esm/pds-modal-footer.entry.js +1 -1
- package/dist/esm/pds-modal-header.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js +2 -2
- package/dist/esm/pds-popover.entry.js +1 -1
- package/dist/esm/pds-progress.entry.js +1 -1
- package/dist/esm/pds-radio.entry.js +4 -4
- package/dist/esm/pds-row.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +3 -4
- package/dist/esm/pds-select.entry.js.map +1 -1
- package/dist/esm/pds-sortable-item.entry.js +2 -2
- package/dist/esm/pds-sortable.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +4 -4
- package/dist/esm/pds-tab.entry.js +3 -3
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +2 -2
- package/dist/esm/pds-table-head-cell.entry.js +3 -3
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +1 -1
- package/dist/esm/pds-text.entry.js +1 -1
- package/dist/esm/pds-textarea.entry.js +5 -5
- package/dist/esm/pds-toast.entry.js +3 -3
- package/dist/esm/pds-tooltip.entry.js +17 -1
- package/dist/esm/pds-tooltip.entry.js.map +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm-es5/{index-_4gljHh-.js → index-DpOSrebJ.js} +1 -1
- package/dist/esm-es5/index-DpOSrebJ.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/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-chip.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js.map +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +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-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js.map +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/pine-core/{p-CV405yTU.system.js.map → p--YvWqEjm.system.js.map} +1 -1
- package/dist/pine-core/p-00599bd8.entry.js +2 -0
- package/dist/pine-core/p-00599bd8.entry.js.map +1 -0
- package/dist/pine-core/{p-833f08f3.entry.js → p-04195bdb.entry.js} +2 -2
- package/dist/pine-core/p-065208a1.system.entry.js +2 -0
- package/dist/pine-core/p-065208a1.system.entry.js.map +1 -0
- package/dist/pine-core/{p-4288c861.entry.js → p-07f45626.entry.js} +2 -2
- package/dist/pine-core/{p-0572825b.entry.js → p-0a11384e.entry.js} +2 -2
- package/dist/pine-core/{p-28e28f42.system.entry.js → p-0a87e2fc.system.entry.js} +2 -2
- package/dist/pine-core/p-0c30661b.system.entry.js +2 -0
- package/dist/pine-core/{p-146fcd44.entry.js → p-10e2feff.entry.js} +2 -2
- package/dist/pine-core/{p-bd04212c.system.entry.js → p-13481ef5.system.entry.js} +2 -2
- package/dist/pine-core/{p-c4294be2.entry.js → p-19c01019.entry.js} +2 -2
- package/dist/pine-core/{p-f2c807ac.entry.js → p-1d395d27.entry.js} +2 -2
- package/dist/pine-core/{p-4ff0838c.entry.js → p-2007a0b5.entry.js} +2 -2
- package/dist/pine-core/{p-78cb1c40.system.entry.js → p-27c0ffda.system.entry.js} +2 -2
- package/dist/pine-core/p-35917a1a.entry.js +2 -0
- package/dist/pine-core/p-39a31730.system.entry.js +2 -0
- package/dist/pine-core/p-39a31730.system.entry.js.map +1 -0
- package/dist/pine-core/{p-1b109c01.entry.js → p-3ea415b0.entry.js} +2 -2
- package/dist/pine-core/p-44f10d3c.entry.js +2 -0
- package/dist/pine-core/p-44f10d3c.entry.js.map +1 -0
- package/dist/pine-core/{p-48e76945.system.entry.js → p-4b2aab79.system.entry.js} +2 -2
- package/dist/pine-core/{p-77c3a10d.entry.js → p-51cc93b3.entry.js} +2 -2
- package/dist/pine-core/{p-83252078.system.entry.js → p-5367f477.system.entry.js} +2 -2
- package/dist/pine-core/{p-a2572675.system.entry.js → p-593df966.system.entry.js} +2 -2
- package/dist/pine-core/{p-d6ac2862.system.entry.js → p-5a437fcd.system.entry.js} +2 -2
- package/dist/pine-core/{p-c0f74199.entry.js → p-60fbeb1c.entry.js} +2 -2
- package/dist/pine-core/p-65a875f6.entry.js +2 -0
- package/dist/pine-core/{p-30142a25.system.entry.js → p-6a7936e7.system.entry.js} +2 -2
- package/dist/pine-core/p-76e35041.entry.js +2 -0
- package/dist/pine-core/{p-d1b222f5.entry.js.map → p-76e35041.entry.js.map} +1 -1
- package/dist/pine-core/{p-86d388a2.entry.js → p-76f7cf21.entry.js} +2 -2
- package/dist/pine-core/{p-121e03ad.system.entry.js → p-78327c08.system.entry.js} +2 -2
- package/dist/pine-core/{p-e2dc81c0.entry.js → p-78f29270.entry.js} +2 -2
- package/dist/pine-core/{p-83c632f6.system.entry.js → p-79cb7835.system.entry.js} +2 -2
- package/dist/pine-core/{p-e9d972db.system.entry.js → p-7bb3a5d4.system.entry.js} +2 -2
- package/dist/pine-core/{p-17d3fa8b.entry.js → p-80f36506.entry.js} +2 -2
- package/dist/pine-core/{p-f47133fd.entry.js → p-8180b641.entry.js} +2 -2
- package/dist/pine-core/{p-a394645a.system.entry.js → p-833b2170.system.entry.js} +2 -2
- package/dist/pine-core/{p-83ffc1cc.entry.js → p-86329612.entry.js} +2 -2
- package/dist/pine-core/p-8b6b0db7.entry.js +2 -0
- package/dist/pine-core/p-8b6b0db7.entry.js.map +1 -0
- package/dist/pine-core/{p-cd2cd116.entry.js → p-8f06b020.entry.js} +2 -2
- package/dist/pine-core/{p-78fb945e.system.entry.js → p-959c8247.system.entry.js} +2 -2
- package/dist/pine-core/{p-f9e01886.system.entry.js → p-96e9774e.system.entry.js} +2 -2
- package/dist/pine-core/p-9c01e81b.system.entry.js +2 -0
- package/dist/pine-core/p-9db1f179.entry.js +2 -0
- package/dist/pine-core/p-9db1f179.entry.js.map +1 -0
- package/dist/pine-core/{p-CWtKi9tV.system.js.map → p-A4_UN20E.system.js.map} +1 -1
- package/dist/pine-core/{p-C-oNYS10.system.js.map → p-BE1qV1Jc.system.js.map} +1 -1
- package/dist/pine-core/{p-BVUeEWjl.system.js.map → p-BEYGfY83.system.js.map} +1 -1
- package/dist/pine-core/p-BHp2IZGP.system.js.map +1 -0
- package/dist/pine-core/{p-DV_GadHU.system.js.map → p-BISuGf0f.system.js.map} +1 -1
- package/dist/pine-core/{p-HBgo7i_E.system.js.map → p-BPQAcMLl.system.js.map} +1 -1
- package/dist/pine-core/{p-CzKqvFNN.system.js.map → p-BaAcO8Mz.system.js.map} +1 -1
- package/dist/pine-core/{p-yku4NLl6.system.js.map → p-BcuE4ZrB.system.js.map} +1 -1
- package/dist/pine-core/p-BsL2GDnH.system.js +1 -1
- package/dist/pine-core/{p-DEsea81X.system.js.map → p-BwHnCFqU.system.js.map} +1 -1
- package/dist/pine-core/{p-D9LPgNmN.system.js.map → p-BxBtA60x.system.js.map} +1 -1
- package/dist/pine-core/{p-Bs9Nyvj2.system.js.map → p-C0oRS1F9.system.js.map} +1 -1
- package/dist/pine-core/{p-Derxa-nn.system.js.map → p-C2d75seA.system.js.map} +1 -1
- package/dist/pine-core/{p-DbVkYdnF.system.js.map → p-CGABEyvz.system.js.map} +1 -1
- package/dist/pine-core/{p-CiDIFl28.system.js.map → p-CIc_XeAg.system.js.map} +1 -1
- package/dist/pine-core/{p-Bo6FQRlR.system.js.map → p-CNYB6FL-.system.js.map} +1 -1
- package/dist/pine-core/{p-DgOMN0Ur.system.js.map → p-CNkajx9x.system.js.map} +1 -1
- package/dist/pine-core/{p-Cj2r1nL6.system.js.map → p-CS2nVL5p.system.js.map} +1 -1
- package/dist/pine-core/{p-B-pTdYoP.system.js.map → p-CTPMEWZT.system.js.map} +1 -1
- package/dist/pine-core/{p-CDIHBBTC.system.js.map → p-CTWkFhWu.system.js.map} +1 -1
- package/dist/pine-core/{p-M2Hhmwex.system.js.map → p-CdzfTGbZ.system.js.map} +1 -1
- package/dist/pine-core/{p-DiJV28pi.system.js.map → p-CkoeYrxa.system.js.map} +1 -1
- package/dist/pine-core/{p-DKSZziVY.system.js.map → p-ClVQjta4.system.js.map} +1 -1
- package/dist/pine-core/{p-DS7q5AvX.system.js.map → p-D2UtaGL2.system.js.map} +1 -1
- package/dist/pine-core/{p-DN9puCWI.system.js.map → p-DGyATOIf.system.js.map} +1 -1
- package/dist/pine-core/p-DMeT5CsE.system.js.map +1 -0
- package/dist/pine-core/{p-CsM74dxm.system.js.map → p-DVhX1_nD.system.js.map} +1 -1
- package/dist/pine-core/p-DeW-6a7f.system.js.map +1 -0
- package/dist/pine-core/{p-BOJnNd1p.system.js.map → p-DgTp_KeO.system.js.map} +1 -1
- package/dist/pine-core/p-DjXmy34u.system.js.map +1 -0
- package/dist/pine-core/{p-_4gljHh-.js → p-DpOSrebJ.js} +1 -1
- package/dist/pine-core/p-DpOSrebJ.js.map +1 -0
- package/dist/pine-core/{p-B4W0_y2p.system.js → p-DyDReOdO.system.js} +1 -1
- package/dist/pine-core/p-DyDReOdO.system.js.map +1 -0
- package/dist/pine-core/{p-CLNi-hRD.system.js.map → p-EqAbQY8l.system.js.map} +1 -1
- package/dist/pine-core/p-Ke8SGZqs.system.js.map +1 -0
- package/dist/pine-core/{p-D-4Xbxlj.system.js.map → p-Mqxw-gWj.system.js.map} +1 -1
- package/dist/pine-core/{p-D5vuiRx2.system.js.map → p-PPIMiuZX.system.js.map} +1 -1
- package/dist/pine-core/{p-CnPERKGo.system.js.map → p-UhZHDNH2.system.js.map} +1 -1
- package/dist/pine-core/{p-d2ccda59.system.entry.js → p-a556a328.system.entry.js} +2 -2
- package/dist/pine-core/{p-6a2296e6.system.entry.js → p-a98cda38.system.entry.js} +2 -2
- package/dist/pine-core/{p-3f82ac77.system.entry.js → p-ab7e4700.system.entry.js} +2 -2
- package/dist/pine-core/{p-3798a631.system.entry.js → p-aeaae417.system.entry.js} +2 -2
- package/dist/pine-core/{p-b7ba6316.entry.js → p-b2820acd.entry.js} +2 -2
- package/dist/pine-core/{p-2296c34f.entry.js → p-bf699bad.entry.js} +2 -2
- package/dist/pine-core/{p-7b38e384.system.entry.js → p-c1909a5d.system.entry.js} +2 -2
- package/dist/pine-core/{p-984578f8.system.entry.js → p-c551191a.system.entry.js} +2 -2
- package/dist/pine-core/{p-1bd715ee.system.entry.js → p-c5e1ed09.system.entry.js} +2 -2
- package/dist/pine-core/p-c5e1ed09.system.entry.js.map +1 -0
- package/dist/pine-core/{p-596e0292.system.entry.js → p-cc21ddcc.system.entry.js} +2 -2
- package/dist/pine-core/{p-b2796d3c.system.entry.js → p-d0adaca0.system.entry.js} +2 -2
- package/dist/pine-core/{p-722012ac.entry.js → p-d28768d1.entry.js} +2 -2
- package/dist/pine-core/{p-24607f93.entry.js → p-d35b3494.entry.js} +2 -2
- package/dist/pine-core/{p-730221a8.system.entry.js → p-d553e05c.system.entry.js} +2 -2
- package/dist/pine-core/{p-04df41d7.system.entry.js → p-d6d453d8.system.entry.js} +2 -2
- package/dist/pine-core/p-dcda4ff5.system.entry.js +2 -0
- package/dist/pine-core/{p-1224c874.entry.js → p-ddcc4932.entry.js} +2 -2
- package/dist/pine-core/{p-c1b0f921.system.entry.js → p-de550d9e.system.entry.js} +2 -2
- package/dist/pine-core/p-dfd5a5b6.system.entry.js +2 -0
- package/dist/pine-core/p-dfd5a5b6.system.entry.js.map +1 -0
- package/dist/pine-core/p-e562ad73.system.entry.js +2 -0
- package/dist/pine-core/p-e562ad73.system.entry.js.map +1 -0
- package/dist/pine-core/p-e9f004c5.entry.js +2 -0
- package/dist/pine-core/p-e9f004c5.entry.js.map +1 -0
- package/dist/pine-core/{p-71265b2a.system.entry.js → p-f46c4618.system.entry.js} +2 -2
- package/dist/pine-core/{p-761946a0.entry.js → p-f6b226df.entry.js} +2 -2
- package/dist/pine-core/{p-bcc4edaa.entry.js → p-f99c59a8.entry.js} +2 -2
- package/dist/pine-core/{p-b3d05184.entry.js → p-fb1eb0c4.entry.js} +2 -2
- package/dist/pine-core/{p-367e188f.entry.js → p-fb2fb435.entry.js} +2 -2
- package/dist/pine-core/p-fd1ef1e1.entry.js +2 -0
- package/dist/pine-core/{p-85ff1482.entry.js → p-fdf3a5ff.entry.js} +2 -2
- package/dist/pine-core/p-fed5f55e.system.entry.js +2 -0
- package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-chip.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-input.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-select.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-tooltip.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-chip/pds-chip.d.ts +9 -1
- package/dist/types/components/pds-input/pds-input.d.ts +57 -9
- package/dist/types/components/pds-select/pds-select.d.ts +4 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +70 -6
- package/hydrate/index.js +187 -73
- package/hydrate/index.mjs +187 -73
- package/package.json +2 -2
- package/dist/cjs/index-CG2Rr2io.js.map +0 -1
- package/dist/esm/index-_4gljHh-.js.map +0 -1
- package/dist/esm-es5/index-_4gljHh-.js.map +0 -1
- package/dist/pine-core/p-0069abf8.system.entry.js +0 -2
- package/dist/pine-core/p-0069abf8.system.entry.js.map +0 -1
- package/dist/pine-core/p-1bd715ee.system.entry.js.map +0 -1
- package/dist/pine-core/p-1eec6bea.system.entry.js +0 -2
- package/dist/pine-core/p-1eec6bea.system.entry.js.map +0 -1
- package/dist/pine-core/p-21c3aaeb.entry.js +0 -2
- package/dist/pine-core/p-29ad0b86.entry.js +0 -2
- package/dist/pine-core/p-29ad0b86.entry.js.map +0 -1
- package/dist/pine-core/p-32bd3e33.entry.js +0 -2
- package/dist/pine-core/p-32bd3e33.entry.js.map +0 -1
- package/dist/pine-core/p-49265849.system.entry.js +0 -2
- package/dist/pine-core/p-71f01676.system.entry.js +0 -2
- package/dist/pine-core/p-742d4490.entry.js +0 -2
- package/dist/pine-core/p-742d4490.entry.js.map +0 -1
- package/dist/pine-core/p-7e92ec48.system.entry.js +0 -2
- package/dist/pine-core/p-7e92ec48.system.entry.js.map +0 -1
- package/dist/pine-core/p-7ff213bb.system.entry.js +0 -2
- package/dist/pine-core/p-8023086c.entry.js +0 -2
- package/dist/pine-core/p-8023086c.entry.js.map +0 -1
- package/dist/pine-core/p-929bb7ab.system.entry.js +0 -2
- package/dist/pine-core/p-B4W0_y2p.system.js.map +0 -1
- package/dist/pine-core/p-BO1OsmVU.system.js.map +0 -1
- package/dist/pine-core/p-CtAVdPaE.system.js.map +0 -1
- package/dist/pine-core/p-D8DRYw9w.system.js.map +0 -1
- package/dist/pine-core/p-DyQ_s5MV.system.js.map +0 -1
- package/dist/pine-core/p-_4gljHh-.js.map +0 -1
- package/dist/pine-core/p-abec6606.entry.js +0 -2
- package/dist/pine-core/p-abec6606.entry.js.map +0 -1
- package/dist/pine-core/p-b9c13f99.entry.js +0 -2
- package/dist/pine-core/p-d1b222f5.entry.js +0 -2
- package/dist/pine-core/p-e09a3682.system.entry.js +0 -2
- package/dist/pine-core/p-e09a3682.system.entry.js.map +0 -1
- package/dist/pine-core/p-e6d6e103.entry.js +0 -2
- package/dist/pine-core/p-xgOOHGQo.system.js.map +0 -1
- /package/dist/pine-core/{p-833f08f3.entry.js.map → p-04195bdb.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4288c861.entry.js.map → p-07f45626.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0572825b.entry.js.map → p-0a11384e.entry.js.map} +0 -0
- /package/dist/pine-core/{p-28e28f42.system.entry.js.map → p-0a87e2fc.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-71f01676.system.entry.js.map → p-0c30661b.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-146fcd44.entry.js.map → p-10e2feff.entry.js.map} +0 -0
- /package/dist/pine-core/{p-bd04212c.system.entry.js.map → p-13481ef5.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c4294be2.entry.js.map → p-19c01019.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f2c807ac.entry.js.map → p-1d395d27.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4ff0838c.entry.js.map → p-2007a0b5.entry.js.map} +0 -0
- /package/dist/pine-core/{p-78cb1c40.system.entry.js.map → p-27c0ffda.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-21c3aaeb.entry.js.map → p-35917a1a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1b109c01.entry.js.map → p-3ea415b0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-48e76945.system.entry.js.map → p-4b2aab79.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-77c3a10d.entry.js.map → p-51cc93b3.entry.js.map} +0 -0
- /package/dist/pine-core/{p-83252078.system.entry.js.map → p-5367f477.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a2572675.system.entry.js.map → p-593df966.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d6ac2862.system.entry.js.map → p-5a437fcd.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c0f74199.entry.js.map → p-60fbeb1c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e6d6e103.entry.js.map → p-65a875f6.entry.js.map} +0 -0
- /package/dist/pine-core/{p-30142a25.system.entry.js.map → p-6a7936e7.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-86d388a2.entry.js.map → p-76f7cf21.entry.js.map} +0 -0
- /package/dist/pine-core/{p-121e03ad.system.entry.js.map → p-78327c08.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e2dc81c0.entry.js.map → p-78f29270.entry.js.map} +0 -0
- /package/dist/pine-core/{p-83c632f6.system.entry.js.map → p-79cb7835.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e9d972db.system.entry.js.map → p-7bb3a5d4.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-17d3fa8b.entry.js.map → p-80f36506.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f47133fd.entry.js.map → p-8180b641.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a394645a.system.entry.js.map → p-833b2170.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-83ffc1cc.entry.js.map → p-86329612.entry.js.map} +0 -0
- /package/dist/pine-core/{p-cd2cd116.entry.js.map → p-8f06b020.entry.js.map} +0 -0
- /package/dist/pine-core/{p-78fb945e.system.entry.js.map → p-959c8247.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f9e01886.system.entry.js.map → p-96e9774e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-929bb7ab.system.entry.js.map → p-9c01e81b.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d2ccda59.system.entry.js.map → p-a556a328.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6a2296e6.system.entry.js.map → p-a98cda38.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3f82ac77.system.entry.js.map → p-ab7e4700.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3798a631.system.entry.js.map → p-aeaae417.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b7ba6316.entry.js.map → p-b2820acd.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2296c34f.entry.js.map → p-bf699bad.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7b38e384.system.entry.js.map → p-c1909a5d.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-984578f8.system.entry.js.map → p-c551191a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-596e0292.system.entry.js.map → p-cc21ddcc.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b2796d3c.system.entry.js.map → p-d0adaca0.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-722012ac.entry.js.map → p-d28768d1.entry.js.map} +0 -0
- /package/dist/pine-core/{p-24607f93.entry.js.map → p-d35b3494.entry.js.map} +0 -0
- /package/dist/pine-core/{p-730221a8.system.entry.js.map → p-d553e05c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-04df41d7.system.entry.js.map → p-d6d453d8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-49265849.system.entry.js.map → p-dcda4ff5.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1224c874.entry.js.map → p-ddcc4932.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c1b0f921.system.entry.js.map → p-de550d9e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-71265b2a.system.entry.js.map → p-f46c4618.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-761946a0.entry.js.map → p-f6b226df.entry.js.map} +0 -0
- /package/dist/pine-core/{p-bcc4edaa.entry.js.map → p-f99c59a8.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b3d05184.entry.js.map → p-fb1eb0c4.entry.js.map} +0 -0
- /package/dist/pine-core/{p-367e188f.entry.js.map → p-fb2fb435.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b9c13f99.entry.js.map → p-fd1ef1e1.entry.js.map} +0 -0
- /package/dist/pine-core/{p-85ff1482.entry.js.map → p-fdf3a5ff.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7ff213bb.system.entry.js.map → p-fed5f55e.system.entry.js.map} +0 -0
|
@@ -33,7 +33,7 @@ export class PdsRow {
|
|
|
33
33
|
})), (this.minHeight && {
|
|
34
34
|
'min-height': this.minHeight,
|
|
35
35
|
}));
|
|
36
|
-
return h(Host, { key: '
|
|
36
|
+
return h(Host, { key: '7641ed5798525661b1a100bfbce60ed271e76887', class: `pds-row ${rowClasses}`, style: rowInlineStyles });
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "pds-row"; }
|
|
39
39
|
static get originalStyleUrls() {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--pds-select-background: var(--pine-color-background-container);
|
|
3
|
+
--pds-select-border: var(--pine-border);
|
|
4
|
+
--pds-select-border-radius: var(--pine-dimension-125);
|
|
5
|
+
--pds-select-border-radius-start-end: var(--pine-dimension-125);
|
|
6
|
+
--pds-select-border-radius-start-start: var(--pine-dimension-125);
|
|
7
|
+
--pds-select-border-radius-end-end: var(--pine-dimension-125);
|
|
8
|
+
--pds-select-border-radius-end-start: var(--pine-dimension-125);
|
|
9
|
+
--pds-select-min-height: 36px;
|
|
10
|
+
--box-shadow-focus: 0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-focus-ring);
|
|
11
|
+
--box-shadow-focus-error: 0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-focus-ring-danger);
|
|
12
|
+
}
|
|
1
13
|
:host .hidden,
|
|
2
14
|
:host :host([hidden]) {
|
|
3
15
|
display: none;
|
|
@@ -20,12 +32,17 @@ label {
|
|
|
20
32
|
|
|
21
33
|
select {
|
|
22
34
|
appearance: none;
|
|
23
|
-
background: var(--
|
|
24
|
-
border: var(--
|
|
25
|
-
border-radius: var(--
|
|
35
|
+
background-color: var(--pds-select-background);
|
|
36
|
+
border: var(--pds-select-border);
|
|
37
|
+
border-radius: var(--pds-select-border-radius);
|
|
38
|
+
border-bottom-left-radius: var(--pds-select-border-radius-end-start, var(--pds-select-border-radius));
|
|
39
|
+
border-bottom-right-radius: var(--pds-select-border-radius-end-end, var(--pds-select-border-radius));
|
|
40
|
+
border-top-left-radius: var(--pds-select-border-radius-start-start, var(--pds-select-border-radius));
|
|
41
|
+
border-top-right-radius: var(--pds-select-border-radius-start-end, var(--pds-select-border-radius));
|
|
26
42
|
font: var(--pine-typography-body);
|
|
27
43
|
grid-area: field;
|
|
28
44
|
letter-spacing: var(--pine-letter-spacing);
|
|
45
|
+
min-height: var(--pds-select-min-height);
|
|
29
46
|
padding: var(--pine-dimension-xs) var(--pine-dimension-150);
|
|
30
47
|
padding-inline-end: var(--pine-dimension-450);
|
|
31
48
|
position: relative;
|
|
@@ -84,8 +101,21 @@ select:has(~ .pds-select__message .pds-select__error-message):focus-visible {
|
|
|
84
101
|
display: flex;
|
|
85
102
|
grid-column: -1/-2;
|
|
86
103
|
grid-row: 2/3;
|
|
87
|
-
height:
|
|
104
|
+
height: var(--pds-select-min-height);
|
|
88
105
|
pointer-events: none;
|
|
89
106
|
position: relative;
|
|
90
107
|
z-index: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.visually-hidden {
|
|
111
|
+
border: 0;
|
|
112
|
+
clip: rect(0 0 0 0);
|
|
113
|
+
clip-path: polygon(0 0, 0 0, 0 0);
|
|
114
|
+
height: 1px;
|
|
115
|
+
margin: -1px;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
padding: 0;
|
|
118
|
+
position: absolute;
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
width: 1px;
|
|
91
121
|
}
|
|
@@ -114,8 +114,7 @@ export class PdsSelect {
|
|
|
114
114
|
return classNames.join(' ');
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
return (h(Host, { key: '
|
|
118
|
-
h("label", { key: '9eadfcc4e6fd6d42f718eb0ad1542f7c03b67052', htmlFor: this.componentId }, this.label), h("select", { key: 'eb1d368ed4f765dead79f6101265e922bd06ca94', autocomplete: this.autocomplete || undefined, class: "pds-select__field", disabled: this.disabled, id: this.componentId, multiple: this.multiple, name: this.name, onChange: this.onSelectUpdate, required: this.required, ref: (el) => (this.selectEl = el) }), h("div", { key: '1dcbfe5d51e55af333e80bb99995cef1693f36c1', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, h("slot", { key: '4d0c76c632e9588dc178c859be5ef1fd474fa191', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && h("pds-icon", { key: '954d31034ed522ba128c9048998e92553592d12f', class: "pds-select__select-icon", icon: enlarge }))));
|
|
117
|
+
return (h(Host, { key: 'c0a0b391e6b5c35d5d3d7fce9d1f92583c582aa5', "aria-disabled": this.disabled ? 'true' : null, class: this.classNames() }, h("div", { key: '4f91cfcfcc570cf79d8e6a2f86d741f471489591', class: "pds-select" }, !this.hideLabel && (h("label", { key: '21fa83cfdad6a46be1efa22ebc4df696ca49b7b1', htmlFor: this.componentId }, h("span", { key: '760e46f98327c3b8e9ceb48ee158202ce42b8bb6', class: this.hideLabel ? 'visually-hidden' : '' }, this.label))), h("select", { key: '78d92779624d84df9ae73515bbda74d9d44a8919', "aria-label": this.hideLabel ? this.label : undefined, autocomplete: this.autocomplete || undefined, class: "pds-select__field", disabled: this.disabled, id: this.componentId, multiple: this.multiple, name: this.name, onChange: this.onSelectUpdate, part: "select", required: this.required, ref: (el) => (this.selectEl = el) }), h("div", { key: '9a75bf791747df08018d59de49855410c6dc2312', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, h("slot", { key: '1a974b4e171971e922aa04e9a56d6e6f26635724', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && h("pds-icon", { key: '9cbc569418617092229d660b34b2c17a2826c878', class: "pds-select__select-icon", icon: enlarge }))));
|
|
119
118
|
}
|
|
120
119
|
static get is() { return "pds-select"; }
|
|
121
120
|
static get encapsulation() { return "shadow"; }
|
|
@@ -211,6 +210,25 @@ export class PdsSelect {
|
|
|
211
210
|
"attribute": "error-message",
|
|
212
211
|
"reflect": false
|
|
213
212
|
},
|
|
213
|
+
"hideLabel": {
|
|
214
|
+
"type": "boolean",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "boolean",
|
|
218
|
+
"resolved": "boolean",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers."
|
|
226
|
+
},
|
|
227
|
+
"getter": false,
|
|
228
|
+
"setter": false,
|
|
229
|
+
"attribute": "hide-label",
|
|
230
|
+
"reflect": false
|
|
231
|
+
},
|
|
214
232
|
"helperMessage": {
|
|
215
233
|
"type": "string",
|
|
216
234
|
"mutable": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, h, Prop, Watch } from '@stencil/core';\nimport { messageId } from '../../utils/form';\nimport { danger, enlarge } from '@pine-ds/icons/icons';\n\n@Component({\n tag: 'pds-select',\n styleUrls: ['pds-select.tokens.scss', '../../global/styles/utils/label.scss', 'pds-select.scss'],\n shadow: true,\n})\nexport class PdsSelect {\n\n private selectEl!: HTMLSelectElement;\n private slotContainer!: HTMLDivElement;\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 * Indicates whether or not the select field is disabled.\n * @defaultValue false\n */\n @Prop() disabled = false\n\n /**\n * Displays error message text describing an invalid state.\n */\n @Prop() errorMessage: string;\n\n /**\n * Displays helper message text below select.\n */\n @Prop() helperMessage: string;\n\n /**\n * Determines whether or not the select is invalid.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the select label.\n */\n @Prop() label?: string;\n\n /**\n * Indicates whether multiple options can be selected.\n * @defaultValue false\n */\n @Prop() multiple = false;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name!: string;\n\n /**\n * Indicates whether or not the select field is required.\n * @defaultValue false\n */\n @Prop() required = false;\n\n /**\n * The value(s) of the selected option(s).\n *\n */\n @Prop({ mutable: true }) value?: string | string[];\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsSelectChange: EventEmitter<InputEvent>;\n\n @Watch('value')\n /**\n * Handles the change in the value of the select component.\n * This method is called whenever the value of the select component changes.\n * It updates the selected option accordingly.\n */\n valueChanged() {\n this.updateSelectedOption();\n }\n\n componentWillLoad() {\n this.updateSelectedOption();\n }\n\n /**\n * Updates the selected option in the select element based on the current value.\n *\n * This method iterates through all the options of the select element and sets the\n * 'selected' attribute on the option that matches the current value. If an option\n * does not match the current value, the 'selected' attribute is removed.\n *\n * @private\n * @returns {void}\n */\n private updateSelectedOption() {\n if (this.selectEl) {\n const options = this.selectEl.options;\n\n // Update the selected attribute for all options.\n Array.from(options).map((option: HTMLOptionElement) => {\n if (Array.isArray(this.value)) {\n option.selected = this.value.includes(option.value);\n } else {\n option.selected = this.value === option.value;\n }\n });\n };\n }\n\n /**\n * Emits an event on input change.\n */\n private onSelectUpdate = (e: Event) => {\n const target = e.target as HTMLSelectElement\n\n const values = Array.from(target.options)\n .filter((option) => ( option.selected))\n .map((option) => ( option.value));\n\n if (values.length === 1 && !this.multiple) {\n this.value = values[0];\n } else {\n this.value = values;\n }\n\n this.pdsSelectChange.emit(e as InputEvent);\n };\n\n /**\n * Handles the change event for the slot element.\n * This method is triggered when the slot content changes.\n * It updates the inner HTML of the select element by cloning and appending\n * the assigned <option> elements from the slot.\n */\n private handleSlotChange = () => {\n const slot = this.slotContainer.querySelector('slot') as HTMLSlotElement;\n\n this.selectEl.innerHTML = '';\n const assignedElements = slot.assignedElements({ flatten: true }) as (HTMLOptionElement | HTMLOptGroupElement)[];\n\n assignedElements.forEach((item) => {\n if ( ['OPTION', 'OPTGROUP'].includes(item.tagName)) {\n const clonedItem = item.cloneNode(true) as HTMLOptionElement | HTMLOptGroupElement;\n if (clonedItem.tagName === 'OPTION' && (clonedItem as HTMLOptionElement).value === this.value) {\n (clonedItem as HTMLOptionElement).selected = true;\n }\n this.selectEl.appendChild(clonedItem);\n }\n });\n\n this.updateSelectedOption();\n };\n\n private getHelperMessage() {\n return this.helperMessage && (\n <p class=\"pds-select__helper-message\" id={messageId(this.componentId, 'helper')}>\n {this.helperMessage}\n </p>\n );\n }\n\n private getErrorMessage() {\n return this.errorMessage && (\n <p class=\"pds-select__error-message\" id={messageId(this.componentId, 'error')} aria-live=\"assertive\">\n <pds-icon icon={danger} size=\"small\"></pds-icon>\n {this.errorMessage}\n </p>\n );\n }\n\n private renderMessages() {\n if (!this.helperMessage && !this.errorMessage) return null;\n\n return (\n <div class=\"pds-select__message\">\n {this.getHelperMessage()}\n {this.getErrorMessage()}\n </div>\n );\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.invalid) { classNames.push('is-invalid'); }\n if (this.disabled) { classNames.push('is-disabled'); }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host aria-disabled={this.disabled ? 'true' : null} class={this.classNames()}>\n <div class=\"pds-select\">\n {this.label &&\n <label htmlFor={this.componentId}>{this.label}</label>\n }\n <select\n autocomplete={this.autocomplete || undefined}\n class=\"pds-select__field\"\n disabled={this.disabled}\n id={this.componentId}\n multiple={this.multiple}\n name={this.name}\n onChange={this.onSelectUpdate}\n required={this.required}\n ref={(el) => (this.selectEl = el as HTMLSelectElement)}\n ></select>\n <div aria-hidden=\"true\" class=\"hidden\" ref={(el) => (this.slotContainer = el)}>\n <slot onSlotchange={this.handleSlotChange}></slot>\n </div>\n {this.renderMessages()}\n {!this.multiple && <pds-icon class=\"pds-select__select-icon\" icon={enlarge} />}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-select.js","sourceRoot":"","sources":["../../../src/components/pds-select/pds-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAOvD,MAAM,OAAO,SAAS;IALtB;QAoBE;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAA;QA2BxB;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAOzB;;;WAGG;QACK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esContent":["import { Component, Event, EventEmitter, Host, h, Prop, Watch } from '@stencil/core';\nimport { messageId } from '../../utils/form';\nimport { danger, enlarge } from '@pine-ds/icons/icons';\n\n@Component({\n tag: 'pds-select',\n styleUrls: ['pds-select.tokens.scss', '../../global/styles/utils/label.scss', 'pds-select.scss'],\n shadow: true,\n})\nexport class PdsSelect {\n\n private selectEl!: HTMLSelectElement;\n private slotContainer!: HTMLDivElement;\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 * Indicates whether or not the select field is disabled.\n * @defaultValue false\n */\n @Prop() disabled = false\n\n /**\n * Displays error message text describing an invalid state.\n */\n @Prop() errorMessage: string;\n\n /**\n * Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Displays helper message text below select.\n */\n @Prop() helperMessage: string;\n\n /**\n * Determines whether or not the select is invalid.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the select label.\n */\n @Prop() label?: string;\n\n /**\n * Indicates whether multiple options can be selected.\n * @defaultValue false\n */\n @Prop() multiple = false;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name!: string;\n\n /**\n * Indicates whether or not the select field is required.\n * @defaultValue false\n */\n @Prop() required = false;\n\n /**\n * The value(s) of the selected option(s).\n *\n */\n @Prop({ mutable: true }) value?: string | string[];\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsSelectChange: EventEmitter<InputEvent>;\n\n @Watch('value')\n /**\n * Handles the change in the value of the select component.\n * This method is called whenever the value of the select component changes.\n * It updates the selected option accordingly.\n */\n valueChanged() {\n this.updateSelectedOption();\n }\n\n componentWillLoad() {\n this.updateSelectedOption();\n }\n\n /**\n * Updates the selected option in the select element based on the current value.\n *\n * This method iterates through all the options of the select element and sets the\n * 'selected' attribute on the option that matches the current value. If an option\n * does not match the current value, the 'selected' attribute is removed.\n *\n * @private\n * @returns {void}\n */\n private updateSelectedOption() {\n if (this.selectEl) {\n const options = this.selectEl.options;\n\n // Update the selected attribute for all options.\n Array.from(options).map((option: HTMLOptionElement) => {\n if (Array.isArray(this.value)) {\n option.selected = this.value.includes(option.value);\n } else {\n option.selected = this.value === option.value;\n }\n });\n };\n }\n\n /**\n * Emits an event on input change.\n */\n private onSelectUpdate = (e: Event) => {\n const target = e.target as HTMLSelectElement\n\n const values = Array.from(target.options)\n .filter((option) => ( option.selected))\n .map((option) => ( option.value));\n\n if (values.length === 1 && !this.multiple) {\n this.value = values[0];\n } else {\n this.value = values;\n }\n\n this.pdsSelectChange.emit(e as InputEvent);\n };\n\n /**\n * Handles the change event for the slot element.\n * This method is triggered when the slot content changes.\n * It updates the inner HTML of the select element by cloning and appending\n * the assigned <option> elements from the slot.\n */\n private handleSlotChange = () => {\n const slot = this.slotContainer.querySelector('slot') as HTMLSlotElement;\n\n this.selectEl.innerHTML = '';\n const assignedElements = slot.assignedElements({ flatten: true }) as (HTMLOptionElement | HTMLOptGroupElement)[];\n\n assignedElements.forEach((item) => {\n if ( ['OPTION', 'OPTGROUP'].includes(item.tagName)) {\n const clonedItem = item.cloneNode(true) as HTMLOptionElement | HTMLOptGroupElement;\n if (clonedItem.tagName === 'OPTION' && (clonedItem as HTMLOptionElement).value === this.value) {\n (clonedItem as HTMLOptionElement).selected = true;\n }\n this.selectEl.appendChild(clonedItem);\n }\n });\n\n this.updateSelectedOption();\n };\n\n private getHelperMessage() {\n return this.helperMessage && (\n <p class=\"pds-select__helper-message\" id={messageId(this.componentId, 'helper')}>\n {this.helperMessage}\n </p>\n );\n }\n\n private getErrorMessage() {\n return this.errorMessage && (\n <p class=\"pds-select__error-message\" id={messageId(this.componentId, 'error')} aria-live=\"assertive\">\n <pds-icon icon={danger} size=\"small\"></pds-icon>\n {this.errorMessage}\n </p>\n );\n }\n\n private renderMessages() {\n if (!this.helperMessage && !this.errorMessage) return null;\n\n return (\n <div class=\"pds-select__message\">\n {this.getHelperMessage()}\n {this.getErrorMessage()}\n </div>\n );\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.invalid) { classNames.push('is-invalid'); }\n if (this.disabled) { classNames.push('is-disabled'); }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host aria-disabled={this.disabled ? 'true' : null} class={this.classNames()}>\n <div class=\"pds-select\">\n {!this.hideLabel && (\n <label htmlFor={this.componentId}>\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n )}\n <select\n aria-label={this.hideLabel ? this.label : undefined}\n autocomplete={this.autocomplete || undefined}\n class=\"pds-select__field\"\n disabled={this.disabled}\n id={this.componentId}\n multiple={this.multiple}\n name={this.name}\n onChange={this.onSelectUpdate}\n part=\"select\"\n required={this.required}\n ref={(el) => (this.selectEl = el as HTMLSelectElement)}\n ></select>\n <div aria-hidden=\"true\" class=\"hidden\" ref={(el) => (this.slotContainer = el)}>\n <slot onSlotchange={this.handleSlotChange}></slot>\n </div>\n {this.renderMessages()}\n {!this.multiple && <pds-icon class=\"pds-select__select-icon\" icon={enlarge} />}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@ export default {
|
|
|
7
7
|
autocomplete: null,
|
|
8
8
|
disabled: false,
|
|
9
9
|
errorMessage: null,
|
|
10
|
+
hideLabel: false,
|
|
10
11
|
helperMessage: null,
|
|
11
12
|
invalid: false,
|
|
12
13
|
multiple: false,
|
|
@@ -52,6 +53,7 @@ const BaseTemplate = (args) =>
|
|
|
52
53
|
disabled="${args.disabled}"
|
|
53
54
|
error-message="${args.errorMessage}"
|
|
54
55
|
helper-message="${args.helperMessage}"
|
|
56
|
+
hide-label="${args.hideLabel}"
|
|
55
57
|
invalid="${args.invalid}"
|
|
56
58
|
label="${args.label}"
|
|
57
59
|
multiple="${args.multiple}"
|
|
@@ -25,7 +25,7 @@ export class PdsSortableItem {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: 'b7817592ed6329f84e09ff5c5e200bc4305275bc', class: "pds-sortable-item", id: this.componentId }, this.showHandle && (h("div", { key: 'c31df5f0c81bd684ac60690044e2409d0cbc7831', class: "pds-sortable-item__handle" }, h("pds-icon", { key: 'ff764a5ef70560c073474a7a51f45dd89df53190', icon: handleIcon }))), h("slot", { key: 'e1f33a5e56b37405b7e46bff24dc91e4ece71870' }), this.enableActions && (h("div", { key: '569563f7c7d5b069888a8c3ee8e50fd3d626b1b2', class: "pds-sortable-item__actions" }, h("slot", { key: '9ca544725723703ddac0de3f0bb9a4b0884d1571', name: "sortable-item-actions" })))));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "pds-sortable-item"; }
|
|
31
31
|
static get encapsulation() { return "scoped"; }
|
|
@@ -44,7 +44,7 @@ export class PdsSortable {
|
|
|
44
44
|
Sortable.create(this.el, sortableOptions);
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: 'c5353036ad9b108f742e55b1a28ebb449cf556d0', class: this.classNames(), id: this.componentId }, h("slot", { key: 'cb71736fb3388f5829476c5b4802d5aa5f811ac7' })));
|
|
48
48
|
}
|
|
49
49
|
static get is() { return "pds-sortable"; }
|
|
50
50
|
static get encapsulation() { return "scoped"; }
|
|
@@ -43,9 +43,9 @@ export class PdsSwitch {
|
|
|
43
43
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (h(Host, { key: '
|
|
47
|
-
h("div", { key: '
|
|
48
|
-
h("div", { key: '
|
|
46
|
+
return (h(Host, { key: 'c91cd6368fff2cbcc6b4974505d94139fa2722c5', class: this.switchClassNames(), "aria-disabled": this.disabled ? 'true' : null }, h("label", { key: 'e46f5f6a8073236ec0d55b2bcc8087dc32ad5a68', htmlFor: this.componentId }, h("input", Object.assign({ key: '9a2db3481c6c5e223819066df34bc220a139df03', "aria-describedby": assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.disabled, id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate, required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), h("span", { key: 'c3b138eb7b6800d01e5676e94c17988c8a52d4b2', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), this.helperMessage &&
|
|
47
|
+
h("div", { key: 'fcaaa0ea30c8ad155a0b43004e77549abf888a57', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
48
|
+
h("div", { key: '045311e393d47bebd536d8fbe220260d112ceb3f', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '035488794764ffaee3275edfa9a3e9fad2d11ddb', icon: danger, size: "small" }), this.errorMessage)));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "pds-switch"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class PdsTableBody {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'ac8d361f2d78eb929c17523843d2ca0ac53f6789', role: "rowgroup" }, h("slot", { key: '132782ab9466a9dbd4350247aae762d731e7aa71' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "pds-table-body"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -37,11 +37,11 @@ export class PdsTableCell {
|
|
|
37
37
|
return classNames.join(' ');
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '801c1c1de26cb633280f308274861e8fd3629091', class: this.classNames(), role: "gridcell", style: this.tableRef &&
|
|
41
41
|
this.tableRef.fixedColumn &&
|
|
42
42
|
this.tableRef.selectable
|
|
43
43
|
? { '--fixed-cell-position': '40px' }
|
|
44
|
-
: {} }, h("slot", { key: '
|
|
44
|
+
: {} }, h("slot", { key: '0000fae3c9f199e3e80328afa7dd4347f429980b' })));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "pds-table-cell"; }
|
|
47
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -32,7 +32,7 @@ export class PdsTableHead {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '38eaecd17a328791e5993d020a490f63f67cd9d5', role: "row" }, this.tableRef && this.tableRef.selectable && (h("pds-table-head-cell", { key: '438086205f3e018f597c868e98f300d28c4f3384', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, h("pds-checkbox", { key: '835bbe3c1f3a0fcb217f62cf862b9ea80ddff38e', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected }))), h("slot", { key: 'aa5507016e20951eab86f62680720c54de5a5a86' })));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "pds-table-head"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -61,11 +61,11 @@ export class PdsTableHeadCell {
|
|
|
61
61
|
return classNames.join(' ');
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
|
-
return (h(Host, { key: '
|
|
64
|
+
return (h(Host, { key: '2e75e9b8d1254ec21c786fd7e8304aaf38b26377', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, style: this.tableRef &&
|
|
65
65
|
this.tableRef.fixedColumn &&
|
|
66
66
|
this.tableRef.selectable
|
|
67
67
|
? { '--fixed-cell-position': '40px' }
|
|
68
|
-
: {} }, h("slot", { key: '
|
|
68
|
+
: {} }, h("slot", { key: 'f9c7aae07eb7907a18dcf1a59813a2810341f2e9' }), this.sortable && (h("pds-icon", { key: 'd24a2f2c1db5bb15216ba64bc5a7299e18c23626', icon: this.sortingDirection === 'asc' ? upSmall : downSmall }))));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "pds-table-head-cell"; }
|
|
71
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,7 +43,7 @@ export class PdsTableRow {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: '651138280f94fd837a77e172c7e0ae5181ce8357', class: this.classNames(), role: "row" }, this.tableRef && this.tableRef.selectable && (h("pds-table-cell", { key: '739cd15863b52d60f9a00bffcf0d900b1ce1f545', part: this.tableRef.fixedColumn ? 'checkbox-cell' : '', class: this.tableRef.selectable ? 'has-checkbox' : '' }, h("pds-checkbox", { key: '2b2000bc223fa72e2be0edea25e72e4d26a98fa1', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected }))), h("slot", { key: '9d3be777c57b1ba4be066cc4ffa5496289fbdc02' })));
|
|
47
47
|
}
|
|
48
48
|
static get is() { return "pds-table-row"; }
|
|
49
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -83,7 +83,7 @@ export class PdsTable {
|
|
|
83
83
|
headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '8fbd30502d23962edf8977e9d23b8e990f043e23', class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, h("slot", { key: '5041e5f588db255c747406c47bcfb3524cd58450' })));
|
|
87
87
|
}
|
|
88
88
|
static get is() { return "pds-table"; }
|
|
89
89
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,9 +11,9 @@ export class PdsTab {
|
|
|
11
11
|
this.pdsTabClick.emit([index, parentComponentId]);
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
const availabilityTabEdgeInlineStart = (h("span", { key: '
|
|
15
|
-
const availabilityTabEdgeInlineEnd = (h("span", { key: '
|
|
16
|
-
return (h(Host, { key: '
|
|
14
|
+
const availabilityTabEdgeInlineStart = (h("span", { key: 'cdf38229fcb4548cf188e401d8949f0fdddd8160', class: "pds-tab-edge", role: "presentation" }));
|
|
15
|
+
const availabilityTabEdgeInlineEnd = (h("span", { key: 'ffd68b6f2c2a521560495411455185d426d41446', class: "pds-tab-edge pds-tab-edge--end", role: "presentation" }));
|
|
16
|
+
return (h(Host, { key: 'afc723cff632012e447cecf9e4a2d7258b846d48', variant: this.variant, slot: "tabs", index: this.index }, h("button", { key: 'f7f814b9ef9ac505a741ce74abd91934116f975f', role: "tab", id: this.parentComponentId + "__" + this.name, "aria-controls": this.parentComponentId + "__" + this.name + "-panel", tabindex: this.selected ? "0" : "-1", "aria-selected": this.selected ? "true" : "false", class: this.selected ? "pds-tab is-active" : "pds-tab", onClick: this.onTabClick.bind(this, this.index, this.parentComponentId) }, this.variant === "availability" && availabilityTabEdgeInlineStart, this.variant === "availability" && availabilityTabEdgeInlineEnd, h("div", { key: '12fea0cfdf4a1e9acee497ff3e60cb276f6ae649', class: "pds-tab__content" }, h("slot", { key: 'bf4455e277526a453111542ce7c80a0621135f18' })))));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "pds-tab"; }
|
|
19
19
|
static get originalStyleUrls() {
|
|
@@ -8,7 +8,7 @@ export class PdsTabpanel {
|
|
|
8
8
|
this.selected = false; // eslint-disable-line @stencil-community/strict-mutable
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '021d0c1f2fd740087bdd88069ac82455b8b5ede1', slot: "tabpanels" }, h("div", { key: '036aca9a0a29ba7cfc8aa0132eab027898a661f2', role: "tabpanel", id: this.parentComponentId + "__" + this.name + '-panel', tabindex: "0", "aria-labelledby": this.parentComponentId + "__" + this.name, class: this.selected ? "pds-tabpanel is-active" : "pds-tabpanel" }, h("slot", { key: 'd6b61e7b8af79204dbb5d3e421028715236a7bb1' }))));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "pds-tabpanel"; }
|
|
14
14
|
static get originalStyleUrls() {
|
|
@@ -76,7 +76,7 @@ export class PdsTabs {
|
|
|
76
76
|
this.passPropsToChildren();
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: 'ed163de5068114e7c7dd8314c7ed036859d0d0af', "active-tab-name": this.activeTabName, class: this.classNames(), id: this.componentId }, h("div", { key: '4b0f2bce407b2ea5c7ceb1435f4f91531334557e', class: "pds-tabs__tablist", role: "tablist", "aria-label": this.tablistLabel }, h("slot", { key: 'a61fb9bd35056f87233c1fec66dda175b201b265', name: "tabs" })), h("slot", { key: 'd78cc498b17ddd84015174802e4eb18fc5053ec2', name: "tabpanels" })));
|
|
80
80
|
}
|
|
81
81
|
static get is() { return "pds-tabs"; }
|
|
82
82
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,7 +17,7 @@ export class PdsText {
|
|
|
17
17
|
${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}
|
|
18
18
|
${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}
|
|
19
19
|
`;
|
|
20
|
-
return (h(Tag, { key: '
|
|
20
|
+
return (h(Tag, { key: '327e3b37535dd5eb28cf3ea0430e544261e570c0', style: this.color && setColor(this.color), class: typeClasses }, h("slot", { key: '97010a619baa6fd4a45e79ab9354097e99af0ae2' })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "pds-text"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,10 +121,10 @@ export class PdsTextarea {
|
|
|
121
121
|
}
|
|
122
122
|
render() {
|
|
123
123
|
const value = this.getValue();
|
|
124
|
-
return (h(Host, { key: '
|
|
125
|
-
h("label", { key: '
|
|
126
|
-
h("p", { key: '
|
|
127
|
-
h("p", { key: '
|
|
124
|
+
return (h(Host, { key: 'ebbf2c30176e11c92f04de02cad236496bc50a44', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null }, h("div", { key: '687811120416068af1b6d23a5fa8af149674669b', class: "pds-textarea" }, this.label &&
|
|
125
|
+
h("label", { key: '40fa708e95ff63881f3d41646bf99841625631d6', htmlFor: this.componentId }, this.label), h("textarea", Object.assign({ key: '543b7d6996b441b32f124f13025787c76340218d', ref: (el) => this.nativeTextarea = el, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, class: this.textareaClassNames(), disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, rows: this.rows, onBlur: this.onBlur, onChange: this.onTextareaChange, onFocus: this.onFocus, onInput: this.onInput }, this.inheritedAttributes), value), this.helperMessage &&
|
|
126
|
+
h("p", { key: '47cd46e8c8c5daaa3ff6fa830e5dde3624403575', class: "pds-textarea__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.invalid &&
|
|
127
|
+
h("p", { key: 'd84d1aece21db4ef596c154919fe689d66f4bd66', "aria-live": "assertive", class: "pds-textarea__error-message", id: messageId(this.componentId, 'error') }, h("pds-icon", { key: 'cb4627c36e25e14f6699ad0cfddd4bf8528755e0', icon: danger, size: "small" }), this.errorMessage))));
|
|
128
128
|
}
|
|
129
129
|
static get is() { return "pds-textarea"; }
|
|
130
130
|
static get encapsulation() { return "shadow"; }
|
|
@@ -77,13 +77,13 @@ export class PdsToast {
|
|
|
77
77
|
return this.icon && h("pds-icon", { name: this.icon, class: "pds-toast__icon" });
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: 'dbb28e20be685c46f8c6cb2dd1a5f58f28e27589', hidden: !this.isVisible }, h("div", { key: '471b6b387799754b92ad16baf70562e26c379616', class: {
|
|
81
81
|
'pds-toast': true,
|
|
82
82
|
[`pds-toast--${this.type}`]: this.type !== 'default',
|
|
83
83
|
'pds-toast--animating-out': this.isAnimatingOut
|
|
84
|
-
}, role: "alert", "aria-live": "polite" }, this.renderIcon(), h("span", { key: '
|
|
84
|
+
}, role: "alert", "aria-live": "polite" }, this.renderIcon(), h("span", { key: '638faa5e37de1bae0e59c994de35e27960fc625b', class: "pds-toast__message" }, h("slot", { key: 'e58c86bbe9a5467b6b362e0f67db4074b9cac0cb' })), this.dismissible && (h("button", { key: '43bd64963222a78163b337b37e9d5ff888236b45', type: "button", class: "pds-toast__button", onClick: () => {
|
|
85
85
|
this.dismiss();
|
|
86
|
-
}, "aria-label": "Dismiss message" }, h("pds-icon", { key: '
|
|
86
|
+
}, "aria-label": "Dismiss message" }, h("pds-icon", { key: '0c924e96515a7934f51d80b4e57f97db5bfaed14', name: "remove" }))))));
|
|
87
87
|
}
|
|
88
88
|
static get is() { return "pds-toast"; }
|
|
89
89
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,6 +16,8 @@ export class PdsTooltip {
|
|
|
16
16
|
this.contentDiv = null;
|
|
17
17
|
this.slotMutationObserver = null;
|
|
18
18
|
this.overlayResizeObserver = null;
|
|
19
|
+
this.currentPathname = '';
|
|
20
|
+
this.pathnameCheckInterval = null;
|
|
19
21
|
/**
|
|
20
22
|
* Determines when the tooltip is open
|
|
21
23
|
* @defaultValue false
|
|
@@ -85,6 +87,12 @@ export class PdsTooltip {
|
|
|
85
87
|
this.hideTooltip();
|
|
86
88
|
this._isInteractiveOpen = false;
|
|
87
89
|
};
|
|
90
|
+
this.checkPathnameChange = () => {
|
|
91
|
+
if (window.location.pathname !== this.currentPathname) {
|
|
92
|
+
this.currentPathname = window.location.pathname;
|
|
93
|
+
this.handleSpaNavigation();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
88
96
|
}
|
|
89
97
|
handleOpenToggle(newValue, oldValue) {
|
|
90
98
|
if (newValue === false && oldValue === true) {
|
|
@@ -96,6 +104,7 @@ export class PdsTooltip {
|
|
|
96
104
|
}
|
|
97
105
|
componentDidLoad() {
|
|
98
106
|
window.addEventListener('pageshow', this.handlePageShow);
|
|
107
|
+
this.currentPathname = window.location.pathname;
|
|
99
108
|
this.triggerEl = this.el.querySelector('.pds-tooltip__trigger');
|
|
100
109
|
const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');
|
|
101
110
|
if (contentSlotWrapper !== null) {
|
|
@@ -254,6 +263,8 @@ export class PdsTooltip {
|
|
|
254
263
|
window.addEventListener('scroll', this.handleScroll, true);
|
|
255
264
|
window.addEventListener('popstate', this.handleSpaNavigation, true);
|
|
256
265
|
window.addEventListener('hashchange', this.handleSpaNavigation, true);
|
|
266
|
+
// Start pathname change detection
|
|
267
|
+
this.pathnameCheckInterval = setInterval(this.checkPathnameChange, 100);
|
|
257
268
|
// Add ARIA attribute to trigger, now that portalEl and its ID are confirmed
|
|
258
269
|
if (this.triggerEl !== null && this.portalEl.id !== '') {
|
|
259
270
|
this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);
|
|
@@ -264,6 +275,11 @@ export class PdsTooltip {
|
|
|
264
275
|
this.overlayResizeObserver.unobserve(this.contentDiv);
|
|
265
276
|
this.overlayResizeObserver = null;
|
|
266
277
|
}
|
|
278
|
+
// Stop pathname change detection
|
|
279
|
+
if (this.pathnameCheckInterval !== null) {
|
|
280
|
+
clearInterval(this.pathnameCheckInterval);
|
|
281
|
+
this.pathnameCheckInterval = null;
|
|
282
|
+
}
|
|
267
283
|
if (this.portalEl !== null) {
|
|
268
284
|
window.removeEventListener('scroll', this.handleScroll, true);
|
|
269
285
|
window.removeEventListener('popstate', this.handleSpaNavigation, true);
|
|
@@ -279,7 +295,7 @@ export class PdsTooltip {
|
|
|
279
295
|
}
|
|
280
296
|
render() {
|
|
281
297
|
const hostId = this.componentId || undefined;
|
|
282
|
-
return (h(Host, { key: '
|
|
298
|
+
return (h(Host, { key: '462d8c0b1b70de08c0a4f9fe0b3977fa3b4af461', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: 'dfb735da6e04d95701bc223bc054414d781c0f4a', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide, onFocus: this.handleShow, onBlur: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: 'f0e5970a1ba6d59045306b836468cd00a06b183f' })), h("div", { key: '212ec606b29bd7a64a2ea3b1b4fae9746361a712', class: "pds-tooltip__content-slot-wrapper", style: { display: 'none' } }, h("slot", { key: '035ea5b2dfec0ca7f1462c30053f8f455cb986f2', name: "content" }))));
|
|
283
299
|
}
|
|
284
300
|
static get is() { return "pds-tooltip"; }
|
|
285
301
|
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;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AAQH,MAAM,OAAO,UAAU;IANvB;QASE;;;WAGG;QACc,uBAAkB,GAAG,KAAK,CAAC;QAEpC,aAAQ,GAAuB,IAAI,CAAC;QACpC,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAAuB,IAAI,CAAC;QACtC,yBAAoB,GAA4B,IAAI,CAAC;QACrD,0BAAqB,GAA0B,IAAI,CAAC;QAO5D;;;WAGG;QACM,WAAM,GAAG,KAAK,CAAC;QAYxB;;;WAGG;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,EAAE;YAC9D,6DACE,KAAK,EAAC,sBAAsB,EAC5B,YAAY,EAAE,IAAI,CAAC,UAAU,EAC7B,YAAY,EAAE,IAAI,CAAC,UAAU,EAC7B,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;gBAE9B,8DAAQ,CACH;YACP,4DAAK,KAAK,EAAC,mCAAmC,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;gBACvE,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtXc,0BAAe,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport { positionTooltip } from '../../utils/overlay';\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 triggerEl: HTMLElement | null = null;\n private contentDiv: HTMLElement | null = null;\n private slotMutationObserver: MutationObserver | null = null;\n private overlayResizeObserver: ResizeObserver | null = null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Determines when the tooltip is open\n * @defaultValue false\n */\n @State() isOpen = false;\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:\n 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = '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 }\n\n componentDidLoad() {\n window.addEventListener('pageshow', this.handlePageShow);\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 return () => {\n window.removeEventListener('pageshow', this.handlePageShow);\n\n if (this.slotMutationObserver !== null) {\n this.slotMutationObserver.disconnect();\n }\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\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 private handleScroll = () => {\n if (this.opened) {\n if (!this._isInteractiveOpen) {\n this.repositionPortal();\n } else {\n this.hideTooltip();\n this._isInteractiveOpen = false;\n }\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 /**\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.\n * Uses the determined anchor element and the current content dimensions.\n */\n private repositionPortal() {\n const anchor = this.determinePositioningAnchor();\n\n if (anchor !== null && this.contentDiv !== null) {\n positionTooltip({ elem: anchor, elemPlacement: this.placement, overlay: this.contentDiv });\n const placementParts = this.placement.split('-');\n const primaryPlacement = placementParts[0];\n const isCardinalCenterPlacement = placementParts.length === 1;\n\n if (isCardinalCenterPlacement) {\n const anchorRect = anchor.getBoundingClientRect();\n const overlayRect = this.contentDiv.getBoundingClientRect();\n\n if (primaryPlacement === 'left' || primaryPlacement === 'right') {\n const currentOverlayTop = parseFloat(this.contentDiv.style.top || '0');\n const anchorCenterY = anchorRect.top + (anchorRect.height / 2);\n const overlayCenterY = overlayRect.top + (overlayRect.height / 2);\n const adjustmentY = anchorCenterY - overlayCenterY;\n\n if (Math.abs(adjustmentY) > 0.5) {\n this.contentDiv.style.top = `${currentOverlayTop + adjustmentY}px`;\n }\n\n } else if (primaryPlacement === 'top' || primaryPlacement === 'bottom') {\n const currentOverlayLeft = parseFloat(this.contentDiv.style.left || '0');\n const anchorCenterX = anchorRect.left + (anchorRect.width / 2);\n const overlayCenterX = overlayRect.left + (overlayRect.width / 2);\n const adjustmentX = anchorCenterX - overlayCenterX;\n\n if (Math.abs(adjustmentX) > 0.5) {\n this.contentDiv.style.left = `${currentOverlayLeft + adjustmentX}px`;\n }\n }\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.placement} ${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 this.portalEl.id = this.componentId || this.el.id || `pds-tooltip-portal-${PdsTooltip.instanceCounter++}`;\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 this.contentDiv.setAttribute('role', 'tooltip');\n this.contentDiv.style.maxWidth = this.maxWidth;\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) {\n if (this.content !== '') {\n this.contentDiv.textContent = this.content;\n }\n }\n\n this.portalEl.appendChild(this.contentDiv);\n document.body.appendChild(this.portalEl);\n\n this.repositionPortal();\n\n if (this.contentDiv !== null) {\n this.overlayResizeObserver = new ResizeObserver(() => {\n this.repositionPortal();\n });\n this.overlayResizeObserver.observe(this.contentDiv);\n }\n\n // Add global listeners when portal is created\n window.addEventListener('scroll', this.handleScroll, true);\n window.addEventListener('popstate', this.handleSpaNavigation, true);\n window.addEventListener('hashchange', this.handleSpaNavigation, true);\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 if (this.overlayResizeObserver !== null && this.contentDiv !== null) {\n this.overlayResizeObserver.unobserve(this.contentDiv);\n this.overlayResizeObserver = null;\n }\n\n if (this.portalEl !== null) {\n window.removeEventListener('scroll', this.handleScroll, true);\n window.removeEventListener('popstate', this.handleSpaNavigation, true);\n window.removeEventListener('hashchange', this.handleSpaNavigation, true);\n document.body.removeChild(this.portalEl);\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 onFocus={this.handleShow}\n onBlur={this.handleHide}\n ref={el => this.triggerEl = el}\n >\n <slot />\n </span>\n <div class=\"pds-tooltip__content-slot-wrapper\" style={{ display: 'none' }}>\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;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AAQH,MAAM,OAAO,UAAU;IANvB;QASE;;;WAGG;QACc,uBAAkB,GAAG,KAAK,CAAC;QAEpC,aAAQ,GAAuB,IAAI,CAAC;QACpC,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAAuB,IAAI,CAAC;QACtC,yBAAoB,GAA4B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzYc,0BAAe,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport { positionTooltip } from '../../utils/overlay';\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 triggerEl: HTMLElement | null = null;\n private contentDiv: HTMLElement | null = null;\n private slotMutationObserver: MutationObserver | null = null;\n private overlayResizeObserver: ResizeObserver | null = null;\n private currentPathname: string = '';\n private pathnameCheckInterval: NodeJS.Timeout | null = null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Determines when the tooltip is open\n * @defaultValue false\n */\n @State() isOpen = false;\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:\n 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = '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 }\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 return () => {\n window.removeEventListener('pageshow', this.handlePageShow);\n\n if (this.slotMutationObserver !== null) {\n this.slotMutationObserver.disconnect();\n }\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\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 private handleScroll = () => {\n if (this.opened) {\n if (!this._isInteractiveOpen) {\n this.repositionPortal();\n } else {\n this.hideTooltip();\n this._isInteractiveOpen = false;\n }\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.\n * Uses the determined anchor element and the current content dimensions.\n */\n private repositionPortal() {\n const anchor = this.determinePositioningAnchor();\n\n if (anchor !== null && this.contentDiv !== null) {\n positionTooltip({ elem: anchor, elemPlacement: this.placement, overlay: this.contentDiv });\n const placementParts = this.placement.split('-');\n const primaryPlacement = placementParts[0];\n const isCardinalCenterPlacement = placementParts.length === 1;\n\n if (isCardinalCenterPlacement) {\n const anchorRect = anchor.getBoundingClientRect();\n const overlayRect = this.contentDiv.getBoundingClientRect();\n\n if (primaryPlacement === 'left' || primaryPlacement === 'right') {\n const currentOverlayTop = parseFloat(this.contentDiv.style.top || '0');\n const anchorCenterY = anchorRect.top + (anchorRect.height / 2);\n const overlayCenterY = overlayRect.top + (overlayRect.height / 2);\n const adjustmentY = anchorCenterY - overlayCenterY;\n\n if (Math.abs(adjustmentY) > 0.5) {\n this.contentDiv.style.top = `${currentOverlayTop + adjustmentY}px`;\n }\n\n } else if (primaryPlacement === 'top' || primaryPlacement === 'bottom') {\n const currentOverlayLeft = parseFloat(this.contentDiv.style.left || '0');\n const anchorCenterX = anchorRect.left + (anchorRect.width / 2);\n const overlayCenterX = overlayRect.left + (overlayRect.width / 2);\n const adjustmentX = anchorCenterX - overlayCenterX;\n\n if (Math.abs(adjustmentX) > 0.5) {\n this.contentDiv.style.left = `${currentOverlayLeft + adjustmentX}px`;\n }\n }\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.placement} ${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 this.portalEl.id = this.componentId || this.el.id || `pds-tooltip-portal-${PdsTooltip.instanceCounter++}`;\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 this.contentDiv.setAttribute('role', 'tooltip');\n this.contentDiv.style.maxWidth = this.maxWidth;\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) {\n if (this.content !== '') {\n this.contentDiv.textContent = this.content;\n }\n }\n\n this.portalEl.appendChild(this.contentDiv);\n document.body.appendChild(this.portalEl);\n\n this.repositionPortal();\n\n if (this.contentDiv !== null) {\n this.overlayResizeObserver = new ResizeObserver(() => {\n this.repositionPortal();\n });\n this.overlayResizeObserver.observe(this.contentDiv);\n }\n\n // Add global listeners when portal is created\n window.addEventListener('scroll', this.handleScroll, true);\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 if (this.overlayResizeObserver !== null && this.contentDiv !== null) {\n this.overlayResizeObserver.unobserve(this.contentDiv);\n this.overlayResizeObserver = 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 window.removeEventListener('scroll', this.handleScroll, true);\n window.removeEventListener('popstate', this.handleSpaNavigation, true);\n window.removeEventListener('hashchange', this.handleSpaNavigation, true);\n document.body.removeChild(this.portalEl);\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 onFocus={this.handleShow}\n onBlur={this.handleHide}\n ref={el => this.triggerEl = el}\n >\n <slot />\n </span>\n <div class=\"pds-tooltip__content-slot-wrapper\" style={{ display: 'none' }}>\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|