@pine-ds/core 3.17.0 → 3.19.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/pds-button2.js +21 -8
- package/components/pds-button2.js.map +1 -1
- package/components/pds-chip2.js +20 -7
- package/components/pds-chip2.js.map +1 -1
- package/components/pds-combobox.js +2 -2
- package/components/pds-combobox.js.map +1 -1
- package/components/pds-copytext.js +49 -1
- package/components/pds-copytext.js.map +1 -1
- package/components/pds-dropdown-menu-item.js +3 -2
- package/components/pds-dropdown-menu-item.js.map +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-dropdown-menu.js.map +1 -1
- package/components/pds-link2.js +3 -2
- package/components/pds-link2.js.map +1 -1
- package/components/pds-multiselect.js +61 -15
- package/components/pds-multiselect.js.map +1 -1
- package/components/pds-table-cell2.js +36 -3
- package/components/pds-table-cell2.js.map +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-head.js.map +1 -1
- package/components/pds-table-row.js +3 -3
- package/components/pds-table-row.js.map +1 -1
- package/components/pds-table.js +12 -4
- package/components/pds-table.js.map +1 -1
- package/components/pds-text2.js +41 -1
- package/components/pds-text2.js.map +1 -1
- package/components/truncation-tooltip.js +247 -0
- package/components/truncation-tooltip.js.map +1 -0
- package/dist/cjs/{index-DkQebouX.js → index-CjhTEk39.js} +3 -3
- package/dist/cjs/index-CjhTEk39.js.map +1 -0
- package/dist/cjs/loader.cjs.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 +17 -7
- 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 +20 -8
- package/dist/cjs/pds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +2 -2
- package/dist/cjs/pds-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +48 -2
- package/dist/cjs/pds-copytext.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-filter.cjs.entry.js +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +1 -1
- package/dist/cjs/pds-link.cjs.entry.js +3 -3
- package/dist/cjs/pds-link.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-multiselect.cjs.entry.js +58 -15
- package/dist/cjs/pds-multiselect.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +1 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +35 -3
- package/dist/cjs/pds-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +11 -4
- package/dist/cjs/pds-table.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-text.cjs.entry.js +40 -1
- package/dist/cjs/pds-text.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/truncation-tooltip-BGGnm8SZ.js +249 -0
- package/dist/cjs/truncation-tooltip-BGGnm8SZ.js.map +1 -0
- package/dist/collection/components/pds-button/pds-button.css +1 -1
- package/dist/collection/components/pds-button/pds-button.js +42 -7
- package/dist/collection/components/pds-button/pds-button.js.map +1 -1
- package/dist/collection/components/pds-chip/pds-chip.css +25 -4
- package/dist/collection/components/pds-chip/pds-chip.js +50 -7
- package/dist/collection/components/pds-chip/pds-chip.js.map +1 -1
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +36 -13
- package/dist/collection/components/pds-combobox/pds-combobox.js +2 -2
- package/dist/collection/components/pds-combobox/pds-combobox.js.map +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +52 -2
- package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +21 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js.map +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +1 -1
- package/dist/collection/components/pds-link/pds-link.js +21 -2
- package/dist/collection/components/pds-link/pds-link.js.map +1 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.css +2 -2
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +130 -13
- package/dist/collection/components/pds-multiselect/pds-multiselect.js.map +1 -1
- package/dist/collection/components/pds-multiselect/stories/pds-multiselect.stories.js +55 -0
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +37 -3
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +3 -3
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table.css +1 -0
- package/dist/collection/components/pds-table/pds-table.js +33 -17
- package/dist/collection/components/pds-table/pds-table.js.map +1 -1
- package/dist/collection/components/pds-table/stories/pds-table.stories.js +58 -0
- package/dist/collection/components/pds-text/pds-text.js +43 -2
- package/dist/collection/components/pds-text/pds-text.js.map +1 -1
- package/dist/collection/components/pds-text/stories/pds-text.stories.js +21 -2
- package/dist/collection/utils/truncation-tooltip.js +242 -0
- package/dist/collection/utils/truncation-tooltip.js.map +1 -0
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/docs.json +255 -20
- package/dist/esm/{index-D094LgxJ.js → index-BFkDH5XU.js} +3 -3
- package/dist/esm/index-BFkDH5XU.js.map +1 -0
- package/dist/esm/loader.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 +17 -7
- 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 +20 -8
- package/dist/esm/pds-chip.entry.js.map +1 -1
- package/dist/esm/pds-combobox.entry.js +2 -2
- package/dist/esm/pds-combobox.entry.js.map +1 -1
- package/dist/esm/pds-copytext.entry.js +49 -3
- package/dist/esm/pds-copytext.entry.js.map +1 -1
- package/dist/esm/pds-dropdown-menu-item.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu-item.entry.js.map +1 -1
- package/dist/esm/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu.entry.js.map +1 -1
- package/dist/esm/pds-filter.entry.js +1 -1
- package/dist/esm/pds-input.entry.js +1 -1
- package/dist/esm/pds-link.entry.js +3 -3
- package/dist/esm/pds-link.entry.js.map +1 -1
- package/dist/esm/pds-multiselect.entry.js +58 -15
- package/dist/esm/pds-multiselect.entry.js.map +1 -1
- package/dist/esm/pds-radio-group.entry.js +1 -1
- package/dist/esm/pds-radio.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +1 -1
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +35 -3
- package/dist/esm/pds-table-cell.entry.js.map +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +1 -1
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-head.entry.js.map +1 -1
- package/dist/esm/pds-table-row.entry.js +3 -3
- package/dist/esm/pds-table-row.entry.js.map +1 -1
- package/dist/esm/pds-table.entry.js +11 -4
- package/dist/esm/pds-table.entry.js.map +1 -1
- package/dist/esm/pds-text.entry.js +40 -1
- package/dist/esm/pds-text.entry.js.map +1 -1
- package/dist/esm/pds-textarea.entry.js +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/truncation-tooltip-CTHpMbU3.js +247 -0
- package/dist/esm/truncation-tooltip-CTHpMbU3.js.map +1 -0
- package/dist/esm-es5/{index-D094LgxJ.js → index-BFkDH5XU.js} +1 -1
- package/dist/esm-es5/index-BFkDH5XU.js.map +1 -0
- package/dist/esm-es5/loader.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-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js.map +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js.map +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js.map +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js.map +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js.map +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js.map +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js.map +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js.map +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/truncation-tooltip-CTHpMbU3.js +2 -0
- package/dist/esm-es5/truncation-tooltip-CTHpMbU3.js.map +1 -0
- package/dist/pine-core/{p-2aac4495.system.entry.js → p-15ac22bd.system.entry.js} +2 -2
- package/dist/pine-core/p-203f6e9e.entry.js +2 -0
- package/dist/pine-core/p-203f6e9e.entry.js.map +1 -0
- package/dist/pine-core/{p-0ac54273.entry.js → p-276f774a.entry.js} +2 -2
- package/dist/pine-core/p-27ccbd3f.entry.js +2 -0
- package/dist/pine-core/p-27ccbd3f.entry.js.map +1 -0
- package/dist/pine-core/p-2e22a1fc.system.entry.js +2 -0
- package/dist/pine-core/p-2e22a1fc.system.entry.js.map +1 -0
- package/dist/pine-core/{p-01aec1ad.system.entry.js → p-2f64a2fe.system.entry.js} +2 -2
- package/dist/pine-core/p-2f64a2fe.system.entry.js.map +1 -0
- package/dist/pine-core/p-3239c67a.entry.js +2 -0
- package/dist/pine-core/{p-f5fb71f6.entry.js.map → p-3239c67a.entry.js.map} +1 -1
- package/dist/pine-core/{p-ce069162.entry.js → p-32f65e48.entry.js} +2 -2
- package/dist/pine-core/p-4189f1be.system.entry.js +2 -0
- package/dist/pine-core/p-4189f1be.system.entry.js.map +1 -0
- package/dist/pine-core/{p-7d7dce2c.system.entry.js → p-4232520f.system.entry.js} +2 -2
- package/dist/pine-core/{p-8e40c9ef.entry.js → p-439e3343.entry.js} +2 -2
- package/dist/pine-core/p-439e3343.entry.js.map +1 -0
- package/dist/pine-core/{p-5abc5d82.system.entry.js → p-49c2e2ce.system.entry.js} +2 -2
- package/dist/pine-core/{p-b1a7a0b2.entry.js → p-4de64b1f.entry.js} +2 -2
- package/dist/pine-core/{p-0b52923b.system.entry.js → p-52c5ced3.system.entry.js} +2 -2
- package/dist/pine-core/{p-b46f66e8.system.entry.js → p-5757d038.system.entry.js} +2 -2
- package/dist/pine-core/p-5757d038.system.entry.js.map +1 -0
- package/dist/pine-core/{p-36e5e9f4.system.entry.js → p-57aa762e.system.entry.js} +2 -2
- package/dist/pine-core/p-57aa762e.system.entry.js.map +1 -0
- package/dist/pine-core/p-57d2c33a.entry.js +2 -0
- package/dist/pine-core/p-57d2c33a.entry.js.map +1 -0
- package/dist/pine-core/{p-3815f565.entry.js → p-593cee44.entry.js} +2 -2
- package/dist/pine-core/{p-73bce0bf.entry.js → p-5a7b25d0.entry.js} +2 -2
- package/dist/pine-core/{p-06046885.entry.js → p-5dbbb2be.entry.js} +3 -3
- package/dist/pine-core/{p-06046885.entry.js.map → p-5dbbb2be.entry.js.map} +1 -1
- package/dist/pine-core/p-5hPM5knE.js +2 -0
- package/dist/pine-core/p-5hPM5knE.js.map +1 -0
- package/dist/pine-core/{p-957647f9.entry.js → p-663abd80.entry.js} +2 -2
- package/dist/pine-core/{p-23111b1c.system.entry.js → p-6980edfe.system.entry.js} +2 -2
- package/dist/pine-core/{p-BxVkyfaO.system.js → p-6I02BpQf.system.js} +1 -1
- package/dist/pine-core/p-6I02BpQf.system.js.map +1 -0
- package/dist/pine-core/{p-c9965216.system.entry.js → p-6fbe6be4.system.entry.js} +2 -2
- package/dist/pine-core/p-7514a191.entry.js +2 -0
- package/dist/pine-core/p-7514a191.entry.js.map +1 -0
- package/dist/pine-core/{p-bd18b9bf.system.entry.js → p-77d4f274.system.entry.js} +2 -2
- package/dist/pine-core/{p-78246e05.entry.js → p-85ce731b.entry.js} +2 -2
- package/dist/pine-core/{p-b1820970.system.entry.js → p-87cee4a0.system.entry.js} +2 -2
- package/dist/pine-core/{p-fbd8ae50.entry.js → p-88686193.entry.js} +2 -2
- package/dist/pine-core/p-88eb4f6c.entry.js +2 -0
- package/dist/pine-core/p-88eb4f6c.entry.js.map +1 -0
- package/dist/pine-core/{p-b09bde5c.system.entry.js → p-8ab66dbc.system.entry.js} +2 -2
- package/dist/pine-core/p-8be316b4.system.entry.js +2 -0
- package/dist/pine-core/p-8be316b4.system.entry.js.map +1 -0
- package/dist/pine-core/{p-7a11a6c7.entry.js → p-8f935480.entry.js} +2 -2
- package/dist/pine-core/p-9263809e.entry.js +2 -0
- package/dist/pine-core/p-9263809e.entry.js.map +1 -0
- package/dist/pine-core/{p-425144ae.entry.js → p-9a9c1b17.entry.js} +2 -2
- package/dist/pine-core/p-9a9c1b17.entry.js.map +1 -0
- package/dist/pine-core/{p-3f05d72e.system.entry.js → p-9e3e441c.system.entry.js} +2 -2
- package/dist/pine-core/{p-3cd53462.entry.js → p-9e8296fc.entry.js} +2 -2
- package/dist/pine-core/{p-BJPmPVaF.system.js.map → p-B3dAc5EW.system.js.map} +1 -1
- package/dist/pine-core/{p-h_fnwqV_.system.js.map → p-B3xx1u93.system.js.map} +1 -1
- package/dist/pine-core/p-B48FyOD0.system.js.map +1 -0
- package/dist/pine-core/{p-DY97YDUU.system.js.map → p-B5CyjPYU.system.js.map} +1 -1
- package/dist/pine-core/{p-N-jt0_Yl.system.js.map → p-BBJXL9br.system.js.map} +1 -1
- package/dist/pine-core/{p-D094LgxJ.js → p-BFkDH5XU.js} +1 -1
- package/dist/pine-core/p-BFkDH5XU.js.map +1 -0
- package/dist/pine-core/p-BGVC08sX.system.js.map +1 -0
- package/dist/pine-core/p-BMx906Ad.system.js.map +1 -0
- package/dist/pine-core/{p-CjQwwLdV.system.js.map → p-Bd3ynCsJ.system.js.map} +1 -1
- package/dist/pine-core/{p-D4YdQDsG.system.js.map → p-BiLmvJTd.system.js.map} +1 -1
- package/dist/pine-core/{p-PZw10cnm.system.js.map → p-C8y7SAd7.system.js.map} +1 -1
- package/dist/pine-core/p-C9OQdhX3.system.js.map +1 -0
- package/dist/pine-core/{p-gcCcHox5.system.js.map → p-CCh7iS6N.system.js.map} +1 -1
- package/dist/pine-core/p-CEE11B7K.system.js.map +1 -0
- package/dist/pine-core/{p-D3Ug1A-l.system.js.map → p-CbRBe3Eq.system.js.map} +1 -1
- package/dist/pine-core/p-CsWO_n3t.system.js.map +1 -0
- package/dist/pine-core/{p-c2oMjk1r.system.js.map → p-Ctc231vq.system.js.map} +1 -1
- package/dist/pine-core/p-DXVwADJT.system.js +2 -0
- package/dist/pine-core/p-DXVwADJT.system.js.map +1 -0
- package/dist/pine-core/p-DYm9--lc.system.js.map +1 -0
- package/dist/pine-core/p-DenbFuEN.system.js.map +1 -0
- package/dist/pine-core/{p-BnJypAy2.system.js.map → p-DhLX7iDs.system.js.map} +1 -1
- package/dist/pine-core/p-Dkz0RoFB.system.js.map +1 -0
- package/dist/pine-core/p-JAVnELnm.system.js +1 -1
- package/dist/pine-core/{p-15e554ae.entry.js → p-a30edeb1.entry.js} +2 -2
- package/dist/pine-core/{p-5O8bhSdk.system.js.map → p-aKHwHZQR.system.js.map} +1 -1
- package/dist/pine-core/p-b232004f.system.entry.js +2 -0
- package/dist/pine-core/p-b232004f.system.entry.js.map +1 -0
- package/dist/pine-core/{p-fce519e3.system.entry.js → p-b416cb4b.system.entry.js} +2 -2
- package/dist/pine-core/p-b416cb4b.system.entry.js.map +1 -0
- package/dist/pine-core/{p-94c73d98.entry.js → p-b5316979.entry.js} +2 -2
- package/dist/pine-core/p-b5316979.entry.js.map +1 -0
- package/dist/pine-core/{p-d2b2caa2.system.entry.js → p-b6f57c0f.system.entry.js} +2 -2
- package/dist/pine-core/p-b7f2f9f3.system.entry.js +2 -0
- package/dist/pine-core/p-b7f2f9f3.system.entry.js.map +1 -0
- package/dist/pine-core/{p-19fef546.system.entry.js → p-c301925f.system.entry.js} +2 -2
- package/dist/pine-core/{p-19fef546.system.entry.js.map → p-c301925f.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-f0df10c7.system.entry.js → p-ca20b134.system.entry.js} +2 -2
- package/dist/pine-core/p-ca20b134.system.entry.js.map +1 -0
- package/dist/pine-core/{p-6748d7b4.entry.js → p-d38da7a6.entry.js} +2 -2
- package/dist/pine-core/p-d38da7a6.entry.js.map +1 -0
- package/dist/pine-core/p-eac7cc81.entry.js +2 -0
- package/dist/pine-core/p-eac7cc81.entry.js.map +1 -0
- package/dist/pine-core/p-ed5ca877.system.entry.js +2 -0
- package/dist/pine-core/{p-29266dcd.system.entry.js.map → p-ed5ca877.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-13105538.system.entry.js → p-f795d3fe.system.entry.js} +2 -2
- package/dist/pine-core/p-f7d9bZ8U.system.js.map +1 -0
- package/dist/pine-core/p-f81b0dbb.system.entry.js +2 -0
- package/dist/pine-core/p-f81b0dbb.system.entry.js.map +1 -0
- package/dist/pine-core/{p-2d21bc31.entry.js → p-f8a2aedd.entry.js} +2 -2
- package/dist/pine-core/{p-CQtQQn3_.system.js.map → p-hL5Id7g5.system.js.map} +1 -1
- package/dist/pine-core/{p-BK1BTkTt.system.js.map → p-hzdqYC6e.system.js.map} +1 -1
- package/dist/pine-core/p-n9xvc2MF.system.js.map +1 -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-combobox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-copytext.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-dropdown-menu.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-link.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-multiselect.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-cell.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-head.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-row.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-text.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-button/pds-button.d.ts +12 -1
- package/dist/types/components/pds-chip/pds-chip.d.ts +9 -2
- package/dist/types/components/pds-copytext/pds-copytext.d.ts +10 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +7 -0
- package/dist/types/components/pds-link/pds-link.d.ts +6 -0
- package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +27 -0
- package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +7 -1
- package/dist/types/components/pds-table/pds-table-row/pds-table-row.d.ts +1 -1
- package/dist/types/components/pds-table/pds-table.d.ts +6 -7
- package/dist/types/components/pds-text/pds-text.d.ts +9 -0
- package/dist/types/components.d.ts +86 -16
- package/dist/types/utils/truncation-tooltip.d.ts +21 -0
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/vscode.html-data.json +68 -8
- package/hydrate/index.js +486 -52
- package/hydrate/index.mjs +486 -52
- package/package.json +2 -2
- package/dist/cjs/index-DkQebouX.js.map +0 -1
- package/dist/esm/index-D094LgxJ.js.map +0 -1
- package/dist/esm-es5/index-D094LgxJ.js.map +0 -1
- package/dist/pine-core/p-003884fd.entry.js +0 -2
- package/dist/pine-core/p-003884fd.entry.js.map +0 -1
- package/dist/pine-core/p-01aec1ad.system.entry.js.map +0 -1
- package/dist/pine-core/p-1971d358.entry.js +0 -2
- package/dist/pine-core/p-1971d358.entry.js.map +0 -1
- package/dist/pine-core/p-23aba538.entry.js +0 -2
- package/dist/pine-core/p-23aba538.entry.js.map +0 -1
- package/dist/pine-core/p-29266dcd.system.entry.js +0 -2
- package/dist/pine-core/p-36e5e9f4.system.entry.js.map +0 -1
- package/dist/pine-core/p-3b0a4abe.entry.js +0 -2
- package/dist/pine-core/p-3b0a4abe.entry.js.map +0 -1
- package/dist/pine-core/p-3c026ec7.system.entry.js +0 -2
- package/dist/pine-core/p-3c026ec7.system.entry.js.map +0 -1
- package/dist/pine-core/p-425144ae.entry.js.map +0 -1
- package/dist/pine-core/p-48ed8147.entry.js +0 -2
- package/dist/pine-core/p-48ed8147.entry.js.map +0 -1
- package/dist/pine-core/p-6748d7b4.entry.js.map +0 -1
- package/dist/pine-core/p-6877a50d.system.entry.js +0 -2
- package/dist/pine-core/p-6877a50d.system.entry.js.map +0 -1
- package/dist/pine-core/p-6918b378.system.entry.js +0 -2
- package/dist/pine-core/p-6918b378.system.entry.js.map +0 -1
- package/dist/pine-core/p-8KFA3I5T.system.js.map +0 -1
- package/dist/pine-core/p-8e40c9ef.entry.js.map +0 -1
- package/dist/pine-core/p-93d0be59.entry.js +0 -2
- package/dist/pine-core/p-93d0be59.entry.js.map +0 -1
- package/dist/pine-core/p-94c73d98.entry.js.map +0 -1
- package/dist/pine-core/p-BpZTjdau.system.js.map +0 -1
- package/dist/pine-core/p-BxVkyfaO.system.js.map +0 -1
- package/dist/pine-core/p-CjnIO2Ro.system.js.map +0 -1
- package/dist/pine-core/p-Ct5QAsPN.system.js.map +0 -1
- package/dist/pine-core/p-D094LgxJ.js.map +0 -1
- package/dist/pine-core/p-DR2CskUb.system.js.map +0 -1
- package/dist/pine-core/p-DZEhYV6y.system.js.map +0 -1
- package/dist/pine-core/p-DdTbt4lH.system.js.map +0 -1
- package/dist/pine-core/p-Ri89mw0-.system.js.map +0 -1
- package/dist/pine-core/p-ZUqfslIz.system.js.map +0 -1
- package/dist/pine-core/p-aeb2f6ac.system.entry.js +0 -2
- package/dist/pine-core/p-aeb2f6ac.system.entry.js.map +0 -1
- package/dist/pine-core/p-b3c66c58.entry.js +0 -2
- package/dist/pine-core/p-b3c66c58.entry.js.map +0 -1
- package/dist/pine-core/p-b46f66e8.system.entry.js.map +0 -1
- package/dist/pine-core/p-cb8c24ad.system.entry.js +0 -2
- package/dist/pine-core/p-cb8c24ad.system.entry.js.map +0 -1
- package/dist/pine-core/p-d83d6fce.system.entry.js +0 -2
- package/dist/pine-core/p-d83d6fce.system.entry.js.map +0 -1
- package/dist/pine-core/p-eT6pKhWF.system.js.map +0 -1
- package/dist/pine-core/p-f0df10c7.system.entry.js.map +0 -1
- package/dist/pine-core/p-f5fb71f6.entry.js +0 -2
- package/dist/pine-core/p-fce519e3.system.entry.js.map +0 -1
- package/dist/pine-core/p-kYQszSpu.system.js.map +0 -1
- /package/dist/pine-core/{p-2aac4495.system.entry.js.map → p-15ac22bd.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0ac54273.entry.js.map → p-276f774a.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ce069162.entry.js.map → p-32f65e48.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7d7dce2c.system.entry.js.map → p-4232520f.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5abc5d82.system.entry.js.map → p-49c2e2ce.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b1a7a0b2.entry.js.map → p-4de64b1f.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0b52923b.system.entry.js.map → p-52c5ced3.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3815f565.entry.js.map → p-593cee44.entry.js.map} +0 -0
- /package/dist/pine-core/{p-73bce0bf.entry.js.map → p-5a7b25d0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-957647f9.entry.js.map → p-663abd80.entry.js.map} +0 -0
- /package/dist/pine-core/{p-23111b1c.system.entry.js.map → p-6980edfe.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c9965216.system.entry.js.map → p-6fbe6be4.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-bd18b9bf.system.entry.js.map → p-77d4f274.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-78246e05.entry.js.map → p-85ce731b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b1820970.system.entry.js.map → p-87cee4a0.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-fbd8ae50.entry.js.map → p-88686193.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b09bde5c.system.entry.js.map → p-8ab66dbc.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7a11a6c7.entry.js.map → p-8f935480.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3f05d72e.system.entry.js.map → p-9e3e441c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3cd53462.entry.js.map → p-9e8296fc.entry.js.map} +0 -0
- /package/dist/pine-core/{p-15e554ae.entry.js.map → p-a30edeb1.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d2b2caa2.system.entry.js.map → p-b6f57c0f.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-13105538.system.entry.js.map → p-f795d3fe.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2d21bc31.entry.js.map → p-f8a2aedd.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{e as exposeTypeProperty,m as messageId}from"./form-CN-lL5QG.js";import{b as danger,e as enlarge}from"./index-D094LgxJ.js";var pdsSelectTokensCss=":host{--pine-select-color-background-danger:var(--pine-color-red-050)}";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsSelectCss=':host{--pds-select-background:var(--pine-color-background-container);--pds-select-border:var(--pine-border);--pds-select-border-radius:var(--pine-dimension-125);--pds-select-border-radius-start-end:var(--pine-dimension-125);--pds-select-border-radius-start-start:var(--pine-dimension-125);--pds-select-border-radius-end-end:var(--pine-dimension-125);--pds-select-border-radius-end-start:var(--pine-dimension-125);--pds-select-min-height:36px;--box-shadow-focus:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring);--box-shadow-focus-error:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring-danger)}:host .hidden,:host :host([hidden]){display:none}.pds-select{color:var(--pine-color-text);display:grid;-ms-flex-direction:column;flex-direction:column;grid-template-areas:"label label" "field field" "message message";grid-template-columns:1fr minmax(2rem, -webkit-min-content);grid-template-columns:1fr minmax(2rem, min-content);grid-template-rows:-webkit-min-content -webkit-min-content -webkit-min-content;grid-template-rows:min-content min-content min-content;position:relative;width:100%}.pds-select__label-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-area:label;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-select__action{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}label{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-select__label-wrapper label{-webkit-margin-after:0;margin-block-end:0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--pds-select-background);border:var(--pds-select-border);border-radius:var(--pds-select-border-radius);border-bottom-left-radius:var(--pds-select-border-radius-end-start, var(--pds-select-border-radius));border-bottom-right-radius:var(--pds-select-border-radius-end-end, var(--pds-select-border-radius));border-top-left-radius:var(--pds-select-border-radius-start-start, var(--pds-select-border-radius));border-top-right-radius:var(--pds-select-border-radius-start-end, var(--pds-select-border-radius));color:var(--pine-color-text);font:var(--pine-typography-body);grid-area:field;letter-spacing:var(--pine-letter-spacing);min-height:var(--pds-select-min-height);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-150);-webkit-padding-end:var(--pine-dimension-450);padding-inline-end:var(--pine-dimension-450);position:relative}select:hover{border-color:var(--pine-color-border-hover);cursor:pointer}select:focus-visible{border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}select:disabled{background-color:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}select:has(~.pds-select__message .pds-select__error-message){background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) select:has(~.pds-select__message .pds-select__error-message){background-color:var(--pine-color-red-950)}select:has(~.pds-select__message .pds-select__error-message):focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) select{background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) :host(.is-invalid) select{background-color:var(--pine-color-red-950)}:host(.is-invalid) select:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select{background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-accent);color:var(--pine-color-text-accent)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select:hover:not(:disabled){border-color:var(--pine-color-accent-hover)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select:focus-visible{outline-color:var(--pine-color-focus-ring)}:host([highlight]:not(.is-disabled):not(.is-invalid)) .pds-select__select-icon{color:var(--pine-color-text-accent)}.pds-select__error-message,.pds-select__helper-message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-select__error-message{color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-select__error-message pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.pds-select__message{grid-area:message}.pds-select__select-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-column:-1/-2;grid-row:2/3;height:var(--pds-select-min-height);pointer-events:none;position:relative;z-index:var(--pine-z-index-raised)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}';var PdsSelect=function(){function e(e){var i=this;registerInstance(this,e);this.pdsSelectChange=createEvent(this,"pdsSelectChange");this.pdsBlur=createEvent(this,"pdsBlur");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsKeyDown=createEvent(this,"pdsKeyDown");this._type="select-one";this.disabled=false;this.multiple=false;this.required=false;this.onSelectUpdate=function(e){var s=e.target;var r=Array.from(s.options).filter((function(e){return e.selected})).map((function(e){return e.value}));if(r.length===1&&!i.multiple){i.value=r[0]}else{i.value=r}i.pdsSelectChange.emit(e)};this.onBlur=function(e){i.pdsBlur.emit(e)};this.onFocus=function(e){i.pdsFocus.emit(e)};this.onKeyDown=function(e){i.pdsKeyDown.emit(e)};this.handleSlotChange=function(){var e=i.slotContainer.querySelector("slot");i.selectEl.innerHTML="";var s=e.assignedElements({flatten:true});s.forEach((function(e){if(["OPTION","OPTGROUP"].includes(e.tagName)){var s=e.cloneNode(true);if(s.tagName==="OPTION"&&s.value===i.value){s.selected=true}i.selectEl.appendChild(s)}}));i.updateSelectedOption()}}e.prototype.valueChanged=function(){this.updateSelectedOption();this.updateFormValue()};e.prototype.multipleChanged=function(){this.updateType()};e.prototype.updateType=function(){this._type=this.multiple?"select-multiple":"select-one"};e.prototype.connectedCallback=function(){var e=this;if(this.el.attachInternals&&!this.internals){this.internals=this.el.attachInternals()}exposeTypeProperty(this.el,(function(){return e._type}))};e.prototype.componentWillLoad=function(){this.updateType();this.updateSelectedOption()};e.prototype.componentDidLoad=function(){this.updateFormValue()};e.prototype.updateSelectedOption=function(){var e=this;if(this.selectEl){var i=this.selectEl.options;Array.from(i).map((function(i){if(Array.isArray(e.value)){i.selected=e.value.includes(i.value)}else{i.selected=e.value===i.value}}))}};e.prototype.getHelperMessage=function(){return this.helperMessage&&h("p",{class:"pds-select__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage)};e.prototype.getErrorMessage=function(){return this.errorMessage&&h("p",{class:"pds-select__error-message",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{icon:danger,size:"small"}),this.errorMessage)};e.prototype.renderMessages=function(){if(!this.helperMessage&&!this.errorMessage)return null;return h("div",{class:"pds-select__message"},this.getHelperMessage(),this.getErrorMessage())};e.prototype.classNames=function(){var e=[];if(this.invalid){e.push("is-invalid")}if(this.disabled){e.push("is-disabled")}return e.join(" ")};e.prototype.renderAction=function(){var e=this.el.querySelector('[slot="action"]')!==null;if(e){return h("div",{class:"pds-select__action",part:"action"},h("slot",{name:"action"}))}return null};e.prototype.updateFormValue=function(){var e=this;if(this.internals&&this.internals.setFormValue){var i=this.value;if(Array.isArray(i)){if(i.length>1){var s=new FormData;i.forEach((function(i){return s.append(e.name||"",i)}));this.internals.setFormValue(s)}else{this.internals.setFormValue(i[0]||null)}}else{this.internals.setFormValue(i||null)}if(this.selectEl&&this.internals&&this.internals.setValidity){this.internals.setValidity(this.selectEl.validity,this.selectEl.validationMessage,this.selectEl)}}};e.prototype.formResetCallback=function(){this.value="";this.updateFormValue()};e.prototype.formDisabledCallback=function(e){this.disabled=e};e.prototype.formStateRestoreCallback=function(e){if(typeof e==="string"){this.value=e}else if(e instanceof FormData&&this.name){var i=e.getAll(this.name);if(i.length>1){this.value=i.filter((function(e){return typeof e==="string"}))}else if(i.length===1&&typeof i[0]==="string"){this.value=i[0]}}};e.prototype.render=function(){var e=this;var i=this.el.querySelector('[slot="action"]')!==null;return h(Host,{key:"d36bddf20910ae21ba2209bbf7e3f13b1ce9c3bf","aria-disabled":this.disabled?"true":null,class:this.classNames(),"has-action":i&&!this.hideLabel?"true":null},h("div",{key:"72fe6ee352834fbd6e8f5f9d9e96b1be232f2988",class:"pds-select"},!this.hideLabel&&h("div",{key:"c2894f7ec00402425f74f1145d449da13d870161",class:"pds-select__label-wrapper"},h("label",{key:"4f6277c3f7b40f3d52995231cb49824e58ebae1b",htmlFor:this.componentId},h("span",{key:"f1b0cf90091843c1a994699263905f811888d4bd",class:this.hideLabel?"visually-hidden":""},this.label)),i&&this.renderAction()),h("select",{key:"727c1644e8ea5afc194e33e29e9730d6b08c3784","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,onBlur:this.onBlur,onChange:this.onSelectUpdate,onFocus:this.onFocus,onKeyDown:this.onKeyDown,part:"select",required:this.required,ref:function(i){return e.selectEl=i}}),h("div",{key:"d7c0c3f3b765b13c6dc34a9c5c13bbcfd081a274","aria-hidden":"true",class:"hidden",ref:function(i){return e.slotContainer=i}},h("slot",{key:"2305afcacb082c0d5faca8b77295919f8d9c9e0b",onSlotchange:this.handleSlotChange})),this.renderMessages(),!this.multiple&&h("pds-icon",{key:"4a1d6ced0ffc14ae17763d116a85324e5a6c7ce5",class:"pds-select__select-icon",icon:enlarge})))};Object.defineProperty(e,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"],multiple:["multipleChanged"]}},enumerable:false,configurable:true});return e}();PdsSelect.style=pdsSelectTokensCss+(labelCss+pdsSelectCss);export{PdsSelect as pds_select};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{e as exposeTypeProperty,m as messageId}from"./form-CN-lL5QG.js";import{b as danger,e as enlarge}from"./index-BFkDH5XU.js";var pdsSelectTokensCss=":host{--pine-select-color-background-danger:var(--pine-color-red-050)}";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsSelectCss=':host{--pds-select-background:var(--pine-color-background-container);--pds-select-border:var(--pine-border);--pds-select-border-radius:var(--pine-dimension-125);--pds-select-border-radius-start-end:var(--pine-dimension-125);--pds-select-border-radius-start-start:var(--pine-dimension-125);--pds-select-border-radius-end-end:var(--pine-dimension-125);--pds-select-border-radius-end-start:var(--pine-dimension-125);--pds-select-min-height:36px;--box-shadow-focus:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring);--box-shadow-focus-error:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring-danger)}:host .hidden,:host :host([hidden]){display:none}.pds-select{color:var(--pine-color-text);display:grid;-ms-flex-direction:column;flex-direction:column;grid-template-areas:"label label" "field field" "message message";grid-template-columns:1fr minmax(2rem, -webkit-min-content);grid-template-columns:1fr minmax(2rem, min-content);grid-template-rows:-webkit-min-content -webkit-min-content -webkit-min-content;grid-template-rows:min-content min-content min-content;position:relative;width:100%}.pds-select__label-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-area:label;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-select__action{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}label{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-select__label-wrapper label{-webkit-margin-after:0;margin-block-end:0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--pds-select-background);border:var(--pds-select-border);border-radius:var(--pds-select-border-radius);border-bottom-left-radius:var(--pds-select-border-radius-end-start, var(--pds-select-border-radius));border-bottom-right-radius:var(--pds-select-border-radius-end-end, var(--pds-select-border-radius));border-top-left-radius:var(--pds-select-border-radius-start-start, var(--pds-select-border-radius));border-top-right-radius:var(--pds-select-border-radius-start-end, var(--pds-select-border-radius));color:var(--pine-color-text);font:var(--pine-typography-body);grid-area:field;letter-spacing:var(--pine-letter-spacing);min-height:var(--pds-select-min-height);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-150);-webkit-padding-end:var(--pine-dimension-450);padding-inline-end:var(--pine-dimension-450);position:relative}select:hover{border-color:var(--pine-color-border-hover);cursor:pointer}select:focus-visible{border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}select:disabled{background-color:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}select:has(~.pds-select__message .pds-select__error-message){background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) select:has(~.pds-select__message .pds-select__error-message){background-color:var(--pine-color-red-950)}select:has(~.pds-select__message .pds-select__error-message):focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) select{background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) :host(.is-invalid) select{background-color:var(--pine-color-red-950)}:host(.is-invalid) select:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select{background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-accent);color:var(--pine-color-text-accent)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select:hover:not(:disabled){border-color:var(--pine-color-accent-hover)}:host([highlight]:not(.is-disabled):not(.is-invalid)) select:focus-visible{outline-color:var(--pine-color-focus-ring)}:host([highlight]:not(.is-disabled):not(.is-invalid)) .pds-select__select-icon{color:var(--pine-color-text-accent)}.pds-select__error-message,.pds-select__helper-message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-select__error-message{color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-select__error-message pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.pds-select__message{grid-area:message}.pds-select__select-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-column:-1/-2;grid-row:2/3;height:var(--pds-select-min-height);pointer-events:none;position:relative;z-index:var(--pine-z-index-raised)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}';var PdsSelect=function(){function e(e){var i=this;registerInstance(this,e);this.pdsSelectChange=createEvent(this,"pdsSelectChange");this.pdsBlur=createEvent(this,"pdsBlur");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsKeyDown=createEvent(this,"pdsKeyDown");this._type="select-one";this.disabled=false;this.multiple=false;this.required=false;this.onSelectUpdate=function(e){var s=e.target;var r=Array.from(s.options).filter((function(e){return e.selected})).map((function(e){return e.value}));if(r.length===1&&!i.multiple){i.value=r[0]}else{i.value=r}i.pdsSelectChange.emit(e)};this.onBlur=function(e){i.pdsBlur.emit(e)};this.onFocus=function(e){i.pdsFocus.emit(e)};this.onKeyDown=function(e){i.pdsKeyDown.emit(e)};this.handleSlotChange=function(){var e=i.slotContainer.querySelector("slot");i.selectEl.innerHTML="";var s=e.assignedElements({flatten:true});s.forEach((function(e){if(["OPTION","OPTGROUP"].includes(e.tagName)){var s=e.cloneNode(true);if(s.tagName==="OPTION"&&s.value===i.value){s.selected=true}i.selectEl.appendChild(s)}}));i.updateSelectedOption()}}e.prototype.valueChanged=function(){this.updateSelectedOption();this.updateFormValue()};e.prototype.multipleChanged=function(){this.updateType()};e.prototype.updateType=function(){this._type=this.multiple?"select-multiple":"select-one"};e.prototype.connectedCallback=function(){var e=this;if(this.el.attachInternals&&!this.internals){this.internals=this.el.attachInternals()}exposeTypeProperty(this.el,(function(){return e._type}))};e.prototype.componentWillLoad=function(){this.updateType();this.updateSelectedOption()};e.prototype.componentDidLoad=function(){this.updateFormValue()};e.prototype.updateSelectedOption=function(){var e=this;if(this.selectEl){var i=this.selectEl.options;Array.from(i).map((function(i){if(Array.isArray(e.value)){i.selected=e.value.includes(i.value)}else{i.selected=e.value===i.value}}))}};e.prototype.getHelperMessage=function(){return this.helperMessage&&h("p",{class:"pds-select__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage)};e.prototype.getErrorMessage=function(){return this.errorMessage&&h("p",{class:"pds-select__error-message",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{icon:danger,size:"small"}),this.errorMessage)};e.prototype.renderMessages=function(){if(!this.helperMessage&&!this.errorMessage)return null;return h("div",{class:"pds-select__message"},this.getHelperMessage(),this.getErrorMessage())};e.prototype.classNames=function(){var e=[];if(this.invalid){e.push("is-invalid")}if(this.disabled){e.push("is-disabled")}return e.join(" ")};e.prototype.renderAction=function(){var e=this.el.querySelector('[slot="action"]')!==null;if(e){return h("div",{class:"pds-select__action",part:"action"},h("slot",{name:"action"}))}return null};e.prototype.updateFormValue=function(){var e=this;if(this.internals&&this.internals.setFormValue){var i=this.value;if(Array.isArray(i)){if(i.length>1){var s=new FormData;i.forEach((function(i){return s.append(e.name||"",i)}));this.internals.setFormValue(s)}else{this.internals.setFormValue(i[0]||null)}}else{this.internals.setFormValue(i||null)}if(this.selectEl&&this.internals&&this.internals.setValidity){this.internals.setValidity(this.selectEl.validity,this.selectEl.validationMessage,this.selectEl)}}};e.prototype.formResetCallback=function(){this.value="";this.updateFormValue()};e.prototype.formDisabledCallback=function(e){this.disabled=e};e.prototype.formStateRestoreCallback=function(e){if(typeof e==="string"){this.value=e}else if(e instanceof FormData&&this.name){var i=e.getAll(this.name);if(i.length>1){this.value=i.filter((function(e){return typeof e==="string"}))}else if(i.length===1&&typeof i[0]==="string"){this.value=i[0]}}};e.prototype.render=function(){var e=this;var i=this.el.querySelector('[slot="action"]')!==null;return h(Host,{key:"d36bddf20910ae21ba2209bbf7e3f13b1ce9c3bf","aria-disabled":this.disabled?"true":null,class:this.classNames(),"has-action":i&&!this.hideLabel?"true":null},h("div",{key:"72fe6ee352834fbd6e8f5f9d9e96b1be232f2988",class:"pds-select"},!this.hideLabel&&h("div",{key:"c2894f7ec00402425f74f1145d449da13d870161",class:"pds-select__label-wrapper"},h("label",{key:"4f6277c3f7b40f3d52995231cb49824e58ebae1b",htmlFor:this.componentId},h("span",{key:"f1b0cf90091843c1a994699263905f811888d4bd",class:this.hideLabel?"visually-hidden":""},this.label)),i&&this.renderAction()),h("select",{key:"727c1644e8ea5afc194e33e29e9730d6b08c3784","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,onBlur:this.onBlur,onChange:this.onSelectUpdate,onFocus:this.onFocus,onKeyDown:this.onKeyDown,part:"select",required:this.required,ref:function(i){return e.selectEl=i}}),h("div",{key:"d7c0c3f3b765b13c6dc34a9c5c13bbcfd081a274","aria-hidden":"true",class:"hidden",ref:function(i){return e.slotContainer=i}},h("slot",{key:"2305afcacb082c0d5faca8b77295919f8d9c9e0b",onSlotchange:this.handleSlotChange})),this.renderMessages(),!this.multiple&&h("pds-icon",{key:"4a1d6ced0ffc14ae17763d116a85324e5a6c7ce5",class:"pds-select__select-icon",icon:enlarge})))};Object.defineProperty(e,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"],multiple:["multipleChanged"]}},enumerable:false,configurable:true});return e}();PdsSelect.style=pdsSelectTokensCss+(labelCss+pdsSelectCss);export{PdsSelect as pds_select};
|
|
2
2
|
//# sourceMappingURL=pds-select.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{h as handle}from"./index-
|
|
1
|
+
import{r as registerInstance,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{h as handle}from"./index-BFkDH5XU.js";var pdsSortableItemCss=".pds-sortable-item.sc-pds-sortable-item-h{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-md)}.pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__actions.sc-pds-sortable-item{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-start:var(--pine-dimension-md);padding-inline-start:var(--pine-dimension-md)}.pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__handle.sc-pds-sortable-item{line-height:1;-webkit-margin-end:var(--pine-dimension-md);margin-inline-end:var(--pine-dimension-md)}.pds-sortable--bordered .pds-sortable-item.sc-pds-sortable-item-h:first-child{border-start-end-radius:calc(var(--pine-dimension-xs) * 1.25);border-start-start-radius:calc(var(--pine-dimension-xs) * 1.25)}.pds-sortable--bordered .pds-sortable-item.sc-pds-sortable-item-h:last-child{border-end-end-radius:calc(var(--pine-dimension-xs) * 1.25);border-end-start-radius:calc(var(--pine-dimension-xs) * 1.25)}.pds-sortable--divided .pds-sortable-item.sc-pds-sortable-item-h{-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border)}.pds-sortable--divided .pds-sortable-item.sc-pds-sortable-item-h:last-child{-webkit-border-after:0;border-block-end:0}.pds-sortable--handle-type-row .pds-sortable-item.sc-pds-sortable-item-h{cursor:-webkit-grab;cursor:grab}.pds-sortable--handle-type-handle .pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__handle.sc-pds-sortable-item{cursor:-webkit-grab;cursor:grab}.pds-sortable-item.sc-pds-sortable-item-h:hover{background-color:var(--pine-color-background-container-hover)}.pds-sortable-item.sc-pds-sortable-item-h:hover pds-icon.sc-pds-sortable-item{color:var(--pine-color-info)}.pds-sortable-item--drag.sc-pds-sortable-item-h{background-color:var(--pine-color-background-container);border-radius:0;-webkit-box-shadow:var(--pine-box-shadow-400);box-shadow:var(--pine-box-shadow-400);opacity:1}.pds-sortable-item--ghost.sc-pds-sortable-item-h{background-color:var(--pine-color-background-container-hover);border-radius:0}";var PdsSortableItem=function(){function e(e){registerInstance(this,e);this.enableActions=false;this.showHandle=false}e.prototype.componentWillRender=function(){this.sortableRef=this.el.closest("pds-sortable");if(this.sortableRef&&this.sortableRef.handleType==="handle"){this.showHandle=true}};e.prototype.render=function(){return h(Host,{key:"631a0c1150226256cdb47d1a7bc6635144bb56d0",class:"pds-sortable-item",id:this.componentId},this.showHandle&&h("div",{key:"bdb6ff779a5d750b75d404521bc91cad02176ea8",class:"pds-sortable-item__handle"},h("pds-icon",{key:"144f4b6fe33a3a3a864ac48041fc93935fbf99c3",icon:handle})),h("slot",{key:"cdddce9c5fa3fde34481c41c46c5f6504e33a358"}),this.enableActions&&h("div",{key:"527e1d22f20223a850dbd956dea4db93878fd9f9",class:"pds-sortable-item__actions"},h("slot",{key:"85ea35dbfdf0393721471dd229e80e9e57f58230",name:"sortable-item-actions"})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsSortableItem.style=pdsSortableItemCss;export{PdsSortableItem as pds_sortable_item};
|
|
2
2
|
//# sourceMappingURL=pds-sortable-item.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{e as exposeTypeProperty,m as messageId,a as assignDescription}from"./form-CN-lL5QG.js";import{b as danger}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{e as exposeTypeProperty,m as messageId,a as assignDescription}from"./form-CN-lL5QG.js";import{b as danger}from"./index-BFkDH5XU.js";import{i as inheritAriaAttributes}from"./attributes-C0M1gTKv.js";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsSwitchCss=':host{--sizing-input-toggle-size:calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));--pine-dimension-025:2px;--spacing-message-inline:calc(var(--pine-dimension-450) + var(--pine-dimension-150));--number-transition-timing:0.15s ease-out;-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-flow:row wrap;flex-flow:row wrap;position:relative}:host(.pds-switch--error){color:var(--pine-color-text-message-danger)}:host(.pds-switch--error) input,:host(.pds-switch--error) input:checked,:host(.pds-switch--error) input:hover:not(:disabled):not(:checked){background-color:var(--pine-color-danger)}:host(.pds-switch--error) input:focus-visible:not(:disabled):not(:checked){outline-color:var(--pine-color-focus-ring-danger)}:host(.pds-switch--error) label{color:var(--color-text-error)}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-neutral);border:0;border-radius:var(--pine-dimension-sm);cursor:pointer;display:inline-block;-ms-flex-negative:0;flex-shrink:0;height:var(--pine-dimension-250);margin:0;padding:0;position:relative;-webkit-transition:var(--number-transition-timing);transition:var(--number-transition-timing);-webkit-transition-property:background, border, color;transition-property:background, border, color;width:var(--pine-dimension-450)}input::after{background:var(--pine-color-secondary);border-radius:var(--pine-border-radius-full);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);content:"";display:block;height:var(--sizing-input-toggle-size);inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate3d(-100%, -50%, 0);transform:translate3d(-100%, -50%, 0);-webkit-transition:-webkit-transform var(--number-transition-timing);transition:-webkit-transform var(--number-transition-timing);transition:transform var(--number-transition-timing);transition:transform var(--number-transition-timing), -webkit-transform var(--number-transition-timing);width:var(--sizing-input-toggle-size)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-150)}.pds-switch--error label{color:inherit}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-switch__message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-xs);margin-block-start:var(--pine-dimension-xs);-webkit-margin-start:var(--spacing-message-inline);margin-inline-start:var(--spacing-message-inline);width:100%}.pds-switch__message+.pds-switch__message{-webkit-margin-before:var(--spacing-message-inline);margin-block-start:var(--spacing-message-inline)}.pds-switch__message--error{color:inherit;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-switch__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}input:disabled{background-color:var(--pine-color-neutral-disabled);cursor:not-allowed}input:disabled~label{cursor:initial}input:disabled:hover::after{background-color:var(--pine-color-secondary)}input:disabled .pds-switch__message{color:initial}input:hover:not(:disabled){background-color:var(--pine-color-neutral-hover)}input:focus-visible:not(:disabled){outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}input:checked::after{-webkit-transform:translate3d(0, -50%, 0);transform:translate3d(0, -50%, 0)}input:checked:not(:disabled){background-color:currentColor;color:var(--pine-color-accent)}input:checked:not(:disabled):hover{border-color:currentColor;color:var(--pine-color-accent-hover)}';var PdsSwitch=function(){function i(i){var e=this;registerInstance(this,i);this.pdsSwitchChange=createEvent(this,"pdsSwitchChange");this.inheritedAttributes={};this._type="checkbox";this.checked=false;this.disabled=false;this.invalid=false;this.required=false;this.onSwitchUpdate=function(i){if(e.disabled)return;var t=i.target;e.checked=t.checked;e.updateFormValue();e.pdsSwitchChange.emit(i)};this.switchClassNames=function(){var i="pds-switch";if(e.invalid===true){i+=" pds-switch--error"}if(e.helperMessage!==undefined){i+=" pds-switch--message"}return i}}i.prototype.connectedCallback=function(){var i=this;if(this.el.attachInternals&&!this.internals){this.internals=this.el.attachInternals()}exposeTypeProperty(this.el,(function(){return i._type}))};i.prototype.componentDidLoad=function(){this.updateFormValue()};i.prototype.checkedChanged=function(){this.updateFormValue()};i.prototype.updateFormValue=function(){var i;if(typeof jest!=="undefined"||typeof process!=="undefined"&&((i=process.env)===null||i===void 0?void 0:i.NODE_ENV)==="test"){return}if(this.internals&&this.internals.setFormValue){var e=this.checked?this.value||"on":null;this.internals.setFormValue(e)}if(this.internals&&this.internals.setValidity){this.internals.setValidity({})}};i.prototype.formStateRestoreCallback=function(i){if(i instanceof FormData){var e=this.value||"on";this.checked=i.get(this.name||this.componentId)===e}else if(typeof i==="string"){this.checked=i===(this.value||"on")}};i.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},inheritAriaAttributes(this.el))};i.prototype.render=function(){return h(Host,{key:"e26422622075f925f0df3dbc2f5ea8223aed9902",class:this.switchClassNames(),"aria-disabled":this.disabled?"true":null},h("label",{key:"b63cdac80d3cd55bc4845979f15b382c92883cf5",htmlFor:this.componentId},h("input",Object.assign({key:"910a7f6cd2093a6062c57c63600bb1721c147c75","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:"45661afcaba7852a6ddf6ebbf4606502bc8b72e2",class:this.hideLabel?"visually-hidden":""},this.label)),this.helperMessage&&h("div",{key:"be3a6fbf3938b7846ca3a9e6eef54d6ee25391fa",class:"pds-switch__message",id:messageId(this.componentId,"helper")},this.helperMessage),this.errorMessage&&h("div",{key:"a5944169798ae8531f9e6414deac2c3631339b0a",class:"pds-switch__message pds-switch__message--error",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{key:"5b864b6ac441c9bd71dc22dbc9722c87c1b781e6",icon:danger,size:"small"}),this.errorMessage))};Object.defineProperty(i,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(i,"watchers",{get:function(){return{checked:["checkedChanged"]}},enumerable:false,configurable:true});return i}();PdsSwitch.style=labelCss+pdsSwitchCss;export{PdsSwitch as pds_switch};
|
|
2
2
|
//# sourceMappingURL=pds-switch.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";var pdsTableCellCss=":host{--box-shadow-fixed:3px 3px 6px -2px rgba(0, 0, 0, 0.2);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);inset-inline-start:var(--pine-dimension-none);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);padding:var(--pine-dimension-sm);vertical-align:middle}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:0;position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-fixed);box-shadow:var(--box-shadow-fixed)}:host(.is-truncated){max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.has-checkbox){vertical-align:middle;width:16px}:host(.pds-table-cell--align-start){text-align:start}:host(.pds-table-cell--align-center){text-align:center}:host(.pds-table-cell--align-end){text-align:end}:host(.pds-table-cell--align-justify){text-align:justify}";var PdsTableCell=function(){function
|
|
1
|
+
import{r as registerInstance,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{s as setupTruncationTooltip}from"./truncation-tooltip-CTHpMbU3.js";import"./floating-ui.dom-BO6p966C.js";var pdsTableCellCss=":host{--box-shadow-fixed:3px 3px 6px -2px rgba(0, 0, 0, 0.2);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);inset-inline-start:var(--pine-dimension-none);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);padding:var(--pine-dimension-sm);vertical-align:middle}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:0;position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-fixed);box-shadow:var(--box-shadow-fixed)}:host(.is-truncated){max-width:var(--pds-table-cell-truncate-max-width, 100px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.has-checkbox){vertical-align:middle;width:16px}:host(.pds-table-cell--align-start){text-align:start}:host(.pds-table-cell--align-center){text-align:center}:host(.pds-table-cell--align-end){text-align:end}:host(.pds-table-cell--align-justify){text-align:justify}";var PdsTableCell=function(){function t(t){var i=this;registerInstance(this,t);this.scrollContainer=null;this.setupRetries=0;this.truncationCleanup=null;this.tableScrolling=false;this.handleScroll=function(){if(!i.scrollContainer){return}try{i.tableScrolling=i.scrollContainer.scrollLeft>0}catch(t){console.warn("Scroll handler error:",t)}}}t.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table")};t.prototype.componentDidLoad=function(){if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.setupScrollListener()}if(this.truncate){this.initTruncationTooltip()}};t.prototype.disconnectedCallback=function(){this.cleanupScrollListener();this.destroyTruncationTooltip()};t.prototype.setupScrollListener=function(){var t=this;var i;if(!this.tableRef)return;var e=(i=this.tableRef.shadowRoot)===null||i===void 0?void 0:i.querySelector(".pds-table-responsive-container");if(e){this.scrollContainer=e;this.scrollContainer.addEventListener("scroll",this.handleScroll,{passive:true});this.handleScroll();this.setupRetries=0}else{this.setupTimer=window.setTimeout((function(){if(t.scrollContainer)return;t.setupRetries=(t.setupRetries||0)+1;if(t.setupRetries<=50){t.setupScrollListener()}else{console.warn("Failed to find responsive container after 50 attempts")}}),100)}};t.prototype.cleanupScrollListener=function(){if(this.scrollContainer){this.scrollContainer.removeEventListener("scroll",this.handleScroll);this.scrollContainer=null}if(this.setupTimer!==undefined){window.clearTimeout(this.setupTimer);this.setupTimer=undefined}this.setupRetries=0};t.prototype.handleTruncateChange=function(t){if(t){this.initTruncationTooltip()}else{this.destroyTruncationTooltip()}};t.prototype.initTruncationTooltip=function(){var t=this;this.destroyTruncationTooltip();this.truncationCleanup=setupTruncationTooltip({hostEl:this.hostElement,contentEl:this.hostElement,getTooltipText:function(){return t.hostElement.textContent||""}})};t.prototype.destroyTruncationTooltip=function(){if(this.truncationCleanup){this.truncationCleanup();this.truncationCleanup=null}};t.prototype.classNames=function(){var t=[];if(this.tableRef&&this.tableRef.compact){t.push("is-compact")}if(this.cellAlign){t.push("pds-table-cell--align-".concat(this.cellAlign))}if(this.truncate){t.push("is-truncated")}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){t.push("has-scrolled")}return t.join(" ")};t.prototype.render=function(){return h(Host,{key:"f1526ebf858c52e01185174cb37770d130abd3ca",class:this.classNames(),role:"gridcell",part:"cell",tabIndex:this.truncate?0:undefined,style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},h("slot",{key:"518a3cb3fad0bbbe029f218c2dc89596d1cd0b16"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{truncate:["handleTruncateChange"]}},enumerable:false,configurable:true});return t}();PdsTableCell.style=pdsTableCellCss;export{PdsTableCell as pds_table_cell};
|
|
2
2
|
//# sourceMappingURL=pds-table-cell.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-table-cell.entry.js","sources":["src/components/pds-table/pds-table-cell/pds-table-cell.scss?tag=pds-table-cell&encapsulation=shadow","src/components/pds-table/pds-table-cell/pds-table-cell.tsx"],"sourcesContent":[":host {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n --box-shadow-fixed: 3px 3px 6px -2px rgba(0, 0, 0, 0.2);\n\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n inset-inline-start: var(--pine-dimension-none);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-sm);\n vertical-align: middle;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: 0;\n position: sticky;\n z-index: var(--pine-z-index-raised);\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-fixed);\n}\n\n:host(.is-truncated) {\n max-width: 100px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host(.has-checkbox) {\n vertical-align: middle;\n width: 16px;\n}\n\n// Text Alignment\n:host(.pds-table-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-table-cell',\n styleUrls: ['pds-table-cell.scss'],\n shadow: true,\n})\nexport class PdsTableCell {\n @Element() hostElement: HTMLPdsTableCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Sets the text alignment within the cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Truncates content to a max width of 100px and adds an ellipsis.\n */\n @Prop() truncate: boolean;\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-cell--align-${this.cellAlign}`);\n }\n\n if (this.truncate) {\n classNames.push('is-truncated');\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"gridcell\"\n part=\"cell\"\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,eAAe,GAAG,mkCAAmkC;;MCO9kC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,c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EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,MAAM,EACX,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pds-table-cell.entry.js","sources":["src/components/pds-table/pds-table-cell/pds-table-cell.scss?tag=pds-table-cell&encapsulation=shadow","src/components/pds-table/pds-table-cell/pds-table-cell.tsx"],"sourcesContent":[":host {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n --box-shadow-fixed: 3px 3px 6px -2px rgba(0, 0, 0, 0.2);\n\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n inset-inline-start: var(--pine-dimension-none);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-sm);\n vertical-align: middle;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: 0;\n position: sticky;\n z-index: var(--pine-z-index-raised);\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-fixed);\n}\n\n:host(.is-truncated) {\n max-width: var(--pds-table-cell-truncate-max-width, 100px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host(.has-checkbox) {\n vertical-align: middle;\n width: 16px;\n}\n\n// Text Alignment\n:host(.pds-table-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { setupTruncationTooltip } from '../../../utils/truncation-tooltip';\n\n@Component({\n tag: 'pds-table-cell',\n styleUrls: ['pds-table-cell.scss'],\n shadow: true,\n})\nexport class PdsTableCell {\n @Element() hostElement: HTMLPdsTableCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n private truncationCleanup: (() => void) | null = null;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n\n if (this.truncate) {\n this.initTruncationTooltip();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n this.destroyTruncationTooltip();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Sets the text alignment within the cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Truncates content to a max width and adds an ellipsis.\n * When text overflows, a tooltip showing the full text will appear on hover/focus.\n * Note: When truncate is enabled, the element automatically receives tabindex=\"0\" for keyboard accessibility.\n */\n @Prop() truncate: boolean;\n\n @Watch('truncate')\n handleTruncateChange(newValue: boolean) {\n if (newValue) {\n this.initTruncationTooltip();\n } else {\n this.destroyTruncationTooltip();\n }\n }\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n private initTruncationTooltip() {\n this.destroyTruncationTooltip();\n\n this.truncationCleanup = setupTruncationTooltip({\n hostEl: this.hostElement,\n contentEl: this.hostElement,\n getTooltipText: () => this.hostElement.textContent || '',\n });\n }\n\n private destroyTruncationTooltip() {\n if (this.truncationCleanup) {\n this.truncationCleanup();\n this.truncationCleanup = null;\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-cell--align-${this.cellAlign}`);\n }\n\n if (this.truncate) {\n classNames.push('is-truncated');\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"gridcell\"\n part=\"cell\"\n tabIndex={this.truncate ? 0 : undefined}\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,6mCAA6mC;;MCQxnC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AACxB,QAAA,IAAiB,CAAA,iBAAA,GAAwB,IAAI;AAoFrD;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAyChD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAqBF;IAnKC,mBAAmB,GAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAwB;;IAG9E,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;;;YAG1E,IAAI,CAAC,mBAAmB,EAAE;;AAG5B,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,qBAAqB,EAAE;;;IAIhC,oBAAoB,GAAA;QAClB,IAAI,CAAC,qBAAqB,EAAE;QAC5B,IAAI,CAAC,wBAAwB,EAAE;;IAGzB,mBAAmB,GAAA;;QACzB,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AACJ,QAAA,QACE,CAAC,CAAA,IAAI,EACH,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,SAAS,EACvC,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as upSmall,d as downSmall}from"./index-
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as upSmall,d as downSmall}from"./index-BFkDH5XU.js";var pdsTableHeadCellCss=":host{--border-head-cell-default:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);--box-shadow-default:3px 3px 6px -2px rgba(0, 0, 0, 0.1);-webkit-border-after:var(--border-head-cell-default);border-block-end:var(--border-head-cell-default);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);padding:var(--pine-dimension-sm);position:relative;text-align:start;vertical-align:inherit}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(.is-fixed.has-head-background){background-color:var(--pine-color-background-subtle)}:host(.has-head-border){-webkit-border-before:var(--border-head-cell-default);border-block-start:var(--border-head-cell-default)}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-default);box-shadow:var(--box-shadow-default)}:host(.is-sortable){cursor:pointer}:host(.is-sortable) pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs);-webkit-padding-before:2px;padding-block-start:2px;position:absolute}:host(.is-sortable:hover),:host(.is-active){color:var(--pine-color-text-strong)}:host(.pds-table-head-cell--align-start){text-align:start}:host(.pds-table-head-cell--align-center){text-align:center}:host(.pds-table-head-cell--align-end){text-align:end}:host(.pds-table-head-cell--align-justify){text-align:justify}";var PdsTableHeadCell=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableSort=createEvent(this,"pdsTableSort");this.scrollContainer=null;this.setupRetries=0;this.sortingDirection="asc";this.tableScrolling=false;this.isSelected=false;this.hasHeadBorder=false;this.hasHeadBackground=false;this.isActive=false;this.handleScroll=function(){if(!e.scrollContainer){return}try{e.tableScrolling=e.scrollContainer.scrollLeft>0}catch(t){console.warn("Scroll handler error:",t)}};this.toggleSort=function(){if(e.sortable){if(!e.tableRef){return}var t=e.hostElement.innerText.trim();e.sortingDirection=e.sortingDirection==="asc"?"desc":"asc";e.tableRef.querySelectorAll("pds-table-head-cell").forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!(t!==this.hostElement))return[3,2];e=t;return[4,e.clearActiveSort()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))}));e.isActive=true;e.hostElement.classList.add("is-active");e.pdsTableSort.emit({column:t,direction:e.sortingDirection})}}}t.prototype.setActiveSort=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.sortable)return[2];this.sortingDirection=t;this.isActive=true;this.hostElement.classList.add("is-active");return[2]}))}))};t.prototype.clearActiveSort=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=false;this.hostElement.classList.remove("is-active");return[2]}))}))};t.prototype.componentWillLoad=function(){this.tableRef=this.hostElement.closest("pds-table");var t=this.hostElement.closest("pds-table-head");if(t){this.hasHeadBorder=t.hasAttribute("border");this.hasHeadBackground=t.hasAttribute("background")}};t.prototype.componentDidLoad=function(){var t=this;if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.setupScrollListener()}var e=this.hostElement.closest("pds-table-head");if(e&&typeof MutationObserver!=="undefined"){if(this.headObserver){this.headObserver.disconnect()}this.headObserver=new MutationObserver((function(){t.hasHeadBorder=e.hasAttribute("border");t.hasHeadBackground=e.hasAttribute("background")}));this.headObserver.observe(e,{attributes:true,attributeFilter:["border","background"]})}};t.prototype.disconnectedCallback=function(){this.cleanupScrollListener();if(this.headObserver){this.headObserver.disconnect()}};t.prototype.setupScrollListener=function(){var t=this;var e;if(!this.tableRef)return;var i=(e=this.tableRef.shadowRoot)===null||e===void 0?void 0:e.querySelector(".pds-table-responsive-container");if(i){this.scrollContainer=i;this.scrollContainer.addEventListener("scroll",this.handleScroll,{passive:true});this.handleScroll();this.setupRetries=0}else{this.setupTimer=window.setTimeout((function(){if(t.scrollContainer)return;t.setupRetries=(t.setupRetries||0)+1;if(t.setupRetries<=50){t.setupScrollListener()}else{console.warn("Failed to find responsive container after 50 attempts")}}),100)}};t.prototype.cleanupScrollListener=function(){if(this.scrollContainer){this.scrollContainer.removeEventListener("scroll",this.handleScroll);this.scrollContainer=null}if(this.setupTimer!==undefined){window.clearTimeout(this.setupTimer);this.setupTimer=undefined}this.setupRetries=0};t.prototype.classNames=function(){var t=[];if(this.tableRef&&this.tableRef.compact){t.push("is-compact")}if(this.cellAlign){t.push("pds-table-head-cell--align-".concat(this.cellAlign))}if(this.sortable){t.push("is-sortable")}if(this.sortable&&this.sortingDirection!==null){t.push("sort-"+this.sortingDirection)}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){t.push("has-scrolled")}if(this.hasHeadBackground){t.push("has-head-background")}if(this.hasHeadBorder){t.push("has-head-border")}return t.join(" ")};t.prototype.render=function(){return h(Host,{key:"a0196e242282574b969375a4767950ffd7a1e5b8",class:this.classNames(),role:"columnheader",onClick:this.toggleSort,part:"head-cell",style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},h("slot",{key:"90f6d190ed912276fb8ff5607a80b592d1884d71"}),this.sortable&&this.isActive&&h("pds-icon",{key:"128bd50d5163ea1690a66a4bef227480a0076f39",icon:this.sortingDirection==="asc"?upSmall:downSmall,part:"sort-icon"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableHeadCell.style=pdsTableHeadCellCss;export{PdsTableHeadCell as pds_table_head_cell};
|
|
2
2
|
//# sourceMappingURL=pds-table-head-cell.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableHeadCss=":host{--border-head-default:var(--pine-border-width-thin) solid var(--pine-color-background-subtle);border-color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table-header-group;vertical-align:middle}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host pds-table-checkbox-cell{-webkit-border-after:var(--border-head-default);border-block-end:var(--border-head-default)}:host([border]){-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([border]) pds-table-head-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([background]){background-color:var(--pine-color-background-subtle)}:host([background]) pds-table-head-cell{background-color:var(--pine-color-background-subtle)}";var PdsTableHead=function(){function e(e){var r=this;registerInstance(this,e);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.border=false;this.background=false;this.generateUniqueId=function(){var e=Math.random().toString(36).substring(2,8);var r=(new Date).toISOString().replace(/[:.]/g,"-");var t="".concat(e,"-").concat(r);return t};this.handleInput=function(e){r.isSelected=!e.target.checked;r.handleSelect(r.isSelected)};this.handleSelect=function(e){r.indeterminate=false;if(closest("pds-table-head",r.hostElement)){r.pdsTableSelectAll.emit({isSelected:e})}}}e.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var e=this.hostElement.querySelector("pds-table-head-cell:first-child");e===null||e===void 0?void 0:e.classList.add("is-fixed")}};e.prototype.render=function(){return h(Host,{key:"d5d5906bdb23794b911ecd5904a4cc58aa5380d6",role:"row",part:"head"},this.tableRef&&this.tableRef.selectable&&h("pds-table-head-cell",{key:"85df57fb4371e4fba855e16ce62c8329b49e08cf",part:this.tableRef.selectable?"checkbox-cell":""}
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableHeadCss=":host{--border-head-default:var(--pine-border-width-thin) solid var(--pine-color-background-subtle);border-color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table-header-group;vertical-align:middle}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host pds-table-checkbox-cell{-webkit-border-after:var(--border-head-default);border-block-end:var(--border-head-default)}:host([border]){-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([border]) pds-table-head-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([background]){background-color:var(--pine-color-background-subtle)}:host([background]) pds-table-head-cell{background-color:var(--pine-color-background-subtle)}";var PdsTableHead=function(){function e(e){var r=this;registerInstance(this,e);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.border=false;this.background=false;this.generateUniqueId=function(){var e=Math.random().toString(36).substring(2,8);var r=(new Date).toISOString().replace(/[:.]/g,"-");var t="".concat(e,"-").concat(r);return t};this.handleInput=function(e){r.isSelected=!e.target.checked;r.handleSelect(r.isSelected)};this.handleSelect=function(e){r.indeterminate=false;if(closest("pds-table-head",r.hostElement)){r.pdsTableSelectAll.emit({isSelected:e})}}}e.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var e=this.hostElement.querySelector("pds-table-head-cell:first-child");e===null||e===void 0?void 0:e.classList.add("is-fixed")}};e.prototype.render=function(){return h(Host,{key:"d5d5906bdb23794b911ecd5904a4cc58aa5380d6",role:"row",part:"head"},this.tableRef&&this.tableRef.selectable&&h("pds-table-head-cell",{key:"85df57fb4371e4fba855e16ce62c8329b49e08cf",part:this.tableRef.selectable?"checkbox-cell":""},!this.tableRef.disableSelectAll&&h("pds-checkbox",{key:"92bd5565463e29d249d1ac71d9dc0d000f3eea79",componentId:this.generateUniqueId(),indeterminate:this.indeterminate,onInput:this.handleInput,label:"Select All Rows",hideLabel:true,checked:this.isSelected,part:"select-all-checkbox"})),h("slot",{key:"494dc0395da229a264c38540479f36967601cc26"}))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsTableHead.style=pdsTableHeadCss;export{PdsTableHead as pds_table_head};
|
|
2
2
|
//# sourceMappingURL=pds-table-head.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-table-head.entry.js","sources":["src/components/pds-table/pds-table-head/pds-table-head.scss?tag=pds-table-head&encapsulation=shadow","src/components/pds-table/pds-table-head/pds-table-head.tsx"],"sourcesContent":[":host {\n --border-head-default: var(--pine-border-width-thin) solid var(--pine-color-background-subtle);\n\n border-color: inherit;\n box-sizing: border-box;\n display: table-header-group;\n vertical-align: middle;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: var(--pine-z-index-raised);\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n\n:host([border]) {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([border]) pds-table-head-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([background]) {\n background-color: var(--pine-color-background-subtle);\n}\n\n:host([background]) pds-table-head-cell {\n background-color: var(--pine-color-background-subtle);\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { closest } from '@utils/closest';\n\n@Component({\n tag: 'pds-table-head',\n styleUrls: ['pds-table-head.scss'],\n shadow: true,\n})\nexport class PdsTableHead {\n @Element() hostElement: HTMLPdsTableHeadElement;\n private tableRef: HTMLPdsTableElement\n\n /**\n * Determines if the select all checkbox is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @Prop({mutable: true}) isSelected: boolean;\n\n /**\n * Adds top and bottom borders to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) border = false;\n\n /**\n * Adds a subtle background color to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) background = false;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n private handleInput = (ev: Event) => {\n this.isSelected = !(ev.target as HTMLInputElement).checked\n this.handleSelect(this.isSelected)\n };\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false\n\n if ( closest('pds-table-head', this.hostElement) ) {\n this.pdsTableSelectAll.emit({ isSelected });\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected)\n }\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-head-cell:first-child');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n render() {\n return (\n <Host role=\"row\" part=\"head\">\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-head-cell part={this.tableRef.selectable ? 'checkbox-cell' : ''}>\n <pds-checkbox\n
|
|
1
|
+
{"version":3,"file":"pds-table-head.entry.js","sources":["src/components/pds-table/pds-table-head/pds-table-head.scss?tag=pds-table-head&encapsulation=shadow","src/components/pds-table/pds-table-head/pds-table-head.tsx"],"sourcesContent":[":host {\n --border-head-default: var(--pine-border-width-thin) solid var(--pine-color-background-subtle);\n\n border-color: inherit;\n box-sizing: border-box;\n display: table-header-group;\n vertical-align: middle;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: var(--pine-z-index-raised);\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n\n:host([border]) {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([border]) pds-table-head-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([background]) {\n background-color: var(--pine-color-background-subtle);\n}\n\n:host([background]) pds-table-head-cell {\n background-color: var(--pine-color-background-subtle);\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { closest } from '@utils/closest';\n\n@Component({\n tag: 'pds-table-head',\n styleUrls: ['pds-table-head.scss'],\n shadow: true,\n})\nexport class PdsTableHead {\n @Element() hostElement: HTMLPdsTableHeadElement;\n private tableRef: HTMLPdsTableElement\n\n /**\n * Determines if the select all checkbox is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @Prop({mutable: true}) isSelected: boolean;\n\n /**\n * Adds top and bottom borders to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) border = false;\n\n /**\n * Adds a subtle background color to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) background = false;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n private handleInput = (ev: Event) => {\n this.isSelected = !(ev.target as HTMLInputElement).checked\n this.handleSelect(this.isSelected)\n };\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false\n\n if ( closest('pds-table-head', this.hostElement) ) {\n this.pdsTableSelectAll.emit({ isSelected });\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected)\n }\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-head-cell:first-child');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n render() {\n return (\n <Host role=\"row\" part=\"head\">\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-head-cell part={this.tableRef.selectable ? 'checkbox-cell' : ''}>\n {!this.tableRef.disableSelectAll && (\n <pds-checkbox\n componentId={this.generateUniqueId()}\n indeterminate={this.indeterminate}\n onInput={this.handleInput}\n label={\"Select All Rows\"}\n hideLabel={true}\n checked={this.isSelected}\n part=\"select-all-checkbox\"\n />\n )}\n </pds-table-head-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG,87CAA87C;;MCQz8C,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBE;;;AAGG;AACsB,QAAA,IAAM,CAAA,MAAA,GAAG,KAAK;AAEvC;;;AAGG;AACsB,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK;AAOnC,QAAA,IAAgB,CAAA,gBAAA,GAAG,MAAK;AAC9B,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/D,YAAA,MAAM,SAAS,GAAG,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AA,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAA,EACzB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KACxC,CAAqB,CAAA,qBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,eAAe,GAAG,EAAE,EAAA,EACvE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,KAC9B,CACE,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EACpC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,qBAAqB,EAC1B,CAAA,CACH,CACmB,CACvB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableRowCss=":host{--color-background-interactive:var(--pine-color-background-subtle);border-color:inherit;display:table-row;vertical-align:inherit}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(:hover),:host(:hover)::part(checkbox-cell),:host(:hover) ::slotted(pds-table-cell),:host(.is-selected),:host(.is-selected)::part(checkbox-cell),:host(.is-selected) ::slotted(pds-table-cell){background:var(--color-background-interactive)}:host(.has-divider) ::slotted(pds-table-cell),:host(.has-divider) pds-table-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host(.has-divider.is-last-row) ::slotted(pds-table-cell),:host(.has-divider.is-last-row) pds-table-cell{-webkit-border-after:0;border-block-end:0}";var PdsTableRow=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableRowSelected=createEvent(this,"pdsTableRowSelected");this.observer=null;this.bodyObserver=null;this.hasDivider=false;this.isLastRow=false;this.
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableRowCss=":host{--color-background-interactive:var(--pine-color-background-subtle);border-color:inherit;display:table-row;vertical-align:inherit}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(:hover),:host(:hover)::part(checkbox-cell),:host(:hover) ::slotted(pds-table-cell),:host(.is-selected),:host(.is-selected)::part(checkbox-cell),:host(.is-selected) ::slotted(pds-table-cell){background:var(--color-background-interactive)}:host(.has-divider) ::slotted(pds-table-cell),:host(.has-divider) pds-table-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host(.has-divider.is-last-row) ::slotted(pds-table-cell),:host(.has-divider.is-last-row) pds-table-cell{-webkit-border-after:0;border-block-end:0}";var PdsTableRow=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableRowSelected=createEvent(this,"pdsTableRowSelected");this.observer=null;this.bodyObserver=null;this.hasDivider=false;this.isLastRow=false;this.handleCheckboxChange=function(t){e.isSelected=t.detail.checked;e.handleSelect(e.isSelected)};this.handleSelect=function(t){e.indeterminate=false;if(!closest("pds-table-head",e.hostElement)){var s=Array.from(e.hostElement.parentNode.children).indexOf(e.hostElement);e.pdsTableRowSelected.emit({rowIndex:s,isSelected:t})}};this.generateUniqueId=function(){var t=Math.random().toString(36).substring(2,8);var e=(new Date).toISOString().replace(/[:.]/g,"-");var s="".concat(t,"-").concat(e);return s}}t.prototype.classNames=function(){var t=[];if(this.isSelected){t.push("is-selected")}if(this.hasDivider){t.push("has-divider")}if(this.isLastRow){t.push("is-last-row")}return t.join(" ")};t.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var t=this.hostElement.querySelector("pds-table-cell");t===null||t===void 0?void 0:t.classList.add("is-fixed")}};t.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};t.prototype.connectedCallback=function(){this.tableRef=this.hostElement.closest("pds-table");this.setupObservers();this.updateDividerState()};t.prototype.disconnectedCallback=function(){this.cleanupObservers()};t.prototype.cleanupObservers=function(){if(this.observer){this.observer.disconnect();this.observer=null}if(this.bodyObserver){this.bodyObserver.disconnect();this.bodyObserver=null}};t.prototype.setupObservers=function(){var t=this;this.cleanupObservers();if(this.tableRef&&typeof MutationObserver!=="undefined"){this.observer=new MutationObserver((function(){t.updateDividerState()}));this.observer.observe(this.tableRef,{attributes:true,attributeFilter:["row-dividers"]})}var e=this.hostElement.closest("pds-table-body");if(e&&typeof MutationObserver!=="undefined"){this.bodyObserver=new MutationObserver((function(){t.updateLastRowState()}));this.bodyObserver.observe(e,{childList:true})}};t.prototype.shouldHaveDivider=function(){if(!this.tableRef){this.tableRef=this.hostElement.closest("pds-table")}return!!(this.tableRef&&this.tableRef.rowDividers)};t.prototype.updateDividerState=function(){this.hasDivider=this.shouldHaveDivider();this.updateLastRowState()};t.prototype.updateLastRowState=function(){if(!this.hasDivider){this.isLastRow=false;return}var t=this.hostElement.closest("pds-table-body");if(t){var e=Array.from(t.querySelectorAll("pds-table-row"));this.isLastRow=e[e.length-1]===this.hostElement}else{this.isLastRow=false}};t.prototype.render=function(){return h(Host,{key:"6bbd8bb7cd1f90de0e418748bf8d3b9240ab0cb8",class:this.classNames(),role:"row",part:"row"},this.tableRef&&this.tableRef.selectable&&h("pds-table-cell",{key:"9a92396654e7cdf819536335ebe95169d4d4c26d",part:this.tableRef.fixedColumn?"checkbox-cell":"checkbox-cell",class:this.tableRef.selectable?"has-checkbox":""},h("pds-checkbox",{key:"bf61a00da4d3c19280aae90d8eaff9515a716c52",componentId:this.generateUniqueId(),onPdsCheckboxChange:this.handleCheckboxChange,indeterminate:this.indeterminate,label:"Select Row",hideLabel:true,checked:this.isSelected,part:"row-checkbox"})),h("slot",{key:"f77887e878913bea5e0ca0a281a639285a65f1c1"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableRow.style=pdsTableRowCss;export{PdsTableRow as pds_table_row};
|
|
2
2
|
//# sourceMappingURL=pds-table-row.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-table-row.entry.js","sources":["src/components/pds-table/pds-table-row/pds-table-row.scss?tag=pds-table-row&encapsulation=shadow","src/components/pds-table/pds-table-row/pds-table-row.tsx"],"sourcesContent":[":host {\n --color-background-interactive: var(--pine-color-background-subtle);\n\n border-color: inherit;\n display: table-row;\n vertical-align: inherit;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: var(--pine-z-index-raised);\n }\n}\n\n:host(:hover),\n:host(:hover)::part(checkbox-cell),\n:host(:hover) ::slotted(pds-table-cell),\n:host(.is-selected),\n:host(.is-selected)::part(checkbox-cell),\n:host(.is-selected) ::slotted(pds-table-cell) {\n background: var(--color-background-interactive);\n}\n\n:host(.has-divider) ::slotted(pds-table-cell),\n:host(.has-divider) pds-table-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host(.has-divider.is-last-row) ::slotted(pds-table-cell),\n:host(.has-divider.is-last-row) pds-table-cell {\n border-block-end: 0;\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop, State } from '@stencil/core';\n\nimport { closest } from '../../../utils/closest';\n\n@Component({\n tag: 'pds-table-row',\n styleUrls: ['pds-table-row.scss'],\n shadow: true,\n})\nexport class PdsTableRow {\n @Element() hostElement: HTMLPdsTableRowElement;\n private tableRef: HTMLPdsTableElement;\n private observer: MutationObserver | null = null;\n private bodyObserver: MutationObserver | null = null;\n\n /**\n * Determines if the row selected is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n */\n @Prop({ mutable: true }) isSelected?: boolean;\n\n /**\n * Determines if the row should have a divider border.\n * @defaultValue false\n */\n @State() private hasDivider: boolean = false;\n\n /**\n * Determines if this is the last row in the table body.\n * @defaultValue false\n */\n @State() private isLastRow: boolean = false;\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableRowSelected: EventEmitter<{ rowIndex: number; isSelected: boolean; }>;\n\n private handleClick = () => {\n this.isSelected = !this.isSelected; // Toggle the selected state\n this.handleSelect(this.isSelected);\n }\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false;\n\n if (!closest('pds-table-head', this.hostElement)) {\n const rowIndex = Array.from(this.hostElement.parentNode.children).indexOf(this.hostElement)\n this.pdsTableRowSelected.emit({\n rowIndex,\n isSelected,\n })\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.isSelected) {\n classNames.push(\"is-selected\");\n }\n\n if (this.hasDivider) {\n classNames.push(\"has-divider\");\n }\n\n if (this.isLastRow) {\n classNames.push(\"is-last-row\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n // Always refresh tableRef to get latest prop values\n // This ensures we pick up changes to parent table props\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-cell');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n componentWillLoad() {\n // Handle initial selection state\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n // Note: tableRef, observers, and divider state are set up in connectedCallback\n // which runs before componentWillLoad and also handles row re-attachment after sorting\n }\n\n connectedCallback() {\n // When a row is re-attached to the DOM (e.g., after sorting),\n // we need to re-setup the observers since disconnectedCallback cleared them\n // Note: componentDidLoad only fires once, but connectedCallback fires every time\n // the element is attached to the DOM (including after being moved)\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n this.setupObservers();\n this.updateDividerState();\n }\n\n disconnectedCallback() {\n this.cleanupObservers();\n }\n\n private cleanupObservers() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.bodyObserver) {\n this.bodyObserver.disconnect();\n this.bodyObserver = null;\n }\n }\n\n private setupObservers() {\n // Clean up any existing observers first\n this.cleanupObservers();\n\n // Watch for changes to the parent table's row-dividers attribute\n if (this.tableRef && typeof MutationObserver !== 'undefined') {\n this.observer = new MutationObserver(() => {\n this.updateDividerState();\n });\n\n this.observer.observe(this.tableRef, {\n attributes: true,\n attributeFilter: ['row-dividers']\n });\n }\n\n // Watch for child list changes in table body (e.g., when rows are reordered during sorting)\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody && typeof MutationObserver !== 'undefined') {\n this.bodyObserver = new MutationObserver(() => {\n this.updateLastRowState();\n });\n\n this.bodyObserver.observe(tableBody, {\n childList: true\n });\n }\n }\n\n private shouldHaveDivider(): boolean {\n if (!this.tableRef) {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n // Reads the parent pds-table component's rowDividers property value directly\n return !!(this.tableRef && this.tableRef.rowDividers);\n }\n\n private updateDividerState() {\n this.hasDivider = this.shouldHaveDivider();\n this.updateLastRowState();\n }\n\n private updateLastRowState() {\n if (!this.hasDivider) {\n this.isLastRow = false;\n return;\n }\n\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody) {\n const rows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n this.isLastRow = rows[rows.length - 1] === this.hostElement;\n } else {\n this.isLastRow = false;\n }\n }\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"row\"\n part=\"row\"\n >\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-cell part={this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell'} class={this.tableRef.selectable ? 'has-checkbox' : ''} >\n <pds-checkbox\n componentId={this.generateUniqueId()}\n onClick={this.handleClick}\n indeterminate={this.indeterminate}\n label={\"Select Row\"}\n hideLabel={true}\n checked={this.isSelected}\n part=\"row-checkbox\"\n />\n </pds-table-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,09BAA09B;;MCSp+B,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAQ,CAAA,QAAA,GAA4B,IAAI;AACxC,QAAA,IAAY,CAAA,YAAA,GAA4B,IAAI;AAYpD;;;AAGG;AACc,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAE5C;;;AAGG;AACc,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;AAOnC,QAAA,IAAW,CAAA,WAAA,GAAG,MAAK;YACzB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;AACnC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;AACpC,SAAC;AAEO,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,UAAmB,KAAI;AAC7C,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK;YAE1B,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CA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A,EAAA,0CAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,KAAK,EACV,IAAI,EAAC,KAAK,EAAA,EAET,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KACxC,CAAA,CAAA,gBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAgB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,eAAe,GAAG,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,cAAc,GAAG,EAAE,EAAA,EACxI,CAAA,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EACpC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,cAAc,EAAA,CACnB,CACa,CAClB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pds-table-row.entry.js","sources":["src/components/pds-table/pds-table-row/pds-table-row.scss?tag=pds-table-row&encapsulation=shadow","src/components/pds-table/pds-table-row/pds-table-row.tsx"],"sourcesContent":[":host {\n --color-background-interactive: var(--pine-color-background-subtle);\n\n border-color: inherit;\n display: table-row;\n vertical-align: inherit;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: var(--pine-z-index-raised);\n }\n}\n\n:host(:hover),\n:host(:hover)::part(checkbox-cell),\n:host(:hover) ::slotted(pds-table-cell),\n:host(.is-selected),\n:host(.is-selected)::part(checkbox-cell),\n:host(.is-selected) ::slotted(pds-table-cell) {\n background: var(--color-background-interactive);\n}\n\n:host(.has-divider) ::slotted(pds-table-cell),\n:host(.has-divider) pds-table-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host(.has-divider.is-last-row) ::slotted(pds-table-cell),\n:host(.has-divider.is-last-row) pds-table-cell {\n border-block-end: 0;\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop, State } from '@stencil/core';\n\nimport { CheckboxChangeEventDetail } from '../../pds-checkbox/checkbox-interface';\nimport { closest } from '../../../utils/closest';\n\n@Component({\n tag: 'pds-table-row',\n styleUrls: ['pds-table-row.scss'],\n shadow: true,\n})\nexport class PdsTableRow {\n @Element() hostElement: HTMLPdsTableRowElement;\n private tableRef: HTMLPdsTableElement;\n private observer: MutationObserver | null = null;\n private bodyObserver: MutationObserver | null = null;\n\n /**\n * Determines if the row selected is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n */\n @Prop({ mutable: true }) isSelected?: boolean;\n\n /**\n * Determines if the row should have a divider border.\n * @defaultValue false\n */\n @State() private hasDivider: boolean = false;\n\n /**\n * Determines if this is the last row in the table body.\n * @defaultValue false\n */\n @State() private isLastRow: boolean = false;\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableRowSelected: EventEmitter<{ rowIndex: number; isSelected: boolean; }>;\n\n private handleCheckboxChange = (event: CustomEvent<CheckboxChangeEventDetail>) => {\n this.isSelected = event.detail.checked;\n this.handleSelect(this.isSelected);\n }\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false;\n\n if (!closest('pds-table-head', this.hostElement)) {\n const rowIndex = Array.from(this.hostElement.parentNode.children).indexOf(this.hostElement)\n this.pdsTableRowSelected.emit({\n rowIndex,\n isSelected,\n })\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.isSelected) {\n classNames.push(\"is-selected\");\n }\n\n if (this.hasDivider) {\n classNames.push(\"has-divider\");\n }\n\n if (this.isLastRow) {\n classNames.push(\"is-last-row\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n // Always refresh tableRef to get latest prop values\n // This ensures we pick up changes to parent table props\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-cell');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n componentWillLoad() {\n // Handle initial selection state\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n // Note: tableRef, observers, and divider state are set up in connectedCallback\n // which runs before componentWillLoad and also handles row re-attachment after sorting\n }\n\n connectedCallback() {\n // When a row is re-attached to the DOM (e.g., after sorting),\n // we need to re-setup the observers since disconnectedCallback cleared them\n // Note: componentDidLoad only fires once, but connectedCallback fires every time\n // the element is attached to the DOM (including after being moved)\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n this.setupObservers();\n this.updateDividerState();\n }\n\n disconnectedCallback() {\n this.cleanupObservers();\n }\n\n private cleanupObservers() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.bodyObserver) {\n this.bodyObserver.disconnect();\n this.bodyObserver = null;\n }\n }\n\n private setupObservers() {\n // Clean up any existing observers first\n this.cleanupObservers();\n\n // Watch for changes to the parent table's row-dividers attribute\n if (this.tableRef && typeof MutationObserver !== 'undefined') {\n this.observer = new MutationObserver(() => {\n this.updateDividerState();\n });\n\n this.observer.observe(this.tableRef, {\n attributes: true,\n attributeFilter: ['row-dividers']\n });\n }\n\n // Watch for child list changes in table body (e.g., when rows are reordered during sorting)\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody && typeof MutationObserver !== 'undefined') {\n this.bodyObserver = new MutationObserver(() => {\n this.updateLastRowState();\n });\n\n this.bodyObserver.observe(tableBody, {\n childList: true\n });\n }\n }\n\n private shouldHaveDivider(): boolean {\n if (!this.tableRef) {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n // Reads the parent pds-table component's rowDividers property value directly\n return !!(this.tableRef && this.tableRef.rowDividers);\n }\n\n private updateDividerState() {\n this.hasDivider = this.shouldHaveDivider();\n this.updateLastRowState();\n }\n\n private updateLastRowState() {\n if (!this.hasDivider) {\n this.isLastRow = false;\n return;\n }\n\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody) {\n const rows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n this.isLastRow = rows[rows.length - 1] === this.hostElement;\n } else {\n this.isLastRow = false;\n }\n }\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"row\"\n part=\"row\"\n >\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-cell part={this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell'} class={this.tableRef.selectable ? 'has-checkbox' : ''} >\n <pds-checkbox\n componentId={this.generateUniqueId()}\n onPdsCheckboxChange={this.handleCheckboxChange}\n indeterminate={this.indeterminate}\n label={\"Select Row\"}\n hideLabel={true}\n checked={this.isSelected}\n part=\"row-checkbox\"\n />\n </pds-table-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,09BAA09B;;MCUp+B,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAQ,CAAA,QAAA,GAA4B,IAAI;AACxC,QAAA,IAAY,CAAA,YAAA,GAA4B,IAAI;AAYpD;;;AAGG;AACc,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAE5C;;;AAGG;AACc,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;AAOnC,QAAA,IAAA,CAA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stance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";var pdsTableCss='@charset "UTF-8";:host{--color-background-default:var(--pine-color-background-container);background:var(--color-background-default);border-collapse:separate;border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;width:100%}:host(:focus-visible){outline:var(--pine-outline-focus)}:host(.pds-table-responsive-host){border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;max-width:100% !important;overflow:hidden !important;position:relative !important;width:100% !important}.pds-table-responsive-container{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;overflow-x:auto !important;overflow-y:visible !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper .pds-table{display:table !important;min-width:-webkit-max-content !important;min-width:-moz-max-content !important;min-width:max-content !important;table-layout:auto !important;white-space:nowrap !important;width:100% !important}.scroll-shadow-left,.scroll-shadow-right{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;-webkit-transition:opacity 0.1s ease;transition:opacity 0.1s ease;width:4px;z-index:var(--pine-z-index)}.scroll-shadow-left{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);border-bottom-left-radius:inherit;border-top-left-radius:inherit;left:0}.scroll-shadow-right{background:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);border-bottom-right-radius:inherit;border-top-right-radius:inherit;right:0}';var PdsTable=function(){function t(t){registerInstance(this,t);this.
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";var pdsTableCss='@charset "UTF-8";:host{--color-background-default:var(--pine-color-background-container);background:var(--color-background-default);border-collapse:separate;border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;isolation:isolate;width:100%}:host(:focus-visible){outline:var(--pine-outline-focus)}:host(.pds-table-responsive-host){border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;max-width:100% !important;overflow:hidden !important;position:relative !important;width:100% !important}.pds-table-responsive-container{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;overflow-x:auto !important;overflow-y:visible !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper .pds-table{display:table !important;min-width:-webkit-max-content !important;min-width:-moz-max-content !important;min-width:max-content !important;table-layout:auto !important;white-space:nowrap !important;width:100% !important}.scroll-shadow-left,.scroll-shadow-right{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;-webkit-transition:opacity 0.1s ease;transition:opacity 0.1s ease;width:4px;z-index:var(--pine-z-index)}.scroll-shadow-left{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);border-bottom-left-radius:inherit;border-top-left-radius:inherit;left:0}.scroll-shadow-right{background:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);border-bottom-right-radius:inherit;border-top-right-radius:inherit;right:0}';var PdsTable=function(){function t(t){registerInstance(this,t);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.scrollContainer=null;this._responsiveHandleScroll=null;this._responsiveHandleResize=null;this._responsiveResizeObserver=null;this._teardownResponsive=null;this.disableSelectAll=false;this.rowDividers=false;this.defaultSortDirection="asc";this.sortingColumn=null;this.sortingDirection="asc"}t.prototype.componentDidLoad=function(){var t=this;if(this.responsive){this.setupResponsiveScrolling()}if(this.defaultSortColumn){requestAnimationFrame((function(){void t.applyDefaultSort().catch((function(t){console.warn("Failed to apply default sort.",t)}))}))}};t.prototype.applyDefaultSort=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,r,e,n;var o=this;return __generator(this,(function(s){switch(s.label){case 0:i=this.defaultSortDirection==="desc"?"desc":"asc";r=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));e=r.find((function(t){var i;return((i=t.textContent)!==null&&i!==void 0?i:"").trim()===o.defaultSortColumn}));if(!e)return[3,2];n=((t=e.textContent)!==null&&t!==void 0?t:"").trim();this.sortTable(n,i);this.sortingColumn=n;this.sortingDirection=i;return[4,e.setActiveSort(i)];case 1:s.sent();return[3,3];case 2:console.warn('Default sort column "'.concat(this.defaultSortColumn,'" not found.'));s.label=3;case 3:return[2]}}))}))};t.prototype.disconnectedCallback=function(){if(this._teardownResponsive){this._teardownResponsive();this._teardownResponsive=null}};t.prototype.setupResponsiveScrolling=function(){var t=this;var i,r,e;var n=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector(".pds-table-responsive-container");var o=(r=this.el.shadowRoot)===null||r===void 0?void 0:r.querySelector(".scroll-shadow-left");var s=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".scroll-shadow-right");if(!n||!o||!s)return;this.scrollContainer=n;this._responsiveHandleScroll=function(){if(!t.scrollContainer)return;var i=t.scrollContainer.scrollLeft;var r=t.scrollContainer.scrollWidth-t.scrollContainer.clientWidth;o.style.opacity=i>0&&!t.fixedColumn?"1":"0";s.style.opacity=r>0&&i<r-1?"1":"0"};this.scrollContainer.addEventListener("scroll",this._responsiveHandleScroll,{passive:true});if(typeof window!=="undefined"&&window.ResizeObserver){try{this._responsiveResizeObserver=new ResizeObserver((function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)}));this._responsiveResizeObserver.observe(this.scrollContainer)}catch(t){}}if(typeof window!=="undefined"){this._responsiveHandleResize=function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)};window.addEventListener("resize",this._responsiveHandleResize)}this._teardownResponsive=function(){if(t.scrollContainer&&t._responsiveHandleScroll){t.scrollContainer.removeEventListener("scroll",t._responsiveHandleScroll);t.scrollContainer=null}if(t._responsiveResizeObserver){t._responsiveResizeObserver.disconnect();t._responsiveResizeObserver=null}if(typeof window!=="undefined"&&t._responsiveHandleResize){window.removeEventListener("resize",t._responsiveHandleResize);t._responsiveHandleResize=null}t._responsiveHandleScroll=null};this._responsiveHandleScroll()};t.prototype.classNames=function(){var t=["pds-table"];if(this.compact){t.push("is-compact")}if(this.responsive){t.push("is-responsive")}return t.join(" ")};t.prototype.sortTable=function(t,i){var r=this.el.querySelector("pds-table-body");if(!r)return;var e=Array.from(r.querySelectorAll("pds-table-row"));var n=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));var o=n.find((function(i){return i.innerText.trim()===t}));if(!o){console.warn('Column "'.concat(t,'" not found.'));return}var s=n.indexOf(o);e.sort((function(t,r){var e=t.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();var n=r.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();if(i==="asc"){return e.localeCompare(n,undefined,{sensitivity:"base"})}else{return n.localeCompare(e,undefined,{sensitivity:"base"})}}));r.innerHTML="";e.forEach((function(t){r.appendChild(t)}))};t.prototype.handleTableSort=function(t){if(t.defaultPrevented)return;var i=t.detail.direction;this.sortTable(t.detail.column,i);this.sortingColumn=t.detail.column;this.sortingDirection=i};t.prototype.handleTableSelectAll=function(t){if(t.defaultPrevented)return;var i=this.el.querySelector("pds-table-body");var r=Array.from(i.querySelectorAll("pds-table-row"));r.forEach((function(i){i.isSelected=t.detail.isSelected}))};t.prototype.handleTableSelect=function(t){return __awaiter(this,void 0,void 0,(function(){var i,r,e,n,o;return __generator(this,(function(s){if(t.defaultPrevented)return[2];i=this.el.querySelectorAll("pds-table-row");r=Array.from(i).every((function(t){return t.isSelected}));e=Array.from(i).every((function(t){return!t.isSelected}));n=this.el.querySelector("pds-table-head");if(!n)return[2];o=n.shadowRoot.querySelector("pds-checkbox");if(o){o.checked=r;o.indeterminate=!r&&!e}return[2]}))}))};t.prototype.render=function(){if(this.responsive){return h(Host,{class:"pds-table is-responsive pds-table-responsive-host",id:this.componentId,role:"grid",selectable:this.selectable,tabindex:"0",part:"table responsive-table"},h("div",{class:"scroll-shadow-left",part:"scroll-shadow-left"}),h("div",{class:"scroll-shadow-right",part:"scroll-shadow-right"}),h("div",{class:"pds-table-responsive-container",part:"responsive-container"},h("div",{class:"pds-table-responsive-wrapper",part:"responsive-wrapper"},h("div",{class:this.classNames(),part:"table-inner"},h("slot",null)))))}return h(Host,{class:this.classNames(),id:this.componentId,role:"grid",selectable:this.selectable,tabindex:"0",part:"table"},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTable.style=pdsTableCss;export{PdsTable as pds_table};
|
|
2
2
|
//# sourceMappingURL=pds-table.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-table.entry.js","sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-background-container);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: var(--pine-z-index);\n}\n\n.scroll-shadow-left {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * Adds divider borders between table rows. The last row will not have a bottom border.\n * @defaultValue false\n */\n @Prop({ reflect: true }) rowDividers: boolean = false;\n\n /**\n * The name of the column to sort by on initial load.\n * Must match the text content of a sortable column header.\n */\n @Prop() defaultSortColumn?: string;\n\n /**\n * The direction to sort the default column on initial load.\n * Only applies if `defaultSortColumn` is set.\n * @defaultValue 'asc'\n */\n @Prop() defaultSortDirection?: 'asc' | 'desc' = 'asc';\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the rowIndex and selected value.\n */\n @Event() pdsTableSelect: EventEmitter<{ rowIndex: number; isSelected: boolean }>;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n\n // Apply default sort if specified\n // Use requestAnimationFrame to defer until child components are fully initialized\n if (this.defaultSortColumn) {\n requestAnimationFrame(() => {\n void this.applyDefaultSort().catch((err) => {\n console.warn('Failed to apply default sort.', err);\n });\n });\n }\n }\n\n /**\n * Applies the default sort configuration on initial load.\n * Finds the matching column header and activates its sort state.\n * @private\n */\n private async applyDefaultSort() {\n // Normalize direction to handle invalid HTML attribute values\n const direction: 'asc' | 'desc' = this.defaultSortDirection === 'desc' ? 'desc' : 'asc';\n\n // Find the matching sortable header cell\n const columnHeaderCells = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n ) as HTMLPdsTableHeadCellElement[];\n\n const matchingCell = columnHeaderCells.find(\n (cell) => (cell.textContent ?? '').trim() === this.defaultSortColumn\n );\n\n if (matchingCell) {\n const columnName = (matchingCell.textContent ?? '').trim();\n // Sort the table data\n this.sortTable(columnName, direction);\n this.sortingColumn = columnName;\n this.sortingDirection = direction;\n\n // Activate the visual state on the header cell\n await matchingCell.setActiveSort(direction);\n } else {\n console.warn(`Default sort column \"${this.defaultSortColumn}\" not found.`);\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Return early if no table body exists\n if (!tableBody) return;\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n if (event.defaultPrevented) return;\n\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table responsive-table\"\n >\n <div class=\"scroll-shadow-left\" part=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\" part=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\" part=\"responsive-container\">\n <div class=\"pds-table-responsive-wrapper\" part=\"responsive-wrapper\">\n <div class={this.classNames()} part=\"table-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,09DAA09D;;MCOj+D,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;AAOU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAC1C,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAyB,CAAA,yBAAA,GAA0B,IAAI;AACvD,QAAA,IAAmB,CAAA,mBAAA,GAAwB,IAAI;AA2BvD;;;AAGG;AACsB,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAQrD;;;;AAIG;AACK,QAAA,IAAoB,CAAA,oBAAA,GAAoB,KAAK;AAErD;;;AAGG;AACM,QAAA,IAAa,CAAA,aAAA,GAAkB,IAAI;AAE5C;;;AAGG;AACM,QAAA,IAAgB,CAAA,gB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=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-background-container);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n isolation: isolate;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: var(--pine-z-index);\n}\n\n.scroll-shadow-left {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * Hides the select-all checkbox in the table header while keeping individual row checkboxes functional.\n * Only applies when `selectable` is true.\n * @defaultValue false\n */\n @Prop() disableSelectAll: boolean = false;\n\n /**\n * Adds divider borders between table rows. The last row will not have a bottom border.\n * @defaultValue false\n */\n @Prop({ reflect: true }) rowDividers: boolean = false;\n\n /**\n * The name of the column to sort by on initial load.\n * Must match the text content of a sortable column header.\n */\n @Prop() defaultSortColumn?: string;\n\n /**\n * The direction to sort the default column on initial load.\n * Only applies if `defaultSortColumn` is set.\n * @defaultValue 'asc'\n */\n @Prop() defaultSortDirection?: 'asc' | 'desc' = 'asc';\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n\n // Apply default sort if specified\n // Use requestAnimationFrame to defer until child components are fully initialized\n if (this.defaultSortColumn) {\n requestAnimationFrame(() => {\n void this.applyDefaultSort().catch((err) => {\n console.warn('Failed to apply default sort.', err);\n });\n });\n }\n }\n\n /**\n * Applies the default sort configuration on initial load.\n * Finds the matching column header and activates its sort state.\n * @private\n */\n private async applyDefaultSort() {\n // Normalize direction to handle invalid HTML attribute values\n const direction: 'asc' | 'desc' = this.defaultSortDirection === 'desc' ? 'desc' : 'asc';\n\n // Find the matching sortable header cell\n const columnHeaderCells = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n ) as HTMLPdsTableHeadCellElement[];\n\n const matchingCell = columnHeaderCells.find(\n (cell) => (cell.textContent ?? '').trim() === this.defaultSortColumn\n );\n\n if (matchingCell) {\n const columnName = (matchingCell.textContent ?? '').trim();\n // Sort the table data\n this.sortTable(columnName, direction);\n this.sortingColumn = columnName;\n this.sortingDirection = direction;\n\n // Activate the visual state on the header cell\n await matchingCell.setActiveSort(direction);\n } else {\n console.warn(`Default sort column \"${this.defaultSortColumn}\" not found.`);\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Return early if no table body exists\n if (!tableBody) return;\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n if (event.defaultPrevented) return;\n\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n if (headerCheckbox) {\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table responsive-table\"\n >\n <div class=\"scroll-shadow-left\" part=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\" part=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\" part=\"responsive-container\">\n <div class=\"pds-table-responsive-wrapper\" part=\"responsive-wrapper\">\n <div class={this.classNames()} part=\"table-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings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AC,sBAAsB,EAAA,EACrE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAC,IAAI,EAAC,oBAAoB,EAAA,EACjE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,aAAa,EAAA,EAC/C,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,CACF,CACF,CACD;;QAIX,QACE,CAAA,CAAC,IAAI,EAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAC,GAAG,EACZ,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,h,a as getElement}from"./index-DHPhrb5T.js";import{s as setColor}from"./utils-tJa4KYNO.js";var pdsTextCss=":host{display:inline}:host([decoration=underline-dotted])>*{-webkit-text-decoration-color:var(--pine-color-text-tertiary);text-decoration-color:var(--pine-color-text-tertiary);-webkit-text-decoration-line:underline;text-decoration-line:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:12%;text-underline-offset:0.3rem;text-underline-position:under}:host([decoration=strikethrough])>*{text-decoration:line-through}h1{font:var(--pine-typography-heading-1);letter-spacing:var(--pine-letter-spacing-heading-1)}h2{font:var(--pine-typography-heading-2);letter-spacing:var(--pine-letter-spacing-heading-2)}h3{font:var(--pine-typography-heading-3);letter-spacing:var(--pine-letter-spacing-heading-3)}h4{font:var(--pine-typography-heading-4);letter-spacing:var(--pine-letter-spacing-heading-4)}h5{font:var(--pine-typography-heading-5);letter-spacing:var(--pine-letter-spacing-heading-5)}h6{font:var(--pine-typography-heading-6);letter-spacing:var(--pine-letter-spacing-heading-6)}code,em,p,pre,strong{font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing)}code,pre{font-family:monospace;letter-spacing:0;line-height:1}em{font-style:normal}strong{font-weight:bolder}:host([truncate])>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([italic])>*{font-style:italic}.pds-text{color:var(--color, var(--pine-color-text));margin:var(--pine-dimension-none)}.pds-text--size-2xl{font-size:var(--pine-font-size-body-2xl)}.pds-text--size-xl{font-size:var(--pine-font-size-body-xl)}.pds-text--size-lg{font-size:var(--pine-font-size-body-lg)}.pds-text--size-md{font-size:var(--pine-font-size-body-md)}.pds-text--size-sm{font-size:var(--pine-font-size-body-sm)}.pds-text--size-xs{font-size:var(--pine-font-size-body-xs)}.pds-text--size-2xs{font-size:var(--pine-font-size-body-2xs)}.pds-text--size-h1{font-size:var(--pine-font-size-heading-1)}.pds-text--size-h2{font-size:var(--pine-font-size-heading-2)}.pds-text--size-h3{font-size:var(--pine-font-size-heading-3)}.pds-text--size-h4{font-size:var(--pine-font-size-heading-4)}.pds-text--size-h5{font-size:var(--pine-font-size-heading-5)}.pds-text--size-h6{font-size:var(--pine-font-size-heading-6)}.pds-text--weight-extra-light{font-weight:var(--pine-font-weight-extra-light)}.pds-text--weight-light{font-weight:var(--pine-font-weight-light)}.pds-text--weight-regular{font-weight:var(--pine-font-weight-regular)}.pds-text--weight-medium{font-weight:var(--pine-font-weight-medium)}.pds-text--weight-semibold{font-weight:var(--pine-font-weight-semi-bold)}.pds-text--weight-bold{font-weight:var(--pine-font-weight-bold)}.pds-text--gutter-2xl{-webkit-margin-after:var(--pine-dimension-2xl);margin-block-end:var(--pine-dimension-2xl)}.pds-text--gutter-xl{-webkit-margin-after:var(--pine-dimension-xl);margin-block-end:var(--pine-dimension-xl)}.pds-text--gutter-lg{-webkit-margin-after:var(--pine-dimension-lg);margin-block-end:var(--pine-dimension-lg)}.pds-text--gutter-md{-webkit-margin-after:var(--pine-dimension-md);margin-block-end:var(--pine-dimension-md)}.pds-text--gutter-sm{-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-text--gutter-xs{-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-text--gutter-2xs{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-text--align-start{text-align:start}.pds-text--align-center{text-align:center}.pds-text--align-end{text-align:end}.pds-text--align-justify{text-align:justify}";var PdsText=function(){function
|
|
1
|
+
import{r as registerInstance,h,a as getElement}from"./index-DHPhrb5T.js";import{s as setColor}from"./utils-tJa4KYNO.js";import{s as setupTruncationTooltip}from"./truncation-tooltip-CTHpMbU3.js";import"./floating-ui.dom-BO6p966C.js";var pdsTextCss=":host{display:inline}:host([decoration=underline-dotted])>*{-webkit-text-decoration-color:var(--pine-color-text-tertiary);text-decoration-color:var(--pine-color-text-tertiary);-webkit-text-decoration-line:underline;text-decoration-line:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:12%;text-underline-offset:0.3rem;text-underline-position:under}:host([decoration=strikethrough])>*{text-decoration:line-through}h1{font:var(--pine-typography-heading-1);letter-spacing:var(--pine-letter-spacing-heading-1)}h2{font:var(--pine-typography-heading-2);letter-spacing:var(--pine-letter-spacing-heading-2)}h3{font:var(--pine-typography-heading-3);letter-spacing:var(--pine-letter-spacing-heading-3)}h4{font:var(--pine-typography-heading-4);letter-spacing:var(--pine-letter-spacing-heading-4)}h5{font:var(--pine-typography-heading-5);letter-spacing:var(--pine-letter-spacing-heading-5)}h6{font:var(--pine-typography-heading-6);letter-spacing:var(--pine-letter-spacing-heading-6)}code,em,p,pre,strong{font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing)}code,pre{font-family:monospace;letter-spacing:0;line-height:1}em{font-style:normal}strong{font-weight:bolder}:host([truncate])>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([italic])>*{font-style:italic}.pds-text{color:var(--color, var(--pine-color-text));margin:var(--pine-dimension-none)}.pds-text--size-2xl{font-size:var(--pine-font-size-body-2xl)}.pds-text--size-xl{font-size:var(--pine-font-size-body-xl)}.pds-text--size-lg{font-size:var(--pine-font-size-body-lg)}.pds-text--size-md{font-size:var(--pine-font-size-body-md)}.pds-text--size-sm{font-size:var(--pine-font-size-body-sm)}.pds-text--size-xs{font-size:var(--pine-font-size-body-xs)}.pds-text--size-2xs{font-size:var(--pine-font-size-body-2xs)}.pds-text--size-h1{font-size:var(--pine-font-size-heading-1)}.pds-text--size-h2{font-size:var(--pine-font-size-heading-2)}.pds-text--size-h3{font-size:var(--pine-font-size-heading-3)}.pds-text--size-h4{font-size:var(--pine-font-size-heading-4)}.pds-text--size-h5{font-size:var(--pine-font-size-heading-5)}.pds-text--size-h6{font-size:var(--pine-font-size-heading-6)}.pds-text--weight-extra-light{font-weight:var(--pine-font-weight-extra-light)}.pds-text--weight-light{font-weight:var(--pine-font-weight-light)}.pds-text--weight-regular{font-weight:var(--pine-font-weight-regular)}.pds-text--weight-medium{font-weight:var(--pine-font-weight-medium)}.pds-text--weight-semibold{font-weight:var(--pine-font-weight-semi-bold)}.pds-text--weight-bold{font-weight:var(--pine-font-weight-bold)}.pds-text--gutter-2xl{-webkit-margin-after:var(--pine-dimension-2xl);margin-block-end:var(--pine-dimension-2xl)}.pds-text--gutter-xl{-webkit-margin-after:var(--pine-dimension-xl);margin-block-end:var(--pine-dimension-xl)}.pds-text--gutter-lg{-webkit-margin-after:var(--pine-dimension-lg);margin-block-end:var(--pine-dimension-lg)}.pds-text--gutter-md{-webkit-margin-after:var(--pine-dimension-md);margin-block-end:var(--pine-dimension-md)}.pds-text--gutter-sm{-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-text--gutter-xs{-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-text--gutter-2xs{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-text--align-start{text-align:start}.pds-text--align-center{text-align:center}.pds-text--align-end{text-align:end}.pds-text--align-justify{text-align:justify}";var PdsText=function(){function t(t){registerInstance(this,t);this.truncationCleanup=null;this.tag="p"}t.prototype.handleTruncateChange=function(t){if(t){this.initTruncationTooltip()}else{this.destroyTruncationTooltip()}};t.prototype.componentDidLoad=function(){if(this.truncate){this.initTruncationTooltip()}};t.prototype.disconnectedCallback=function(){this.destroyTruncationTooltip()};t.prototype.initTruncationTooltip=function(){var t=this;this.destroyTruncationTooltip();if(this.contentEl){this.truncationCleanup=setupTruncationTooltip({hostEl:this.el,contentEl:this.contentEl,getTooltipText:function(){return t.el.textContent||""}})}};t.prototype.destroyTruncationTooltip=function(){if(this.truncationCleanup){this.truncationCleanup();this.truncationCleanup=null}};t.prototype.render=function(){var t=this;var e=this.tag;var i="\n pds-text\n ".concat(this.align!==undefined&&this.align.trim()!==""?"pds-text--align-".concat(this.align):"","\n ").concat(this.gutter!==undefined&&this.gutter.trim()!==""?"pds-text--gutter-".concat(this.gutter):"","\n ").concat(this.size!==undefined&&this.size.trim()!==""?"pds-text--size-".concat(this.size):"","\n ").concat(this.weight!==undefined&&this.weight.trim()!==""?"pds-text--weight-".concat(this.weight):"","\n ").concat(this.decoration!==undefined&&this.decoration.trim()!==""?"pds-text--decoration-".concat(this.decoration):"","\n ");return h(e,{key:"e5d4fa802fbc1a66c21d6e959fb2228f8cac1902",ref:function(e){return t.contentEl=e},style:this.color&&setColor(this.color),class:i,part:"content",tabIndex:this.truncate?0:undefined},h("slot",{key:"4ff0b2cb3a185fd97ef296262790379df832b7b8"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{truncate:["handleTruncateChange"]}},enumerable:false,configurable:true});return t}();PdsText.style=pdsTextCss;export{PdsText as pds_text};
|
|
2
2
|
//# sourceMappingURL=pds-text.entry.js.map
|