@swisspost/design-system-components 1.6.3 → 1.7.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/dist/cjs/{check-non-empty-ae713942.js → check-non-empty-eeaa8f77.js} +4 -4
- package/dist/cjs/check-non-empty-eeaa8f77.js.map +1 -0
- package/dist/cjs/index-8c288b1a.js +45 -0
- package/dist/cjs/index-8c288b1a.js.map +1 -0
- package/dist/cjs/{index-b619e205.js → index-c07c0cdb.js} +94 -64
- package/dist/cjs/index-c07c0cdb.js.map +1 -0
- package/dist/cjs/index.cjs.js +17 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-cd0e9960.js +7 -0
- package/dist/cjs/package-cd0e9960.js.map +1 -0
- package/dist/cjs/post-accordion-f2e00198.js +87 -0
- package/dist/cjs/post-accordion-f2e00198.js.map +1 -0
- package/dist/cjs/post-accordion.cjs.entry.js +4 -80
- package/dist/cjs/post-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/post-alert-6d0b5e58.js +101 -0
- package/dist/cjs/{post-alert-b46943e0.js.map → post-alert-6d0b5e58.js.map} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +5 -6
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/{post-collapsible-04364cda.js → post-collapsible-0b8dce97.js} +69 -69
- package/dist/cjs/{post-collapsible-04364cda.js.map → post-collapsible-0b8dce97.js.map} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-components.cjs.js.map +1 -1
- package/dist/cjs/post-icon-3dbb7728.js +105 -0
- package/dist/cjs/post-icon-3dbb7728.js.map +1 -0
- package/dist/cjs/post-icon.cjs.entry.js +5 -6
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-popover-ea22d235.js +118 -0
- package/dist/cjs/post-popover-ea22d235.js.map +1 -0
- package/dist/cjs/post-popover.cjs.entry.js +13 -0
- package/dist/cjs/post-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/post-popovercontainer-42e4ab15.js +1878 -0
- package/dist/cjs/post-popovercontainer-42e4ab15.js.map +1 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js +13 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-header-09074905.js +33 -0
- package/dist/cjs/{post-tab-header-805c0a52.js.map → post-tab-header-09074905.js.map} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-panel-9547b9ac.js +27 -0
- package/dist/cjs/{post-tab-panel-caa44a77.js.map → post-tab-panel-9547b9ac.js.map} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs-2ec2778e.js +153 -0
- package/dist/cjs/post-tabs-2ec2778e.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tooltip-32a9c549.js → post-tooltip-c802c51f.js} +78 -1754
- package/dist/cjs/post-tooltip-c802c51f.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -4
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/collapse.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +167 -166
- package/dist/collection/components/post-accordion/post-accordion.js.map +1 -1
- package/dist/collection/components/post-alert/post-alert.css +2 -2
- package/dist/collection/components/post-alert/post-alert.js +246 -246
- package/dist/collection/components/post-alert/post-alert.js.map +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +169 -168
- package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +250 -250
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/components/post-popover/post-popover.css +3 -0
- package/dist/collection/components/post-popover/post-popover.js +267 -0
- package/dist/collection/components/post-popover/post-popover.js.map +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +288 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js.map +1 -0
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +62 -62
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +50 -50
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +224 -223
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +192 -325
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/is-motion-reduced.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-non-empty.js +3 -3
- package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -2
- package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-type.js +10 -10
- package/dist/collection/utils/property-checkers/check-type.js.map +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +5 -5
- package/dist/collection/utils/property-checkers/empty-or.js.map +1 -1
- package/dist/components/check-non-empty.js +3 -3
- package/dist/components/check-non-empty.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +22 -18
- package/dist/components/index2.js.map +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion.d.ts +2 -2
- package/dist/components/post-accordion.js +1 -101
- package/dist/components/post-accordion.js.map +1 -1
- package/dist/components/post-accordion2.js +105 -0
- package/dist/components/post-accordion2.js.map +1 -0
- package/dist/components/post-alert.d.ts +2 -2
- package/dist/components/post-alert2.js +119 -119
- package/dist/components/post-alert2.js.map +1 -1
- package/dist/components/post-collapsible.d.ts +2 -2
- package/dist/components/post-collapsible2.js +90 -90
- package/dist/components/post-collapsible2.js.map +1 -1
- package/dist/components/post-icon.d.ts +2 -2
- package/dist/components/post-icon2.js +118 -118
- package/dist/components/post-icon2.js.map +1 -1
- package/dist/components/post-popover.d.ts +11 -0
- package/dist/components/post-popover.js +8 -0
- package/dist/components/post-popover.js.map +1 -0
- package/dist/components/post-popover2.js +144 -0
- package/dist/components/post-popover2.js.map +1 -0
- package/dist/components/post-popovercontainer.d.ts +11 -0
- package/dist/components/post-popovercontainer.js +8 -0
- package/dist/components/post-popovercontainer.js.map +1 -0
- package/dist/components/post-popovercontainer2.js +1897 -0
- package/dist/components/post-popovercontainer2.js.map +1 -0
- package/dist/components/post-tab-header.d.ts +2 -2
- package/dist/components/post-tab-header2.js +38 -38
- package/dist/components/post-tab-header2.js.map +1 -1
- package/dist/components/post-tab-panel.d.ts +2 -2
- package/dist/components/post-tab-panel2.js +30 -30
- package/dist/components/post-tab-panel2.js.map +1 -1
- package/dist/components/post-tabs.d.ts +2 -2
- package/dist/components/post-tabs2.js +147 -147
- package/dist/components/post-tabs2.js.map +1 -1
- package/dist/components/post-tooltip.d.ts +2 -2
- package/dist/components/post-tooltip2.js +100 -1774
- package/dist/components/post-tooltip2.js.map +1 -1
- package/dist/docs.d.ts +1 -21
- package/dist/docs.json +604 -77
- package/dist/esm/check-non-empty-58bd6b17.js +11 -0
- package/dist/esm/{check-non-empty-09c39561.js.map → check-non-empty-58bd6b17.js.map} +1 -1
- package/dist/esm/index-1427953c.js +40 -0
- package/dist/esm/index-1427953c.js.map +1 -0
- package/dist/esm/{index-4eff5fc5.js → index-35998e08.js} +94 -64
- package/dist/esm/index-35998e08.js.map +1 -0
- package/dist/esm/index.js +14 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-337354c3.js +5 -0
- package/dist/esm/package-337354c3.js.map +1 -0
- package/dist/esm/post-accordion-c2013bb3.js +85 -0
- package/dist/esm/post-accordion-c2013bb3.js.map +1 -0
- package/dist/esm/post-accordion.entry.js +3 -83
- package/dist/esm/post-accordion.entry.js.map +1 -1
- package/dist/esm/post-alert-7254a70f.js +99 -0
- package/dist/esm/{post-alert-e457e249.js.map → post-alert-7254a70f.js.map} +1 -1
- package/dist/esm/post-alert.entry.js +5 -6
- package/dist/esm/post-alert.entry.js.map +1 -1
- package/dist/esm/{post-collapsible-c0a826b2.js → post-collapsible-4464cc98.js} +69 -69
- package/dist/esm/{post-collapsible-c0a826b2.js.map → post-collapsible-4464cc98.js.map} +1 -1
- package/dist/esm/post-collapsible.entry.js +4 -5
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-components.js.map +1 -1
- package/dist/esm/post-icon-e0bbf0f5.js +103 -0
- package/dist/esm/post-icon-e0bbf0f5.js.map +1 -0
- package/dist/esm/post-icon.entry.js +5 -6
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-popover-25eb3f76.js +116 -0
- package/dist/esm/post-popover-25eb3f76.js.map +1 -0
- package/dist/esm/post-popover.entry.js +5 -0
- package/dist/esm/post-popover.entry.js.map +1 -0
- package/dist/esm/post-popovercontainer-54117eea.js +1876 -0
- package/dist/esm/post-popovercontainer-54117eea.js.map +1 -0
- package/dist/esm/post-popovercontainer.entry.js +5 -0
- package/dist/esm/post-popovercontainer.entry.js.map +1 -0
- package/dist/esm/post-tab-header-1684b507.js +31 -0
- package/dist/esm/{post-tab-header-f0c355d6.js.map → post-tab-header-1684b507.js.map} +1 -1
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel-add26fe5.js +25 -0
- package/dist/esm/{post-tab-panel-46f02247.js.map → post-tab-panel-add26fe5.js.map} +1 -1
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs-d738e61f.js +151 -0
- package/dist/esm/post-tabs-d738e61f.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tooltip-fa7b4a0a.js → post-tooltip-57928808.js} +78 -1754
- package/dist/esm/post-tooltip-57928808.js.map +1 -0
- package/dist/esm/post-tooltip.entry.js +3 -4
- package/dist/esm/post-tooltip.entry.js.map +1 -1
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-05e85f2b.entry.js +2 -0
- package/dist/post-components/p-08abd53e.entry.js +2 -0
- package/dist/post-components/p-09892ad1.js +2 -0
- package/dist/post-components/{p-fffce1d7.js.map → p-09892ad1.js.map} +1 -1
- package/dist/post-components/p-1e9ec4a9.entry.js +2 -0
- package/dist/post-components/p-1f55663e.js +2 -0
- package/dist/post-components/p-1f55663e.js.map +1 -0
- package/dist/post-components/p-30c60b6c.entry.js +2 -0
- package/dist/post-components/p-38d97f62.entry.js +2 -0
- package/dist/post-components/p-4c188911.entry.js +2 -0
- package/dist/post-components/p-568bb469.entry.js +2 -0
- package/dist/post-components/p-65c8bd5c.entry.js +2 -0
- package/dist/post-components/p-6e3158e8.js +2 -0
- package/dist/post-components/{p-ca1e407c.js.map → p-6e3158e8.js.map} +1 -1
- package/dist/post-components/p-7d32dfb7.js +2 -0
- package/dist/post-components/{p-8b6fe20d.js.map → p-7d32dfb7.js.map} +1 -1
- package/dist/post-components/p-81591ad0.js +3 -0
- package/dist/post-components/p-81591ad0.js.map +1 -0
- package/dist/post-components/p-96f4ebc4.js +2 -0
- package/dist/post-components/p-96f4ebc4.js.map +1 -0
- package/dist/post-components/p-9bd5f824.js +2 -0
- package/dist/post-components/p-9bd5f824.js.map +1 -0
- package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
- package/dist/post-components/p-b4b4f59a.js +2 -0
- package/dist/post-components/p-bd032124.js +2 -0
- package/dist/post-components/p-bd032124.js.map +1 -0
- package/dist/post-components/p-c5858d52.entry.js +2 -0
- package/dist/post-components/p-c5858d52.entry.js.map +1 -0
- package/dist/post-components/{p-7b8797c6.entry.js → p-dbd07f20.js} +2 -2
- package/dist/post-components/p-de493e36.js +2 -0
- package/dist/post-components/p-de493e36.js.map +1 -0
- package/dist/post-components/{p-3604be27.js → p-eaddd6cc.js} +2 -2
- package/dist/post-components/p-ed73d4c0.entry.js +2 -0
- package/dist/post-components/p-ed73d4c0.entry.js.map +1 -0
- package/dist/post-components/p-f994dce8.js +9 -0
- package/dist/post-components/p-f994dce8.js.map +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +26 -26
- package/dist/types/components/post-alert/post-alert.d.ts +45 -45
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +31 -31
- package/dist/types/components/post-icon/post-icon.d.ts +43 -43
- package/dist/types/components/post-popover/post-popover.d.ts +53 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +62 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +9 -9
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +8 -8
- package/dist/types/components/post-tabs/post-tabs.d.ts +32 -32
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +35 -62
- package/dist/types/components.d.ts +115 -10
- package/dist/types/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/package.json +15 -13
- package/dist/cjs/check-non-empty-ae713942.js.map +0 -1
- package/dist/cjs/check-one-of-27ad3154.js +0 -10
- package/dist/cjs/check-one-of-27ad3154.js.map +0 -1
- package/dist/cjs/index-b38a23e0.js +0 -41
- package/dist/cjs/index-b38a23e0.js.map +0 -1
- package/dist/cjs/index-b619e205.js.map +0 -1
- package/dist/cjs/package-4e9ab85c.js +0 -7
- package/dist/cjs/package-4e9ab85c.js.map +0 -1
- package/dist/cjs/post-alert-b46943e0.js +0 -101
- package/dist/cjs/post-icon-5b36814e.js +0 -105
- package/dist/cjs/post-icon-5b36814e.js.map +0 -1
- package/dist/cjs/post-tab-header-805c0a52.js +0 -33
- package/dist/cjs/post-tab-panel-caa44a77.js +0 -27
- package/dist/cjs/post-tabs-29d4dc70.js +0 -153
- package/dist/cjs/post-tabs-29d4dc70.js.map +0 -1
- package/dist/cjs/post-tooltip-32a9c549.js.map +0 -1
- package/dist/components/check-one-of.js +0 -8
- package/dist/components/check-one-of.js.map +0 -1
- package/dist/esm/check-non-empty-09c39561.js +0 -11
- package/dist/esm/check-one-of-74750af9.js +0 -8
- package/dist/esm/check-one-of-74750af9.js.map +0 -1
- package/dist/esm/index-35921354.js +0 -36
- package/dist/esm/index-35921354.js.map +0 -1
- package/dist/esm/index-4eff5fc5.js.map +0 -1
- package/dist/esm/package-b9b10dd3.js +0 -5
- package/dist/esm/package-b9b10dd3.js.map +0 -1
- package/dist/esm/post-alert-e457e249.js +0 -99
- package/dist/esm/post-icon-b34da686.js +0 -103
- package/dist/esm/post-icon-b34da686.js.map +0 -1
- package/dist/esm/post-tab-header-f0c355d6.js +0 -31
- package/dist/esm/post-tab-panel-46f02247.js +0 -25
- package/dist/esm/post-tabs-5dd55290.js +0 -151
- package/dist/esm/post-tabs-5dd55290.js.map +0 -1
- package/dist/esm/post-tooltip-fa7b4a0a.js.map +0 -1
- package/dist/post-components/p-1339f8cd.js +0 -2
- package/dist/post-components/p-1339f8cd.js.map +0 -1
- package/dist/post-components/p-195b8c88.entry.js +0 -2
- package/dist/post-components/p-3225e008.entry.js +0 -2
- package/dist/post-components/p-61ffffa9.entry.js +0 -2
- package/dist/post-components/p-88262544.js +0 -2
- package/dist/post-components/p-8b6fe20d.js +0 -2
- package/dist/post-components/p-9f71d450.js +0 -2
- package/dist/post-components/p-a7649277.js +0 -3
- package/dist/post-components/p-a7649277.js.map +0 -1
- package/dist/post-components/p-a7c78dea.entry.js +0 -2
- package/dist/post-components/p-b2c3ed97.entry.js +0 -2
- package/dist/post-components/p-ba9aba3a.entry.js +0 -2
- package/dist/post-components/p-bd293ff3.entry.js +0 -2
- package/dist/post-components/p-ca1e407c.js +0 -2
- package/dist/post-components/p-d407b1c3.js +0 -2
- package/dist/post-components/p-d407b1c3.js.map +0 -1
- package/dist/post-components/p-dfe29f7f.js +0 -2
- package/dist/post-components/p-dfe29f7f.js.map +0 -1
- package/dist/post-components/p-fd7015ae.js +0 -9
- package/dist/post-components/p-fd7015ae.js.map +0 -1
- package/dist/post-components/p-fffce1d7.js +0 -2
- /package/dist/post-components/{p-195b8c88.entry.js.map → p-05e85f2b.entry.js.map} +0 -0
- /package/dist/post-components/{p-3225e008.entry.js.map → p-08abd53e.entry.js.map} +0 -0
- /package/dist/post-components/{p-61ffffa9.entry.js.map → p-1e9ec4a9.entry.js.map} +0 -0
- /package/dist/post-components/{p-88262544.js.map → p-30c60b6c.entry.js.map} +0 -0
- /package/dist/post-components/{p-a7c78dea.entry.js.map → p-38d97f62.entry.js.map} +0 -0
- /package/dist/post-components/{p-b2c3ed97.entry.js.map → p-4c188911.entry.js.map} +0 -0
- /package/dist/post-components/{p-ba9aba3a.entry.js.map → p-568bb469.entry.js.map} +0 -0
- /package/dist/post-components/{p-bd293ff3.entry.js.map → p-65c8bd5c.entry.js.map} +0 -0
- /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
- /package/dist/post-components/{p-9f71d450.js.map → p-b4b4f59a.js.map} +0 -0
- /package/dist/post-components/{p-7b8797c6.entry.js.map → p-dbd07f20.js.map} +0 -0
- /package/dist/post-components/{p-3604be27.js.map → p-eaddd6cc.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-non-empty.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-non-empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,KAAa;
|
|
1
|
+
{"version":3,"file":"check-non-empty.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-non-empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,KAAa;IACzD,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC","sourcesContent":["import { EMPTY_VALUES } from './constants';\n\nexport function checkNonEmpty(value: unknown, error: string) {\n if (EMPTY_VALUES.some(v => v === value)) {\n throw new Error(error);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-one-of.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-one-of.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAI,KAAQ,EAAE,cAA4B,EAAE,KAAa;
|
|
1
|
+
{"version":3,"file":"check-one-of.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-one-of.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAI,KAAQ,EAAE,cAA4B,EAAE,KAAa;IACjF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["export function checkOneOf<T>(value: T, possibleValues: readonly T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function checkPattern(value, pattern, errorMessage) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
if (typeof value !== 'string' || !pattern.test(value))
|
|
3
|
+
throw new Error(errorMessage);
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=check-pattern.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-pattern.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,OAAe,EAAE,YAAoB;
|
|
1
|
+
{"version":3,"file":"check-pattern.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,OAAe,EAAE,YAAoB;IAChF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACvF,CAAC","sourcesContent":["export function checkPattern(value: unknown, pattern: RegExp, errorMessage: string) {\n if (typeof value !== 'string' || !pattern.test(value)) throw new Error(errorMessage);\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export function checkType(value, type, error) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
const typeIsArray = type === 'array';
|
|
3
|
+
const valueIsArray = Array.isArray(value);
|
|
4
|
+
if (typeIsArray || valueIsArray) {
|
|
5
|
+
if (valueIsArray !== typeIsArray)
|
|
6
|
+
throw new Error(error);
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
if (typeof value !== type)
|
|
10
|
+
throw new Error(error);
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=check-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-type.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-type.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;
|
|
1
|
+
{"version":3,"file":"check-type.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/check-type.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;IACzE,MAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;IACrC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,WAAW,IAAI,YAAY,EAAE;QAC/B,IAAI,YAAY,KAAK,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KAC1D;SAAM;QACL,IAAI,OAAO,KAAK,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACnD;AACH,CAAC","sourcesContent":["export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EMPTY_VALUES } from "./constants";
|
|
2
2
|
export function emptyOr(check) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
return (...args) => {
|
|
4
|
+
const value = args[0];
|
|
5
|
+
if (!EMPTY_VALUES.some(v => v === value))
|
|
6
|
+
check(...args);
|
|
7
|
+
};
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=empty-or.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-or.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/empty-or.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,OAAO,CAAsB,KAA2B;
|
|
1
|
+
{"version":3,"file":"empty-or.js","sourceRoot":"","sources":["../../../../src/utils/property-checkers/empty-or.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,OAAO,CAAsB,KAA2B;IACtE,OAAO,CAAC,GAAG,IAAO,EAAE,EAAE;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC;YAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { EMPTY_VALUES } from './constants';\n\nexport function emptyOr<T extends unknown[]>(check: (...args: T) => void) {\n return (...args: T) => {\n const value = args[0];\n if (!EMPTY_VALUES.some(v => v === value)) check(...args);\n };\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { E as EMPTY_VALUES } from './constants.js';
|
|
2
2
|
|
|
3
3
|
function checkNonEmpty(value, error) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if (EMPTY_VALUES.some(v => v === value)) {
|
|
5
|
+
throw new Error(error);
|
|
6
|
+
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { checkNonEmpty as c };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"check-non-empty.js","mappings":";;SAEgB,aAAa,CAAC,KAAc,EAAE,KAAa;
|
|
1
|
+
{"file":"check-non-empty.js","mappings":";;SAEgB,aAAa,CAAC,KAAc,EAAE,KAAa;IACzD,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH;;;;","names":[],"sources":["src/utils/property-checkers/check-non-empty.ts"],"sourcesContent":["import { EMPTY_VALUES } from './constants';\n\nexport function checkNonEmpty(value: unknown, error: string) {\n if (EMPTY_VALUES.some(v => v === value)) {\n throw new Error(error);\n }\n}\n"],"version":3}
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { P as PostAccordion } from './post-accordion2.js';
|
|
2
3
|
export { P as PostAlert } from './post-alert2.js';
|
|
3
4
|
export { P as PostCollapsible } from './post-collapsible2.js';
|
|
4
5
|
export { P as PostIcon } from './post-icon2.js';
|
|
6
|
+
export { P as PostPopover } from './post-popover2.js';
|
|
7
|
+
export { P as PostPopovercontainer } from './post-popovercontainer2.js';
|
|
5
8
|
export { P as PostTabs } from './post-tabs2.js';
|
|
6
9
|
export { P as PostTabHeader } from './post-tab-header2.js';
|
|
7
10
|
export { P as PostTabPanel } from './post-tab-panel2.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":"
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { E as EMPTY_VALUES } from './constants.js';
|
|
2
|
-
import { c as checkOneOf } from './check-one-of.js';
|
|
3
2
|
|
|
4
3
|
function emptyOr(check) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
return (...args) => {
|
|
5
|
+
const value = args[0];
|
|
6
|
+
if (!EMPTY_VALUES.some(v => v === value))
|
|
7
|
+
check(...args);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function checkOneOf(value, possibleValues, error) {
|
|
12
|
+
if (!possibleValues.includes(value))
|
|
13
|
+
throw new Error(error);
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
function checkPattern(value, pattern, errorMessage) {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
if (typeof value !== 'string' || !pattern.test(value))
|
|
18
|
+
throw new Error(errorMessage);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
function checkType(value, type, error) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const typeIsArray = type === 'array';
|
|
23
|
+
const valueIsArray = Array.isArray(value);
|
|
24
|
+
if (typeIsArray || valueIsArray) {
|
|
25
|
+
if (valueIsArray !== typeIsArray)
|
|
26
|
+
throw new Error(error);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (typeof value !== type)
|
|
30
|
+
throw new Error(error);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index2.js","mappings":"
|
|
1
|
+
{"file":"index2.js","mappings":";;SAEgB,OAAO,CAAsB,KAA2B;IACtE,OAAO,CAAC,GAAG,IAAO;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;YAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;KAC1D,CAAC;AACJ;;SCPgB,UAAU,CAAI,KAAQ,EAAE,cAA4B,EAAE,KAAa;IACjF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D;;SCFgB,YAAY,CAAC,KAAc,EAAE,OAAe,EAAE,YAAoB;IAChF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACvF;;SCMgB,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;IACzE,MAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;IACrC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,WAAW,IAAI,YAAY,EAAE;QAC/B,IAAI,YAAY,KAAK,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KAC1D;SAAM;QACL,IAAI,OAAO,KAAK,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACnD;AACH;;MCZa,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE;MACxC,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE;MAC5C,gBAAgB,GAAG,OAAO,CAAC,SAAS;;;;","names":[],"sources":["src/utils/property-checkers/empty-or.ts","src/utils/property-checkers/check-one-of.ts","src/utils/property-checkers/check-pattern.ts","src/utils/property-checkers/check-type.ts","src/utils/property-checkers/index.ts"],"sourcesContent":["import { EMPTY_VALUES } from './constants';\n\nexport function emptyOr<T extends unknown[]>(check: (...args: T) => void) {\n return (...args: T) => {\n const value = args[0];\n if (!EMPTY_VALUES.some(v => v === value)) check(...args);\n };\n}\n","export function checkOneOf<T>(value: T, possibleValues: readonly T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n","export function checkPattern(value: unknown, pattern: RegExp, errorMessage: string) {\n if (typeof value !== 'string' || !pattern.test(value)) throw new Error(errorMessage);\n}\n","export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n","import { emptyOr } from './empty-or';\nimport { checkOneOf } from './check-one-of';\nimport { checkPattern } from './check-pattern';\nimport { checkType } from './check-type';\n\nexport const checkEmptyOrOneOf = emptyOr(checkOneOf);\nexport const checkEmptyOrPattern = emptyOr(checkPattern);\nexport const checkEmptyOrType = emptyOr(checkType);\n\nexport * from './check-non-empty';\nexport * from './check-one-of';\nexport * from './check-pattern';\nexport * from './check-type';\n"],"version":3}
|
|
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
|
|
|
2
2
|
|
|
3
3
|
interface PostAccordion extends Components.PostAccordion, HTMLElement {}
|
|
4
4
|
export const PostAccordion: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
prototype: PostAccordion;
|
|
6
|
+
new (): PostAccordion;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -1,104 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
|
|
4
|
-
const postAccordionCss = ":host{display:block}";
|
|
5
|
-
|
|
6
|
-
const PostAccordion$1 = /*@__PURE__*/ proxyCustomElement(class PostAccordion extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
this.expandedCollapsibles = new Set();
|
|
12
|
-
this.multiple = false;
|
|
13
|
-
}
|
|
14
|
-
componentWillLoad() {
|
|
15
|
-
this.registerCollapsibles();
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Toggles the `post-collapsible` children with the given id.
|
|
19
|
-
*/
|
|
20
|
-
async toggle(id) {
|
|
21
|
-
const collapsibleToToggle = this.collapsibles
|
|
22
|
-
.find(collapsible => collapsible.id === id);
|
|
23
|
-
if (!collapsibleToToggle)
|
|
24
|
-
throw new Error(`No post-collapsible found with id #${id}.`);
|
|
25
|
-
await collapsibleToToggle.toggle();
|
|
26
|
-
}
|
|
27
|
-
collapseChangeHandler(event) {
|
|
28
|
-
const toggledCollapsible = event.target;
|
|
29
|
-
const isClosing = this.expandedCollapsibles.has(toggledCollapsible);
|
|
30
|
-
if (isClosing) {
|
|
31
|
-
this.expandedCollapsibles.delete(toggledCollapsible);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.expandedCollapsibles.add(toggledCollapsible);
|
|
35
|
-
}
|
|
36
|
-
if (this.multiple || isClosing)
|
|
37
|
-
return;
|
|
38
|
-
// close other open collapsible elements to have only one opened at a time
|
|
39
|
-
Array.from(this.expandedCollapsibles.values())
|
|
40
|
-
.filter(collapsible => collapsible !== toggledCollapsible)
|
|
41
|
-
.forEach(collapsible => {
|
|
42
|
-
void collapsible.toggle(false);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Expands all `post-collapsible` children.
|
|
47
|
-
*
|
|
48
|
-
* If `close-others` is `true` and all items are closed, it will open the first one.
|
|
49
|
-
* Otherwise, it will keep the opened one.
|
|
50
|
-
*/
|
|
51
|
-
async expandAll() {
|
|
52
|
-
if (this.multiple) {
|
|
53
|
-
await Promise.all(this.collapsibles.map(collapsible => collapsible.toggle(true)));
|
|
54
|
-
}
|
|
55
|
-
else if (!this.expandedCollapsibles.size) {
|
|
56
|
-
await this.collapsibles[0].toggle(true);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Collapses all `post-collapsible` children.
|
|
61
|
-
*/
|
|
62
|
-
async collapseAll() {
|
|
63
|
-
await Promise.all(this.collapsibles.map(collapsible => collapsible.toggle(false)));
|
|
64
|
-
}
|
|
65
|
-
registerCollapsibles() {
|
|
66
|
-
this.collapsibles = Array.from(this.host.querySelectorAll('post-collapsible'));
|
|
67
|
-
this.collapsibles
|
|
68
|
-
.filter(collapsible => {
|
|
69
|
-
return !collapsible.collapsed || this.expandedCollapsibles.has(collapsible);
|
|
70
|
-
}).forEach((collapsible, index) => {
|
|
71
|
-
if (!this.multiple && index !== 0) {
|
|
72
|
-
collapsible.setAttribute('collapsed', '');
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.expandedCollapsibles.add(collapsible);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
return (h(Host, { "data-version": version }, h("div", { class: "accordion" }, h("slot", { onSlotchange: () => this.registerCollapsibles() }))));
|
|
80
|
-
}
|
|
81
|
-
get host() { return this; }
|
|
82
|
-
static get style() { return postAccordionCss; }
|
|
83
|
-
}, [1, "post-accordion", {
|
|
84
|
-
"multiple": [4],
|
|
85
|
-
"toggle": [64],
|
|
86
|
-
"expandAll": [64],
|
|
87
|
-
"collapseAll": [64]
|
|
88
|
-
}, [[0, "collapseChange", "collapseChangeHandler"]]]);
|
|
89
|
-
function defineCustomElement$1() {
|
|
90
|
-
if (typeof customElements === "undefined") {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const components = ["post-accordion"];
|
|
94
|
-
components.forEach(tagName => { switch (tagName) {
|
|
95
|
-
case "post-accordion":
|
|
96
|
-
if (!customElements.get(tagName)) {
|
|
97
|
-
customElements.define(tagName, PostAccordion$1);
|
|
98
|
-
}
|
|
99
|
-
break;
|
|
100
|
-
} });
|
|
101
|
-
}
|
|
1
|
+
import { P as PostAccordion$1, d as defineCustomElement$1 } from './post-accordion2.js';
|
|
102
2
|
|
|
103
3
|
const PostAccordion = PostAccordion$1;
|
|
104
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"post-accordion.js","mappings":"
|
|
1
|
+
{"file":"post-accordion.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
|
|
4
|
+
const postAccordionCss = ":host{display:block}";
|
|
5
|
+
|
|
6
|
+
const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.expandedCollapsibles = new Set();
|
|
12
|
+
this.multiple = false;
|
|
13
|
+
}
|
|
14
|
+
componentWillLoad() {
|
|
15
|
+
this.registerCollapsibles();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Toggles the `post-collapsible` children with the given id.
|
|
19
|
+
*/
|
|
20
|
+
async toggle(id) {
|
|
21
|
+
const collapsibleToToggle = this.collapsibles
|
|
22
|
+
.find(collapsible => collapsible.id === id);
|
|
23
|
+
if (!collapsibleToToggle)
|
|
24
|
+
throw new Error(`No post-collapsible found with id #${id}.`);
|
|
25
|
+
await collapsibleToToggle.toggle();
|
|
26
|
+
}
|
|
27
|
+
collapseChangeHandler(event) {
|
|
28
|
+
const toggledCollapsible = event.target;
|
|
29
|
+
const isClosing = this.expandedCollapsibles.has(toggledCollapsible);
|
|
30
|
+
if (isClosing) {
|
|
31
|
+
this.expandedCollapsibles.delete(toggledCollapsible);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.expandedCollapsibles.add(toggledCollapsible);
|
|
35
|
+
}
|
|
36
|
+
if (this.multiple || isClosing)
|
|
37
|
+
return;
|
|
38
|
+
// close other open collapsible elements to have only one opened at a time
|
|
39
|
+
Array.from(this.expandedCollapsibles.values())
|
|
40
|
+
.filter(collapsible => collapsible !== toggledCollapsible)
|
|
41
|
+
.forEach(collapsible => {
|
|
42
|
+
void collapsible.toggle(false);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Expands all `post-collapsible` children.
|
|
47
|
+
*
|
|
48
|
+
* If `close-others` is `true` and all items are closed, it will open the first one.
|
|
49
|
+
* Otherwise, it will keep the opened one.
|
|
50
|
+
*/
|
|
51
|
+
async expandAll() {
|
|
52
|
+
if (this.multiple) {
|
|
53
|
+
await Promise.all(this.collapsibles.map(collapsible => collapsible.toggle(true)));
|
|
54
|
+
}
|
|
55
|
+
else if (!this.expandedCollapsibles.size) {
|
|
56
|
+
await this.collapsibles[0].toggle(true);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Collapses all `post-collapsible` children.
|
|
61
|
+
*/
|
|
62
|
+
async collapseAll() {
|
|
63
|
+
await Promise.all(this.collapsibles.map(collapsible => collapsible.toggle(false)));
|
|
64
|
+
}
|
|
65
|
+
registerCollapsibles() {
|
|
66
|
+
this.collapsibles = Array.from(this.host.querySelectorAll('post-collapsible'));
|
|
67
|
+
this.collapsibles
|
|
68
|
+
.filter(collapsible => {
|
|
69
|
+
return !collapsible.collapsed || this.expandedCollapsibles.has(collapsible);
|
|
70
|
+
}).forEach((collapsible, index) => {
|
|
71
|
+
if (!this.multiple && index !== 0) {
|
|
72
|
+
collapsible.setAttribute('collapsed', '');
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.expandedCollapsibles.add(collapsible);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (h(Host, { "data-version": version }, h("div", { class: "accordion" }, h("slot", { onSlotchange: () => this.registerCollapsibles() }))));
|
|
80
|
+
}
|
|
81
|
+
get host() { return this; }
|
|
82
|
+
static get style() { return postAccordionCss; }
|
|
83
|
+
}, [1, "post-accordion", {
|
|
84
|
+
"multiple": [4],
|
|
85
|
+
"toggle": [64],
|
|
86
|
+
"expandAll": [64],
|
|
87
|
+
"collapseAll": [64]
|
|
88
|
+
}, [[0, "collapseChange", "collapseChangeHandler"]]]);
|
|
89
|
+
function defineCustomElement() {
|
|
90
|
+
if (typeof customElements === "undefined") {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const components = ["post-accordion"];
|
|
94
|
+
components.forEach(tagName => { switch (tagName) {
|
|
95
|
+
case "post-accordion":
|
|
96
|
+
if (!customElements.get(tagName)) {
|
|
97
|
+
customElements.define(tagName, PostAccordion);
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
} });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { PostAccordion as P, defineCustomElement as d };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=post-accordion2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"post-accordion2.js","mappings":"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","names":[],"sources":["src/components/post-accordion/post-accordion.scss?tag=post-accordion&encapsulation=shadow","src/components/post-accordion/post-accordion.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Element, h, Host, Listen, Method, Prop } from '@stencil/core';\nimport { version } from '../../../package.json';\n\n@Component({\n tag: 'post-accordion',\n styleUrl: 'post-accordion.scss',\n shadow: true,\n})\nexport class PostAccordion {\n private collapsibles: HTMLPostCollapsibleElement[];\n private expandedCollapsibles = new Set<HTMLPostCollapsibleElement>();\n\n @Element() host: HTMLPostAccordionElement;\n\n /**\n * If `true`, multiple `post-collapsible` can be open at the same time.\n */\n @Prop() readonly multiple: boolean = false;\n\n componentWillLoad() {\n this.registerCollapsibles();\n }\n\n /**\n * Toggles the `post-collapsible` children with the given id.\n */\n @Method()\n async toggle(id: string) {\n const collapsibleToToggle = this.collapsibles\n .find(collapsible => collapsible.id === id);\n\n if (!collapsibleToToggle) throw new Error(`No post-collapsible found with id #${id}.`);\n\n await collapsibleToToggle.toggle();\n }\n\n @Listen('collapseChange')\n collapseChangeHandler(event: CustomEvent) {\n const toggledCollapsible = event.target as HTMLPostCollapsibleElement;\n const isClosing = this.expandedCollapsibles.has(toggledCollapsible);\n\n if (isClosing) {\n this.expandedCollapsibles.delete(toggledCollapsible);\n } else {\n this.expandedCollapsibles.add(toggledCollapsible);\n }\n\n if (this.multiple || isClosing) return;\n\n // close other open collapsible elements to have only one opened at a time\n Array.from(this.expandedCollapsibles.values())\n .filter(collapsible => collapsible !== toggledCollapsible)\n .forEach(collapsible => {\n void collapsible.toggle(false);\n });\n }\n\n /**\n * Expands all `post-collapsible` children.\n *\n * If `close-others` is `true` and all items are closed, it will open the first one.\n * Otherwise, it will keep the opened one.\n */\n @Method()\n async expandAll() {\n if (this.multiple) {\n await Promise.all(\n this.collapsibles.map(collapsible => collapsible.toggle(true))\n );\n } else if (!this.expandedCollapsibles.size) {\n await this.collapsibles[0].toggle(true);\n }\n }\n\n /**\n * Collapses all `post-collapsible` children.\n */\n @Method()\n async collapseAll() {\n await Promise.all(\n this.collapsibles.map(collapsible => collapsible.toggle(false))\n );\n }\n\n private registerCollapsibles() {\n this.collapsibles = Array.from(\n this.host.querySelectorAll('post-collapsible')\n );\n\n this.collapsibles\n .filter(collapsible => {\n return !collapsible.collapsed || this.expandedCollapsibles.has(collapsible);\n }).forEach((collapsible, index) => {\n if (!this.multiple && index !== 0) {\n collapsible.setAttribute('collapsed', '');\n return;\n }\n\n this.expandedCollapsibles.add(collapsible);\n });\n }\n\n render() {\n return (\n <Host data-version={version}>\n <div class=\"accordion\">\n <slot onSlotchange={() => this.registerCollapsibles()}/>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
|
|
|
2
2
|
|
|
3
3
|
interface PostAlert extends Components.PostAlert, HTMLElement {}
|
|
4
4
|
export const PostAlert: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
prototype: PostAlert;
|
|
6
|
+
new (): PostAlert;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|