@swisspost/design-system-components 10.0.0-next.39 → 10.0.0-next.41
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/breakpoints-DIH5Oaz7.js +186 -0
- package/dist/cjs/event-from-AKK8RQrn.js +107 -0
- package/dist/cjs/{get-root-8102fecd.js → get-root-DmyBVSJ_.js} +1 -1
- package/dist/cjs/{index-b60129c4.js → index-CRMt-jq2.js} +1172 -313
- package/dist/cjs/index.cjs.js +0 -72
- package/dist/cjs/loader.cjs.js +3 -6
- package/dist/cjs/{package-29dc73af.js → package-C2pR6Vs2.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +183 -0
- package/dist/cjs/post-avatar.cjs.entry.js +151 -8
- package/dist/cjs/post-back-to-top.cjs.entry.js +86 -9
- package/dist/cjs/post-banner.cjs.entry.js +81 -9
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +62 -8
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +119 -7
- package/dist/cjs/post-card-control.cjs.entry.js +283 -8
- package/dist/cjs/post-closebutton_15.cjs.entry.js +4376 -30
- package/dist/cjs/post-collapsible_2.cjs.entry.js +196 -10
- package/dist/cjs/post-components.cjs.js +7 -8
- package/dist/cjs/post-footer.cjs.entry.js +59 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +24 -6
- package/dist/cjs/post-popover.cjs.entry.js +151 -8
- package/dist/cjs/post-rating.cjs.entry.js +115 -8
- package/dist/cjs/post-tab-header.cjs.entry.js +26 -9
- package/dist/cjs/post-tab-panel.cjs.entry.js +28 -9
- package/dist/cjs/post-tabs.cjs.entry.js +165 -7
- package/dist/cjs/post-tag.cjs.entry.js +50 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +5195 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +78 -9
- package/dist/collection/collection-manifest.json +4 -4
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +39 -23
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +26 -12
- package/dist/collection/components/post-avatar/post-avatar.js +12 -9
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +4 -3
- package/dist/collection/components/post-banner/post-banner.js +18 -9
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +4 -6
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +13 -9
- package/dist/collection/components/post-card-control/post-card-control.js +33 -16
- package/dist/collection/components/post-collapsible/post-collapsible.js +6 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +21 -9
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +35 -15
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +28 -16
- package/dist/collection/components/post-icon/post-icon.js +66 -54
- package/dist/collection/components/post-language-option/post-language-option.css +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +17 -13
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +43 -24
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-list/post-list.js +13 -4
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +4 -5
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +12 -6
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +34 -20
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +43 -21
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +11 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +9 -5
- package/dist/collection/components/post-popover/post-popover.js +20 -6
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +44 -16
- package/dist/collection/components/post-rating/post-rating.js +26 -6
- package/dist/collection/components/post-tab-header/post-tab-header.js +4 -6
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -6
- package/dist/collection/components/post-tabs/post-tabs.js +4 -3
- package/dist/collection/components/post-tag/post-tag.js +11 -9
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +8 -3
- package/dist/collection/components/post-tooltip/post-tooltip.js +25 -7
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +20 -12
- package/dist/collection/index.js +1 -37
- package/dist/collection/utils/breakpoints.js +38 -45
- package/dist/collection/utils/event-from.js +103 -0
- package/dist/collection/utils/index.js +1 -1
- package/dist/components/index.js +2315 -37
- package/dist/components/p-1KLiMO0w.js +3 -0
- package/dist/components/p-8U5GFtQP.js +105 -0
- package/dist/components/{post-menu2.js → p-BLhBouGz.js} +51 -30
- package/dist/{esm/index-ffccd040.js → components/p-CV7fm1rW.js} +1 -1
- package/dist/components/{post-menu-trigger2.js → p-CaPj3whI.js} +14 -12
- package/dist/components/{post-breadcrumb-item2.js → p-Cpaqct04.js} +9 -11
- package/dist/components/p-CtNCtg2z.js +114 -0
- package/dist/components/p-Cx0AiN2A.js +182 -0
- package/{loaders/post-collapsible-trigger2.js → dist/components/p-D3LhzIrC.js} +25 -14
- package/dist/components/{get-root.js → p-DBHo9yGF.js} +1 -1
- package/dist/components/p-DQuPPEca.js +31 -0
- package/dist/components/{post-accordion2.js → p-DlEtlaNu.js} +42 -29
- package/dist/components/{post-collapsible2.js → p-DphlfQse.js} +11 -8
- package/dist/components/{post-popovercontainer2.js → p-elg4VvHg.js} +246 -278
- package/{loaders/post-icon2.js → dist/components/p-fmA57Ivd.js} +52 -54
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-avatar.js +183 -1
- package/dist/components/post-back-to-top.js +115 -1
- package/dist/components/post-banner.js +120 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +182 -1
- package/dist/components/post-card-control.js +322 -1
- package/dist/components/post-closebutton.js +37 -1
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-footer.js +112 -1
- package/dist/components/post-header.js +273 -1
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-language-option.js +96 -1
- package/dist/components/post-language-switch.js +154 -1
- package/dist/components/post-linkarea.js +41 -1
- package/dist/components/post-list-item.js +34 -1
- package/dist/components/post-list.js +57 -1
- package/dist/components/post-logo.js +54 -1
- package/dist/components/post-mainnavigation.js +181 -1
- package/dist/components/post-megadropdown-trigger.js +132 -1
- package/dist/components/post-megadropdown.js +194 -1
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-popover.js +184 -1
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-rating.js +148 -1
- package/dist/components/post-tab-header.js +48 -1
- package/dist/components/post-tab-panel.js +50 -1
- package/dist/components/post-tabs.js +186 -1
- package/dist/components/post-tag.js +82 -1
- package/dist/components/post-togglebutton.js +52 -1
- package/dist/components/post-tooltip-trigger.js +5218 -1
- package/dist/components/post-tooltip.js +110 -1
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +426 -118
- package/dist/esm/breakpoints-DyVir0ex.js +182 -0
- package/dist/esm/event-from-8U5GFtQP.js +105 -0
- package/{loaders/get-root.js → dist/esm/get-root-D9QC9-TY.js} +1 -1
- package/{loaders/index2.js → dist/esm/index-BWC0gtGU.js} +1 -1
- package/dist/esm/{index-f4d19816.js → index-CVhzhVv0.js} +1169 -309
- package/dist/esm/index.js +1 -31
- package/dist/esm/loader.js +3 -4
- package/dist/esm/package-1KLiMO0w.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +180 -0
- package/dist/esm/post-avatar.entry.js +154 -5
- package/dist/esm/post-back-to-top.entry.js +89 -6
- package/dist/esm/post-banner.entry.js +85 -7
- package/dist/esm/post-breadcrumb-item_2.entry.js +65 -5
- package/dist/esm/post-breadcrumbs.entry.js +123 -5
- package/dist/esm/post-card-control.entry.js +286 -5
- package/dist/esm/post-closebutton_15.entry.js +4362 -10
- package/dist/esm/post-collapsible_2.entry.js +199 -7
- package/dist/esm/post-components.js +5 -5
- package/dist/esm/post-footer.entry.js +62 -5
- package/dist/esm/post-linkarea.entry.js +27 -3
- package/dist/esm/post-popover.entry.js +155 -6
- package/dist/esm/post-rating.entry.js +118 -5
- package/dist/esm/post-tab-header.entry.js +29 -6
- package/dist/esm/post-tab-panel.entry.js +31 -6
- package/dist/esm/post-tabs.entry.js +169 -5
- package/dist/esm/post-tag.entry.js +53 -5
- package/dist/esm/post-tooltip-trigger.entry.js +5199 -5
- package/dist/esm/post-tooltip.entry.js +81 -6
- package/dist/post-components/index.esm.js +0 -1
- package/dist/post-components/p-0d08ab13.entry.js +1 -0
- package/dist/post-components/p-1KLiMO0w.js +1 -0
- package/dist/post-components/p-1e006e29.entry.js +1 -0
- package/dist/post-components/p-3a5bdb7f.entry.js +1 -0
- package/dist/post-components/p-4214b85e.entry.js +1 -0
- package/dist/post-components/p-50916d48.entry.js +1 -0
- package/dist/post-components/p-5f4126d8.entry.js +1 -0
- package/dist/post-components/p-62982420.entry.js +1 -0
- package/dist/post-components/p-78f4dd12.entry.js +1 -0
- package/dist/post-components/p-7a7d237b.entry.js +1 -0
- package/dist/post-components/p-80174475.entry.js +1 -0
- package/dist/post-components/p-8U5GFtQP.js +1 -0
- package/dist/post-components/p-8d5a4218.entry.js +1 -0
- package/dist/post-components/p-8e89ccc1.entry.js +1 -0
- package/dist/post-components/p-9003674b.entry.js +1 -0
- package/dist/post-components/p-925aee3d.entry.js +1 -0
- package/dist/post-components/p-9b446561.entry.js +1 -0
- package/dist/post-components/p-9ec29527.entry.js +1 -0
- package/dist/post-components/{p-b176309b.js → p-BWC0gtGU.js} +1 -1
- package/dist/post-components/{p-6b31a76a.js → p-Bkp2QDth.js} +1 -1
- package/dist/post-components/p-CVhzhVv0.js +2 -0
- package/dist/post-components/p-DyVir0ex.js +1 -0
- package/dist/post-components/p-ec764922.entry.js +1 -0
- package/dist/post-components/p-fa550b4a.entry.js +1 -0
- package/dist/post-components/p-fb46e260.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-footer/post-footer.d.ts +7 -3
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -4
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +1 -0
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components.d.ts +61 -1
- package/dist/types/index.d.ts +10 -37
- package/dist/types/stencil-public-runtime.d.ts +29 -1
- package/dist/types/utils/breakpoints.d.ts +12 -7
- package/dist/types/utils/event-from.d.ts +9 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/hydrate/index.d.ts +273 -0
- package/hydrate/index.js +32002 -0
- package/hydrate/index.mjs +31994 -0
- package/hydrate/package.json +12 -0
- package/package.json +45 -17
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/breakpoints-cdf1b747.js +0 -59
- package/dist/cjs/event-guard-efabc84f.js +0 -47
- package/dist/cjs/heading-levels-608d432e.js +0 -5
- package/dist/cjs/post-accordion-c433c493.js +0 -105
- package/dist/cjs/post-accordion-item-8d5a301d.js +0 -64
- package/dist/cjs/post-accordion-item.cjs.entry.js +0 -16
- package/dist/cjs/post-accordion.cjs.entry.js +0 -15
- package/dist/cjs/post-avatar-421043df.js +0 -162
- package/dist/cjs/post-back-to-top-3cca3803.js +0 -93
- package/dist/cjs/post-banner-2e99c9d8.js +0 -87
- package/dist/cjs/post-breadcrumbs-1be50860.js +0 -126
- package/dist/cjs/post-card-control-0bfdad92.js +0 -290
- package/dist/cjs/post-collapsible-trigger-4180b218.js +0 -190
- package/dist/cjs/post-footer-92adffac.js +0 -48
- package/dist/cjs/post-linkarea-26c457b3.js +0 -30
- package/dist/cjs/post-menu-item-d0a53c84.js +0 -68
- package/dist/cjs/post-popover-36cead3d.js +0 -150
- package/dist/cjs/post-rating-f50a9939.js +0 -109
- package/dist/cjs/post-tab-header-f47508da.js +0 -34
- package/dist/cjs/post-tab-panel-7c51798b.js +0 -36
- package/dist/cjs/post-tabs-2debea01.js +0 -173
- package/dist/cjs/post-tag-ac62c57f.js +0 -60
- package/dist/cjs/post-togglebutton-43c46511.js +0 -4491
- package/dist/cjs/post-tooltip-b7dcfb44.js +0 -74
- package/dist/cjs/post-tooltip-trigger-904061b6.js +0 -4685
- package/dist/collection/utils/event-guard.js +0 -43
- package/dist/components/breakpoints.js +0 -56
- package/dist/components/event-guard.js +0 -45
- package/dist/components/index2.js +0 -88
- package/dist/components/package.js +0 -3
- package/dist/components/post-accordion-item2.js +0 -103
- package/dist/components/post-avatar2.js +0 -190
- package/dist/components/post-back-to-top2.js +0 -118
- package/dist/components/post-banner2.js +0 -121
- package/dist/components/post-breadcrumbs2.js +0 -184
- package/dist/components/post-card-control2.js +0 -325
- package/dist/components/post-closebutton2.js +0 -39
- package/dist/components/post-collapsible-trigger2.js +0 -125
- package/dist/components/post-footer2.js +0 -90
- package/dist/components/post-header2.js +0 -397
- package/dist/components/post-icon2.js +0 -156
- package/dist/components/post-language-option2.js +0 -102
- package/dist/components/post-language-switch2.js +0 -143
- package/dist/components/post-linkarea2.js +0 -43
- package/dist/components/post-list-item2.js +0 -36
- package/dist/components/post-list2.js +0 -54
- package/dist/components/post-logo2.js +0 -57
- package/dist/components/post-mainnavigation2.js +0 -183
- package/dist/components/post-megadropdown-trigger2.js +0 -121
- package/dist/components/post-megadropdown2.js +0 -190
- package/dist/components/post-menu-item2.js +0 -27
- package/dist/components/post-popover2.js +0 -178
- package/dist/components/post-rating2.js +0 -138
- package/dist/components/post-tab-header2.js +0 -52
- package/dist/components/post-tab-panel2.js +0 -54
- package/dist/components/post-tabs2.js +0 -189
- package/dist/components/post-tag2.js +0 -88
- package/dist/components/post-togglebutton2.js +0 -51
- package/dist/components/post-tooltip-trigger2.js +0 -4703
- package/dist/components/post-tooltip2.js +0 -102
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/breakpoints-7812702e.js +0 -56
- package/dist/esm/event-guard-538ee077.js +0 -45
- package/dist/esm/get-root-1b1af46f.js +0 -15
- package/dist/esm/heading-levels-5b7b4349.js +0 -3
- package/dist/esm/package-8503eaa8.js +0 -3
- package/dist/esm/post-accordion-9365faca.js +0 -103
- package/dist/esm/post-accordion-item-2dc8e3b7.js +0 -62
- package/dist/esm/post-accordion-item.entry.js +0 -8
- package/dist/esm/post-accordion.entry.js +0 -7
- package/dist/esm/post-avatar-4f73dc4d.js +0 -160
- package/dist/esm/post-back-to-top-8f759d32.js +0 -91
- package/dist/esm/post-banner-ad979275.js +0 -85
- package/dist/esm/post-breadcrumbs-a20336c7.js +0 -124
- package/dist/esm/post-card-control-3c77e778.js +0 -288
- package/dist/esm/post-collapsible-trigger-5fd0e193.js +0 -187
- package/dist/esm/post-footer-3e117b5a.js +0 -46
- package/dist/esm/post-linkarea-16a14609.js +0 -28
- package/dist/esm/post-menu-item-b1604fe4.js +0 -65
- package/dist/esm/post-popover-49096648.js +0 -148
- package/dist/esm/post-rating-405bee8f.js +0 -107
- package/dist/esm/post-tab-header-b228c217.js +0 -32
- package/dist/esm/post-tab-panel-98110b64.js +0 -34
- package/dist/esm/post-tabs-44d9313c.js +0 -171
- package/dist/esm/post-tag-99cc9616.js +0 -58
- package/dist/esm/post-togglebutton-ea73e63f.js +0 -4475
- package/dist/esm/post-tooltip-78cd2988.js +0 -72
- package/dist/esm/post-tooltip-trigger-bdb21c45.js +0 -4683
- package/dist/post-components/p-0889c759.js +0 -1
- package/dist/post-components/p-09dd5aa4.js +0 -1
- package/dist/post-components/p-0f9322e5.js +0 -8
- package/dist/post-components/p-11572299.js +0 -1
- package/dist/post-components/p-19a83519.entry.js +0 -1
- package/dist/post-components/p-1afb3c43.entry.js +0 -1
- package/dist/post-components/p-214cd032.js +0 -1
- package/dist/post-components/p-21e5b028.js +0 -1
- package/dist/post-components/p-2320305b.js +0 -1
- package/dist/post-components/p-247a1668.js +0 -1
- package/dist/post-components/p-2523f97b.entry.js +0 -1
- package/dist/post-components/p-2bd3a436.js +0 -1
- package/dist/post-components/p-2ce8fbf5.js +0 -1
- package/dist/post-components/p-2f879f4e.entry.js +0 -1
- package/dist/post-components/p-33e26845.entry.js +0 -1
- package/dist/post-components/p-38b1c71e.entry.js +0 -1
- package/dist/post-components/p-38d59732.js +0 -1
- package/dist/post-components/p-3a67f1ff.js +0 -1
- package/dist/post-components/p-41450b6c.entry.js +0 -1
- package/dist/post-components/p-4c23ed05.entry.js +0 -1
- package/dist/post-components/p-57746c40.js +0 -1
- package/dist/post-components/p-6313d72e.entry.js +0 -1
- package/dist/post-components/p-64e0b0fc.js +0 -1
- package/dist/post-components/p-658a2e34.entry.js +0 -1
- package/dist/post-components/p-722ffaae.js +0 -1
- package/dist/post-components/p-746d3cd3.entry.js +0 -1
- package/dist/post-components/p-79a2dad0.entry.js +0 -1
- package/dist/post-components/p-7dd1807c.js +0 -1
- package/dist/post-components/p-817fbeaf.js +0 -1
- package/dist/post-components/p-85950200.js +0 -1
- package/dist/post-components/p-8ebecf22.entry.js +0 -1
- package/dist/post-components/p-8ed1cb53.entry.js +0 -1
- package/dist/post-components/p-91244b25.js +0 -1
- package/dist/post-components/p-91675004.js +0 -1
- package/dist/post-components/p-94ebc430.js +0 -1
- package/dist/post-components/p-95727a4f.entry.js +0 -1
- package/dist/post-components/p-9e461613.js +0 -2
- package/dist/post-components/p-a844da3a.entry.js +0 -1
- package/dist/post-components/p-af900651.js +0 -1
- package/dist/post-components/p-b373659e.entry.js +0 -1
- package/dist/post-components/p-b500b245.js +0 -1
- package/dist/post-components/p-bf182745.entry.js +0 -1
- package/dist/post-components/p-c9b6f9e7.entry.js +0 -1
- package/dist/post-components/p-cb7d8f67.entry.js +0 -1
- package/dist/post-components/p-e1255160.js +0 -1
- package/dist/post-components/p-e28eb73a.js +0 -1
- package/dist/types/popover-fn.d.ts +0 -11
- package/dist/types/utils/event-guard.d.ts +0 -4
- package/loader/package.json +0 -11
- package/loaders/breakpoints.js +0 -56
- package/loaders/event-guard.js +0 -45
- package/loaders/fade.js +0 -11
- package/loaders/get-focusable-children.js +0 -35
- package/loaders/heading-levels.js +0 -3
- package/loaders/index.browser.js +0 -14
- package/loaders/index.d.ts +0 -108
- package/loaders/index.js +0 -39
- package/loaders/long-press-event.js +0 -264
- package/loaders/package.js +0 -3
- package/loaders/post-accordion-item.d.ts +0 -11
- package/loaders/post-accordion-item.js +0 -6
- package/loaders/post-accordion-item2.js +0 -103
- package/loaders/post-accordion.d.ts +0 -11
- package/loaders/post-accordion.js +0 -129
- package/loaders/post-avatar.d.ts +0 -11
- package/loaders/post-avatar.js +0 -193
- package/loaders/post-back-to-top.d.ts +0 -11
- package/loaders/post-back-to-top.js +0 -121
- package/loaders/post-banner.d.ts +0 -11
- package/loaders/post-banner.js +0 -124
- package/loaders/post-breadcrumb-item.d.ts +0 -11
- package/loaders/post-breadcrumb-item.js +0 -6
- package/loaders/post-breadcrumb-item2.js +0 -82
- package/loaders/post-breadcrumbs.d.ts +0 -11
- package/loaders/post-breadcrumbs.js +0 -187
- package/loaders/post-card-control.d.ts +0 -11
- package/loaders/post-card-control.js +0 -328
- package/loaders/post-closebutton.d.ts +0 -11
- package/loaders/post-closebutton.js +0 -42
- package/loaders/post-collapsible-trigger.d.ts +0 -11
- package/loaders/post-collapsible-trigger.js +0 -6
- package/loaders/post-collapsible.d.ts +0 -11
- package/loaders/post-collapsible.js +0 -6
- package/loaders/post-collapsible2.js +0 -108
- package/loaders/post-footer.d.ts +0 -11
- package/loaders/post-footer.js +0 -93
- package/loaders/post-header.d.ts +0 -11
- package/loaders/post-header.js +0 -400
- package/loaders/post-icon.d.ts +0 -11
- package/loaders/post-icon.js +0 -6
- package/loaders/post-language-option.d.ts +0 -11
- package/loaders/post-language-option.js +0 -105
- package/loaders/post-language-switch.d.ts +0 -11
- package/loaders/post-language-switch.js +0 -146
- package/loaders/post-linkarea.d.ts +0 -11
- package/loaders/post-linkarea.js +0 -46
- package/loaders/post-list-item.d.ts +0 -11
- package/loaders/post-list-item.js +0 -39
- package/loaders/post-list.d.ts +0 -11
- package/loaders/post-list.js +0 -57
- package/loaders/post-logo.d.ts +0 -11
- package/loaders/post-logo.js +0 -60
- package/loaders/post-mainnavigation.d.ts +0 -11
- package/loaders/post-mainnavigation.js +0 -186
- package/loaders/post-megadropdown-trigger.d.ts +0 -11
- package/loaders/post-megadropdown-trigger.js +0 -124
- package/loaders/post-megadropdown.d.ts +0 -11
- package/loaders/post-megadropdown.js +0 -193
- package/loaders/post-menu-item.d.ts +0 -11
- package/loaders/post-menu-item.js +0 -6
- package/loaders/post-menu-item2.js +0 -27
- package/loaders/post-menu-trigger.d.ts +0 -11
- package/loaders/post-menu-trigger.js +0 -6
- package/loaders/post-menu-trigger2.js +0 -109
- package/loaders/post-menu.d.ts +0 -11
- package/loaders/post-menu.js +0 -6
- package/loaders/post-menu2.js +0 -202
- package/loaders/post-popover.d.ts +0 -11
- package/loaders/post-popover.js +0 -181
- package/loaders/post-popovercontainer.d.ts +0 -11
- package/loaders/post-popovercontainer.js +0 -6
- package/loaders/post-popovercontainer2.js +0 -3051
- package/loaders/post-rating.d.ts +0 -11
- package/loaders/post-rating.js +0 -141
- package/loaders/post-tab-header.d.ts +0 -11
- package/loaders/post-tab-header.js +0 -55
- package/loaders/post-tab-panel.d.ts +0 -11
- package/loaders/post-tab-panel.js +0 -57
- package/loaders/post-tabs.d.ts +0 -11
- package/loaders/post-tabs.js +0 -192
- package/loaders/post-tag.d.ts +0 -11
- package/loaders/post-tag.js +0 -91
- package/loaders/post-togglebutton.d.ts +0 -11
- package/loaders/post-togglebutton.js +0 -54
- package/loaders/post-tooltip-trigger.d.ts +0 -11
- package/loaders/post-tooltip-trigger.js +0 -4706
- package/loaders/post-tooltip.d.ts +0 -11
- package/loaders/post-tooltip.js +0 -105
- package/loaders/slide.js +0 -25
- package/loaders/switch-variants.js +0 -3
- /package/dist/cjs/{fade-72d5ef55.js → fade-nS5zzDQS.js} +0 -0
- /package/dist/cjs/{index-2b2b85e5.js → index-DtvYdwe1.js} +0 -0
- /package/dist/cjs/{index.browser-4af21c17.js → index.browser-Doj636JV.js} +0 -0
- /package/dist/cjs/{long-press-event-6e62d113.js → long-press-event-Q8jMUNXD.js} +0 -0
- /package/dist/cjs/{placement-b2bb6ec4.js → placement-qEFR9hmI.js} +0 -0
- /package/dist/cjs/{slide-cd1f09b3.js → slide-CbBL7A8w.js} +0 -0
- /package/dist/components/{index.browser.js → p-BLchVpF6.js} +0 -0
- /package/dist/components/{slide.js → p-BuLMaH5t.js} +0 -0
- /package/dist/components/{get-focusable-children.js → p-C35MCWIp.js} +0 -0
- /package/dist/components/{long-press-event.js → p-C_2k3G1c.js} +0 -0
- /package/dist/components/{switch-variants.js → p-DjIHLduJ.js} +0 -0
- /package/dist/components/{fade.js → p-SbIC4aZX.js} +0 -0
- /package/dist/components/{heading-levels.js → p-r4txK0AC.js} +0 -0
- /package/dist/esm/{fade-1f3cacf4.js → fade-SbIC4aZX.js} +0 -0
- /package/dist/esm/{index.browser-ff103197.js → index.browser-BLchVpF6.js} +0 -0
- /package/dist/esm/{long-press-event-04d24397.js → long-press-event-C_2k3G1c.js} +0 -0
- /package/dist/esm/{placement-8d56605d.js → placement-DRiVosES.js} +0 -0
- /package/dist/esm/{slide-cd2850ee.js → slide-BuLMaH5t.js} +0 -0
- /package/dist/post-components/{p-c65f32b0.js → p-BLchVpF6.js} +0 -0
- /package/dist/post-components/{p-9b052461.js → p-BuLMaH5t.js} +0 -0
- /package/dist/post-components/{p-8db32dab.js → p-C_2k3G1c.js} +0 -0
- /package/dist/post-components/{p-59a38c23.js → p-DRiVosES.js} +0 -0
- /package/dist/post-components/{p-64e3de38.js → p-SbIC4aZX.js} +0 -0
|
@@ -9,31 +9,69 @@ function _interopNamespace(e) {
|
|
|
9
9
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
10
|
Object.defineProperty(n, k, d.get ? d : {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return e[k];
|
|
14
|
-
}
|
|
12
|
+
get: function () { return e[k]; }
|
|
15
13
|
});
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
n
|
|
17
|
+
n.default = e;
|
|
20
18
|
return Object.freeze(n);
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
const NAMESPACE = 'post-components';
|
|
24
|
-
const BUILD = /* post-components */ {
|
|
22
|
+
const BUILD = /* post-components */ { hydratedSelectorName: "data-hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
23
|
+
|
|
24
|
+
const globalScripts = () => {};
|
|
25
|
+
const globalStyles = ":where(post-accordion,post-accordion-item,post-avatar,post-back-to-top,post-banner,post-breadcrumb-item,post-breadcrumbs,post-card-control,post-closebutton,post-collapsible,post-collapsible-trigger,post-footer,post-header,post-icon,post-language-option,post-language-switch,post-linkarea,post-list,post-list-item,post-logo,post-mainnavigation,post-megadropdown,post-megadropdown-trigger,post-menu,post-menu-item,post-menu-trigger,post-popover,post-popovercontainer,post-rating,post-tab-header,post-tab-panel,post-tabs,post-tag,post-togglebutton,post-tooltip,post-tooltip-trigger):not([data-hydrated],:defined){visibility:hidden}";
|
|
25
26
|
|
|
26
27
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
28
|
+
Stencil Client Platform v4.35.0 | MIT Licensed | https://stenciljs.com
|
|
28
29
|
*/
|
|
29
30
|
var __defProp = Object.defineProperty;
|
|
30
31
|
var __export = (target, all) => {
|
|
31
32
|
for (var name in all)
|
|
32
33
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
35
|
+
|
|
36
|
+
// src/utils/constants.ts
|
|
37
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
38
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
39
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
40
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
41
|
+
PrimitiveType2["Null"] = "null";
|
|
42
|
+
PrimitiveType2["String"] = "string";
|
|
43
|
+
PrimitiveType2["Number"] = "number";
|
|
44
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
45
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
46
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
47
|
+
return PrimitiveType2;
|
|
48
|
+
})(PrimitiveType || {});
|
|
49
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
50
|
+
NonPrimitiveType2["Array"] = "array";
|
|
51
|
+
NonPrimitiveType2["Date"] = "date";
|
|
52
|
+
NonPrimitiveType2["Map"] = "map";
|
|
53
|
+
NonPrimitiveType2["Object"] = "object";
|
|
54
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
55
|
+
NonPrimitiveType2["Set"] = "set";
|
|
56
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
57
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
58
|
+
return NonPrimitiveType2;
|
|
59
|
+
})(NonPrimitiveType || {});
|
|
60
|
+
var TYPE_CONSTANT = "type";
|
|
61
|
+
var VALUE_CONSTANT = "value";
|
|
62
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
63
|
+
|
|
64
|
+
// src/client/client-host-ref.ts
|
|
65
|
+
var getHostRef = (ref) => {
|
|
66
|
+
if (ref.__stencil__getHostRef) {
|
|
67
|
+
return ref.__stencil__getHostRef();
|
|
68
|
+
}
|
|
69
|
+
return void 0;
|
|
70
|
+
};
|
|
71
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
72
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
73
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
74
|
+
};
|
|
37
75
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
76
|
const hostRef = {
|
|
39
77
|
$flags$: 0,
|
|
@@ -49,7 +87,9 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
49
87
|
hostElement["s-p"] = [];
|
|
50
88
|
hostElement["s-rc"] = [];
|
|
51
89
|
}
|
|
52
|
-
|
|
90
|
+
const ref = hostRef;
|
|
91
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
92
|
+
return ref;
|
|
53
93
|
};
|
|
54
94
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
55
95
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -74,14 +114,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
74
114
|
}
|
|
75
115
|
switch(bundleId) {
|
|
76
116
|
|
|
77
|
-
case 'post-closebutton_15.cjs':
|
|
78
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
79
|
-
/* webpackMode: "lazy" */
|
|
80
|
-
'./post-closebutton_15.cjs.entry.js')); }).then(processMod, consoleError);
|
|
81
|
-
case 'post-accordion.cjs':
|
|
82
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
83
|
-
/* webpackMode: "lazy" */
|
|
84
|
-
'./post-accordion.cjs.entry.js')); }).then(processMod, consoleError);
|
|
85
117
|
case 'post-avatar.cjs':
|
|
86
118
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
87
119
|
/* webpackMode: "lazy" */
|
|
@@ -90,14 +122,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
90
122
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
91
123
|
/* webpackMode: "lazy" */
|
|
92
124
|
'./post-back-to-top.cjs.entry.js')); }).then(processMod, consoleError);
|
|
93
|
-
case 'post-banner.cjs':
|
|
94
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
95
|
-
/* webpackMode: "lazy" */
|
|
96
|
-
'./post-banner.cjs.entry.js')); }).then(processMod, consoleError);
|
|
97
|
-
case 'post-breadcrumbs.cjs':
|
|
98
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
99
|
-
/* webpackMode: "lazy" */
|
|
100
|
-
'./post-breadcrumbs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
101
125
|
case 'post-card-control.cjs':
|
|
102
126
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
103
127
|
/* webpackMode: "lazy" */
|
|
@@ -110,10 +134,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
110
134
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
111
135
|
/* webpackMode: "lazy" */
|
|
112
136
|
'./post-linkarea.cjs.entry.js')); }).then(processMod, consoleError);
|
|
113
|
-
case 'post-popover.cjs':
|
|
114
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
115
|
-
/* webpackMode: "lazy" */
|
|
116
|
-
'./post-popover.cjs.entry.js')); }).then(processMod, consoleError);
|
|
117
137
|
case 'post-rating.cjs':
|
|
118
138
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
119
139
|
/* webpackMode: "lazy" */
|
|
@@ -126,10 +146,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
126
146
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
127
147
|
/* webpackMode: "lazy" */
|
|
128
148
|
'./post-tab-panel.cjs.entry.js')); }).then(processMod, consoleError);
|
|
129
|
-
case 'post-tabs.cjs':
|
|
130
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
131
|
-
/* webpackMode: "lazy" */
|
|
132
|
-
'./post-tabs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
133
149
|
case 'post-tag.cjs':
|
|
134
150
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
135
151
|
/* webpackMode: "lazy" */
|
|
@@ -138,41 +154,75 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
138
154
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
139
155
|
/* webpackMode: "lazy" */
|
|
140
156
|
'./post-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
141
|
-
case 'post-
|
|
157
|
+
case 'post-banner.cjs':
|
|
142
158
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
143
159
|
/* webpackMode: "lazy" */
|
|
144
|
-
'./post-
|
|
145
|
-
case 'post-
|
|
160
|
+
'./post-banner.cjs.entry.js')); }).then(processMod, consoleError);
|
|
161
|
+
case 'post-breadcrumbs.cjs':
|
|
162
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
163
|
+
/* webpackMode: "lazy" */
|
|
164
|
+
'./post-breadcrumbs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
165
|
+
case 'post-popover.cjs':
|
|
166
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
167
|
+
/* webpackMode: "lazy" */
|
|
168
|
+
'./post-popover.cjs.entry.js')); }).then(processMod, consoleError);
|
|
169
|
+
case 'post-tabs.cjs':
|
|
146
170
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
147
171
|
/* webpackMode: "lazy" */
|
|
148
|
-
'./post-
|
|
172
|
+
'./post-tabs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
149
173
|
case 'post-breadcrumb-item_2.cjs':
|
|
150
174
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
151
175
|
/* webpackMode: "lazy" */
|
|
152
176
|
'./post-breadcrumb-item_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
177
|
+
case 'post-accordion_2.cjs':
|
|
178
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
179
|
+
/* webpackMode: "lazy" */
|
|
180
|
+
'./post-accordion_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
153
181
|
case 'post-collapsible_2.cjs':
|
|
154
182
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
155
183
|
/* webpackMode: "lazy" */
|
|
156
184
|
'./post-collapsible_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
185
|
+
case 'post-closebutton_15.cjs':
|
|
186
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
187
|
+
/* webpackMode: "lazy" */
|
|
188
|
+
'./post-closebutton_15.cjs.entry.js')); }).then(processMod, consoleError);
|
|
189
|
+
case 'post-tooltip-trigger.cjs':
|
|
190
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
191
|
+
/* webpackMode: "lazy" */
|
|
192
|
+
'./post-tooltip-trigger.cjs.entry.js')); }).then(processMod, consoleError);
|
|
157
193
|
}
|
|
158
194
|
}
|
|
159
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
195
|
+
return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(
|
|
160
196
|
/* @vite-ignore */
|
|
161
197
|
/* webpackInclude: /\.entry\.js$/ */
|
|
162
198
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
163
199
|
/* webpackMode: "lazy" */
|
|
164
200
|
`./${bundleId}.entry.js${""}`
|
|
165
|
-
)
|
|
166
|
-
{
|
|
167
|
-
|
|
201
|
+
).then(
|
|
202
|
+
(importedModule) => {
|
|
203
|
+
{
|
|
204
|
+
cmpModules.set(bundleId, importedModule);
|
|
205
|
+
}
|
|
206
|
+
return importedModule[exportName];
|
|
207
|
+
},
|
|
208
|
+
(e) => {
|
|
209
|
+
consoleError(e, hostRef.$hostElement$);
|
|
168
210
|
}
|
|
169
|
-
|
|
170
|
-
}, consoleError);
|
|
211
|
+
);
|
|
171
212
|
};
|
|
172
213
|
|
|
173
214
|
// src/client/client-style.ts
|
|
174
215
|
var styles = /* @__PURE__ */ new Map();
|
|
175
|
-
|
|
216
|
+
|
|
217
|
+
// src/runtime/runtime-constants.ts
|
|
218
|
+
var CONTENT_REF_ID = "r";
|
|
219
|
+
var ORG_LOCATION_ID = "o";
|
|
220
|
+
var SLOT_NODE_ID = "s";
|
|
221
|
+
var TEXT_NODE_ID = "t";
|
|
222
|
+
var COMMENT_NODE_ID = "c";
|
|
223
|
+
var HYDRATE_ID = "s-id";
|
|
224
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
225
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
176
226
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
177
227
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
178
228
|
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
@@ -182,7 +232,6 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
182
232
|
"formStateRestoreCallback"
|
|
183
233
|
];
|
|
184
234
|
var win = typeof window !== "undefined" ? window : {};
|
|
185
|
-
var doc = win.document || { head: {} };
|
|
186
235
|
var plt = {
|
|
187
236
|
$flags$: 0,
|
|
188
237
|
$resourcesUrl$: "",
|
|
@@ -193,9 +242,10 @@ var plt = {
|
|
|
193
242
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
194
243
|
};
|
|
195
244
|
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
245
|
+
var _a;
|
|
196
246
|
let supportsListenerOptions2 = false;
|
|
197
247
|
try {
|
|
198
|
-
|
|
248
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
199
249
|
"e",
|
|
200
250
|
null,
|
|
201
251
|
Object.defineProperty({}, "passive", {
|
|
@@ -252,25 +302,117 @@ var flush = () => {
|
|
|
252
302
|
};
|
|
253
303
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
254
304
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
255
|
-
|
|
256
|
-
// src/utils/constants.ts
|
|
257
|
-
var EMPTY_OBJ = {};
|
|
258
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
259
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
260
|
-
|
|
261
|
-
// src/utils/helpers.ts
|
|
262
|
-
var isDef = (v) => v != null;
|
|
263
305
|
var isComplexType = (o) => {
|
|
264
306
|
o = typeof o;
|
|
265
307
|
return o === "object" || o === "function";
|
|
266
308
|
};
|
|
267
309
|
|
|
268
310
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
269
|
-
function queryNonceMetaTagContent(
|
|
311
|
+
function queryNonceMetaTagContent(doc) {
|
|
270
312
|
var _a, _b, _c;
|
|
271
|
-
return (_c = (_b = (_a =
|
|
313
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
272
314
|
}
|
|
273
315
|
|
|
316
|
+
// src/utils/regular-expression.ts
|
|
317
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
318
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// src/utils/remote-value.ts
|
|
322
|
+
var RemoteValue = class _RemoteValue {
|
|
323
|
+
/**
|
|
324
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
325
|
+
*
|
|
326
|
+
* @param serialized The serialized LocalValue object
|
|
327
|
+
* @returns The original JavaScript value/object
|
|
328
|
+
*/
|
|
329
|
+
static fromLocalValue(serialized) {
|
|
330
|
+
const type = serialized[TYPE_CONSTANT];
|
|
331
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
332
|
+
switch (type) {
|
|
333
|
+
case "string" /* String */:
|
|
334
|
+
return value;
|
|
335
|
+
case "boolean" /* Boolean */:
|
|
336
|
+
return value;
|
|
337
|
+
case "bigint" /* BigInt */:
|
|
338
|
+
return BigInt(value);
|
|
339
|
+
case "undefined" /* Undefined */:
|
|
340
|
+
return void 0;
|
|
341
|
+
case "null" /* Null */:
|
|
342
|
+
return null;
|
|
343
|
+
case "number" /* Number */:
|
|
344
|
+
if (value === "NaN") return NaN;
|
|
345
|
+
if (value === "-0") return -0;
|
|
346
|
+
if (value === "Infinity") return Infinity;
|
|
347
|
+
if (value === "-Infinity") return -Infinity;
|
|
348
|
+
return value;
|
|
349
|
+
case "array" /* Array */:
|
|
350
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
351
|
+
case "date" /* Date */:
|
|
352
|
+
return new Date(value);
|
|
353
|
+
case "map" /* Map */:
|
|
354
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
355
|
+
for (const [key, val] of value) {
|
|
356
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
357
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
358
|
+
map2.set(deserializedKey, deserializedValue);
|
|
359
|
+
}
|
|
360
|
+
return map2;
|
|
361
|
+
case "object" /* Object */:
|
|
362
|
+
const obj = {};
|
|
363
|
+
for (const [key, val] of value) {
|
|
364
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
365
|
+
}
|
|
366
|
+
return obj;
|
|
367
|
+
case "regexp" /* RegularExpression */:
|
|
368
|
+
const { pattern, flags } = value;
|
|
369
|
+
return new RegExp(pattern, flags);
|
|
370
|
+
case "set" /* Set */:
|
|
371
|
+
const set = /* @__PURE__ */ new Set();
|
|
372
|
+
for (const item of value) {
|
|
373
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
374
|
+
}
|
|
375
|
+
return set;
|
|
376
|
+
case "symbol" /* Symbol */:
|
|
377
|
+
return Symbol(value);
|
|
378
|
+
default:
|
|
379
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
384
|
+
*
|
|
385
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
386
|
+
* @returns Array of deserialized JavaScript values
|
|
387
|
+
*/
|
|
388
|
+
static fromLocalValueArray(serializedValues) {
|
|
389
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
393
|
+
*
|
|
394
|
+
* @param obj Object to verify
|
|
395
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
396
|
+
*/
|
|
397
|
+
static isLocalValueObject(obj) {
|
|
398
|
+
if (typeof obj !== "object" || obj === null) {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
const type = obj[TYPE_CONSTANT];
|
|
405
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
406
|
+
if (!hasTypeProperty) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
410
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
411
|
+
}
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
|
|
274
416
|
// src/utils/result.ts
|
|
275
417
|
var result_exports = {};
|
|
276
418
|
__export(result_exports, {
|
|
@@ -319,6 +461,156 @@ var unwrapErr = (result) => {
|
|
|
319
461
|
throw result.value;
|
|
320
462
|
}
|
|
321
463
|
};
|
|
464
|
+
|
|
465
|
+
// src/utils/serialize.ts
|
|
466
|
+
function deserializeProperty(value) {
|
|
467
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
468
|
+
return value;
|
|
469
|
+
}
|
|
470
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
471
|
+
}
|
|
472
|
+
function createShadowRoot(cmpMeta) {
|
|
473
|
+
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
474
|
+
if (supportsConstructableStylesheets) {
|
|
475
|
+
const sheet = new CSSStyleSheet();
|
|
476
|
+
sheet.replaceSync(globalStyles);
|
|
477
|
+
shadowRoot.adoptedStyleSheets.push(sheet);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
481
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
482
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
483
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
484
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
485
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
486
|
+
slotNode.hidden = true;
|
|
487
|
+
} else {
|
|
488
|
+
slotNode.hidden = false;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
let i2 = 0;
|
|
494
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
495
|
+
const childNode = childNodes[i2];
|
|
496
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
497
|
+
updateFallbackSlotVisibility(childNode);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
502
|
+
const result = [];
|
|
503
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
504
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
505
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
506
|
+
result.push(slottedNode);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return result;
|
|
510
|
+
};
|
|
511
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
512
|
+
let i2 = 0;
|
|
513
|
+
let slottedNodes = [];
|
|
514
|
+
let childNode;
|
|
515
|
+
for (; i2 < childNodes.length; i2++) {
|
|
516
|
+
childNode = childNodes[i2];
|
|
517
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
518
|
+
slottedNodes.push(childNode);
|
|
519
|
+
}
|
|
520
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
521
|
+
}
|
|
522
|
+
return slottedNodes;
|
|
523
|
+
}
|
|
524
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
525
|
+
const childNodes = [];
|
|
526
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
527
|
+
let node = slot;
|
|
528
|
+
while (node = node.nextSibling) {
|
|
529
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
530
|
+
}
|
|
531
|
+
return childNodes;
|
|
532
|
+
};
|
|
533
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
534
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
535
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
539
|
+
return true;
|
|
540
|
+
}
|
|
541
|
+
return false;
|
|
542
|
+
}
|
|
543
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
544
|
+
return true;
|
|
545
|
+
}
|
|
546
|
+
return slotName === "";
|
|
547
|
+
};
|
|
548
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
549
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
553
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
554
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
555
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
556
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
557
|
+
if (typeof position !== "undefined") {
|
|
558
|
+
slottedNodeLocation["s-oo"] = position;
|
|
559
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
560
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
561
|
+
childNodes.forEach((n) => {
|
|
562
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
563
|
+
});
|
|
564
|
+
slotRelocateNodes.sort((a, b) => {
|
|
565
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
566
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
567
|
+
return 0;
|
|
568
|
+
});
|
|
569
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
570
|
+
} else {
|
|
571
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
572
|
+
}
|
|
573
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
574
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
575
|
+
};
|
|
576
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
577
|
+
function patchSlotNode(node) {
|
|
578
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
579
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
580
|
+
const toReturn = [];
|
|
581
|
+
const slotName = this["s-sn"];
|
|
582
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
583
|
+
console.error(`
|
|
584
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
585
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
586
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
587
|
+
`);
|
|
588
|
+
}
|
|
589
|
+
const parent = this["s-cr"].parentElement;
|
|
590
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
591
|
+
slottedNodes.forEach((n) => {
|
|
592
|
+
if (slotName === getSlotName(n)) {
|
|
593
|
+
toReturn.push(n);
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
if (elementsOnly) {
|
|
597
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
598
|
+
}
|
|
599
|
+
return toReturn;
|
|
600
|
+
}).bind(node);
|
|
601
|
+
node.assignedElements = assignedFactory(true);
|
|
602
|
+
node.assignedNodes = assignedFactory(false);
|
|
603
|
+
}
|
|
604
|
+
function internalCall(node, method) {
|
|
605
|
+
if ("__" + method in node) {
|
|
606
|
+
const toReturn = node["__" + method];
|
|
607
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
608
|
+
return toReturn.bind(node);
|
|
609
|
+
} else {
|
|
610
|
+
if (typeof node[method] !== "function") return node[method];
|
|
611
|
+
return node[method].bind(node);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
322
614
|
var createTime = (fnName, tagName = "") => {
|
|
323
615
|
{
|
|
324
616
|
return () => {
|
|
@@ -444,13 +736,427 @@ var convertToPrivate = (node) => {
|
|
|
444
736
|
vnode.$name$ = node.vname;
|
|
445
737
|
return vnode;
|
|
446
738
|
};
|
|
447
|
-
|
|
739
|
+
|
|
740
|
+
// src/runtime/client-hydrate.ts
|
|
741
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
742
|
+
var _a;
|
|
743
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
744
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
745
|
+
const childRenderNodes = [];
|
|
746
|
+
const slotNodes = [];
|
|
747
|
+
const slottedNodes = [];
|
|
748
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
749
|
+
const vnode = newVNode(tagName, null);
|
|
750
|
+
vnode.$elm$ = hostElm;
|
|
751
|
+
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
752
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
753
|
+
var _a2, _b;
|
|
754
|
+
if (!(memberFlags & 31 /* Prop */)) {
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
const attributeName = metaAttributeName || memberName;
|
|
758
|
+
const attrVal = hostElm.getAttribute(attributeName);
|
|
759
|
+
if (attrVal !== null) {
|
|
760
|
+
const attrPropVal = parsePropertyValue(
|
|
761
|
+
attrVal,
|
|
762
|
+
memberFlags,
|
|
763
|
+
!!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
|
|
764
|
+
);
|
|
765
|
+
(_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
769
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
770
|
+
}
|
|
771
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
772
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
773
|
+
hostRef.$vnode$ = clientHydrate(
|
|
774
|
+
vnode,
|
|
775
|
+
childRenderNodes,
|
|
776
|
+
slotNodes,
|
|
777
|
+
shadowRootNodes,
|
|
778
|
+
hostElm,
|
|
779
|
+
hostElm,
|
|
780
|
+
hostId,
|
|
781
|
+
slottedNodes
|
|
782
|
+
);
|
|
783
|
+
let crIndex = 0;
|
|
784
|
+
const crLength = childRenderNodes.length;
|
|
785
|
+
let childRenderNode;
|
|
786
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
787
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
788
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
789
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
790
|
+
const node = childRenderNode.$elm$;
|
|
791
|
+
if (!shadowRoot) {
|
|
792
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
793
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
794
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
798
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
799
|
+
if (childRenderNode.$children$) {
|
|
800
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
801
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
802
|
+
childRenderNode.$children$.forEach((c) => {
|
|
803
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
} else {
|
|
807
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
811
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
812
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
813
|
+
}
|
|
814
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
815
|
+
if (!shadowRoot) {
|
|
816
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
820
|
+
}
|
|
821
|
+
const hosts = [];
|
|
822
|
+
const snLen = slottedNodes.length;
|
|
823
|
+
let snIndex = 0;
|
|
824
|
+
let slotGroup;
|
|
825
|
+
let snGroupIdx;
|
|
826
|
+
let snGroupLen;
|
|
827
|
+
let slottedItem;
|
|
828
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
829
|
+
slotGroup = slottedNodes[snIndex];
|
|
830
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
831
|
+
snGroupLen = slotGroup.length;
|
|
832
|
+
snGroupIdx = 0;
|
|
833
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
834
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
835
|
+
if (!hosts[slottedItem.hostId]) {
|
|
836
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
837
|
+
}
|
|
838
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
839
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
840
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
841
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
842
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
843
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
844
|
+
} else {
|
|
845
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
846
|
+
}
|
|
847
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
848
|
+
}
|
|
849
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
850
|
+
hostEle.appendChild(slottedItem.node);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (shadowRoot && !shadowRoot.childNodes.length) {
|
|
855
|
+
let rnIdex = 0;
|
|
856
|
+
const rnLen = shadowRootNodes.length;
|
|
857
|
+
if (rnLen) {
|
|
858
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
859
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
860
|
+
}
|
|
861
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
862
|
+
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
863
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
864
|
+
node.removeAttribute("hidden");
|
|
865
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
866
|
+
node.parentNode.removeChild(node);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
873
|
+
hostRef.$hostElement$ = hostElm;
|
|
874
|
+
endHydrate();
|
|
875
|
+
};
|
|
876
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
877
|
+
let childNodeType;
|
|
878
|
+
let childIdSplt;
|
|
879
|
+
let childVNode;
|
|
880
|
+
let i2;
|
|
881
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
882
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
883
|
+
if (childNodeType) {
|
|
884
|
+
childIdSplt = childNodeType.split(".");
|
|
885
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
886
|
+
childVNode = createSimpleVNode({
|
|
887
|
+
$flags$: 0,
|
|
888
|
+
$hostId$: childIdSplt[0],
|
|
889
|
+
$nodeId$: childIdSplt[1],
|
|
890
|
+
$depth$: childIdSplt[2],
|
|
891
|
+
$index$: childIdSplt[3],
|
|
892
|
+
$tag$: node.tagName.toLowerCase(),
|
|
893
|
+
$elm$: node,
|
|
894
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
895
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
896
|
+
$attrs$: { class: node.className || "" }
|
|
897
|
+
});
|
|
898
|
+
childRenderNodes.push(childVNode);
|
|
899
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
900
|
+
if (!parentVNode.$children$) {
|
|
901
|
+
parentVNode.$children$ = [];
|
|
902
|
+
}
|
|
903
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
904
|
+
if (typeof slotName === "string") {
|
|
905
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
906
|
+
addSlot(
|
|
907
|
+
slotName,
|
|
908
|
+
childIdSplt[2],
|
|
909
|
+
childVNode,
|
|
910
|
+
node,
|
|
911
|
+
parentVNode,
|
|
912
|
+
childRenderNodes,
|
|
913
|
+
slotNodes,
|
|
914
|
+
shadowRootNodes,
|
|
915
|
+
slottedNodes
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
919
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
920
|
+
}
|
|
921
|
+
if (childVNode.$index$ !== void 0) {
|
|
922
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
923
|
+
}
|
|
924
|
+
parentVNode = childVNode;
|
|
925
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
926
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
if (node.shadowRoot) {
|
|
931
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
932
|
+
clientHydrate(
|
|
933
|
+
parentVNode,
|
|
934
|
+
childRenderNodes,
|
|
935
|
+
slotNodes,
|
|
936
|
+
shadowRootNodes,
|
|
937
|
+
hostElm,
|
|
938
|
+
node.shadowRoot.childNodes[i2],
|
|
939
|
+
hostId,
|
|
940
|
+
slottedNodes
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
945
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
946
|
+
clientHydrate(
|
|
947
|
+
parentVNode,
|
|
948
|
+
childRenderNodes,
|
|
949
|
+
slotNodes,
|
|
950
|
+
shadowRootNodes,
|
|
951
|
+
hostElm,
|
|
952
|
+
nonShadowNodes[i2],
|
|
953
|
+
hostId,
|
|
954
|
+
slottedNodes
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
958
|
+
childIdSplt = node.nodeValue.split(".");
|
|
959
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
960
|
+
childNodeType = childIdSplt[0];
|
|
961
|
+
childVNode = createSimpleVNode({
|
|
962
|
+
$hostId$: childIdSplt[1],
|
|
963
|
+
$nodeId$: childIdSplt[2],
|
|
964
|
+
$depth$: childIdSplt[3],
|
|
965
|
+
$index$: childIdSplt[4] || "0",
|
|
966
|
+
$elm$: node,
|
|
967
|
+
$attrs$: null,
|
|
968
|
+
$children$: null,
|
|
969
|
+
$key$: null,
|
|
970
|
+
$name$: null,
|
|
971
|
+
$tag$: null,
|
|
972
|
+
$text$: null
|
|
973
|
+
});
|
|
974
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
975
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
976
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
977
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
978
|
+
childRenderNodes.push(childVNode);
|
|
979
|
+
node.remove();
|
|
980
|
+
if (hostId === childVNode.$hostId$) {
|
|
981
|
+
if (!parentVNode.$children$) {
|
|
982
|
+
parentVNode.$children$ = [];
|
|
983
|
+
}
|
|
984
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
985
|
+
}
|
|
986
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
987
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
991
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
992
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
993
|
+
childRenderNodes.push(childVNode);
|
|
994
|
+
node.remove();
|
|
995
|
+
}
|
|
996
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
997
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
998
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
999
|
+
addSlot(
|
|
1000
|
+
slotName,
|
|
1001
|
+
childIdSplt[2],
|
|
1002
|
+
childVNode,
|
|
1003
|
+
node,
|
|
1004
|
+
parentVNode,
|
|
1005
|
+
childRenderNodes,
|
|
1006
|
+
slotNodes,
|
|
1007
|
+
shadowRootNodes,
|
|
1008
|
+
slottedNodes
|
|
1009
|
+
);
|
|
1010
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1011
|
+
if (shadowRootNodes) {
|
|
1012
|
+
node.remove();
|
|
1013
|
+
} else {
|
|
1014
|
+
hostElm["s-cr"] = node;
|
|
1015
|
+
node["s-cn"] = true;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1021
|
+
const vnode = newVNode(null, node.textContent);
|
|
1022
|
+
vnode.$elm$ = node;
|
|
1023
|
+
vnode.$index$ = "0";
|
|
1024
|
+
parentVNode.$children$ = [vnode];
|
|
1025
|
+
} else {
|
|
1026
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1027
|
+
node.remove();
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
return parentVNode;
|
|
1031
|
+
};
|
|
1032
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
1033
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1034
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
1035
|
+
if (componentId) {
|
|
1036
|
+
orgLocNodes.set(componentId, node);
|
|
1037
|
+
}
|
|
1038
|
+
let i2 = 0;
|
|
1039
|
+
if (node.shadowRoot) {
|
|
1040
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1041
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1045
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
1046
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1047
|
+
}
|
|
1048
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1049
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
1050
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1051
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1052
|
+
node.nodeValue = "";
|
|
1053
|
+
node["s-en"] = childIdSplt[3];
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
var createSimpleVNode = (vnode) => {
|
|
1058
|
+
const defaultVNode = {
|
|
1059
|
+
$flags$: 0,
|
|
1060
|
+
$hostId$: null,
|
|
1061
|
+
$nodeId$: null,
|
|
1062
|
+
$depth$: null,
|
|
1063
|
+
$index$: "0",
|
|
1064
|
+
$elm$: null,
|
|
1065
|
+
$attrs$: null,
|
|
1066
|
+
$children$: null,
|
|
1067
|
+
$key$: null,
|
|
1068
|
+
$name$: null,
|
|
1069
|
+
$tag$: null,
|
|
1070
|
+
$text$: null
|
|
1071
|
+
};
|
|
1072
|
+
return { ...defaultVNode, ...vnode };
|
|
1073
|
+
};
|
|
1074
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1075
|
+
node["s-sr"] = true;
|
|
1076
|
+
childVNode.$name$ = slotName || null;
|
|
1077
|
+
childVNode.$tag$ = "slot";
|
|
1078
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1079
|
+
if (shadowRootNodes && win.document) {
|
|
1080
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1081
|
+
if (childVNode.$name$) {
|
|
1082
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1083
|
+
}
|
|
1084
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1085
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1086
|
+
} else {
|
|
1087
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1088
|
+
}
|
|
1089
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1090
|
+
node.remove();
|
|
1091
|
+
if (childVNode.$depth$ === "0") {
|
|
1092
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1093
|
+
}
|
|
1094
|
+
} else {
|
|
1095
|
+
const slot = childVNode.$elm$;
|
|
1096
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1097
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1098
|
+
patchSlotNode(node);
|
|
1099
|
+
if (shouldMove) {
|
|
1100
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1101
|
+
}
|
|
1102
|
+
childRenderNodes.push(childVNode);
|
|
1103
|
+
}
|
|
1104
|
+
slotNodes.push(childVNode);
|
|
1105
|
+
if (!parentVNode.$children$) {
|
|
1106
|
+
parentVNode.$children$ = [];
|
|
1107
|
+
}
|
|
1108
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1109
|
+
}
|
|
1110
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1111
|
+
let slottedNode = slotNode.nextSibling;
|
|
1112
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1113
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1114
|
+
slottedNode["s-sn"] = slotName;
|
|
1115
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1116
|
+
slottedNode = slottedNode.nextSibling;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
var findCorrespondingNode = (node, type) => {
|
|
1120
|
+
let sibling = node;
|
|
1121
|
+
do {
|
|
1122
|
+
sibling = sibling.nextSibling;
|
|
1123
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
1124
|
+
return sibling;
|
|
1125
|
+
};
|
|
1126
|
+
var createSupportsRuleRe = (selector) => {
|
|
1127
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
1128
|
+
return new RegExp(
|
|
1129
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
1130
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
1131
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
1132
|
+
"g"
|
|
1133
|
+
);
|
|
1134
|
+
};
|
|
1135
|
+
createSupportsRuleRe("::slotted");
|
|
1136
|
+
createSupportsRuleRe(":host");
|
|
1137
|
+
createSupportsRuleRe(":host-context");
|
|
1138
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
1139
|
+
if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
1140
|
+
try {
|
|
1141
|
+
propValue = JSON.parse(propValue);
|
|
1142
|
+
return propValue;
|
|
1143
|
+
} catch (e) {
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1147
|
+
propValue = deserializeProperty(propValue);
|
|
1148
|
+
return propValue;
|
|
1149
|
+
}
|
|
448
1150
|
if (propValue != null && !isComplexType(propValue)) {
|
|
449
1151
|
if (propType & 4 /* Boolean */) {
|
|
450
|
-
|
|
1152
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1153
|
+
return propValue === "" || !!propValue;
|
|
1154
|
+
} else {
|
|
1155
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1156
|
+
}
|
|
451
1157
|
}
|
|
452
1158
|
if (propType & 2 /* Number */) {
|
|
453
|
-
return parseFloat(propValue);
|
|
1159
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
454
1160
|
}
|
|
455
1161
|
if (propType & 1 /* String */) {
|
|
456
1162
|
return String(propValue);
|
|
@@ -467,9 +1173,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
467
1173
|
return {
|
|
468
1174
|
emit: (detail) => {
|
|
469
1175
|
return emitEvent(elm, name, {
|
|
470
|
-
bubbles:
|
|
471
|
-
composed:
|
|
472
|
-
cancelable:
|
|
1176
|
+
bubbles: true,
|
|
1177
|
+
composed: true,
|
|
1178
|
+
cancelable: true,
|
|
473
1179
|
detail
|
|
474
1180
|
});
|
|
475
1181
|
}
|
|
@@ -499,7 +1205,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
499
1205
|
var _a;
|
|
500
1206
|
const scopeId2 = getScopeId(cmpMeta);
|
|
501
1207
|
const style = styles.get(scopeId2);
|
|
502
|
-
|
|
1208
|
+
if (!win.document) {
|
|
1209
|
+
return scopeId2;
|
|
1210
|
+
}
|
|
1211
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
503
1212
|
if (style) {
|
|
504
1213
|
if (typeof style === "string") {
|
|
505
1214
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -509,14 +1218,43 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
509
1218
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
510
1219
|
}
|
|
511
1220
|
if (!appliedStyles.has(scopeId2)) {
|
|
512
|
-
{
|
|
513
|
-
styleElm = doc.createElement("style");
|
|
1221
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
514
1222
|
styleElm.innerHTML = style;
|
|
515
|
-
|
|
1223
|
+
} else {
|
|
1224
|
+
styleElm = win.document.createElement("style");
|
|
1225
|
+
styleElm.innerHTML = style;
|
|
1226
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
516
1227
|
if (nonce != null) {
|
|
517
1228
|
styleElm.setAttribute("nonce", nonce);
|
|
518
1229
|
}
|
|
519
|
-
|
|
1230
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
1231
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
1232
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
1233
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
1234
|
+
styleContainerNode.insertBefore(
|
|
1235
|
+
styleElm,
|
|
1236
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
1237
|
+
);
|
|
1238
|
+
} else if ("host" in styleContainerNode) {
|
|
1239
|
+
if (supportsConstructableStylesheets) {
|
|
1240
|
+
const stylesheet = new CSSStyleSheet();
|
|
1241
|
+
stylesheet.replaceSync(style);
|
|
1242
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1243
|
+
} else {
|
|
1244
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
1245
|
+
if (existingStyleContainer) {
|
|
1246
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1247
|
+
} else {
|
|
1248
|
+
styleContainerNode.prepend(styleElm);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
} else {
|
|
1252
|
+
styleContainerNode.append(styleElm);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1256
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
1257
|
+
}
|
|
520
1258
|
}
|
|
521
1259
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
522
1260
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -546,121 +1284,170 @@ var attachStyles = (hostRef) => {
|
|
|
546
1284
|
endAttachStyles();
|
|
547
1285
|
};
|
|
548
1286
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
1287
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1288
|
+
var hydrateScopedToShadow = () => {
|
|
1289
|
+
if (!win.document) {
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1293
|
+
let i2 = 0;
|
|
1294
|
+
for (; i2 < styles2.length; i2++) {
|
|
1295
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
1299
|
+
if (oldValue === newValue) {
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
1303
|
+
let ln = memberName.toLowerCase();
|
|
1304
|
+
if (memberName === "class") {
|
|
1305
|
+
const classList = elm.classList;
|
|
1306
|
+
const oldClasses = parseClassList(oldValue);
|
|
1307
|
+
let newClasses = parseClassList(newValue);
|
|
1308
|
+
if (elm["s-si"] && initialRender) {
|
|
1309
|
+
newClasses.push(elm["s-si"]);
|
|
1310
|
+
oldClasses.forEach((c) => {
|
|
1311
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1312
|
+
});
|
|
1313
|
+
newClasses = [...new Set(newClasses)];
|
|
1314
|
+
classList.add(...newClasses);
|
|
1315
|
+
} else {
|
|
557
1316
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
558
1317
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
elm.style.removeProperty(prop);
|
|
565
|
-
} else {
|
|
566
|
-
elm.style[prop] = "";
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
for (const prop in newValue) {
|
|
572
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1318
|
+
}
|
|
1319
|
+
} else if (memberName === "style") {
|
|
1320
|
+
{
|
|
1321
|
+
for (const prop in oldValue) {
|
|
1322
|
+
if (!newValue || newValue[prop] == null) {
|
|
573
1323
|
if (prop.includes("-")) {
|
|
574
|
-
elm.style.
|
|
1324
|
+
elm.style.removeProperty(prop);
|
|
575
1325
|
} else {
|
|
576
|
-
elm.style[prop] =
|
|
1326
|
+
elm.style[prop] = "";
|
|
577
1327
|
}
|
|
578
1328
|
}
|
|
579
1329
|
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
} else if (isMemberInElement(win, ln)) {
|
|
588
|
-
memberName = ln.slice(2);
|
|
589
|
-
} else {
|
|
590
|
-
memberName = ln[2] + memberName.slice(3);
|
|
591
|
-
}
|
|
592
|
-
if (oldValue || newValue) {
|
|
593
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
594
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
595
|
-
if (oldValue) {
|
|
596
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
597
|
-
}
|
|
598
|
-
if (newValue) {
|
|
599
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
1330
|
+
}
|
|
1331
|
+
for (const prop in newValue) {
|
|
1332
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1333
|
+
if (prop.includes("-")) {
|
|
1334
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
1335
|
+
} else {
|
|
1336
|
+
elm.style[prop] = newValue[prop];
|
|
600
1337
|
}
|
|
601
1338
|
}
|
|
1339
|
+
}
|
|
1340
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
1341
|
+
if (newValue) {
|
|
1342
|
+
newValue(elm);
|
|
1343
|
+
}
|
|
1344
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1345
|
+
if (memberName[2] === "-") {
|
|
1346
|
+
memberName = memberName.slice(3);
|
|
1347
|
+
} else if (isMemberInElement(win, ln)) {
|
|
1348
|
+
memberName = ln.slice(2);
|
|
602
1349
|
} else {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
1350
|
+
memberName = ln[2] + memberName.slice(3);
|
|
1351
|
+
}
|
|
1352
|
+
if (oldValue || newValue) {
|
|
1353
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
1354
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
1355
|
+
if (oldValue) {
|
|
1356
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
1357
|
+
}
|
|
1358
|
+
if (newValue) {
|
|
1359
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
} else {
|
|
1363
|
+
const isComplex = isComplexType(newValue);
|
|
1364
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1365
|
+
try {
|
|
1366
|
+
if (!elm.tagName.includes("-")) {
|
|
1367
|
+
const n = newValue == null ? "" : newValue;
|
|
1368
|
+
if (memberName === "list") {
|
|
1369
|
+
isProp = false;
|
|
1370
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
1371
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
611
1372
|
elm[memberName] = n;
|
|
1373
|
+
} else {
|
|
1374
|
+
elm.setAttribute(memberName, n);
|
|
612
1375
|
}
|
|
613
|
-
} else {
|
|
614
|
-
elm[memberName] = newValue;
|
|
615
1376
|
}
|
|
616
|
-
}
|
|
1377
|
+
} else if (elm[memberName] !== newValue) {
|
|
1378
|
+
elm[memberName] = newValue;
|
|
617
1379
|
}
|
|
1380
|
+
} catch (e) {
|
|
618
1381
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
1382
|
+
}
|
|
1383
|
+
let xlink = false;
|
|
1384
|
+
{
|
|
1385
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1386
|
+
memberName = ln;
|
|
1387
|
+
xlink = true;
|
|
625
1388
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
630
|
-
} else {
|
|
631
|
-
elm.removeAttribute(memberName);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
635
|
-
newValue = newValue === true ? "" : newValue;
|
|
1389
|
+
}
|
|
1390
|
+
if (newValue == null || newValue === false) {
|
|
1391
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
636
1392
|
if (xlink) {
|
|
637
|
-
elm.
|
|
1393
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
638
1394
|
} else {
|
|
639
|
-
elm.
|
|
1395
|
+
elm.removeAttribute(memberName);
|
|
640
1396
|
}
|
|
641
1397
|
}
|
|
1398
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
1399
|
+
newValue = newValue === true ? "" : newValue;
|
|
1400
|
+
if (xlink) {
|
|
1401
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1402
|
+
} else {
|
|
1403
|
+
elm.setAttribute(memberName, newValue);
|
|
1404
|
+
}
|
|
642
1405
|
}
|
|
643
1406
|
}
|
|
644
1407
|
};
|
|
645
1408
|
var parseClassListRegex = /\s/;
|
|
646
|
-
var parseClassList = (value) =>
|
|
1409
|
+
var parseClassList = (value) => {
|
|
1410
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
1411
|
+
value = value.baseVal;
|
|
1412
|
+
}
|
|
1413
|
+
if (!value || typeof value !== "string") {
|
|
1414
|
+
return [];
|
|
1415
|
+
}
|
|
1416
|
+
return value.split(parseClassListRegex);
|
|
1417
|
+
};
|
|
647
1418
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
648
1419
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
649
1420
|
|
|
650
1421
|
// src/runtime/vdom/update-element.ts
|
|
651
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
1422
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
652
1423
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
653
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
654
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
1424
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1425
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
655
1426
|
{
|
|
656
1427
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
657
1428
|
if (!(memberName in newVnodeAttrs)) {
|
|
658
|
-
setAccessor(
|
|
1429
|
+
setAccessor(
|
|
1430
|
+
elm,
|
|
1431
|
+
memberName,
|
|
1432
|
+
oldVnodeAttrs[memberName],
|
|
1433
|
+
void 0,
|
|
1434
|
+
isSvgMode2,
|
|
1435
|
+
newVnode.$flags$,
|
|
1436
|
+
isInitialRender
|
|
1437
|
+
);
|
|
659
1438
|
}
|
|
660
1439
|
}
|
|
661
1440
|
}
|
|
662
1441
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
663
|
-
setAccessor(
|
|
1442
|
+
setAccessor(
|
|
1443
|
+
elm,
|
|
1444
|
+
memberName,
|
|
1445
|
+
oldVnodeAttrs[memberName],
|
|
1446
|
+
newVnodeAttrs[memberName],
|
|
1447
|
+
isSvgMode2,
|
|
1448
|
+
newVnode.$flags$,
|
|
1449
|
+
isInitialRender
|
|
1450
|
+
);
|
|
664
1451
|
}
|
|
665
1452
|
};
|
|
666
1453
|
function sortedAttrNames(attrNames) {
|
|
@@ -672,16 +1459,13 @@ function sortedAttrNames(attrNames) {
|
|
|
672
1459
|
attrNames
|
|
673
1460
|
);
|
|
674
1461
|
}
|
|
675
|
-
|
|
676
|
-
// src/runtime/vdom/vdom-render.ts
|
|
677
|
-
var scopeId;
|
|
678
1462
|
var contentRef;
|
|
679
1463
|
var hostTagName;
|
|
680
1464
|
var useNativeShadowDom = false;
|
|
681
1465
|
var checkSlotFallbackVisibility = false;
|
|
682
1466
|
var checkSlotRelocate = false;
|
|
683
1467
|
var isSvgMode = false;
|
|
684
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
1468
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
685
1469
|
var _a;
|
|
686
1470
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
687
1471
|
let i2 = 0;
|
|
@@ -691,9 +1475,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
691
1475
|
if (!useNativeShadowDom) {
|
|
692
1476
|
checkSlotRelocate = true;
|
|
693
1477
|
if (newVNode2.$tag$ === "slot") {
|
|
694
|
-
if (scopeId) {
|
|
695
|
-
parentElm.classList.add(scopeId + "-s");
|
|
696
|
-
}
|
|
697
1478
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
698
1479
|
// slot element has fallback content
|
|
699
1480
|
// still create an element that "mocks" the slot element
|
|
@@ -707,14 +1488,22 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
707
1488
|
}
|
|
708
1489
|
}
|
|
709
1490
|
if (newVNode2.$text$ !== null) {
|
|
710
|
-
elm = newVNode2.$elm$ =
|
|
1491
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
711
1492
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
712
|
-
elm = newVNode2.$elm$ =
|
|
1493
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
1494
|
+
{
|
|
1495
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
1496
|
+
}
|
|
713
1497
|
} else {
|
|
714
1498
|
if (!isSvgMode) {
|
|
715
1499
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
716
1500
|
}
|
|
717
|
-
|
|
1501
|
+
if (!win.document) {
|
|
1502
|
+
throw new Error(
|
|
1503
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
718
1507
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
719
1508
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
720
1509
|
) ;
|
|
@@ -724,12 +1513,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
724
1513
|
{
|
|
725
1514
|
updateElement(null, newVNode2, isSvgMode);
|
|
726
1515
|
}
|
|
727
|
-
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
728
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
729
|
-
}
|
|
730
1516
|
if (newVNode2.$children$) {
|
|
731
1517
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
732
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
1518
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
733
1519
|
if (childNode) {
|
|
734
1520
|
elm.appendChild(childNode);
|
|
735
1521
|
}
|
|
@@ -750,6 +1536,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
750
1536
|
elm["s-cr"] = contentRef;
|
|
751
1537
|
elm["s-sn"] = newVNode2.$name$ || "";
|
|
752
1538
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1539
|
+
patchSlotNode(elm);
|
|
753
1540
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
754
1541
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
755
1542
|
{
|
|
@@ -762,19 +1549,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
762
1549
|
};
|
|
763
1550
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
764
1551
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
765
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
766
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
767
|
-
let node = parentElm;
|
|
768
|
-
while (node = node.nextSibling) {
|
|
769
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
770
|
-
oldSlotChildNodes.push(node);
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
1552
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
774
1553
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
775
1554
|
const childNode = oldSlotChildNodes[i2];
|
|
776
1555
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
777
|
-
insertBefore(
|
|
1556
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
778
1557
|
childNode["s-ol"].remove();
|
|
779
1558
|
childNode["s-ol"] = void 0;
|
|
780
1559
|
childNode["s-sh"] = void 0;
|
|
@@ -784,7 +1563,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
784
1563
|
putBackInOriginalLocation(childNode, recursive);
|
|
785
1564
|
}
|
|
786
1565
|
}
|
|
787
|
-
plt.$flags$ &=
|
|
1566
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
788
1567
|
};
|
|
789
1568
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
790
1569
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
@@ -794,7 +1573,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
794
1573
|
}
|
|
795
1574
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
796
1575
|
if (vnodes[startIdx]) {
|
|
797
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
1576
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
798
1577
|
if (childNode) {
|
|
799
1578
|
vnodes[startIdx].$elm$ = childNode;
|
|
800
1579
|
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
@@ -881,7 +1660,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
881
1660
|
if (idxInOld >= 0) {
|
|
882
1661
|
elmToMove = oldCh[idxInOld];
|
|
883
1662
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
884
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1663
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
885
1664
|
} else {
|
|
886
1665
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
887
1666
|
oldCh[idxInOld] = void 0;
|
|
@@ -889,12 +1668,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
889
1668
|
}
|
|
890
1669
|
newStartVnode = newCh[++newStartIdx];
|
|
891
1670
|
} else {
|
|
892
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1671
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
893
1672
|
newStartVnode = newCh[++newStartIdx];
|
|
894
1673
|
}
|
|
895
1674
|
if (node) {
|
|
896
1675
|
{
|
|
897
|
-
insertBefore(
|
|
1676
|
+
insertBefore(
|
|
1677
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1678
|
+
node,
|
|
1679
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1680
|
+
);
|
|
898
1681
|
}
|
|
899
1682
|
}
|
|
900
1683
|
}
|
|
@@ -920,14 +1703,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
920
1703
|
if (!isInitialRender) {
|
|
921
1704
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
922
1705
|
}
|
|
1706
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1707
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1708
|
+
}
|
|
923
1709
|
return true;
|
|
924
1710
|
}
|
|
925
1711
|
return false;
|
|
926
1712
|
};
|
|
927
|
-
var referenceNode = (node) =>
|
|
928
|
-
return node && node["s-ol"] || node;
|
|
929
|
-
};
|
|
930
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1713
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
931
1714
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
932
1715
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
933
1716
|
const oldChildren = oldVNode.$children$;
|
|
@@ -940,9 +1723,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
940
1723
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
941
1724
|
}
|
|
942
1725
|
{
|
|
943
|
-
|
|
944
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
945
|
-
}
|
|
1726
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
946
1727
|
}
|
|
947
1728
|
if (oldChildren !== null && newChildren !== null) {
|
|
948
1729
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -951,7 +1732,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
951
1732
|
elm.textContent = "";
|
|
952
1733
|
}
|
|
953
1734
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
954
|
-
} else if (
|
|
1735
|
+
} else if (
|
|
1736
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1737
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1738
|
+
) {
|
|
955
1739
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
956
1740
|
}
|
|
957
1741
|
if (isSvgMode && tag === "svg") {
|
|
@@ -963,45 +1747,19 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
963
1747
|
elm.data = text;
|
|
964
1748
|
}
|
|
965
1749
|
};
|
|
966
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
967
|
-
const childNodes = elm.childNodes;
|
|
968
|
-
for (const childNode of childNodes) {
|
|
969
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
970
|
-
if (childNode["s-sr"]) {
|
|
971
|
-
const slotName = childNode["s-sn"];
|
|
972
|
-
childNode.hidden = false;
|
|
973
|
-
for (const siblingNode of childNodes) {
|
|
974
|
-
if (siblingNode !== childNode) {
|
|
975
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
976
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
977
|
-
childNode.hidden = true;
|
|
978
|
-
break;
|
|
979
|
-
}
|
|
980
|
-
} else {
|
|
981
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
982
|
-
childNode.hidden = true;
|
|
983
|
-
break;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
updateFallbackSlotVisibility(childNode);
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
};
|
|
993
1750
|
var relocateNodes = [];
|
|
994
1751
|
var markSlotContentForRelocation = (elm) => {
|
|
995
1752
|
let node;
|
|
996
1753
|
let hostContentNodes;
|
|
997
1754
|
let j;
|
|
998
|
-
|
|
1755
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1756
|
+
for (const childNode of children) {
|
|
999
1757
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1000
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1758
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1001
1759
|
const slotName = childNode["s-sn"];
|
|
1002
1760
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1003
1761
|
node = hostContentNodes[j];
|
|
1004
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (
|
|
1762
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
1005
1763
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1006
1764
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1007
1765
|
checkSlotFallbackVisibility = true;
|
|
@@ -1039,21 +1797,6 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1039
1797
|
}
|
|
1040
1798
|
}
|
|
1041
1799
|
};
|
|
1042
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1043
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1044
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1045
|
-
return true;
|
|
1046
|
-
}
|
|
1047
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1048
|
-
return true;
|
|
1049
|
-
}
|
|
1050
|
-
return false;
|
|
1051
|
-
}
|
|
1052
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1053
|
-
return true;
|
|
1054
|
-
}
|
|
1055
|
-
return slotName === "";
|
|
1056
|
-
};
|
|
1057
1800
|
var nullifyVNodeRefs = (vNode) => {
|
|
1058
1801
|
{
|
|
1059
1802
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -1061,15 +1804,17 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
1061
1804
|
}
|
|
1062
1805
|
};
|
|
1063
1806
|
var insertBefore = (parent, newNode, reference) => {
|
|
1064
|
-
|
|
1065
|
-
|
|
1807
|
+
{
|
|
1808
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1809
|
+
}
|
|
1066
1810
|
};
|
|
1067
1811
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1068
1812
|
var _a, _b, _c, _d;
|
|
1069
1813
|
const hostElm = hostRef.$hostElement$;
|
|
1070
1814
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1071
1815
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1072
|
-
const
|
|
1816
|
+
const isHostElement = isHost(renderFnResults);
|
|
1817
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1073
1818
|
hostTagName = hostElm.tagName;
|
|
1074
1819
|
if (cmpMeta.$attrsToReflect$) {
|
|
1075
1820
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
@@ -1088,10 +1833,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1088
1833
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1089
1834
|
hostRef.$vnode$ = rootVnode;
|
|
1090
1835
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1091
|
-
|
|
1092
|
-
scopeId = hostElm["s-sc"];
|
|
1093
|
-
}
|
|
1094
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1836
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1095
1837
|
{
|
|
1096
1838
|
contentRef = hostElm["s-cr"];
|
|
1097
1839
|
checkSlotFallbackVisibility = false;
|
|
@@ -1103,8 +1845,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1103
1845
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1104
1846
|
for (const relocateData of relocateNodes) {
|
|
1105
1847
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1106
|
-
if (!nodeToRelocate["s-ol"]) {
|
|
1107
|
-
const orgLocationNode =
|
|
1848
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1849
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1108
1850
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1109
1851
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1110
1852
|
}
|
|
@@ -1119,7 +1861,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1119
1861
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1120
1862
|
while (orgLocationNode) {
|
|
1121
1863
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1122
|
-
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
|
|
1864
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1123
1865
|
refNode = refNode.nextSibling;
|
|
1124
1866
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1125
1867
|
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
@@ -1132,18 +1874,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1132
1874
|
orgLocationNode = orgLocationNode.previousSibling;
|
|
1133
1875
|
}
|
|
1134
1876
|
}
|
|
1135
|
-
|
|
1877
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1878
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1879
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1136
1880
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1137
1881
|
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1138
1882
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1139
1883
|
}
|
|
1140
1884
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1141
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1885
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1142
1886
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1143
1887
|
}
|
|
1144
1888
|
}
|
|
1145
1889
|
}
|
|
1146
|
-
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](
|
|
1890
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1147
1891
|
} else {
|
|
1148
1892
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1149
1893
|
if (isInitialLoad) {
|
|
@@ -1157,7 +1901,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1157
1901
|
if (checkSlotFallbackVisibility) {
|
|
1158
1902
|
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1159
1903
|
}
|
|
1160
|
-
plt.$flags$ &=
|
|
1904
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1161
1905
|
relocateNodes.length = 0;
|
|
1162
1906
|
}
|
|
1163
1907
|
contentRef = void 0;
|
|
@@ -1166,7 +1910,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1166
1910
|
// src/runtime/update-component.ts
|
|
1167
1911
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1168
1912
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1169
|
-
ancestorComponent["s-p"].push(
|
|
1913
|
+
const index = ancestorComponent["s-p"].push(
|
|
1914
|
+
new Promise(
|
|
1915
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1916
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1917
|
+
r();
|
|
1918
|
+
}
|
|
1919
|
+
)
|
|
1920
|
+
);
|
|
1170
1921
|
}
|
|
1171
1922
|
};
|
|
1172
1923
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1195,17 +1946,15 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1195
1946
|
{
|
|
1196
1947
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1197
1948
|
if (hostRef.$queuedListeners$) {
|
|
1198
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1949
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
1199
1950
|
hostRef.$queuedListeners$ = void 0;
|
|
1200
1951
|
}
|
|
1201
1952
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
{
|
|
1207
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1953
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1954
|
+
} else {
|
|
1955
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1208
1956
|
}
|
|
1957
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1209
1958
|
endSchedule();
|
|
1210
1959
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1211
1960
|
};
|
|
@@ -1248,7 +1997,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1248
1997
|
try {
|
|
1249
1998
|
instance = instance.render() ;
|
|
1250
1999
|
{
|
|
1251
|
-
hostRef.$flags$ &=
|
|
2000
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1252
2001
|
}
|
|
1253
2002
|
{
|
|
1254
2003
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -1271,17 +2020,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1271
2020
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1272
2021
|
const instance = hostRef.$lazyInstance$ ;
|
|
1273
2022
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1274
|
-
|
|
1275
|
-
safeCall(instance, "componentDidRender");
|
|
1276
|
-
}
|
|
2023
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1277
2024
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1278
2025
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1279
2026
|
{
|
|
1280
2027
|
addHydratedFlag(elm);
|
|
1281
2028
|
}
|
|
1282
|
-
|
|
1283
|
-
safeCall(instance, "componentDidLoad");
|
|
1284
|
-
}
|
|
2029
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1285
2030
|
endPostUpdate();
|
|
1286
2031
|
{
|
|
1287
2032
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1290,6 +2035,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1290
2035
|
}
|
|
1291
2036
|
}
|
|
1292
2037
|
} else {
|
|
2038
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1293
2039
|
endPostUpdate();
|
|
1294
2040
|
}
|
|
1295
2041
|
{
|
|
@@ -1303,21 +2049,18 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1303
2049
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1304
2050
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1305
2051
|
}
|
|
1306
|
-
hostRef.$flags$ &=
|
|
2052
|
+
hostRef.$flags$ &= -517;
|
|
1307
2053
|
}
|
|
1308
2054
|
};
|
|
1309
2055
|
var appDidLoad = (who) => {
|
|
1310
|
-
{
|
|
1311
|
-
addHydratedFlag(doc.documentElement);
|
|
1312
|
-
}
|
|
1313
2056
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1314
2057
|
};
|
|
1315
|
-
var safeCall = (instance, method, arg) => {
|
|
2058
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1316
2059
|
if (instance && instance[method]) {
|
|
1317
2060
|
try {
|
|
1318
2061
|
return instance[method](arg);
|
|
1319
2062
|
} catch (e) {
|
|
1320
|
-
consoleError(e);
|
|
2063
|
+
consoleError(e, elm);
|
|
1321
2064
|
}
|
|
1322
2065
|
}
|
|
1323
2066
|
return void 0;
|
|
@@ -1333,14 +2076,18 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1333
2076
|
const hostRef = getHostRef(ref);
|
|
1334
2077
|
if (!hostRef) {
|
|
1335
2078
|
throw new Error(
|
|
1336
|
-
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/
|
|
2079
|
+
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
1337
2080
|
);
|
|
1338
2081
|
}
|
|
1339
2082
|
const elm = hostRef.$hostElement$ ;
|
|
1340
2083
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1341
2084
|
const flags = hostRef.$flags$;
|
|
1342
2085
|
const instance = hostRef.$lazyInstance$ ;
|
|
1343
|
-
newVal = parsePropertyValue(
|
|
2086
|
+
newVal = parsePropertyValue(
|
|
2087
|
+
newVal,
|
|
2088
|
+
cmpMeta.$members$[propName][0],
|
|
2089
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2090
|
+
);
|
|
1344
2091
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1345
2092
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1346
2093
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -1359,6 +2106,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1359
2106
|
}
|
|
1360
2107
|
}
|
|
1361
2108
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2109
|
+
if (instance.componentShouldUpdate) {
|
|
2110
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
1362
2114
|
scheduleUpdate(hostRef, false);
|
|
1363
2115
|
}
|
|
1364
2116
|
}
|
|
@@ -1370,23 +2122,23 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1370
2122
|
var _a, _b;
|
|
1371
2123
|
const prototype = Cstr.prototype;
|
|
1372
2124
|
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1373
|
-
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
|
|
1374
|
-
|
|
2125
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2126
|
+
Object.defineProperty(prototype, cbName, {
|
|
1375
2127
|
value(...args) {
|
|
1376
2128
|
const hostRef = getHostRef(this);
|
|
1377
2129
|
const instance = hostRef.$lazyInstance$ ;
|
|
1378
2130
|
if (!instance) {
|
|
1379
|
-
hostRef.$onReadyPromise$.then((
|
|
1380
|
-
const cb =
|
|
1381
|
-
typeof cb === "function" && cb.call(
|
|
2131
|
+
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2132
|
+
const cb = asyncInstance[cbName];
|
|
2133
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1382
2134
|
});
|
|
1383
2135
|
} else {
|
|
1384
|
-
const cb = instance[cbName];
|
|
2136
|
+
const cb = instance[cbName] ;
|
|
1385
2137
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
1386
2138
|
}
|
|
1387
2139
|
}
|
|
1388
|
-
})
|
|
1389
|
-
);
|
|
2140
|
+
});
|
|
2141
|
+
});
|
|
1390
2142
|
}
|
|
1391
2143
|
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
1392
2144
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
@@ -1395,15 +2147,78 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1395
2147
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1396
2148
|
members.map(([memberName, [memberFlags]]) => {
|
|
1397
2149
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2150
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
2151
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
2152
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
2153
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
2154
|
+
Object.defineProperty(prototype, memberName, {
|
|
2155
|
+
get() {
|
|
2156
|
+
{
|
|
2157
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
2158
|
+
return getValue(this, memberName);
|
|
2159
|
+
}
|
|
2160
|
+
const ref = getHostRef(this);
|
|
2161
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
2162
|
+
if (!instance) return;
|
|
2163
|
+
return instance[memberName];
|
|
2164
|
+
}
|
|
2165
|
+
},
|
|
2166
|
+
configurable: true,
|
|
2167
|
+
enumerable: true
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
1398
2170
|
Object.defineProperty(prototype, memberName, {
|
|
1399
|
-
get() {
|
|
1400
|
-
return getValue(this, memberName);
|
|
1401
|
-
},
|
|
1402
2171
|
set(newValue) {
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
2172
|
+
const ref = getHostRef(this);
|
|
2173
|
+
if (origSetter) {
|
|
2174
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2175
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
2176
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
2177
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2178
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2179
|
+
}
|
|
2180
|
+
origSetter.apply(this, [
|
|
2181
|
+
parsePropertyValue(
|
|
2182
|
+
newValue,
|
|
2183
|
+
memberFlags,
|
|
2184
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2185
|
+
)
|
|
2186
|
+
]);
|
|
2187
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2188
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
{
|
|
2192
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
2193
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2194
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
2195
|
+
ref.$onReadyPromise$.then(() => {
|
|
2196
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
2197
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
2198
|
+
}
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
const setterSetVal = () => {
|
|
2204
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2205
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2206
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2207
|
+
}
|
|
2208
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
2209
|
+
newValue,
|
|
2210
|
+
memberFlags,
|
|
2211
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2212
|
+
);
|
|
2213
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2214
|
+
};
|
|
2215
|
+
if (ref.$lazyInstance$) {
|
|
2216
|
+
setterSetVal();
|
|
2217
|
+
} else {
|
|
2218
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
1407
2222
|
});
|
|
1408
2223
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1409
2224
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -1424,10 +2239,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1424
2239
|
plt.jmp(() => {
|
|
1425
2240
|
var _a2;
|
|
1426
2241
|
const propName = attrNameToPropName.get(attrName);
|
|
1427
|
-
if (this.hasOwnProperty(propName)) {
|
|
2242
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1428
2243
|
newValue = this[propName];
|
|
1429
2244
|
delete this[propName];
|
|
1430
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
2245
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
2246
|
+
this[propName] == newValue) {
|
|
1431
2247
|
return;
|
|
1432
2248
|
} else if (propName == null) {
|
|
1433
2249
|
const hostRef = getHostRef(this);
|
|
@@ -1443,7 +2259,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1443
2259
|
}
|
|
1444
2260
|
return;
|
|
1445
2261
|
}
|
|
1446
|
-
|
|
2262
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2263
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2264
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
2265
|
+
this[propName] = newValue;
|
|
2266
|
+
}
|
|
1447
2267
|
});
|
|
1448
2268
|
};
|
|
1449
2269
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1472,7 +2292,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1472
2292
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1473
2293
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1474
2294
|
if (bundleId) {
|
|
1475
|
-
const CstrImport = loadModule(cmpMeta);
|
|
2295
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1476
2296
|
if (CstrImport && "then" in CstrImport) {
|
|
1477
2297
|
const endLoad = uniqueTime();
|
|
1478
2298
|
Cstr = await CstrImport;
|
|
@@ -1497,16 +2317,16 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1497
2317
|
try {
|
|
1498
2318
|
new Cstr(hostRef);
|
|
1499
2319
|
} catch (e) {
|
|
1500
|
-
consoleError(e);
|
|
2320
|
+
consoleError(e, elm);
|
|
1501
2321
|
}
|
|
1502
2322
|
{
|
|
1503
|
-
hostRef.$flags$ &=
|
|
2323
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1504
2324
|
}
|
|
1505
2325
|
{
|
|
1506
2326
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1507
2327
|
}
|
|
1508
2328
|
endNewInstance();
|
|
1509
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2329
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1510
2330
|
} else {
|
|
1511
2331
|
Cstr = elm.constructor;
|
|
1512
2332
|
const cmpTag = elm.localName;
|
|
@@ -1533,9 +2353,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1533
2353
|
schedule();
|
|
1534
2354
|
}
|
|
1535
2355
|
};
|
|
1536
|
-
var fireConnectedCallback = (instance) => {
|
|
2356
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1537
2357
|
{
|
|
1538
|
-
safeCall(instance, "connectedCallback");
|
|
2358
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1539
2359
|
}
|
|
1540
2360
|
};
|
|
1541
2361
|
|
|
@@ -1547,7 +2367,18 @@ var connectedCallback = (elm) => {
|
|
|
1547
2367
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1548
2368
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1549
2369
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2370
|
+
let hostId;
|
|
1550
2371
|
{
|
|
2372
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2373
|
+
if (hostId) {
|
|
2374
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2375
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2376
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2377
|
+
}
|
|
2378
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
if (!hostId) {
|
|
1551
2382
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1552
2383
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1553
2384
|
setContentReference(elm);
|
|
@@ -1556,7 +2387,7 @@ var connectedCallback = (elm) => {
|
|
|
1556
2387
|
{
|
|
1557
2388
|
let ancestorComponent = elm;
|
|
1558
2389
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1559
|
-
if (ancestorComponent["s-p"]) {
|
|
2390
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1560
2391
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1561
2392
|
break;
|
|
1562
2393
|
}
|
|
@@ -1577,24 +2408,27 @@ var connectedCallback = (elm) => {
|
|
|
1577
2408
|
} else {
|
|
1578
2409
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1579
2410
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1580
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2411
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1581
2412
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1582
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
2413
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1583
2414
|
}
|
|
1584
2415
|
}
|
|
1585
2416
|
endConnected();
|
|
1586
2417
|
}
|
|
1587
2418
|
};
|
|
1588
2419
|
var setContentReference = (elm) => {
|
|
1589
|
-
|
|
2420
|
+
if (!win.document) {
|
|
2421
|
+
return;
|
|
2422
|
+
}
|
|
2423
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1590
2424
|
""
|
|
1591
2425
|
);
|
|
1592
2426
|
contentRefElm["s-cn"] = true;
|
|
1593
2427
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1594
2428
|
};
|
|
1595
|
-
var disconnectInstance = (instance) => {
|
|
2429
|
+
var disconnectInstance = (instance, elm) => {
|
|
1596
2430
|
{
|
|
1597
|
-
safeCall(instance, "disconnectedCallback");
|
|
2431
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1598
2432
|
}
|
|
1599
2433
|
};
|
|
1600
2434
|
var disconnectedCallback = async (elm) => {
|
|
@@ -1607,28 +2441,44 @@ var disconnectedCallback = async (elm) => {
|
|
|
1607
2441
|
}
|
|
1608
2442
|
}
|
|
1609
2443
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1610
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
2444
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1611
2445
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1612
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
2446
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1613
2447
|
}
|
|
1614
2448
|
}
|
|
2449
|
+
if (rootAppliedStyles.has(elm)) {
|
|
2450
|
+
rootAppliedStyles.delete(elm);
|
|
2451
|
+
}
|
|
2452
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
2453
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
2454
|
+
}
|
|
1615
2455
|
};
|
|
1616
2456
|
|
|
1617
2457
|
// src/runtime/bootstrap-lazy.ts
|
|
1618
2458
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1619
2459
|
var _a;
|
|
2460
|
+
if (!win.document) {
|
|
2461
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
2462
|
+
return;
|
|
2463
|
+
}
|
|
1620
2464
|
const endBootstrap = createTime();
|
|
1621
2465
|
const cmpTags = [];
|
|
1622
2466
|
const exclude = options.exclude || [];
|
|
1623
2467
|
const customElements2 = win.customElements;
|
|
1624
|
-
const head =
|
|
2468
|
+
const head = win.document.head;
|
|
1625
2469
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1626
|
-
const dataStyles = /* @__PURE__ */
|
|
2470
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1627
2471
|
const deferredConnectedCallbacks = [];
|
|
1628
2472
|
let appLoadFallback;
|
|
1629
2473
|
let isBootstrapping = true;
|
|
1630
2474
|
Object.assign(plt, options);
|
|
1631
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
|
2475
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
2476
|
+
{
|
|
2477
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
2478
|
+
}
|
|
2479
|
+
{
|
|
2480
|
+
hydrateScopedToShadow();
|
|
2481
|
+
}
|
|
1632
2482
|
let hasSlotRelocation = false;
|
|
1633
2483
|
lazyBundles.map((lazyBundle) => {
|
|
1634
2484
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1665,9 +2515,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1665
2515
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1666
2516
|
{
|
|
1667
2517
|
if (!self.shadowRoot) {
|
|
1668
|
-
|
|
1669
|
-
self.attachShadow({ mode: "open" });
|
|
1670
|
-
}
|
|
2518
|
+
createShadowRoot.call(self, cmpMeta);
|
|
1671
2519
|
} else {
|
|
1672
2520
|
if (self.shadowRoot.mode !== "open") {
|
|
1673
2521
|
throw new Error(
|
|
@@ -1696,6 +2544,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1696
2544
|
}
|
|
1697
2545
|
disconnectedCallback() {
|
|
1698
2546
|
plt.jmp(() => disconnectedCallback(this));
|
|
2547
|
+
plt.raf(() => {
|
|
2548
|
+
var _a3;
|
|
2549
|
+
const hostRef = getHostRef(this);
|
|
2550
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
2551
|
+
if (i2 > -1) {
|
|
2552
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
2553
|
+
}
|
|
2554
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
2555
|
+
delete hostRef.$vnode$.$elm$;
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
1699
2558
|
}
|
|
1700
2559
|
componentOnReady() {
|
|
1701
2560
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1718,12 +2577,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1718
2577
|
if (hasSlotRelocation) {
|
|
1719
2578
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
1720
2579
|
}
|
|
1721
|
-
{
|
|
1722
|
-
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1723
|
-
}
|
|
1724
2580
|
if (dataStyles.innerHTML.length) {
|
|
1725
2581
|
dataStyles.setAttribute("data-styles", "");
|
|
1726
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
2582
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1727
2583
|
if (nonce != null) {
|
|
1728
2584
|
dataStyles.setAttribute("nonce", nonce);
|
|
1729
2585
|
}
|
|
@@ -1741,9 +2597,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1741
2597
|
endBootstrap();
|
|
1742
2598
|
};
|
|
1743
2599
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1744
|
-
if (listeners) {
|
|
2600
|
+
if (listeners && win.document) {
|
|
1745
2601
|
listeners.map(([flags, name, method]) => {
|
|
1746
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2602
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1747
2603
|
const handler = hostListenerProxy(hostRef, method);
|
|
1748
2604
|
const opts = hostListenerOpts(flags);
|
|
1749
2605
|
plt.ael(target, name, handler, opts);
|
|
@@ -1762,11 +2618,13 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1762
2618
|
}
|
|
1763
2619
|
}
|
|
1764
2620
|
} catch (e) {
|
|
1765
|
-
consoleError(e);
|
|
2621
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1766
2622
|
}
|
|
1767
2623
|
};
|
|
1768
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1769
|
-
if (flags & 8 /* TargetWindow */)
|
|
2624
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2625
|
+
if (flags & 8 /* TargetWindow */) {
|
|
2626
|
+
return win;
|
|
2627
|
+
}
|
|
1770
2628
|
return elm;
|
|
1771
2629
|
};
|
|
1772
2630
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -1781,6 +2639,7 @@ exports.Host = Host;
|
|
|
1781
2639
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1782
2640
|
exports.createEvent = createEvent;
|
|
1783
2641
|
exports.getElement = getElement;
|
|
2642
|
+
exports.globalScripts = globalScripts;
|
|
1784
2643
|
exports.h = h;
|
|
1785
2644
|
exports.promiseResolve = promiseResolve;
|
|
1786
2645
|
exports.registerInstance = registerInstance;
|