@pine-ds/core 4.4.2 → 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/attributes.js +1 -1
- package/components/closest.js +1 -1
- package/components/pds-avatar.js +1 -1
- package/components/pds-box2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +2 -2
- package/components/pds-copytext.js +1 -1
- package/components/pds-datepicker.js +1 -1
- package/components/pds-drawer-content.js +1 -1
- package/components/pds-drawer-footer.js +1 -1
- package/components/pds-drawer-header.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.js +1 -1
- package/components/pds-modal-footer.js +1 -1
- package/components/pds-modal-header.js +1 -1
- package/components/pds-modal2.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-radio-group.js +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +1 -1
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +2 -2
- package/components/pds-switch.js +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-tooltip.js +1 -1
- package/components/reflected-attribute-default.js +1 -0
- package/dist/cjs/attributes-DrQqSEv4.js +188 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +17 -1
- package/dist/cjs/pds-box.cjs.entry.js +11 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +11 -4
- package/dist/cjs/pds-chip.cjs.entry.js +10 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +11 -6
- package/dist/cjs/pds-copytext.cjs.entry.js +16 -1
- package/dist/cjs/pds-drawer-content.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-drawer.cjs.entry.js +2 -2
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +39 -9
- package/dist/cjs/pds-input.cjs.entry.js +1 -1
- package/dist/cjs/pds-loader.cjs.entry.js +27 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +2 -2
- package/dist/cjs/pds-modal-footer.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal.cjs.entry.js +135 -49
- package/dist/cjs/pds-popover.cjs.entry.js +81 -13
- package/dist/cjs/pds-progress.cjs.entry.js +12 -1
- package/dist/cjs/pds-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/pds-radio.cjs.entry.js +11 -3
- package/dist/cjs/pds-row.cjs.entry.js +11 -1
- package/dist/cjs/pds-select.cjs.entry.js +13 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +10 -1
- package/dist/cjs/pds-sortable.cjs.entry.js +11 -1
- package/dist/cjs/pds-switch.cjs.entry.js +12 -4
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +13 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/pds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/reflected-attribute-default-DVYHG6O1.js +44 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +20 -3
- package/dist/collection/components/pds-box/pds-box.js +14 -1
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +11 -4
- package/dist/collection/components/pds-chip/pds-chip.js +10 -1
- package/dist/collection/components/pds-combobox/pds-combobox.css +16 -2
- package/dist/collection/components/pds-combobox/pds-combobox.js +33 -5
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +41 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js +17 -2
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +2 -1
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +4 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +4 -1
- package/dist/collection/components/pds-drawer/pds-drawer.js +3 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +39 -9
- package/dist/collection/components/pds-loader/pds-loader.js +29 -2
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +5 -2
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +4 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +4 -1
- package/dist/collection/components/pds-modal/pds-modal.js +138 -49
- package/dist/collection/components/pds-popover/pds-popover.js +83 -14
- package/dist/collection/components/pds-progress/pds-progress.js +12 -1
- package/dist/collection/components/pds-radio/pds-radio.js +12 -3
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +4 -3
- package/dist/collection/components/pds-row/pds-row.js +14 -1
- package/dist/collection/components/pds-select/pds-select.js +13 -1
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +11 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +14 -1
- package/dist/collection/components/pds-switch/pds-switch.js +12 -4
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +4 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +13 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +3 -2
- package/dist/collection/utils/attributes.js +101 -0
- package/dist/collection/utils/reflected-attribute-default.js +40 -0
- package/dist/collection/utils/test/host-strip.js +50 -0
- package/dist/docs.json +129 -19
- package/dist/esm/attributes-myrJDwbR.js +183 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-avatar.entry.js +18 -2
- package/dist/esm/pds-box.entry.js +12 -2
- package/dist/esm/pds-checkbox.entry.js +11 -4
- package/dist/esm/pds-chip.entry.js +10 -1
- package/dist/esm/pds-combobox.entry.js +11 -6
- package/dist/esm/pds-copytext.entry.js +16 -1
- package/dist/esm/pds-drawer-content.entry.js +1 -1
- package/dist/esm/pds-drawer-footer.entry.js +1 -1
- package/dist/esm/pds-drawer-header.entry.js +1 -1
- package/dist/esm/pds-drawer.entry.js +2 -2
- package/dist/esm/pds-dropdown-menu.entry.js +39 -9
- package/dist/esm/pds-input.entry.js +1 -1
- package/dist/esm/pds-loader.entry.js +28 -2
- package/dist/esm/pds-modal-content.entry.js +2 -2
- package/dist/esm/pds-modal-footer.entry.js +1 -1
- package/dist/esm/pds-modal-header.entry.js +1 -1
- package/dist/esm/pds-modal.entry.js +135 -49
- package/dist/esm/pds-popover.entry.js +81 -13
- package/dist/esm/pds-progress.entry.js +13 -2
- package/dist/esm/pds-radio-group.entry.js +3 -3
- package/dist/esm/pds-radio.entry.js +11 -3
- package/dist/esm/pds-row.entry.js +12 -2
- package/dist/esm/pds-select.entry.js +13 -1
- package/dist/esm/pds-sortable-item.entry.js +10 -1
- package/dist/esm/pds-sortable.entry.js +11 -1
- package/dist/esm/pds-switch.entry.js +12 -4
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +13 -1
- package/dist/esm/pds-textarea.entry.js +1 -1
- package/dist/esm/pds-tooltip.entry.js +2 -2
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/reflected-attribute-default-t3idJwV0.js +42 -0
- package/dist/esm-es5/attributes-myrJDwbR.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
- package/dist/esm-es5/pds-drawer.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +2 -2
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/reflected-attribute-default-t3idJwV0.js +1 -0
- package/dist/pine-core/p-09d10e9e.entry.js +7 -0
- package/dist/pine-core/p-1feace6a.system.entry.js +1 -0
- package/dist/pine-core/p-21abd971.entry.js +1 -0
- package/dist/pine-core/p-2212224a.system.entry.js +1 -0
- package/dist/pine-core/p-2806fa55.system.entry.js +1 -0
- package/dist/pine-core/p-2dd3ab72.entry.js +1 -0
- package/dist/pine-core/p-30784d57.entry.js +1 -0
- package/dist/pine-core/p-3088cd66.entry.js +1 -0
- package/dist/pine-core/p-3e829372.system.entry.js +1 -0
- package/dist/pine-core/{p-67227922.entry.js → p-44cbdf94.system.entry.js} +1 -1
- package/dist/pine-core/p-4765f7f0.entry.js +1 -0
- package/dist/pine-core/{p-d00c5b9c.system.entry.js → p-48ab7da8.system.entry.js} +1 -1
- package/dist/pine-core/{p-c5c46b65.entry.js → p-4af5f936.entry.js} +1 -1
- package/dist/pine-core/{p-b823bde2.system.entry.js → p-5064f007.system.entry.js} +1 -1
- package/dist/pine-core/p-5081a96f.entry.js +1 -0
- package/dist/pine-core/p-51eb36f4.system.entry.js +3 -0
- package/dist/pine-core/p-5527e825.system.entry.js +1 -0
- package/dist/pine-core/{p-8d42f505.entry.js → p-5db91557.entry.js} +1 -1
- package/dist/pine-core/p-62377463.system.entry.js +1 -0
- package/dist/pine-core/{p-d11e4956.entry.js → p-63644dbd.entry.js} +1 -1
- package/dist/pine-core/p-6d6079f5.entry.js +1 -0
- package/dist/pine-core/p-7386bbdf.system.entry.js +1 -0
- package/dist/pine-core/p-74d93179.system.entry.js +1 -0
- package/dist/pine-core/p-7647b568.system.entry.js +1 -0
- package/dist/pine-core/{p-5e9396e2.system.entry.js → p-7698fcfa.system.entry.js} +1 -1
- package/dist/pine-core/{p-b802776b.system.entry.js → p-778a0228.system.entry.js} +1 -1
- package/dist/pine-core/{p-f5677949.system.entry.js → p-7a9c687d.system.entry.js} +1 -1
- package/dist/pine-core/{p-9b262a9d.entry.js → p-85d77b55.entry.js} +1 -1
- package/dist/pine-core/p-88728d46.system.entry.js +1 -0
- package/dist/pine-core/{p-6b25f349.system.entry.js → p-8d8512ae.system.entry.js} +1 -1
- package/dist/pine-core/p-93341083.system.entry.js +1 -0
- package/dist/pine-core/{p-871894e1.entry.js → p-95649e1c.entry.js} +1 -1
- package/dist/pine-core/p-97c04215.system.entry.js +1 -0
- package/dist/pine-core/p-9ca1b473.system.entry.js +1 -0
- package/dist/pine-core/p-Bkho_oFB.system.js +1 -0
- package/dist/pine-core/p-BwmzR47K.system.js +1 -0
- package/dist/pine-core/p-DO9XKAkv.system.js +1 -1
- package/dist/pine-core/p-a0f8a61a.entry.js +1 -0
- package/dist/pine-core/p-a232dc19.entry.js +1 -0
- package/dist/pine-core/p-a8884f2d.system.entry.js +1 -0
- package/dist/pine-core/{p-601b646c.system.entry.js → p-a8f23db0.system.entry.js} +1 -1
- package/dist/pine-core/p-a9ea3c9d.entry.js +1 -0
- package/dist/pine-core/{p-495f791c.entry.js → p-b15777a2.entry.js} +1 -1
- package/dist/pine-core/p-bc7ba7d3.system.entry.js +1 -0
- package/dist/pine-core/{p-7608e9b2.entry.js → p-c497d6c6.entry.js} +1 -1
- package/dist/pine-core/p-c971cdb3.entry.js +1 -0
- package/dist/pine-core/p-cdd21cbe.entry.js +1 -0
- package/dist/pine-core/p-ce74a47e.entry.js +2 -0
- package/dist/pine-core/p-cf4758a7.entry.js +1 -0
- package/dist/pine-core/{p-f2560935.entry.js → p-cfc9d4a8.entry.js} +1 -1
- package/dist/pine-core/p-d1b0b372.entry.js +1 -0
- package/dist/pine-core/p-d6002d5b.entry.js +1 -0
- package/dist/pine-core/{p-773f5771.system.entry.js → p-d8a6298c.system.entry.js} +1 -1
- package/dist/pine-core/p-d933227e.system.entry.js +1 -0
- package/dist/pine-core/p-d962fc84.entry.js +1 -0
- package/dist/pine-core/p-dafff7dd.system.entry.js +1 -0
- package/dist/pine-core/p-ed22da0c.system.entry.js +1 -0
- package/dist/pine-core/{p-de740b3e.system.entry.js → p-f0632690.system.entry.js} +1 -1
- package/dist/pine-core/p-f1c6b23a.entry.js +1 -0
- package/dist/pine-core/p-f3188c57.system.entry.js +8 -0
- package/dist/pine-core/p-f33d6417.entry.js +1 -0
- package/dist/pine-core/p-f832dcd9.entry.js +1 -0
- package/dist/pine-core/p-f83fe305.entry.js +1 -0
- package/dist/pine-core/p-myrJDwbR.js +1 -0
- package/dist/pine-core/p-t3idJwV0.js +1 -0
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-avatar/pds-avatar.d.ts +3 -0
- package/dist/types/components/pds-box/pds-box.d.ts +7 -0
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +2 -0
- package/dist/types/components/pds-chip/pds-chip.d.ts +2 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +5 -0
- package/dist/types/components/pds-copytext/pds-copytext.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +1 -0
- package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +3 -0
- package/dist/types/components/pds-drawer/pds-drawer.d.ts +1 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +4 -0
- package/dist/types/components/pds-loader/pds-loader.d.ts +5 -0
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal.d.ts +9 -1
- package/dist/types/components/pds-popover/pds-popover.d.ts +15 -0
- package/dist/types/components/pds-progress/pds-progress.d.ts +4 -0
- package/dist/types/components/pds-radio/pds-radio.d.ts +3 -0
- package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +1 -0
- package/dist/types/components/pds-row/pds-row.d.ts +7 -0
- package/dist/types/components/pds-select/pds-select.d.ts +2 -0
- package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +4 -0
- package/dist/types/components/pds-sortable/pds-sortable.d.ts +6 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +2 -0
- package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +3 -0
- package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +3 -0
- package/dist/types/components/pds-tabs/pds-tabs.d.ts +3 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +199 -0
- package/dist/types/utils/attributes.d.ts +38 -0
- package/dist/types/utils/reflected-attribute-default.d.ts +31 -0
- package/dist/types/utils/test/host-strip.d.ts +10 -0
- package/dist/vscode.html-data.json +7 -0
- package/hydrate/index.js +717 -201
- package/hydrate/index.mjs +717 -201
- package/package.json +2 -2
- package/dist/cjs/attributes-oNMnBEnP.js +0 -85
- package/dist/esm/attributes-C0M1gTKv.js +0 -82
- package/dist/esm-es5/attributes-C0M1gTKv.js +0 -1
- package/dist/pine-core/p-015d2ceb.entry.js +0 -1
- package/dist/pine-core/p-02a428af.system.entry.js +0 -1
- package/dist/pine-core/p-06534502.entry.js +0 -1
- package/dist/pine-core/p-0827c6a6.entry.js +0 -1
- package/dist/pine-core/p-0af4685d.entry.js +0 -1
- package/dist/pine-core/p-1747c005.system.entry.js +0 -1
- package/dist/pine-core/p-1ae0b503.entry.js +0 -2
- package/dist/pine-core/p-2a00844f.entry.js +0 -1
- package/dist/pine-core/p-3653fd52.system.entry.js +0 -1
- package/dist/pine-core/p-4a43fbd9.entry.js +0 -1
- package/dist/pine-core/p-517f9962.entry.js +0 -1
- package/dist/pine-core/p-569b07ed.system.entry.js +0 -1
- package/dist/pine-core/p-5986f3c9.entry.js +0 -1
- package/dist/pine-core/p-600be0e1.entry.js +0 -1
- package/dist/pine-core/p-62045f88.system.entry.js +0 -1
- package/dist/pine-core/p-62241978.entry.js +0 -1
- package/dist/pine-core/p-63930a06.system.entry.js +0 -1
- package/dist/pine-core/p-6516adf7.system.entry.js +0 -1
- package/dist/pine-core/p-6aaf945c.entry.js +0 -1
- package/dist/pine-core/p-715b8e6b.entry.js +0 -1
- package/dist/pine-core/p-77961987.system.entry.js +0 -1
- package/dist/pine-core/p-7a177548.system.entry.js +0 -1
- package/dist/pine-core/p-806f17de.system.entry.js +0 -1
- package/dist/pine-core/p-832cedb7.entry.js +0 -1
- package/dist/pine-core/p-847e5f00.system.entry.js +0 -1
- package/dist/pine-core/p-85981c5d.system.entry.js +0 -1
- package/dist/pine-core/p-9dbb8fe9.entry.js +0 -1
- package/dist/pine-core/p-BhQhw0S3.system.js +0 -1
- package/dist/pine-core/p-C0M1gTKv.js +0 -1
- package/dist/pine-core/p-b412473d.system.entry.js +0 -8
- package/dist/pine-core/p-b51cfa3b.entry.js +0 -1
- package/dist/pine-core/p-b62e08c2.system.entry.js +0 -1
- package/dist/pine-core/p-c53e560a.system.entry.js +0 -1
- package/dist/pine-core/p-cd7deae5.entry.js +0 -1
- package/dist/pine-core/p-cd86ee3e.system.entry.js +0 -1
- package/dist/pine-core/p-cf5a484e.system.entry.js +0 -1
- package/dist/pine-core/p-cf99f7d8.system.entry.js +0 -1
- package/dist/pine-core/p-cff7013e.system.entry.js +0 -1
- package/dist/pine-core/p-e1d541f7.entry.js +0 -1
- package/dist/pine-core/p-ea0e5253.entry.js +0 -7
- package/dist/pine-core/p-f22a5f9c.system.entry.js +0 -3
- package/dist/pine-core/p-f22abb4d.system.entry.js +0 -1
- package/dist/pine-core/p-f6943cbf.entry.js +0 -1
- package/dist/pine-core/p-f794f7ad.entry.js +0 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../utils/attributes";
|
|
2
3
|
import { assignDescription, messageId, exposeTypeProperty } from "../../utils/form";
|
|
3
4
|
import { danger } from "@pine-ds/icons/icons";
|
|
4
5
|
/**
|
|
5
6
|
* @slot image - Custom image content to display instead of the default radio input
|
|
6
7
|
* @part image-container - The container for the image
|
|
8
|
+
* @lightDom renders-markup
|
|
7
9
|
*/
|
|
8
10
|
export class PdsRadio {
|
|
9
11
|
constructor() {
|
|
10
12
|
this._type = 'radio';
|
|
13
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
11
14
|
this._hasImage = false;
|
|
12
15
|
/**
|
|
13
16
|
* Determines whether or not the radio is checked.
|
|
@@ -75,9 +78,13 @@ export class PdsRadio {
|
|
|
75
78
|
this._hasImage = this.hasImageSlot();
|
|
76
79
|
}
|
|
77
80
|
connectedCallback() {
|
|
81
|
+
this.hostKeeper.connect(this.el);
|
|
78
82
|
// Expose type property on the element instance to match native form element behavior
|
|
79
83
|
exposeTypeProperty(this.el, () => this._type);
|
|
80
84
|
}
|
|
85
|
+
disconnectedCallback() {
|
|
86
|
+
this.hostKeeper.disconnect();
|
|
87
|
+
}
|
|
81
88
|
// Discards stale hidden label/message/wrapper copies left by a page-cache (Turbo, bfcache) reconnect, rescuing real [slot="image"] content stranded inside a stale image-container first.
|
|
82
89
|
componentDidRender() {
|
|
83
90
|
const freshImageContainer = this.el.querySelector('.pds-radio__image-container:not([hidden])');
|
|
@@ -92,11 +99,13 @@ export class PdsRadio {
|
|
|
92
99
|
}
|
|
93
100
|
render() {
|
|
94
101
|
const renderLabelAndMessages = () => [
|
|
95
|
-
h("label", { htmlFor: this.componentId, key: `${this.componentId}-label` }, h("input", { key: '
|
|
102
|
+
h("label", { htmlFor: this.componentId, key: `${this.componentId}-label` }, h("input", { key: 'add893cd82f79b9398589bd5c0a72d5ae4a90475', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, type: "radio", id: this.componentId, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleRadioChange, class: this.hasImage() ? 'visually-hidden' : '' }), h("span", { key: 'b58eed8681d1932397d38ffe82515987e6486e08', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)),
|
|
96
103
|
this.helperMessage && (h("div", { key: `${this.componentId}-helper`, class: 'pds-radio__message', id: messageId(this.componentId, 'helper') }, this.helperMessage)),
|
|
97
|
-
this.errorMessage && (h("div", { key: `${this.componentId}-error`, class: `pds-radio__message pds-radio__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '
|
|
104
|
+
this.errorMessage && (h("div", { key: `${this.componentId}-error`, class: `pds-radio__message pds-radio__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '7374924219e59eab46a7ced9e7062c3e674b4451', icon: danger, size: "small" }), this.errorMessage))
|
|
98
105
|
];
|
|
99
|
-
|
|
106
|
+
const hostClass = this.classNames();
|
|
107
|
+
this.hostKeeper.record(hostClass);
|
|
108
|
+
return (h(Host, { key: '24269923f168d1d39ebfc1994619736f0dc8087a', class: hostClass }, this.hasImage() && (h("div", { key: '74a72bef89aa012047cbf3a1744fcd33f13bb464', class: "pds-radio__image-container", part: "image-container" }, h("slot", { key: '99dbcfdac86cb7c012fd44eab607217e21304bab', name: "image", onSlotchange: () => (this._hasImage = this.hasImageSlot()) }))), this.hasImage() ? (h("div", { class: "pds-radio__content-wrapper" }, renderLabelAndMessages())) : (renderLabelAndMessages())));
|
|
100
109
|
}
|
|
101
110
|
static get is() { return "pds-radio"; }
|
|
102
111
|
static get encapsulation() { return "scoped"; }
|
|
@@ -3,6 +3,7 @@ import { messageId } from "../../utils/form";
|
|
|
3
3
|
import { danger } from "@pine-ds/icons/icons";
|
|
4
4
|
/**
|
|
5
5
|
* @slot (default) - Child pds-radio components
|
|
6
|
+
* @lightDom renders-markup
|
|
6
7
|
*/
|
|
7
8
|
export class PdsRadioGroup {
|
|
8
9
|
constructor() {
|
|
@@ -160,13 +161,13 @@ export class PdsRadioGroup {
|
|
|
160
161
|
render() {
|
|
161
162
|
const gapValue = this.getGapValue();
|
|
162
163
|
const ariaDescribedBy = this.getAriaDescribedBy();
|
|
163
|
-
return (h(Host, { key: '
|
|
164
|
+
return (h(Host, { key: '9dc78eb36bbc1b872f4320203dbbc64e43816ebf', class: this.classNames(), id: this._groupId, role: "group", "aria-describedby": ariaDescribedBy, style: {
|
|
164
165
|
'--pds-radio-group-gap': gapValue,
|
|
165
|
-
} }, this.groupLabel && (h("div", { key: '
|
|
166
|
+
} }, this.groupLabel && (h("div", { key: '7b6f95608dcf356b141ef5d590ff3070f83b5975', class: "pds-radio-group__label" }, this.groupLabel)), h("div", { key: '6e1a634c9b81ca3f3bbbe9c6590bcd4efc97e6ea', class: {
|
|
166
167
|
'pds-radio-group__radios': true,
|
|
167
168
|
'pds-radio-group__radios--row': this.direction === 'row',
|
|
168
169
|
'pds-radio-group__radios--column': this.direction === 'column',
|
|
169
|
-
} }, h("slot", { key: '
|
|
170
|
+
} }, h("slot", { key: 'b5b16148f3c77d425a50b7ada8a822e9919ef5c5', onSlotchange: () => this.updateChildRadios() })), this.helperMessage && (h("div", { key: 'ca6b98f926b8d7a53fda630170ac037c99f5ee85', class: "pds-radio-group__message", id: messageId(this._groupId, 'helper') }, this.helperMessage)), this.errorMessage && (h("div", { key: '37b57e2622370364e619ea090712a7b79fe79501', class: "pds-radio-group__message pds-radio-group__message--error", id: messageId(this._groupId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '6a362d048a67312b1b227f71cc4b8f821ae0817e', icon: danger, size: "small" }), this.errorMessage))));
|
|
170
171
|
}
|
|
171
172
|
static get is() { return "pds-radio-group"; }
|
|
172
173
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../utils/attributes";
|
|
3
|
+
/**
|
|
4
|
+
* @lightDom host-only
|
|
5
|
+
*/
|
|
2
6
|
export class PdsRow {
|
|
3
7
|
constructor() {
|
|
8
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
4
9
|
/**
|
|
5
10
|
* If `true`, the row will have a border.
|
|
6
11
|
*/
|
|
@@ -38,6 +43,12 @@ export class PdsRow {
|
|
|
38
43
|
'800': 'var(--pine-dimension-800)'
|
|
39
44
|
};
|
|
40
45
|
}
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
this.hostKeeper.connect(this.el);
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
this.hostKeeper.disconnect();
|
|
51
|
+
}
|
|
41
52
|
render() {
|
|
42
53
|
const rowClasses = `
|
|
43
54
|
${this.alignItems !== undefined && this.alignItems.trim() !== '' ? `pds-align-items-${this.alignItems}` : ''}
|
|
@@ -55,7 +66,8 @@ export class PdsRow {
|
|
|
55
66
|
})), (this.minHeight && {
|
|
56
67
|
'min-height': this.minHeight,
|
|
57
68
|
}));
|
|
58
|
-
|
|
69
|
+
this.hostKeeper.record(`pds-row ${rowClasses}`, rowInlineStyles);
|
|
70
|
+
return h(Host, { key: 'ee3a32ae1376919c7c2d1fcf186a1b7c272ee085', class: `pds-row ${rowClasses}`, style: rowInlineStyles });
|
|
59
71
|
}
|
|
60
72
|
static get is() { return "pds-row"; }
|
|
61
73
|
static get originalStyleUrls() {
|
|
@@ -272,4 +284,5 @@ export class PdsRow {
|
|
|
272
284
|
}
|
|
273
285
|
};
|
|
274
286
|
}
|
|
287
|
+
static get elementRef() { return "el"; }
|
|
275
288
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../utils/attributes";
|
|
2
3
|
import { assignDescription, isSpecTest, messageId, exposeTypeProperty } from "../../utils/form";
|
|
3
4
|
import { danger, enlarge } from "@pine-ds/icons/icons";
|
|
4
5
|
/**
|
|
@@ -7,6 +8,7 @@ import { danger, enlarge } from "@pine-ds/icons/icons";
|
|
|
7
8
|
export class PdsSelect {
|
|
8
9
|
constructor() {
|
|
9
10
|
this._type = 'select-one';
|
|
11
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
10
12
|
/**
|
|
11
13
|
* Indicates whether or not the select field is disabled.
|
|
12
14
|
* @defaultValue false
|
|
@@ -88,6 +90,7 @@ export class PdsSelect {
|
|
|
88
90
|
this._type = this.multiple ? 'select-multiple' : 'select-one';
|
|
89
91
|
}
|
|
90
92
|
connectedCallback() {
|
|
93
|
+
this.hostKeeper.connect(this.el);
|
|
91
94
|
// Initialize ElementInternals for form association (only once per element instance)
|
|
92
95
|
if (this.el.attachInternals && !this.internals) {
|
|
93
96
|
this.internals = this.el.attachInternals();
|
|
@@ -95,6 +98,9 @@ export class PdsSelect {
|
|
|
95
98
|
// Expose type property on the element instance to match native form element behavior
|
|
96
99
|
exposeTypeProperty(this.el, () => this._type);
|
|
97
100
|
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
this.hostKeeper.disconnect();
|
|
103
|
+
}
|
|
98
104
|
componentWillLoad() {
|
|
99
105
|
// Set initial type based on multiple prop
|
|
100
106
|
this.updateType();
|
|
@@ -228,7 +234,13 @@ export class PdsSelect {
|
|
|
228
234
|
}
|
|
229
235
|
render() {
|
|
230
236
|
const hasAction = this.el.querySelector('[slot="action"]') !== null;
|
|
231
|
-
|
|
237
|
+
const hostClass = this.classNames();
|
|
238
|
+
const hostAttributes = {
|
|
239
|
+
'aria-disabled': this.disabled ? 'true' : null,
|
|
240
|
+
'has-action': hasAction && !this.hideLabel ? 'true' : null,
|
|
241
|
+
};
|
|
242
|
+
this.hostKeeper.record(hostClass, {}, hostAttributes);
|
|
243
|
+
return (h(Host, Object.assign({ key: 'c99bfc000ad351298e154554a8b22635b1abb718', class: hostClass }, hostAttributes), h("div", { key: '35374b150cbef745c6a6068ba5a2fde0803c0314', class: "pds-select" }, !this.hideLabel && (h("div", { key: 'a3b9bae451c5c384606790a29bf8ab5fc70427c0', class: "pds-select__label-wrapper" }, h("label", { key: '80d7740a05a6d3cce6d51224169eb6c2501c4896', htmlFor: this.componentId }, h("span", { key: 'a51c02d7c84f75bb168889dab50cae807271c63d', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), hasAction && this.renderAction())), h("select", { key: '11444dad795bd02c008252a60e701125861e4af0', "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "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: (el) => (this.selectEl = el) }), h("div", { key: 'ce54fa1df287d96a7503bb19cd2ba6c74a6da638', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, h("slot", { key: '22c55e78999076a37d43fb708dabc7379dd4cee3', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && h("pds-icon", { key: '45628074fbcdb259b8bba42299082423309a6968', "aria-hidden": "true", class: "pds-select__select-icon", icon: enlarge }))));
|
|
232
244
|
}
|
|
233
245
|
static get is() { return "pds-select"; }
|
|
234
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../../utils/attributes";
|
|
2
3
|
import { handle as handleIcon } from "@pine-ds/icons/icons";
|
|
3
4
|
/**
|
|
4
5
|
* @slot sortable-item-actions - Content is placed within the `pds-sortable-item__actions` element as children. This slot is only rendered if `actions` is set to `true`.
|
|
6
|
+
* @lightDom renders-markup
|
|
5
7
|
*/
|
|
6
8
|
export class PdsSortableItem {
|
|
7
9
|
constructor() {
|
|
10
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
8
11
|
/**
|
|
9
12
|
* Determines whether `sortable-item-actions` slot should be enabled.
|
|
10
13
|
* @defaultValue false
|
|
@@ -16,6 +19,12 @@ export class PdsSortableItem {
|
|
|
16
19
|
*/
|
|
17
20
|
this.showHandle = false;
|
|
18
21
|
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
this.hostKeeper.connect(this.el);
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
this.hostKeeper.disconnect();
|
|
27
|
+
}
|
|
19
28
|
// Discards stale handle/actions siblings left by a page-cache (Turbo, bfcache) reconnect; the fresh handle is always first, the fresh actions wrapper always last.
|
|
20
29
|
componentDidRender() {
|
|
21
30
|
const handles = Array.from(this.el.children).filter((child) => child.matches('.pds-sortable-item__handle'));
|
|
@@ -38,7 +47,8 @@ export class PdsSortableItem {
|
|
|
38
47
|
}
|
|
39
48
|
}
|
|
40
49
|
render() {
|
|
41
|
-
|
|
50
|
+
this.hostKeeper.record('pds-sortable-item');
|
|
51
|
+
return (h(Host, { key: '3f9098a7c938bfa6443f08fb8b0a7c7217230890', class: "pds-sortable-item", id: this.componentId }, this.showHandle && (h("div", { key: '77718a6867ddd8bc029bb3ef995f6ee9a5999ce7', class: "pds-sortable-item__handle" }, h("pds-icon", { key: 'aad7f46e776ece85858798f8f1a1a50c9022b84f', "aria-hidden": "true", icon: handleIcon }))), h("slot", { key: 'afa9346ec8fd7aa6132a15dd44d3b1cae24500b9' }), this.enableActions && (h("div", { key: 'c28c85391117542999c12d673879768394002c90', class: "pds-sortable-item__actions" }, h("slot", { key: '88ab53f3ba4ed47715e31935b861d9ab42342b32', name: "sortable-item-actions" })))));
|
|
42
52
|
}
|
|
43
53
|
static get is() { return "pds-sortable-item"; }
|
|
44
54
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../utils/attributes";
|
|
2
3
|
import Sortable from "sortablejs";
|
|
4
|
+
/**
|
|
5
|
+
* @lightDom host-only
|
|
6
|
+
*/
|
|
3
7
|
export class PdsSortable {
|
|
4
8
|
constructor() {
|
|
5
9
|
/**
|
|
@@ -20,6 +24,7 @@ export class PdsSortable {
|
|
|
20
24
|
* Determines the grabbable area for the `pds-sortable-item`.
|
|
21
25
|
*/
|
|
22
26
|
this.handleType = 'row';
|
|
27
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
23
28
|
}
|
|
24
29
|
handleDisabledChange() {
|
|
25
30
|
var _a;
|
|
@@ -41,6 +46,12 @@ export class PdsSortable {
|
|
|
41
46
|
}
|
|
42
47
|
return classNames.join(' ');
|
|
43
48
|
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
this.hostKeeper.connect(this.el);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this.hostKeeper.disconnect();
|
|
54
|
+
}
|
|
44
55
|
componentDidLoad() {
|
|
45
56
|
let sortableOptions = {
|
|
46
57
|
animation: 150,
|
|
@@ -57,7 +68,9 @@ export class PdsSortable {
|
|
|
57
68
|
this.sortableInstance = Sortable.create(this.el, sortableOptions);
|
|
58
69
|
}
|
|
59
70
|
render() {
|
|
60
|
-
|
|
71
|
+
const classNames = this.classNames();
|
|
72
|
+
this.hostKeeper.record(classNames);
|
|
73
|
+
return (h(Host, { key: 'fb6e9a79babf01980c04ee7208d195510493a7dc', class: classNames, id: this.componentId }, h("slot", { key: '5735ca3af531a736f07d1fafde8ae544d00a75bb' })));
|
|
61
74
|
}
|
|
62
75
|
static get is() { return "pds-sortable"; }
|
|
63
76
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { assignDescription, isSpecTest, messageId, exposeTypeProperty } from "../../utils/form";
|
|
3
3
|
import { danger } from "@pine-ds/icons/icons";
|
|
4
|
-
import { inheritAriaAttributes } from "../../utils/attributes";
|
|
4
|
+
import { inheritAriaAttributes, HostStylingKeeper } from "../../utils/attributes";
|
|
5
5
|
/**
|
|
6
6
|
* @slot label - Content displayed as the switch label in place of the `label` text. Clicking it toggles the switch.
|
|
7
7
|
*/
|
|
@@ -9,6 +9,7 @@ export class PdsSwitch {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.inheritedAttributes = {};
|
|
11
11
|
this._type = 'checkbox';
|
|
12
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
12
13
|
this.hasLabelSlot = false;
|
|
13
14
|
/**
|
|
14
15
|
* Determines the input 'checked' state.
|
|
@@ -52,6 +53,7 @@ export class PdsSwitch {
|
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
connectedCallback() {
|
|
56
|
+
this.hostKeeper.connect(this.el);
|
|
55
57
|
// Initialize ElementInternals for form association (only once per element instance)
|
|
56
58
|
if (this.el.attachInternals && !this.internals) {
|
|
57
59
|
this.internals = this.el.attachInternals();
|
|
@@ -59,6 +61,9 @@ export class PdsSwitch {
|
|
|
59
61
|
// Expose type property on the element instance to match native form element behavior
|
|
60
62
|
exposeTypeProperty(this.el, () => this._type);
|
|
61
63
|
}
|
|
64
|
+
disconnectedCallback() {
|
|
65
|
+
this.hostKeeper.disconnect();
|
|
66
|
+
}
|
|
62
67
|
componentDidLoad() {
|
|
63
68
|
this.updateFormValue();
|
|
64
69
|
}
|
|
@@ -93,9 +98,12 @@ export class PdsSwitch {
|
|
|
93
98
|
this.updateHasLabelSlot();
|
|
94
99
|
}
|
|
95
100
|
render() {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
const hostClass = this.switchClassNames();
|
|
102
|
+
const ariaDisabled = this.disabled ? 'true' : null;
|
|
103
|
+
this.hostKeeper.record(hostClass, {}, { 'aria-disabled': ariaDisabled });
|
|
104
|
+
return (h(Host, { key: '6d4b51307f2619a99981e344f782f69871aabf0f', class: hostClass, "aria-disabled": ariaDisabled }, h("label", { key: '068ef3759e2bc3d9870cff36714de0e9cf558b2b', htmlFor: this.componentId }, h("input", Object.assign({ key: 'aa28fb67332bb2d81c09b6c749c1cb0f079e327f', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "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: 'd237980a9ce2abc04d57085df022f28dfa2768e4', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: '83d0e2110cfdcd3208319302af237178dfd419a4', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
105
|
+
h("div", { key: '137d9e5626b34ade33f68c4c24c3dcb154500dc6', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
106
|
+
h("div", { key: '64c3b8884d0568e26953f67a95d045aa5731c41f', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'f99f8045eb33d0c60518f3b4c6a0183170a50f4a', icon: danger, size: "small" }), this.errorMessage)));
|
|
99
107
|
}
|
|
100
108
|
static get is() { return "pds-switch"; }
|
|
101
109
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { unwrapReconnectedContent } from "../../../utils/reconnected-content";
|
|
3
|
+
/**
|
|
4
|
+
* @lightDom renders-markup
|
|
5
|
+
*/
|
|
3
6
|
export class PdsTabpanel {
|
|
4
7
|
constructor() {
|
|
5
8
|
/**
|
|
@@ -18,7 +21,7 @@ export class PdsTabpanel {
|
|
|
18
21
|
unwrapReconnectedContent(this.el.querySelector('.pds-tabpanel'), '.pds-tabpanel');
|
|
19
22
|
}
|
|
20
23
|
render() {
|
|
21
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '87b00d828c9cddbcccd5d6e89dab7541a3c5c839', slot: "tabpanels", class: this.stretch && this.selected ? "pds-tabpanel--stretch-active" : undefined }, h("div", { key: 'd7058a727d010351c73b5287f45991d48ef71151', role: "tabpanel", id: this.parentComponentId + "__" + this.name + '-panel', tabindex: "0", "aria-labelledby": this.parentComponentId + "__" + this.name, class: this.selected ? "pds-tabpanel is-active" : "pds-tabpanel" }, h("slot", { key: '97861fcd8432206a1115135fad919d75dc327112' }))));
|
|
22
25
|
}
|
|
23
26
|
static get is() { return "pds-tabpanel"; }
|
|
24
27
|
static get originalStyleUrls() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { HostStylingKeeper } from "../../utils/attributes";
|
|
2
3
|
/**
|
|
3
4
|
* @slot tabs - Content is placed within the `div[role="tablist"]` element as children
|
|
4
5
|
* @slot tabpanels - Content is placed directly after the `div[role="tablist"]` element as siblings
|
|
@@ -6,6 +7,7 @@ import { Host, h } from "@stencil/core";
|
|
|
6
7
|
*/
|
|
7
8
|
export class PdsTabs {
|
|
8
9
|
constructor() {
|
|
10
|
+
this.hostKeeper = new HostStylingKeeper();
|
|
9
11
|
/**
|
|
10
12
|
* Adds a divider rule beneath the tab list.
|
|
11
13
|
* @defaultValue false
|
|
@@ -26,6 +28,12 @@ export class PdsTabs {
|
|
|
26
28
|
*/
|
|
27
29
|
this.nav = false;
|
|
28
30
|
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
this.hostKeeper.connect(this.el);
|
|
33
|
+
}
|
|
34
|
+
disconnectedCallback() {
|
|
35
|
+
this.hostKeeper.disconnect();
|
|
36
|
+
}
|
|
29
37
|
tabClickHandler(event) {
|
|
30
38
|
if (this.componentId === event.detail[1]) {
|
|
31
39
|
this.activeTabIndex = event.detail[0];
|
|
@@ -160,7 +168,11 @@ export class PdsTabs {
|
|
|
160
168
|
// Navigation mode: a <nav> landmark of links (aria-current marks the current
|
|
161
169
|
// page). Panel mode: the ARIA tablist of role=tab buttons over tabpanels.
|
|
162
170
|
const tabList = this.isNav ? (h("nav", { class: "pds-tabs__tablist", "aria-label": this.tablistLabel || undefined, part: "tab-list" }, h("slot", { name: "tabs" }))) : (h("div", { class: "pds-tabs__tablist", role: "tablist", "aria-label": this.tablistLabel, part: "tab-list" }, h("slot", { name: "tabs" })));
|
|
163
|
-
|
|
171
|
+
const hostClass = this.classNames();
|
|
172
|
+
// Only the classes: `active-tab-name` backs the mutable activeTabName prop, so a morph that drops
|
|
173
|
+
// it is a prop change, not a strip.
|
|
174
|
+
this.hostKeeper.record(hostClass);
|
|
175
|
+
return (h(Host, { key: 'ea26bc4e4cadd4621511afa01ca2a353a053fd0e', "active-tab-name": this.activeTabName, class: hostClass, id: this.componentId }, tabList, h("slot", { key: '3f920708c647920af3d0d50f74b5409d30d70af8', name: "tabpanels" })));
|
|
164
176
|
}
|
|
165
177
|
static get is() { return "pds-tabs"; }
|
|
166
178
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,6 +3,7 @@ import { autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/
|
|
|
3
3
|
/**
|
|
4
4
|
* @slot (default) - The tooltip's target element
|
|
5
5
|
* @slot content - HTML content for the tooltip
|
|
6
|
+
* @lightDom renders-markup
|
|
6
7
|
*/
|
|
7
8
|
export class PdsTooltip {
|
|
8
9
|
constructor() {
|
|
@@ -342,9 +343,9 @@ export class PdsTooltip {
|
|
|
342
343
|
}
|
|
343
344
|
render() {
|
|
344
345
|
const hostId = this.componentId || undefined;
|
|
345
|
-
return (h(Host, { key: '
|
|
346
|
+
return (h(Host, { key: 'e80abb11248d9bf6aec1ae738c61692594975630', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: '9ff484925a1792302eee230a5c37a0268d536935', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide,
|
|
346
347
|
/* focusin/out bubble; ensure keyboard users see tooltips */
|
|
347
|
-
onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '
|
|
348
|
+
onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '738c314a816e82fd81a0c0e9895d51af45b75eb2' })), h("div", { key: '5b0477cd433cae0b53c4d5ce5767dc703be28ee0', class: "pds-tooltip__content-slot-wrapper", hidden: true }, h("slot", { key: '51ad497357c1d1547bba69d07fd7fa1b675c021f', name: "content" }))));
|
|
348
349
|
}
|
|
349
350
|
static get is() { return "pds-tooltip"; }
|
|
350
351
|
static get originalStyleUrls() {
|
|
@@ -1,3 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sets each attribute whose current value differs, and leaves the rest alone. A `MutationObserver`
|
|
3
|
+
* that calls this to restore attributes sees its own writes once and then settles, so it can't loop.
|
|
4
|
+
* @param el - Element to write to
|
|
5
|
+
* @param attributes - Attribute names and the values they should have
|
|
6
|
+
*/
|
|
7
|
+
export const setAttributesIfChanged = (el, attributes) => {
|
|
8
|
+
Object.entries(attributes).forEach(([name, value]) => {
|
|
9
|
+
if (el.getAttribute(name) !== value)
|
|
10
|
+
el.setAttribute(name, value);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
// Classes Stencil itself puts on a host: its default `hydratedFlag` (Pine doesn't change it), and a
|
|
14
|
+
// scoped component's own scope classes (`sc-pds-radio`, `sc-pds-radio-h`, `sc-pds-radio-s`), which
|
|
15
|
+
// its CSS needs. Only the host's own: another `sc-` class may be a consumer's (styled-components ids).
|
|
16
|
+
const isStencilClass = (el, name) => {
|
|
17
|
+
const scope = `sc-${el.localName}`;
|
|
18
|
+
return name === 'hydrated' || name === scope || name === `${scope}-h` || name === `${scope}-s`;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The class names in a rendered `class` value: a string, or Stencil's `{ name: boolean }` form.
|
|
22
|
+
*/
|
|
23
|
+
export const classNamesOf = (classes) => typeof classes === 'string'
|
|
24
|
+
? classes.split(/\s+/).filter(Boolean)
|
|
25
|
+
: Object.keys(classes).filter((name) => classes[name]);
|
|
26
|
+
/**
|
|
27
|
+
* Puts back any of `expected`'s classes or style properties that are missing from `el`. It only
|
|
28
|
+
* adds what's missing, never rewrites a value that's there, because browsers normalize some style
|
|
29
|
+
* values (`flex: 1` reads back as `1 1 0%`): comparing values would rewrite them forever.
|
|
30
|
+
* @param el - Host element
|
|
31
|
+
* @param expected - Classes and style properties the component rendered
|
|
32
|
+
*/
|
|
33
|
+
export const restoreHostStyling = (el, { classes, styles }) => {
|
|
34
|
+
const missing = classes.filter((name) => !el.classList.contains(name));
|
|
35
|
+
if (missing.length > 0)
|
|
36
|
+
el.classList.add(...missing);
|
|
37
|
+
Object.entries(styles).forEach(([name, value]) => {
|
|
38
|
+
if (value && el.style.getPropertyValue(name) === '')
|
|
39
|
+
el.style.setProperty(name, value);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Watches a component's own host and puts back what it rendered when something strips it. A DOM
|
|
44
|
+
* morph does: it makes the host match the server's HTML, which carries the component's props but not
|
|
45
|
+
* the classes, styles and attributes it wrote, and Stencil won't write them again because it diffs
|
|
46
|
+
* against its previous render, not the live DOM.
|
|
47
|
+
*
|
|
48
|
+
* It also means a script that removes one of these on purpose sees it come back: change them through
|
|
49
|
+
* the component's props instead.
|
|
50
|
+
* @param el - Host element
|
|
51
|
+
* @param expected - Reads what the component last rendered
|
|
52
|
+
* @returns The observer, to disconnect when the component is removed; `null` without MutationObserver
|
|
53
|
+
*/
|
|
54
|
+
const keepHostStyling = (el, expected) => {
|
|
55
|
+
if (typeof MutationObserver === 'undefined')
|
|
56
|
+
return null;
|
|
57
|
+
const observer = new MutationObserver((records) => {
|
|
58
|
+
const styling = expected();
|
|
59
|
+
// A strip takes Stencil's own classes too: without `hydrated` Stencil hides the component, and
|
|
60
|
+
// without its scope classes a scoped component's CSS stops matching. Put back only the ones that
|
|
61
|
+
// were there, so this never runs ahead of Stencil.
|
|
62
|
+
const stencilClasses = records
|
|
63
|
+
.filter((record) => record.attributeName === 'class' && record.oldValue != null)
|
|
64
|
+
.flatMap((record) => classNamesOf(record.oldValue).filter((name) => isStencilClass(el, name)));
|
|
65
|
+
restoreHostStyling(el, Object.assign(Object.assign({}, styling), { classes: [...styling.classes, ...stencilClasses] }));
|
|
66
|
+
// An attribute the component still renders comes back with the value it had, which is what
|
|
67
|
+
// Stencil wrote (a boolean `true` lands as an empty value). One it stopped rendering stays
|
|
68
|
+
// removed, since that was Stencil's own write.
|
|
69
|
+
records.forEach(({ attributeName: name, oldValue }) => {
|
|
70
|
+
var _a;
|
|
71
|
+
const rendered = (_a = styling.attributes) === null || _a === void 0 ? void 0 : _a[name];
|
|
72
|
+
if (oldValue == null || rendered == null || rendered === false || el.hasAttribute(name))
|
|
73
|
+
return;
|
|
74
|
+
el.setAttribute(name, oldValue);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
observer.observe(el, { attributes: true, attributeOldValue: true });
|
|
78
|
+
return observer;
|
|
79
|
+
};
|
|
1
80
|
/**
|
|
2
81
|
* Inherit attributes from the host element
|
|
3
82
|
* @param el - Host element
|
|
@@ -81,3 +160,25 @@ export const inheritAriaAttributes = (el, ignoreList) => {
|
|
|
81
160
|
}
|
|
82
161
|
return inheritAttributes(el, attributesToInherit);
|
|
83
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* One component's use of `keepHostStyling`: `record` what `render()` puts on the host, `connect` in
|
|
165
|
+
* `connectedCallback` and `disconnect` in `disconnectedCallback`.
|
|
166
|
+
*/
|
|
167
|
+
export class HostStylingKeeper {
|
|
168
|
+
constructor() {
|
|
169
|
+
this.styling = { classes: [], styles: {} };
|
|
170
|
+
this.observer = null;
|
|
171
|
+
}
|
|
172
|
+
record(classes, styles = {}, attributes = {}) {
|
|
173
|
+
this.styling = { classes: classNamesOf(classes), styles, attributes };
|
|
174
|
+
}
|
|
175
|
+
connect(el) {
|
|
176
|
+
var _a;
|
|
177
|
+
(_a = this.observer) !== null && _a !== void 0 ? _a : (this.observer = keepHostStyling(el, () => this.styling));
|
|
178
|
+
}
|
|
179
|
+
disconnect() {
|
|
180
|
+
var _a;
|
|
181
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
182
|
+
this.observer = null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Restores a reflected prop's default when its attribute is removed.
|
|
3
|
+
*
|
|
4
|
+
* A reflected `@Prop` with a default writes that default onto the host as an
|
|
5
|
+
* attribute even when the author leaves it out. Removing the attribute doesn't
|
|
6
|
+
* restore the default: Stencil's `attributeChangedCallback` sets the prop to
|
|
7
|
+
* `null` (or `false` for a boolean), even when its default is `true`. A Turbo
|
|
8
|
+
* morph hits this whenever the author relied on the default, since the
|
|
9
|
+
* server's HTML never carries the attribute Pine wrote.
|
|
10
|
+
*
|
|
11
|
+
* A `null` or `undefined` falls back to the default, whether the attribute was
|
|
12
|
+
* removed or a consumer (or a framework clearing a prop) assigned it. Any other
|
|
13
|
+
* value is a real write and is kept, except a boolean's `false`: that's also
|
|
14
|
+
* what removing the attribute produces, so it's told apart by the host's actual
|
|
15
|
+
* attribute. Present, trust it; absent, fall back to the default.
|
|
16
|
+
*
|
|
17
|
+
* Falling back also writes the default back onto the host. Stencil won't: it
|
|
18
|
+
* diffs a reflected attribute against the previous render, not the live DOM,
|
|
19
|
+
* so when the removed attribute held the default (`'lg'` → `null` → `'lg'`)
|
|
20
|
+
* the values match and it skips the write. Left absent, the attribute would
|
|
21
|
+
* make a later `copytext.border = false` fall back to the default too.
|
|
22
|
+
*
|
|
23
|
+
* Wire up from a `@Watch` on the prop and reassign the prop to the result.
|
|
24
|
+
*
|
|
25
|
+
* `attr` is the HTML attribute name, not the prop name — pass the kebab-case
|
|
26
|
+
* form (e.g. `'is-loading'`) for a camelCase prop. They're the same string
|
|
27
|
+
* for every current caller (`size`, `variant`, `placement`, `border`), but
|
|
28
|
+
* `hasAttribute` would silently always return `false` for a multi-word prop
|
|
29
|
+
* if the prop name were passed instead.
|
|
30
|
+
*/
|
|
31
|
+
export function restoreReflectedDefault(el, attr, value, defaultValue) {
|
|
32
|
+
// Only a boolean's `false` needs the attribute to tell a write from a removal. Checking it for
|
|
33
|
+
// other values would let a `null` write strip the attribute and reset every later write.
|
|
34
|
+
if (value != null && (value !== false || el.hasAttribute(attr)))
|
|
35
|
+
return value;
|
|
36
|
+
if (defaultValue !== false && defaultValue != null) {
|
|
37
|
+
el.setAttribute(attr, defaultValue === true ? '' : String(defaultValue));
|
|
38
|
+
}
|
|
39
|
+
return defaultValue;
|
|
40
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// The browser-side code below is passed as strings, the same workaround `runAxe` uses: under Jest's
|
|
2
|
+
// coverage instrumentation, a function passed to `page.$eval` is serialized with injected `cov_*`
|
|
3
|
+
// counter calls that don't exist in the browser, which throws a `ReferenceError` there.
|
|
4
|
+
const inBrowser = (page, selector, body, args = null) => page.evaluate(`
|
|
5
|
+
(() => {
|
|
6
|
+
const el = document.querySelector(${JSON.stringify(selector)});
|
|
7
|
+
const args = ${JSON.stringify(args)};
|
|
8
|
+
${body}
|
|
9
|
+
})()
|
|
10
|
+
`);
|
|
11
|
+
// Computed properties a host class, style or attribute tends to drive, for the host and everything
|
|
12
|
+
// it renders (its shadow tree, or its light DOM for a shadowless component).
|
|
13
|
+
const snapshotStyles = (page, selector) => inBrowser(page, selector, `
|
|
14
|
+
const nodes = [el, ...Array.from((el.shadowRoot || el).querySelectorAll('*'))];
|
|
15
|
+
return nodes.map((node) => {
|
|
16
|
+
const style = getComputedStyle(node);
|
|
17
|
+
// No sizes: text width shifts as web fonts load, and inner elements can be mid-animation. The
|
|
18
|
+
// class check covers what a size would have caught.
|
|
19
|
+
return [
|
|
20
|
+
style.display, style.visibility, style.opacity, style.position, style.clip, style.overflow, style.flexDirection, style.flex, style.minHeight, style.gap,
|
|
21
|
+
style.paddingTop, style.maxWidth, style.color, style.backgroundColor, style.fontWeight,
|
|
22
|
+
style.borderTopStyle, style.borderTopColor, style.borderTopWidth,
|
|
23
|
+
style.borderBottomStyle, style.borderBottomColor, style.borderBottomWidth,
|
|
24
|
+
style.animationName, style.cursor,
|
|
25
|
+
].join(' | ');
|
|
26
|
+
});
|
|
27
|
+
`);
|
|
28
|
+
/**
|
|
29
|
+
* Strips the host's `class` (keeping a `consumer` class the markup must carry), its `style`, and any
|
|
30
|
+
* `removeAttributes`, as a DOM morph does when the server's HTML lacks what the component wrote.
|
|
31
|
+
* Expects every class and removed attribute to come back, and every computed style of the host and
|
|
32
|
+
* what it renders to be unchanged.
|
|
33
|
+
*/
|
|
34
|
+
export const expectStylingSurvivesStrip = async (page, selector, { removeAttributes = [] } = {}) => {
|
|
35
|
+
const host = () => inBrowser(page, selector, `
|
|
36
|
+
return {
|
|
37
|
+
classes: Array.from(el.classList).sort(),
|
|
38
|
+
attributes: args.map((name) => [name, el.getAttribute(name)]),
|
|
39
|
+
};
|
|
40
|
+
`, removeAttributes);
|
|
41
|
+
const before = { host: await host(), styles: await snapshotStyles(page, selector) };
|
|
42
|
+
await inBrowser(page, selector, `
|
|
43
|
+
el.setAttribute('class', 'consumer');
|
|
44
|
+
el.removeAttribute('style');
|
|
45
|
+
args.forEach((name) => el.removeAttribute(name));
|
|
46
|
+
`, removeAttributes);
|
|
47
|
+
await page.waitForChanges();
|
|
48
|
+
expect(await host()).toEqual(before.host);
|
|
49
|
+
expect(await snapshotStyles(page, selector)).toEqual(before.styles);
|
|
50
|
+
};
|