@swisspost/design-system-components 1.6.2 → 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-e7618bb3.js → index-c07c0cdb.js} +79 -59
- 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-1fb90f2d.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-0b8dce97.js +93 -0
- package/dist/cjs/post-collapsible-0b8dce97.js.map +1 -0
- 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-a3845fe5.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-b7326ff8.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-2becc97a.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.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +170 -169
- 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 +91 -91
- 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 +610 -78
- 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-08d62a75.js → index-35998e08.js} +79 -59
- 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-46926902.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-4464cc98.js +91 -0
- package/dist/esm/post-collapsible-4464cc98.js.map +1 -0
- 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-84b12382.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-216c0b6e.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-47f2146d.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-57b48dff.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-21549a50.js.map → p-6e3158e8.js.map} +1 -1
- package/dist/post-components/p-7d32dfb7.js +2 -0
- package/dist/post-components/{p-57fdeeab.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-ce907090.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-eaddd6cc.js +2 -0
- package/dist/post-components/p-eaddd6cc.js.map +1 -0
- 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 +16 -14
- 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-e7618bb3.js.map +0 -1
- package/dist/cjs/package-041a8597.js +0 -7
- package/dist/cjs/package-041a8597.js.map +0 -1
- package/dist/cjs/post-alert-1fb90f2d.js +0 -101
- package/dist/cjs/post-collapsible-e46002bb.js +0 -93
- package/dist/cjs/post-collapsible-e46002bb.js.map +0 -1
- package/dist/cjs/post-icon-91f6603a.js +0 -105
- package/dist/cjs/post-icon-91f6603a.js.map +0 -1
- package/dist/cjs/post-tab-header-a3845fe5.js +0 -33
- package/dist/cjs/post-tab-panel-b7326ff8.js +0 -27
- package/dist/cjs/post-tabs-384a1fab.js +0 -153
- package/dist/cjs/post-tabs-384a1fab.js.map +0 -1
- package/dist/cjs/post-tooltip-2becc97a.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-08d62a75.js.map +0 -1
- package/dist/esm/index-35921354.js +0 -36
- package/dist/esm/index-35921354.js.map +0 -1
- package/dist/esm/package-a962a93d.js +0 -5
- package/dist/esm/package-a962a93d.js.map +0 -1
- package/dist/esm/post-alert-46926902.js +0 -99
- package/dist/esm/post-collapsible-f1b6592d.js +0 -91
- package/dist/esm/post-collapsible-f1b6592d.js.map +0 -1
- package/dist/esm/post-icon-fb627697.js +0 -103
- package/dist/esm/post-icon-fb627697.js.map +0 -1
- package/dist/esm/post-tab-header-84b12382.js +0 -31
- package/dist/esm/post-tab-panel-216c0b6e.js +0 -25
- package/dist/esm/post-tabs-e235d663.js +0 -151
- package/dist/esm/post-tabs-e235d663.js.map +0 -1
- package/dist/esm/post-tooltip-47f2146d.js.map +0 -1
- package/dist/post-components/p-03fe58da.js +0 -2
- package/dist/post-components/p-03fe58da.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-151b55c0.entry.js +0 -2
- package/dist/post-components/p-21549a50.js +0 -2
- package/dist/post-components/p-4cb18ddf.js +0 -9
- package/dist/post-components/p-4cb18ddf.js.map +0 -1
- package/dist/post-components/p-4e24f13b.entry.js +0 -2
- package/dist/post-components/p-57b48dff.js +0 -2
- package/dist/post-components/p-57fdeeab.js +0 -2
- package/dist/post-components/p-58cc7b5a.entry.js +0 -2
- package/dist/post-components/p-6cafa644.entry.js +0 -2
- package/dist/post-components/p-7f370d77.entry.js +0 -2
- package/dist/post-components/p-7f4eba57.js +0 -2
- package/dist/post-components/p-8c006e7d.js +0 -3
- package/dist/post-components/p-8c006e7d.js.map +0 -1
- package/dist/post-components/p-aee47e1a.entry.js +0 -2
- package/dist/post-components/p-b5e1fd89.js +0 -2
- package/dist/post-components/p-b5e1fd89.js.map +0 -1
- package/dist/post-components/p-d13111f2.js +0 -2
- package/dist/post-components/p-dfe29f7f.js +0 -2
- package/dist/post-components/p-dfe29f7f.js.map +0 -1
- package/dist/post-components/p-f35c2075.entry.js +0 -2
- /package/dist/post-components/{p-151b55c0.entry.js.map → p-05e85f2b.entry.js.map} +0 -0
- /package/dist/post-components/{p-4e24f13b.entry.js.map → p-08abd53e.entry.js.map} +0 -0
- /package/dist/post-components/{p-58cc7b5a.entry.js.map → p-1e9ec4a9.entry.js.map} +0 -0
- /package/dist/post-components/{p-6cafa644.entry.js.map → p-30c60b6c.entry.js.map} +0 -0
- /package/dist/post-components/{p-7f370d77.entry.js.map → p-38d97f62.entry.js.map} +0 -0
- /package/dist/post-components/{p-aee47e1a.entry.js.map → p-4c188911.entry.js.map} +0 -0
- /package/dist/post-components/{p-d13111f2.js.map → p-568bb469.entry.js.map} +0 -0
- /package/dist/post-components/{p-f35c2075.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-7f4eba57.js.map → p-b4b4f59a.js.map} +0 -0
- /package/dist/post-components/{p-ce907090.entry.js.map → p-dbd07f20.js.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { E as EMPTY_VALUES } from './constants-8d548297.js';
|
|
2
|
+
|
|
3
|
+
function checkNonEmpty(value, error) {
|
|
4
|
+
if (EMPTY_VALUES.some(v => v === value)) {
|
|
5
|
+
throw new Error(error);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { checkNonEmpty as c };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=check-non-empty-58bd6b17.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"check-non-empty-
|
|
1
|
+
{"file":"check-non-empty-58bd6b17.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}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { E as EMPTY_VALUES } from './constants-8d548297.js';
|
|
2
|
+
|
|
3
|
+
function emptyOr(check) {
|
|
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);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function checkPattern(value, pattern, errorMessage) {
|
|
17
|
+
if (typeof value !== 'string' || !pattern.test(value))
|
|
18
|
+
throw new Error(errorMessage);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function checkType(value, type, error) {
|
|
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
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
35
|
+
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
36
|
+
const checkEmptyOrType = emptyOr(checkType);
|
|
37
|
+
|
|
38
|
+
export { checkEmptyOrPattern as a, checkEmptyOrOneOf as b, checkType as c, checkEmptyOrType as d };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index-1427953c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index-1427953c.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}
|
|
@@ -27,6 +27,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
30
|
+
/**
|
|
31
|
+
* Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
|
|
32
|
+
*
|
|
33
|
+
* Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
|
|
34
|
+
* support as of Stencil v4.
|
|
35
|
+
*/
|
|
36
|
+
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
30
37
|
/**
|
|
31
38
|
* Default style mode id
|
|
32
39
|
*/
|
|
@@ -35,11 +42,6 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
|
35
42
|
* Don't add values to these!!
|
|
36
43
|
*/
|
|
37
44
|
const EMPTY_OBJ = {};
|
|
38
|
-
/**
|
|
39
|
-
* Namespaces
|
|
40
|
-
*/
|
|
41
|
-
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
42
|
-
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
43
45
|
const isDef = (v) => v != null;
|
|
44
46
|
/**
|
|
45
47
|
* Check whether a value is a 'complex type', defined here as an object or a
|
|
@@ -336,6 +338,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
336
338
|
}
|
|
337
339
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
338
340
|
}
|
|
341
|
+
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
342
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
343
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
344
|
+
}
|
|
339
345
|
if (appliedStyles) {
|
|
340
346
|
appliedStyles.add(scopeId);
|
|
341
347
|
}
|
|
@@ -500,7 +506,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
500
506
|
elm[memberName] = newValue;
|
|
501
507
|
}
|
|
502
508
|
}
|
|
503
|
-
catch (e) {
|
|
509
|
+
catch (e) {
|
|
510
|
+
/**
|
|
511
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
512
|
+
*/
|
|
513
|
+
}
|
|
504
514
|
}
|
|
505
515
|
if (newValue == null || newValue === false) {
|
|
506
516
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
@@ -519,6 +529,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
519
529
|
}
|
|
520
530
|
};
|
|
521
531
|
const parseClassListRegex = /\s/;
|
|
532
|
+
/**
|
|
533
|
+
* Parsed a string of classnames into an array
|
|
534
|
+
* @param value className string, e.g. "foo bar baz"
|
|
535
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
536
|
+
*/
|
|
522
537
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
523
538
|
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
524
539
|
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
@@ -565,15 +580,8 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
565
580
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
566
581
|
}
|
|
567
582
|
else {
|
|
568
|
-
if (!isSvgMode) {
|
|
569
|
-
isSvgMode = newVNode.$tag$ === 'svg';
|
|
570
|
-
}
|
|
571
583
|
// create element
|
|
572
|
-
elm = newVNode.$elm$ = (doc.
|
|
573
|
-
);
|
|
574
|
-
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
575
|
-
isSvgMode = false;
|
|
576
|
-
}
|
|
584
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
|
|
577
585
|
// add css classes, attrs, props, listeners, etc.
|
|
578
586
|
{
|
|
579
587
|
updateElement(null, newVNode, isSvgMode);
|
|
@@ -594,17 +602,10 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
594
602
|
}
|
|
595
603
|
}
|
|
596
604
|
}
|
|
597
|
-
{
|
|
598
|
-
if (newVNode.$tag$ === 'svg') {
|
|
599
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
600
|
-
isSvgMode = false;
|
|
601
|
-
}
|
|
602
|
-
else if (elm.tagName === 'foreignObject') {
|
|
603
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
604
|
-
isSvgMode = true;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
605
|
}
|
|
606
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
607
|
+
// to another component but don't end up in a slot
|
|
608
|
+
elm['s-hn'] = hostTagName;
|
|
608
609
|
return elm;
|
|
609
610
|
};
|
|
610
611
|
/**
|
|
@@ -729,8 +730,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
729
730
|
* @param oldCh the old children of the parent node
|
|
730
731
|
* @param newVNode the new VNode which will replace the parent
|
|
731
732
|
* @param newCh the new children of the parent node
|
|
733
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
732
734
|
*/
|
|
733
|
-
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
735
|
+
const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
|
|
734
736
|
let oldStartIdx = 0;
|
|
735
737
|
let newStartIdx = 0;
|
|
736
738
|
let idxInOld = 0;
|
|
@@ -757,25 +759,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
757
759
|
else if (newEndVnode == null) {
|
|
758
760
|
newEndVnode = newCh[--newEndIdx];
|
|
759
761
|
}
|
|
760
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
762
|
+
else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
761
763
|
// if the start nodes are the same then we should patch the new VNode
|
|
762
764
|
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
763
765
|
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
764
766
|
// since things are matched up in order.
|
|
765
|
-
patch(oldStartVnode, newStartVnode);
|
|
767
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
766
768
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
767
769
|
newStartVnode = newCh[++newStartIdx];
|
|
768
770
|
}
|
|
769
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
771
|
+
else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
770
772
|
// likewise, if the end nodes are the same we patch new onto old and
|
|
771
773
|
// decrement our end indices, and also likewise in this case we don't
|
|
772
774
|
// need to move any DOM Nodes.
|
|
773
|
-
patch(oldEndVnode, newEndVnode);
|
|
775
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
774
776
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
775
777
|
newEndVnode = newCh[--newEndIdx];
|
|
776
778
|
}
|
|
777
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
778
|
-
patch(oldStartVnode, newEndVnode);
|
|
779
|
+
else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
780
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
779
781
|
// We need to move the element for `oldStartVnode` into a position which
|
|
780
782
|
// will be appropriate for `newEndVnode`. For this we can use
|
|
781
783
|
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
@@ -797,8 +799,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
797
799
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
798
800
|
newEndVnode = newCh[--newEndIdx];
|
|
799
801
|
}
|
|
800
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
801
|
-
patch(oldEndVnode, newStartVnode);
|
|
802
|
+
else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
803
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
802
804
|
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
803
805
|
// the same node, so since we're here we know that they are not. Thus we
|
|
804
806
|
// can move the element for `oldEndVnode` _before_ the element for
|
|
@@ -835,7 +837,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
835
837
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
836
838
|
}
|
|
837
839
|
else {
|
|
838
|
-
patch(elmToMove, newStartVnode);
|
|
840
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
839
841
|
// invalidate the matching old node so that we won't try to update it
|
|
840
842
|
// again later on
|
|
841
843
|
oldCh[idxInOld] = undefined;
|
|
@@ -886,16 +888,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
886
888
|
*
|
|
887
889
|
* @param leftVNode the first VNode to check
|
|
888
890
|
* @param rightVNode the second VNode to check
|
|
891
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
889
892
|
* @returns whether they're equal or not
|
|
890
893
|
*/
|
|
891
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
894
|
+
const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
892
895
|
// compare if two vnode to see if they're "technically" the same
|
|
893
896
|
// need to have the same element tag, and same key to be the same
|
|
894
897
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
895
|
-
// this will be set if
|
|
896
|
-
|
|
898
|
+
// this will be set if JSX tags in the build have `key` attrs set on them
|
|
899
|
+
// we only want to check this if we're not on the first render since on
|
|
900
|
+
// first render `leftVNode.$key$` will always be `null`, so we can be led
|
|
901
|
+
// astray and, for instance, accidentally delete a DOM node that we want to
|
|
902
|
+
// keep around.
|
|
903
|
+
if (!isInitialRender) {
|
|
897
904
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
898
905
|
}
|
|
906
|
+
return true;
|
|
899
907
|
}
|
|
900
908
|
return false;
|
|
901
909
|
};
|
|
@@ -906,19 +914,15 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
906
914
|
*
|
|
907
915
|
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
908
916
|
* @param newVNode a new VNode representing an updated version of the old one
|
|
917
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
909
918
|
*/
|
|
910
|
-
const patch = (oldVNode, newVNode) => {
|
|
919
|
+
const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
911
920
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
912
921
|
const oldChildren = oldVNode.$children$;
|
|
913
922
|
const newChildren = newVNode.$children$;
|
|
914
923
|
const tag = newVNode.$tag$;
|
|
915
924
|
const text = newVNode.$text$;
|
|
916
925
|
if (text === null) {
|
|
917
|
-
{
|
|
918
|
-
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
919
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
920
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
921
|
-
}
|
|
922
926
|
{
|
|
923
927
|
if (tag === 'slot')
|
|
924
928
|
;
|
|
@@ -932,7 +936,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
932
936
|
if (oldChildren !== null && newChildren !== null) {
|
|
933
937
|
// looks like there's child vnodes for both the old and new vnodes
|
|
934
938
|
// so we need to call `updateChildren` to reconcile them
|
|
935
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
939
|
+
updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
|
|
936
940
|
}
|
|
937
941
|
else if (newChildren !== null) {
|
|
938
942
|
// no old child vnodes, but there are new child vnodes to add
|
|
@@ -947,9 +951,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
947
951
|
// no new child vnodes, but there are old child vnodes to remove
|
|
948
952
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
949
953
|
}
|
|
950
|
-
if (isSvgMode && tag === 'svg') {
|
|
951
|
-
isSvgMode = false;
|
|
952
|
-
}
|
|
953
954
|
}
|
|
954
955
|
else if (oldVNode.$text$ !== text) {
|
|
955
956
|
// update the text content for the text only vnode
|
|
@@ -1022,7 +1023,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1022
1023
|
scopeId = hostElm['s-sc'];
|
|
1023
1024
|
}
|
|
1024
1025
|
// synchronous patch
|
|
1025
|
-
patch(oldVNode, rootVnode);
|
|
1026
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1026
1027
|
};
|
|
1027
1028
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1028
1029
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
@@ -1339,13 +1340,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1339
1340
|
*/
|
|
1340
1341
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1341
1342
|
var _a;
|
|
1343
|
+
const prototype = Cstr.prototype;
|
|
1342
1344
|
if (cmpMeta.$members$) {
|
|
1343
1345
|
if (Cstr.watchers) {
|
|
1344
1346
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1345
1347
|
}
|
|
1346
1348
|
// It's better to have a const than two Object.entries()
|
|
1347
1349
|
const members = Object.entries(cmpMeta.$members$);
|
|
1348
|
-
const prototype = Cstr.prototype;
|
|
1349
1350
|
members.map(([memberName, [memberFlags]]) => {
|
|
1350
1351
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1351
1352
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1368,8 +1369,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1368
1369
|
// proxyComponent - method
|
|
1369
1370
|
Object.defineProperty(prototype, memberName, {
|
|
1370
1371
|
value(...args) {
|
|
1372
|
+
var _a;
|
|
1371
1373
|
const ref = getHostRef(this);
|
|
1372
|
-
return ref.$onInstancePromise
|
|
1374
|
+
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); });
|
|
1373
1375
|
},
|
|
1374
1376
|
});
|
|
1375
1377
|
}
|
|
@@ -1378,6 +1380,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1378
1380
|
const attrNameToPropName = new Map();
|
|
1379
1381
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1380
1382
|
plt.jmp(() => {
|
|
1383
|
+
var _a;
|
|
1381
1384
|
const propName = attrNameToPropName.get(attrName);
|
|
1382
1385
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1383
1386
|
// in the case where an attribute was set inline.
|
|
@@ -1433,11 +1436,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1433
1436
|
// 1. The instance is ready
|
|
1434
1437
|
// 2. The watchers are ready
|
|
1435
1438
|
// 3. The value has changed
|
|
1436
|
-
if (
|
|
1439
|
+
if (flags &&
|
|
1440
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1437
1441
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1438
1442
|
newValue !== oldValue) {
|
|
1439
1443
|
const instance = hostRef.$lazyInstance$ ;
|
|
1440
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1444
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1441
1445
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1442
1446
|
if (instance[callbackName] != null) {
|
|
1443
1447
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
@@ -1647,12 +1651,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1647
1651
|
const customElements = win.customElements;
|
|
1648
1652
|
const head = doc.head;
|
|
1649
1653
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1650
|
-
const
|
|
1654
|
+
const dataStyles = /*@__PURE__*/ doc.createElement('style');
|
|
1651
1655
|
const deferredConnectedCallbacks = [];
|
|
1652
1656
|
let appLoadFallback;
|
|
1653
1657
|
let isBootstrapping = true;
|
|
1654
1658
|
Object.assign(plt, options);
|
|
1655
1659
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1660
|
+
let hasSlotRelocation = false;
|
|
1656
1661
|
lazyBundles.map((lazyBundle) => {
|
|
1657
1662
|
lazyBundle[1].map((compactMeta) => {
|
|
1658
1663
|
var _a;
|
|
@@ -1662,6 +1667,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1662
1667
|
$members$: compactMeta[2],
|
|
1663
1668
|
$listeners$: compactMeta[3],
|
|
1664
1669
|
};
|
|
1670
|
+
// Check if we are using slots outside the shadow DOM in this component.
|
|
1671
|
+
// We'll use this information later to add styles for `slot-fb` elements
|
|
1672
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
1673
|
+
hasSlotRelocation = true;
|
|
1674
|
+
}
|
|
1665
1675
|
{
|
|
1666
1676
|
cmpMeta.$members$ = compactMeta[2];
|
|
1667
1677
|
}
|
|
@@ -1718,15 +1728,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1718
1728
|
}
|
|
1719
1729
|
});
|
|
1720
1730
|
});
|
|
1731
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
1732
|
+
if (hasSlotRelocation) {
|
|
1733
|
+
dataStyles.innerHTML += SLOT_FB_CSS;
|
|
1734
|
+
}
|
|
1735
|
+
// Add hydration styles
|
|
1721
1736
|
{
|
|
1722
|
-
|
|
1723
|
-
|
|
1737
|
+
dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
|
|
1738
|
+
}
|
|
1739
|
+
// If we have styles, add them to the DOM
|
|
1740
|
+
if (dataStyles.innerHTML.length) {
|
|
1741
|
+
dataStyles.setAttribute('data-styles', '');
|
|
1724
1742
|
// Apply CSP nonce to the style tag if it exists
|
|
1725
1743
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1726
1744
|
if (nonce != null) {
|
|
1727
|
-
|
|
1745
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
1728
1746
|
}
|
|
1729
|
-
|
|
1747
|
+
// Insert the styles into the document head
|
|
1748
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
1749
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1730
1750
|
}
|
|
1731
1751
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1732
1752
|
isBootstrapping = false;
|
|
@@ -1911,9 +1931,9 @@ const flush = () => {
|
|
|
1911
1931
|
}
|
|
1912
1932
|
}
|
|
1913
1933
|
};
|
|
1914
|
-
const nextTick =
|
|
1934
|
+
const nextTick = (cb) => promiseResolve().then(cb);
|
|
1915
1935
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1916
1936
|
|
|
1917
1937
|
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1918
1938
|
|
|
1919
|
-
//# sourceMappingURL=index-
|
|
1939
|
+
//# sourceMappingURL=index-35998e08.js.map
|