@swisspost/design-system-components 1.6.3 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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} +144 -65
- 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-989e0b36.js +7 -0
- package/dist/cjs/package-989e0b36.js.map +1 -0
- package/dist/cjs/post-accordion-bc0c6f31.js +87 -0
- package/dist/cjs/post-accordion-bc0c6f31.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-39ac30a4.js +101 -0
- package/dist/cjs/{post-alert-b46943e0.js.map → post-alert-39ac30a4.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-85f8ace5.js} +69 -69
- package/dist/cjs/{post-collapsible-04364cda.js.map → post-collapsible-85f8ace5.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-53e50c15.js +105 -0
- package/dist/cjs/post-icon-53e50c15.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-5a75c1b2.js +118 -0
- package/dist/cjs/post-popover-5a75c1b2.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-84378594.js +1878 -0
- package/dist/cjs/post-popovercontainer-84378594.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-02c6e31e.js +33 -0
- package/dist/cjs/{post-tab-header-805c0a52.js.map → post-tab-header-02c6e31e.js.map} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-panel-3973b707.js +27 -0
- package/dist/cjs/{post-tab-panel-caa44a77.js.map → post-tab-panel-3973b707.js.map} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs-7a4fead7.js +153 -0
- package/dist/cjs/post-tabs-7a4fead7.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tooltip-32a9c549.js → post-tooltip-79a9c96d.js} +78 -1754
- package/dist/cjs/post-tooltip-79a9c96d.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} +144 -65
- 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-e13ef9ad.js +5 -0
- package/dist/esm/package-e13ef9ad.js.map +1 -0
- package/dist/esm/post-accordion-8e96598a.js +85 -0
- package/dist/esm/post-accordion-8e96598a.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-5e352303.js +99 -0
- package/dist/esm/{post-alert-e457e249.js.map → post-alert-5e352303.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-3cc5dd87.js} +69 -69
- package/dist/esm/{post-collapsible-c0a826b2.js.map → post-collapsible-3cc5dd87.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-fdda3f99.js +103 -0
- package/dist/esm/post-icon-fdda3f99.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-ff2c259f.js +116 -0
- package/dist/esm/post-popover-ff2c259f.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-f4cd18cd.js +1876 -0
- package/dist/esm/post-popovercontainer-f4cd18cd.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-486b267b.js +31 -0
- package/dist/esm/{post-tab-header-f0c355d6.js.map → post-tab-header-486b267b.js.map} +1 -1
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel-13940300.js +25 -0
- package/dist/esm/{post-tab-panel-46f02247.js.map → post-tab-panel-13940300.js.map} +1 -1
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs-6f44ed1d.js +151 -0
- package/dist/esm/post-tabs-6f44ed1d.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tooltip-fa7b4a0a.js → post-tooltip-1d99cd0c.js} +78 -1754
- package/dist/esm/post-tooltip-1d99cd0c.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-169b8ef7.entry.js +2 -0
- package/dist/post-components/p-28be44d7.js +2 -0
- package/dist/post-components/{p-8b6fe20d.js.map → p-28be44d7.js.map} +1 -1
- package/dist/post-components/p-3ef3a1d2.js +2 -0
- package/dist/post-components/p-3ef3a1d2.js.map +1 -0
- package/dist/post-components/p-4b94c2a1.entry.js +2 -0
- package/dist/post-components/p-4cbb5212.entry.js +2 -0
- package/dist/post-components/p-51ae6f46.entry.js +2 -0
- package/dist/post-components/p-668bf58c.entry.js +2 -0
- package/dist/post-components/p-67d0a4fa.entry.js +2 -0
- package/dist/post-components/p-6b3a5063.entry.js +2 -0
- package/dist/post-components/{p-3604be27.js → p-6cdc82c6.js} +2 -2
- package/dist/post-components/p-723336f2.js +2 -0
- package/dist/post-components/{p-ca1e407c.js.map → p-723336f2.js.map} +1 -1
- package/dist/post-components/p-7d08e4f1.js +2 -0
- package/dist/post-components/p-7d08e4f1.js.map +1 -0
- 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-9b1b6e06.entry.js +2 -0
- package/dist/post-components/{p-9f71d450.js → p-a5a23448.js} +2 -2
- package/dist/post-components/p-aca6e9c1.js +2 -0
- package/dist/post-components/{p-fffce1d7.js.map → p-aca6e9c1.js.map} +1 -1
- package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
- package/dist/post-components/p-bc27f061.js +9 -0
- package/dist/post-components/p-bc27f061.js.map +1 -0
- package/dist/post-components/p-bd1d0117.js +2 -0
- package/dist/post-components/p-bd1d0117.js.map +1 -0
- package/dist/post-components/p-d3ed113e.js +2 -0
- package/dist/post-components/p-d3ed113e.js.map +1 -0
- package/dist/post-components/p-d8365401.entry.js +2 -0
- package/dist/post-components/p-d8365401.entry.js.map +1 -0
- package/dist/post-components/p-e78d158d.entry.js +2 -0
- package/dist/post-components/p-e78d158d.entry.js.map +1 -0
- package/dist/post-components/{p-7b8797c6.entry.js → p-f695aab4.js} +2 -2
- 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-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-169b8ef7.entry.js.map} +0 -0
- /package/dist/post-components/{p-3225e008.entry.js.map → p-4b94c2a1.entry.js.map} +0 -0
- /package/dist/post-components/{p-61ffffa9.entry.js.map → p-4cbb5212.entry.js.map} +0 -0
- /package/dist/post-components/{p-88262544.js.map → p-51ae6f46.entry.js.map} +0 -0
- /package/dist/post-components/{p-a7c78dea.entry.js.map → p-668bf58c.entry.js.map} +0 -0
- /package/dist/post-components/{p-b2c3ed97.entry.js.map → p-67d0a4fa.entry.js.map} +0 -0
- /package/dist/post-components/{p-ba9aba3a.entry.js.map → p-6b3a5063.entry.js.map} +0 -0
- /package/dist/post-components/{p-3604be27.js.map → p-6cdc82c6.js.map} +0 -0
- /package/dist/post-components/{p-bd293ff3.entry.js.map → p-9b1b6e06.entry.js.map} +0 -0
- /package/dist/post-components/{p-9f71d450.js.map → p-a5a23448.js.map} +0 -0
- /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
- /package/dist/post-components/{p-7b8797c6.entry.js.map → p-f695aab4.js.map} +0 -0
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
const constants = require('./constants-238701d3.js');
|
|
4
4
|
|
|
5
5
|
function checkNonEmpty(value, error) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
if (constants.EMPTY_VALUES.some(v => v === value)) {
|
|
7
|
+
throw new Error(error);
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
exports.checkNonEmpty = checkNonEmpty;
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=check-non-empty-
|
|
13
|
+
//# sourceMappingURL=check-non-empty-eeaa8f77.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"check-non-empty-eeaa8f77.js","mappings":";;;;SAEgB,aAAa,CAAC,KAAc,EAAE,KAAa;IACzD,IAAIA,sBAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH;;;;","names":["EMPTY_VALUES"],"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}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const constants = require('./constants-238701d3.js');
|
|
4
|
+
|
|
5
|
+
function emptyOr(check) {
|
|
6
|
+
return (...args) => {
|
|
7
|
+
const value = args[0];
|
|
8
|
+
if (!constants.EMPTY_VALUES.some(v => v === value))
|
|
9
|
+
check(...args);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function checkOneOf(value, possibleValues, error) {
|
|
14
|
+
if (!possibleValues.includes(value))
|
|
15
|
+
throw new Error(error);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function checkPattern(value, pattern, errorMessage) {
|
|
19
|
+
if (typeof value !== 'string' || !pattern.test(value))
|
|
20
|
+
throw new Error(errorMessage);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function checkType(value, type, error) {
|
|
24
|
+
const typeIsArray = type === 'array';
|
|
25
|
+
const valueIsArray = Array.isArray(value);
|
|
26
|
+
if (typeIsArray || valueIsArray) {
|
|
27
|
+
if (valueIsArray !== typeIsArray)
|
|
28
|
+
throw new Error(error);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (typeof value !== type)
|
|
32
|
+
throw new Error(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
37
|
+
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
38
|
+
const checkEmptyOrType = emptyOr(checkType);
|
|
39
|
+
|
|
40
|
+
exports.checkEmptyOrOneOf = checkEmptyOrOneOf;
|
|
41
|
+
exports.checkEmptyOrPattern = checkEmptyOrPattern;
|
|
42
|
+
exports.checkEmptyOrType = checkEmptyOrType;
|
|
43
|
+
exports.checkType = checkType;
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=index-8c288b1a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index-8c288b1a.js","mappings":";;;;SAEgB,OAAO,CAAsB,KAA2B;IACtE,OAAO,CAAC,GAAG,IAAO;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAACA,sBAAY,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":["EMPTY_VALUES"],"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}
|
|
@@ -49,6 +49,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
52
|
+
/**
|
|
53
|
+
* Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
|
|
54
|
+
*
|
|
55
|
+
* Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
|
|
56
|
+
* support as of Stencil v4.
|
|
57
|
+
*/
|
|
58
|
+
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
52
59
|
/**
|
|
53
60
|
* Default style mode id
|
|
54
61
|
*/
|
|
@@ -57,11 +64,6 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
|
57
64
|
* Don't add values to these!!
|
|
58
65
|
*/
|
|
59
66
|
const EMPTY_OBJ = {};
|
|
60
|
-
/**
|
|
61
|
-
* Namespaces
|
|
62
|
-
*/
|
|
63
|
-
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
64
|
-
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
65
67
|
const isDef = (v) => v != null;
|
|
66
68
|
/**
|
|
67
69
|
* Check whether a value is a 'complex type', defined here as an object or a
|
|
@@ -358,6 +360,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
358
360
|
}
|
|
359
361
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
360
362
|
}
|
|
363
|
+
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
364
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
365
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
366
|
+
}
|
|
361
367
|
if (appliedStyles) {
|
|
362
368
|
appliedStyles.add(scopeId);
|
|
363
369
|
}
|
|
@@ -488,11 +494,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
488
494
|
// except for the first character, we keep the event name case
|
|
489
495
|
memberName = ln[2] + memberName.slice(3);
|
|
490
496
|
}
|
|
491
|
-
if (oldValue) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
497
|
+
if (oldValue || newValue) {
|
|
498
|
+
// Need to account for "capture" events.
|
|
499
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
500
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
501
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
502
|
+
// Make sure we only replace the last instance of "Capture"
|
|
503
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
504
|
+
if (oldValue) {
|
|
505
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
506
|
+
}
|
|
507
|
+
if (newValue) {
|
|
508
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
509
|
+
}
|
|
496
510
|
}
|
|
497
511
|
}
|
|
498
512
|
else {
|
|
@@ -514,7 +528,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
514
528
|
elm[memberName] = newValue;
|
|
515
529
|
}
|
|
516
530
|
}
|
|
517
|
-
catch (e) {
|
|
531
|
+
catch (e) {
|
|
532
|
+
/**
|
|
533
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
534
|
+
*/
|
|
535
|
+
}
|
|
518
536
|
}
|
|
519
537
|
if (newValue == null || newValue === false) {
|
|
520
538
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
@@ -533,7 +551,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
533
551
|
}
|
|
534
552
|
};
|
|
535
553
|
const parseClassListRegex = /\s/;
|
|
554
|
+
/**
|
|
555
|
+
* Parsed a string of classnames into an array
|
|
556
|
+
* @param value className string, e.g. "foo bar baz"
|
|
557
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
558
|
+
*/
|
|
536
559
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
560
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
561
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
537
562
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
538
563
|
// if the element passed in is a shadow root, which is a document fragment
|
|
539
564
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -577,15 +602,8 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
577
602
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
578
603
|
}
|
|
579
604
|
else {
|
|
580
|
-
if (!isSvgMode) {
|
|
581
|
-
isSvgMode = newVNode.$tag$ === 'svg';
|
|
582
|
-
}
|
|
583
605
|
// create element
|
|
584
|
-
elm = newVNode.$elm$ = (doc.
|
|
585
|
-
);
|
|
586
|
-
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
587
|
-
isSvgMode = false;
|
|
588
|
-
}
|
|
606
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
|
|
589
607
|
// add css classes, attrs, props, listeners, etc.
|
|
590
608
|
{
|
|
591
609
|
updateElement(null, newVNode, isSvgMode);
|
|
@@ -606,17 +624,10 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
606
624
|
}
|
|
607
625
|
}
|
|
608
626
|
}
|
|
609
|
-
{
|
|
610
|
-
if (newVNode.$tag$ === 'svg') {
|
|
611
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
612
|
-
isSvgMode = false;
|
|
613
|
-
}
|
|
614
|
-
else if (elm.tagName === 'foreignObject') {
|
|
615
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
616
|
-
isSvgMode = true;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
627
|
}
|
|
628
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
629
|
+
// to another component but don't end up in a slot
|
|
630
|
+
elm['s-hn'] = hostTagName;
|
|
620
631
|
return elm;
|
|
621
632
|
};
|
|
622
633
|
/**
|
|
@@ -741,8 +752,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
741
752
|
* @param oldCh the old children of the parent node
|
|
742
753
|
* @param newVNode the new VNode which will replace the parent
|
|
743
754
|
* @param newCh the new children of the parent node
|
|
755
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
744
756
|
*/
|
|
745
|
-
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
757
|
+
const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
|
|
746
758
|
let oldStartIdx = 0;
|
|
747
759
|
let newStartIdx = 0;
|
|
748
760
|
let idxInOld = 0;
|
|
@@ -769,25 +781,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
769
781
|
else if (newEndVnode == null) {
|
|
770
782
|
newEndVnode = newCh[--newEndIdx];
|
|
771
783
|
}
|
|
772
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
784
|
+
else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
773
785
|
// if the start nodes are the same then we should patch the new VNode
|
|
774
786
|
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
775
787
|
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
776
788
|
// since things are matched up in order.
|
|
777
|
-
patch(oldStartVnode, newStartVnode);
|
|
789
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
778
790
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
779
791
|
newStartVnode = newCh[++newStartIdx];
|
|
780
792
|
}
|
|
781
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
793
|
+
else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
782
794
|
// likewise, if the end nodes are the same we patch new onto old and
|
|
783
795
|
// decrement our end indices, and also likewise in this case we don't
|
|
784
796
|
// need to move any DOM Nodes.
|
|
785
|
-
patch(oldEndVnode, newEndVnode);
|
|
797
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
786
798
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
787
799
|
newEndVnode = newCh[--newEndIdx];
|
|
788
800
|
}
|
|
789
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
790
|
-
patch(oldStartVnode, newEndVnode);
|
|
801
|
+
else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
802
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
791
803
|
// We need to move the element for `oldStartVnode` into a position which
|
|
792
804
|
// will be appropriate for `newEndVnode`. For this we can use
|
|
793
805
|
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
@@ -809,8 +821,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
809
821
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
810
822
|
newEndVnode = newCh[--newEndIdx];
|
|
811
823
|
}
|
|
812
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
813
|
-
patch(oldEndVnode, newStartVnode);
|
|
824
|
+
else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
825
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
814
826
|
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
815
827
|
// the same node, so since we're here we know that they are not. Thus we
|
|
816
828
|
// can move the element for `oldEndVnode` _before_ the element for
|
|
@@ -847,7 +859,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
847
859
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
848
860
|
}
|
|
849
861
|
else {
|
|
850
|
-
patch(elmToMove, newStartVnode);
|
|
862
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
851
863
|
// invalidate the matching old node so that we won't try to update it
|
|
852
864
|
// again later on
|
|
853
865
|
oldCh[idxInOld] = undefined;
|
|
@@ -898,16 +910,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
898
910
|
*
|
|
899
911
|
* @param leftVNode the first VNode to check
|
|
900
912
|
* @param rightVNode the second VNode to check
|
|
913
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
901
914
|
* @returns whether they're equal or not
|
|
902
915
|
*/
|
|
903
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
916
|
+
const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
904
917
|
// compare if two vnode to see if they're "technically" the same
|
|
905
918
|
// need to have the same element tag, and same key to be the same
|
|
906
919
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
907
|
-
// this will be set if
|
|
908
|
-
|
|
920
|
+
// this will be set if JSX tags in the build have `key` attrs set on them
|
|
921
|
+
// we only want to check this if we're not on the first render since on
|
|
922
|
+
// first render `leftVNode.$key$` will always be `null`, so we can be led
|
|
923
|
+
// astray and, for instance, accidentally delete a DOM node that we want to
|
|
924
|
+
// keep around.
|
|
925
|
+
if (!isInitialRender) {
|
|
909
926
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
910
927
|
}
|
|
928
|
+
return true;
|
|
911
929
|
}
|
|
912
930
|
return false;
|
|
913
931
|
};
|
|
@@ -918,19 +936,15 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
918
936
|
*
|
|
919
937
|
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
920
938
|
* @param newVNode a new VNode representing an updated version of the old one
|
|
939
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
921
940
|
*/
|
|
922
|
-
const patch = (oldVNode, newVNode) => {
|
|
941
|
+
const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
923
942
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
924
943
|
const oldChildren = oldVNode.$children$;
|
|
925
944
|
const newChildren = newVNode.$children$;
|
|
926
945
|
const tag = newVNode.$tag$;
|
|
927
946
|
const text = newVNode.$text$;
|
|
928
947
|
if (text === null) {
|
|
929
|
-
{
|
|
930
|
-
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
931
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
932
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
933
|
-
}
|
|
934
948
|
{
|
|
935
949
|
if (tag === 'slot')
|
|
936
950
|
;
|
|
@@ -944,7 +958,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
944
958
|
if (oldChildren !== null && newChildren !== null) {
|
|
945
959
|
// looks like there's child vnodes for both the old and new vnodes
|
|
946
960
|
// so we need to call `updateChildren` to reconcile them
|
|
947
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
961
|
+
updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
|
|
948
962
|
}
|
|
949
963
|
else if (newChildren !== null) {
|
|
950
964
|
// no old child vnodes, but there are new child vnodes to add
|
|
@@ -959,9 +973,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
959
973
|
// no new child vnodes, but there are old child vnodes to remove
|
|
960
974
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
961
975
|
}
|
|
962
|
-
if (isSvgMode && tag === 'svg') {
|
|
963
|
-
isSvgMode = false;
|
|
964
|
-
}
|
|
965
976
|
}
|
|
966
977
|
else if (oldVNode.$text$ !== text) {
|
|
967
978
|
// update the text content for the text only vnode
|
|
@@ -1034,7 +1045,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1034
1045
|
scopeId = hostElm['s-sc'];
|
|
1035
1046
|
}
|
|
1036
1047
|
// synchronous patch
|
|
1037
|
-
patch(oldVNode, rootVnode);
|
|
1048
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1038
1049
|
};
|
|
1039
1050
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1040
1051
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
@@ -1351,13 +1362,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1351
1362
|
*/
|
|
1352
1363
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1353
1364
|
var _a;
|
|
1365
|
+
const prototype = Cstr.prototype;
|
|
1354
1366
|
if (cmpMeta.$members$) {
|
|
1355
1367
|
if (Cstr.watchers) {
|
|
1356
1368
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1357
1369
|
}
|
|
1358
1370
|
// It's better to have a const than two Object.entries()
|
|
1359
1371
|
const members = Object.entries(cmpMeta.$members$);
|
|
1360
|
-
const prototype = Cstr.prototype;
|
|
1361
1372
|
members.map(([memberName, [memberFlags]]) => {
|
|
1362
1373
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1363
1374
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1380,8 +1391,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1380
1391
|
// proxyComponent - method
|
|
1381
1392
|
Object.defineProperty(prototype, memberName, {
|
|
1382
1393
|
value(...args) {
|
|
1394
|
+
var _a;
|
|
1383
1395
|
const ref = getHostRef(this);
|
|
1384
|
-
return ref.$onInstancePromise
|
|
1396
|
+
return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
|
|
1385
1397
|
},
|
|
1386
1398
|
});
|
|
1387
1399
|
}
|
|
@@ -1390,6 +1402,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1390
1402
|
const attrNameToPropName = new Map();
|
|
1391
1403
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1392
1404
|
plt.jmp(() => {
|
|
1405
|
+
var _a;
|
|
1393
1406
|
const propName = attrNameToPropName.get(attrName);
|
|
1394
1407
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1395
1408
|
// in the case where an attribute was set inline.
|
|
@@ -1445,11 +1458,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1445
1458
|
// 1. The instance is ready
|
|
1446
1459
|
// 2. The watchers are ready
|
|
1447
1460
|
// 3. The value has changed
|
|
1448
|
-
if (
|
|
1461
|
+
if (flags &&
|
|
1462
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1449
1463
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1450
1464
|
newValue !== oldValue) {
|
|
1451
1465
|
const instance = hostRef.$lazyInstance$ ;
|
|
1452
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1466
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1453
1467
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1454
1468
|
if (instance[callbackName] != null) {
|
|
1455
1469
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
@@ -1659,12 +1673,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1659
1673
|
const customElements = win.customElements;
|
|
1660
1674
|
const head = doc.head;
|
|
1661
1675
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1662
|
-
const
|
|
1676
|
+
const dataStyles = /*@__PURE__*/ doc.createElement('style');
|
|
1663
1677
|
const deferredConnectedCallbacks = [];
|
|
1664
1678
|
let appLoadFallback;
|
|
1665
1679
|
let isBootstrapping = true;
|
|
1666
1680
|
Object.assign(plt, options);
|
|
1667
1681
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1682
|
+
let hasSlotRelocation = false;
|
|
1668
1683
|
lazyBundles.map((lazyBundle) => {
|
|
1669
1684
|
lazyBundle[1].map((compactMeta) => {
|
|
1670
1685
|
var _a;
|
|
@@ -1674,6 +1689,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1674
1689
|
$members$: compactMeta[2],
|
|
1675
1690
|
$listeners$: compactMeta[3],
|
|
1676
1691
|
};
|
|
1692
|
+
// Check if we are using slots outside the shadow DOM in this component.
|
|
1693
|
+
// We'll use this information later to add styles for `slot-fb` elements
|
|
1694
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
1695
|
+
hasSlotRelocation = true;
|
|
1696
|
+
}
|
|
1677
1697
|
{
|
|
1678
1698
|
cmpMeta.$members$ = compactMeta[2];
|
|
1679
1699
|
}
|
|
@@ -1730,15 +1750,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1730
1750
|
}
|
|
1731
1751
|
});
|
|
1732
1752
|
});
|
|
1753
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
1754
|
+
if (hasSlotRelocation) {
|
|
1755
|
+
dataStyles.innerHTML += SLOT_FB_CSS;
|
|
1756
|
+
}
|
|
1757
|
+
// Add hydration styles
|
|
1733
1758
|
{
|
|
1734
|
-
|
|
1735
|
-
|
|
1759
|
+
dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
|
|
1760
|
+
}
|
|
1761
|
+
// If we have styles, add them to the DOM
|
|
1762
|
+
if (dataStyles.innerHTML.length) {
|
|
1763
|
+
dataStyles.setAttribute('data-styles', '');
|
|
1736
1764
|
// Apply CSP nonce to the style tag if it exists
|
|
1737
1765
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1738
1766
|
if (nonce != null) {
|
|
1739
|
-
|
|
1767
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
1740
1768
|
}
|
|
1741
|
-
|
|
1769
|
+
// Insert the styles into the document head
|
|
1770
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
1771
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1742
1772
|
}
|
|
1743
1773
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1744
1774
|
isBootstrapping = false;
|
|
@@ -1848,7 +1878,56 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1848
1878
|
if (module) {
|
|
1849
1879
|
return module[exportName];
|
|
1850
1880
|
}
|
|
1851
|
-
|
|
1881
|
+
|
|
1882
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1883
|
+
const processMod = importedModule => {
|
|
1884
|
+
cmpModules.set(bundleId, importedModule);
|
|
1885
|
+
return importedModule[exportName];
|
|
1886
|
+
}
|
|
1887
|
+
switch(bundleId) {
|
|
1888
|
+
|
|
1889
|
+
case 'post-accordion.cjs':
|
|
1890
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1891
|
+
/* webpackMode: "lazy" */
|
|
1892
|
+
'./post-accordion.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1893
|
+
case 'post-alert.cjs':
|
|
1894
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1895
|
+
/* webpackMode: "lazy" */
|
|
1896
|
+
'./post-alert.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1897
|
+
case 'post-collapsible.cjs':
|
|
1898
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1899
|
+
/* webpackMode: "lazy" */
|
|
1900
|
+
'./post-collapsible.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1901
|
+
case 'post-popover.cjs':
|
|
1902
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1903
|
+
/* webpackMode: "lazy" */
|
|
1904
|
+
'./post-popover.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1905
|
+
case 'post-tab-header.cjs':
|
|
1906
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1907
|
+
/* webpackMode: "lazy" */
|
|
1908
|
+
'./post-tab-header.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1909
|
+
case 'post-tab-panel.cjs':
|
|
1910
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1911
|
+
/* webpackMode: "lazy" */
|
|
1912
|
+
'./post-tab-panel.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1913
|
+
case 'post-tabs.cjs':
|
|
1914
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1915
|
+
/* webpackMode: "lazy" */
|
|
1916
|
+
'./post-tabs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1917
|
+
case 'post-tooltip.cjs':
|
|
1918
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1919
|
+
/* webpackMode: "lazy" */
|
|
1920
|
+
'./post-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1921
|
+
case 'post-icon.cjs':
|
|
1922
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1923
|
+
/* webpackMode: "lazy" */
|
|
1924
|
+
'./post-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1925
|
+
case 'post-popovercontainer.cjs':
|
|
1926
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1927
|
+
/* webpackMode: "lazy" */
|
|
1928
|
+
'./post-popovercontainer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1852
1931
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1853
1932
|
/* @vite-ignore */
|
|
1854
1933
|
/* webpackInclude: /\.entry\.js$/ */
|
|
@@ -1923,7 +2002,7 @@ const flush = () => {
|
|
|
1923
2002
|
}
|
|
1924
2003
|
}
|
|
1925
2004
|
};
|
|
1926
|
-
const nextTick =
|
|
2005
|
+
const nextTick = (cb) => promiseResolve().then(cb);
|
|
1927
2006
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1928
2007
|
|
|
1929
2008
|
exports.Host = Host;
|
|
@@ -1935,4 +2014,4 @@ exports.promiseResolve = promiseResolve;
|
|
|
1935
2014
|
exports.registerInstance = registerInstance;
|
|
1936
2015
|
exports.setNonce = setNonce;
|
|
1937
2016
|
|
|
1938
|
-
//# sourceMappingURL=index-
|
|
2017
|
+
//# sourceMappingURL=index-c07c0cdb.js.map
|