@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
|
@@ -1,17 +1,57 @@
|
|
|
1
1
|
const NAMESPACE = 'post-components';
|
|
2
|
-
const BUILD = /* post-components */ {
|
|
2
|
+
const BUILD = /* post-components */ { hydratedSelectorName: "data-hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
3
|
+
|
|
4
|
+
const globalScripts = () => {};
|
|
5
|
+
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}";
|
|
3
6
|
|
|
4
7
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
8
|
+
Stencil Client Platform v4.35.0 | MIT Licensed | https://stenciljs.com
|
|
6
9
|
*/
|
|
7
10
|
var __defProp = Object.defineProperty;
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
14
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
+
|
|
16
|
+
// src/utils/constants.ts
|
|
17
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
18
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
19
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
20
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
21
|
+
PrimitiveType2["Null"] = "null";
|
|
22
|
+
PrimitiveType2["String"] = "string";
|
|
23
|
+
PrimitiveType2["Number"] = "number";
|
|
24
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
25
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
26
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
27
|
+
return PrimitiveType2;
|
|
28
|
+
})(PrimitiveType || {});
|
|
29
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
30
|
+
NonPrimitiveType2["Array"] = "array";
|
|
31
|
+
NonPrimitiveType2["Date"] = "date";
|
|
32
|
+
NonPrimitiveType2["Map"] = "map";
|
|
33
|
+
NonPrimitiveType2["Object"] = "object";
|
|
34
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
35
|
+
NonPrimitiveType2["Set"] = "set";
|
|
36
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
37
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
38
|
+
return NonPrimitiveType2;
|
|
39
|
+
})(NonPrimitiveType || {});
|
|
40
|
+
var TYPE_CONSTANT = "type";
|
|
41
|
+
var VALUE_CONSTANT = "value";
|
|
42
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
43
|
+
|
|
44
|
+
// src/client/client-host-ref.ts
|
|
45
|
+
var getHostRef = (ref) => {
|
|
46
|
+
if (ref.__stencil__getHostRef) {
|
|
47
|
+
return ref.__stencil__getHostRef();
|
|
48
|
+
}
|
|
49
|
+
return void 0;
|
|
50
|
+
};
|
|
51
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
52
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
53
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
54
|
+
};
|
|
15
55
|
var registerHost = (hostElement, cmpMeta) => {
|
|
16
56
|
const hostRef = {
|
|
17
57
|
$flags$: 0,
|
|
@@ -27,7 +67,9 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
27
67
|
hostElement["s-p"] = [];
|
|
28
68
|
hostElement["s-rc"] = [];
|
|
29
69
|
}
|
|
30
|
-
|
|
70
|
+
const ref = hostRef;
|
|
71
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
72
|
+
return ref;
|
|
31
73
|
};
|
|
32
74
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
33
75
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -52,14 +94,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
52
94
|
}
|
|
53
95
|
switch(bundleId) {
|
|
54
96
|
|
|
55
|
-
case 'post-closebutton_15':
|
|
56
|
-
return import(
|
|
57
|
-
/* webpackMode: "lazy" */
|
|
58
|
-
'./post-closebutton_15.entry.js').then(processMod, consoleError);
|
|
59
|
-
case 'post-accordion':
|
|
60
|
-
return import(
|
|
61
|
-
/* webpackMode: "lazy" */
|
|
62
|
-
'./post-accordion.entry.js').then(processMod, consoleError);
|
|
63
97
|
case 'post-avatar':
|
|
64
98
|
return import(
|
|
65
99
|
/* webpackMode: "lazy" */
|
|
@@ -68,14 +102,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
68
102
|
return import(
|
|
69
103
|
/* webpackMode: "lazy" */
|
|
70
104
|
'./post-back-to-top.entry.js').then(processMod, consoleError);
|
|
71
|
-
case 'post-banner':
|
|
72
|
-
return import(
|
|
73
|
-
/* webpackMode: "lazy" */
|
|
74
|
-
'./post-banner.entry.js').then(processMod, consoleError);
|
|
75
|
-
case 'post-breadcrumbs':
|
|
76
|
-
return import(
|
|
77
|
-
/* webpackMode: "lazy" */
|
|
78
|
-
'./post-breadcrumbs.entry.js').then(processMod, consoleError);
|
|
79
105
|
case 'post-card-control':
|
|
80
106
|
return import(
|
|
81
107
|
/* webpackMode: "lazy" */
|
|
@@ -88,10 +114,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
88
114
|
return import(
|
|
89
115
|
/* webpackMode: "lazy" */
|
|
90
116
|
'./post-linkarea.entry.js').then(processMod, consoleError);
|
|
91
|
-
case 'post-popover':
|
|
92
|
-
return import(
|
|
93
|
-
/* webpackMode: "lazy" */
|
|
94
|
-
'./post-popover.entry.js').then(processMod, consoleError);
|
|
95
117
|
case 'post-rating':
|
|
96
118
|
return import(
|
|
97
119
|
/* webpackMode: "lazy" */
|
|
@@ -104,10 +126,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
104
126
|
return import(
|
|
105
127
|
/* webpackMode: "lazy" */
|
|
106
128
|
'./post-tab-panel.entry.js').then(processMod, consoleError);
|
|
107
|
-
case 'post-tabs':
|
|
108
|
-
return import(
|
|
109
|
-
/* webpackMode: "lazy" */
|
|
110
|
-
'./post-tabs.entry.js').then(processMod, consoleError);
|
|
111
129
|
case 'post-tag':
|
|
112
130
|
return import(
|
|
113
131
|
/* webpackMode: "lazy" */
|
|
@@ -116,22 +134,42 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
116
134
|
return import(
|
|
117
135
|
/* webpackMode: "lazy" */
|
|
118
136
|
'./post-tooltip.entry.js').then(processMod, consoleError);
|
|
119
|
-
case 'post-
|
|
137
|
+
case 'post-banner':
|
|
120
138
|
return import(
|
|
121
139
|
/* webpackMode: "lazy" */
|
|
122
|
-
'./post-
|
|
123
|
-
case 'post-
|
|
140
|
+
'./post-banner.entry.js').then(processMod, consoleError);
|
|
141
|
+
case 'post-breadcrumbs':
|
|
124
142
|
return import(
|
|
125
143
|
/* webpackMode: "lazy" */
|
|
126
|
-
'./post-
|
|
144
|
+
'./post-breadcrumbs.entry.js').then(processMod, consoleError);
|
|
145
|
+
case 'post-popover':
|
|
146
|
+
return import(
|
|
147
|
+
/* webpackMode: "lazy" */
|
|
148
|
+
'./post-popover.entry.js').then(processMod, consoleError);
|
|
149
|
+
case 'post-tabs':
|
|
150
|
+
return import(
|
|
151
|
+
/* webpackMode: "lazy" */
|
|
152
|
+
'./post-tabs.entry.js').then(processMod, consoleError);
|
|
127
153
|
case 'post-breadcrumb-item_2':
|
|
128
154
|
return import(
|
|
129
155
|
/* webpackMode: "lazy" */
|
|
130
156
|
'./post-breadcrumb-item_2.entry.js').then(processMod, consoleError);
|
|
157
|
+
case 'post-accordion_2':
|
|
158
|
+
return import(
|
|
159
|
+
/* webpackMode: "lazy" */
|
|
160
|
+
'./post-accordion_2.entry.js').then(processMod, consoleError);
|
|
131
161
|
case 'post-collapsible_2':
|
|
132
162
|
return import(
|
|
133
163
|
/* webpackMode: "lazy" */
|
|
134
164
|
'./post-collapsible_2.entry.js').then(processMod, consoleError);
|
|
165
|
+
case 'post-closebutton_15':
|
|
166
|
+
return import(
|
|
167
|
+
/* webpackMode: "lazy" */
|
|
168
|
+
'./post-closebutton_15.entry.js').then(processMod, consoleError);
|
|
169
|
+
case 'post-tooltip-trigger':
|
|
170
|
+
return import(
|
|
171
|
+
/* webpackMode: "lazy" */
|
|
172
|
+
'./post-tooltip-trigger.entry.js').then(processMod, consoleError);
|
|
135
173
|
}
|
|
136
174
|
}
|
|
137
175
|
return import(
|
|
@@ -140,17 +178,31 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
140
178
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
141
179
|
/* webpackMode: "lazy" */
|
|
142
180
|
`./${bundleId}.entry.js${""}`
|
|
143
|
-
).then(
|
|
144
|
-
{
|
|
145
|
-
|
|
181
|
+
).then(
|
|
182
|
+
(importedModule) => {
|
|
183
|
+
{
|
|
184
|
+
cmpModules.set(bundleId, importedModule);
|
|
185
|
+
}
|
|
186
|
+
return importedModule[exportName];
|
|
187
|
+
},
|
|
188
|
+
(e) => {
|
|
189
|
+
consoleError(e, hostRef.$hostElement$);
|
|
146
190
|
}
|
|
147
|
-
|
|
148
|
-
}, consoleError);
|
|
191
|
+
);
|
|
149
192
|
};
|
|
150
193
|
|
|
151
194
|
// src/client/client-style.ts
|
|
152
195
|
var styles = /* @__PURE__ */ new Map();
|
|
153
|
-
|
|
196
|
+
|
|
197
|
+
// src/runtime/runtime-constants.ts
|
|
198
|
+
var CONTENT_REF_ID = "r";
|
|
199
|
+
var ORG_LOCATION_ID = "o";
|
|
200
|
+
var SLOT_NODE_ID = "s";
|
|
201
|
+
var TEXT_NODE_ID = "t";
|
|
202
|
+
var COMMENT_NODE_ID = "c";
|
|
203
|
+
var HYDRATE_ID = "s-id";
|
|
204
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
205
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
154
206
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
155
207
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
156
208
|
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
@@ -160,7 +212,6 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
160
212
|
"formStateRestoreCallback"
|
|
161
213
|
];
|
|
162
214
|
var win = typeof window !== "undefined" ? window : {};
|
|
163
|
-
var doc = win.document || { head: {} };
|
|
164
215
|
var plt = {
|
|
165
216
|
$flags$: 0,
|
|
166
217
|
$resourcesUrl$: "",
|
|
@@ -171,9 +222,10 @@ var plt = {
|
|
|
171
222
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
172
223
|
};
|
|
173
224
|
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
225
|
+
var _a;
|
|
174
226
|
let supportsListenerOptions2 = false;
|
|
175
227
|
try {
|
|
176
|
-
|
|
228
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
177
229
|
"e",
|
|
178
230
|
null,
|
|
179
231
|
Object.defineProperty({}, "passive", {
|
|
@@ -230,25 +282,117 @@ var flush = () => {
|
|
|
230
282
|
};
|
|
231
283
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
232
284
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
233
|
-
|
|
234
|
-
// src/utils/constants.ts
|
|
235
|
-
var EMPTY_OBJ = {};
|
|
236
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
237
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
238
|
-
|
|
239
|
-
// src/utils/helpers.ts
|
|
240
|
-
var isDef = (v) => v != null;
|
|
241
285
|
var isComplexType = (o) => {
|
|
242
286
|
o = typeof o;
|
|
243
287
|
return o === "object" || o === "function";
|
|
244
288
|
};
|
|
245
289
|
|
|
246
290
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
247
|
-
function queryNonceMetaTagContent(
|
|
291
|
+
function queryNonceMetaTagContent(doc) {
|
|
248
292
|
var _a, _b, _c;
|
|
249
|
-
return (_c = (_b = (_a =
|
|
293
|
+
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;
|
|
250
294
|
}
|
|
251
295
|
|
|
296
|
+
// src/utils/regular-expression.ts
|
|
297
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
298
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// src/utils/remote-value.ts
|
|
302
|
+
var RemoteValue = class _RemoteValue {
|
|
303
|
+
/**
|
|
304
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
305
|
+
*
|
|
306
|
+
* @param serialized The serialized LocalValue object
|
|
307
|
+
* @returns The original JavaScript value/object
|
|
308
|
+
*/
|
|
309
|
+
static fromLocalValue(serialized) {
|
|
310
|
+
const type = serialized[TYPE_CONSTANT];
|
|
311
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
312
|
+
switch (type) {
|
|
313
|
+
case "string" /* String */:
|
|
314
|
+
return value;
|
|
315
|
+
case "boolean" /* Boolean */:
|
|
316
|
+
return value;
|
|
317
|
+
case "bigint" /* BigInt */:
|
|
318
|
+
return BigInt(value);
|
|
319
|
+
case "undefined" /* Undefined */:
|
|
320
|
+
return void 0;
|
|
321
|
+
case "null" /* Null */:
|
|
322
|
+
return null;
|
|
323
|
+
case "number" /* Number */:
|
|
324
|
+
if (value === "NaN") return NaN;
|
|
325
|
+
if (value === "-0") return -0;
|
|
326
|
+
if (value === "Infinity") return Infinity;
|
|
327
|
+
if (value === "-Infinity") return -Infinity;
|
|
328
|
+
return value;
|
|
329
|
+
case "array" /* Array */:
|
|
330
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
331
|
+
case "date" /* Date */:
|
|
332
|
+
return new Date(value);
|
|
333
|
+
case "map" /* Map */:
|
|
334
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
335
|
+
for (const [key, val] of value) {
|
|
336
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
337
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
338
|
+
map2.set(deserializedKey, deserializedValue);
|
|
339
|
+
}
|
|
340
|
+
return map2;
|
|
341
|
+
case "object" /* Object */:
|
|
342
|
+
const obj = {};
|
|
343
|
+
for (const [key, val] of value) {
|
|
344
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
345
|
+
}
|
|
346
|
+
return obj;
|
|
347
|
+
case "regexp" /* RegularExpression */:
|
|
348
|
+
const { pattern, flags } = value;
|
|
349
|
+
return new RegExp(pattern, flags);
|
|
350
|
+
case "set" /* Set */:
|
|
351
|
+
const set = /* @__PURE__ */ new Set();
|
|
352
|
+
for (const item of value) {
|
|
353
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
354
|
+
}
|
|
355
|
+
return set;
|
|
356
|
+
case "symbol" /* Symbol */:
|
|
357
|
+
return Symbol(value);
|
|
358
|
+
default:
|
|
359
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
364
|
+
*
|
|
365
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
366
|
+
* @returns Array of deserialized JavaScript values
|
|
367
|
+
*/
|
|
368
|
+
static fromLocalValueArray(serializedValues) {
|
|
369
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
373
|
+
*
|
|
374
|
+
* @param obj Object to verify
|
|
375
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
376
|
+
*/
|
|
377
|
+
static isLocalValueObject(obj) {
|
|
378
|
+
if (typeof obj !== "object" || obj === null) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
const type = obj[TYPE_CONSTANT];
|
|
385
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
386
|
+
if (!hasTypeProperty) {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
390
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
391
|
+
}
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
252
396
|
// src/utils/result.ts
|
|
253
397
|
var result_exports = {};
|
|
254
398
|
__export(result_exports, {
|
|
@@ -297,6 +441,156 @@ var unwrapErr = (result) => {
|
|
|
297
441
|
throw result.value;
|
|
298
442
|
}
|
|
299
443
|
};
|
|
444
|
+
|
|
445
|
+
// src/utils/serialize.ts
|
|
446
|
+
function deserializeProperty(value) {
|
|
447
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
448
|
+
return value;
|
|
449
|
+
}
|
|
450
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
451
|
+
}
|
|
452
|
+
function createShadowRoot(cmpMeta) {
|
|
453
|
+
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
454
|
+
if (supportsConstructableStylesheets) {
|
|
455
|
+
const sheet = new CSSStyleSheet();
|
|
456
|
+
sheet.replaceSync(globalStyles);
|
|
457
|
+
shadowRoot.adoptedStyleSheets.push(sheet);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
461
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
462
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
463
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
464
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
465
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
466
|
+
slotNode.hidden = true;
|
|
467
|
+
} else {
|
|
468
|
+
slotNode.hidden = false;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
let i2 = 0;
|
|
474
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
475
|
+
const childNode = childNodes[i2];
|
|
476
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
477
|
+
updateFallbackSlotVisibility(childNode);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
482
|
+
const result = [];
|
|
483
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
484
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
485
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
486
|
+
result.push(slottedNode);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return result;
|
|
490
|
+
};
|
|
491
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
492
|
+
let i2 = 0;
|
|
493
|
+
let slottedNodes = [];
|
|
494
|
+
let childNode;
|
|
495
|
+
for (; i2 < childNodes.length; i2++) {
|
|
496
|
+
childNode = childNodes[i2];
|
|
497
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
498
|
+
slottedNodes.push(childNode);
|
|
499
|
+
}
|
|
500
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
501
|
+
}
|
|
502
|
+
return slottedNodes;
|
|
503
|
+
}
|
|
504
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
505
|
+
const childNodes = [];
|
|
506
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
507
|
+
let node = slot;
|
|
508
|
+
while (node = node.nextSibling) {
|
|
509
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
510
|
+
}
|
|
511
|
+
return childNodes;
|
|
512
|
+
};
|
|
513
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
514
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
515
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
519
|
+
return true;
|
|
520
|
+
}
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
return slotName === "";
|
|
527
|
+
};
|
|
528
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
529
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
533
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
534
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
535
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
536
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
537
|
+
if (typeof position !== "undefined") {
|
|
538
|
+
slottedNodeLocation["s-oo"] = position;
|
|
539
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
540
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
541
|
+
childNodes.forEach((n) => {
|
|
542
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
543
|
+
});
|
|
544
|
+
slotRelocateNodes.sort((a, b) => {
|
|
545
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
546
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
547
|
+
return 0;
|
|
548
|
+
});
|
|
549
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
550
|
+
} else {
|
|
551
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
552
|
+
}
|
|
553
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
554
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
555
|
+
};
|
|
556
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
557
|
+
function patchSlotNode(node) {
|
|
558
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
559
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
560
|
+
const toReturn = [];
|
|
561
|
+
const slotName = this["s-sn"];
|
|
562
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
563
|
+
console.error(`
|
|
564
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
565
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
566
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
567
|
+
`);
|
|
568
|
+
}
|
|
569
|
+
const parent = this["s-cr"].parentElement;
|
|
570
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
571
|
+
slottedNodes.forEach((n) => {
|
|
572
|
+
if (slotName === getSlotName(n)) {
|
|
573
|
+
toReturn.push(n);
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
if (elementsOnly) {
|
|
577
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
578
|
+
}
|
|
579
|
+
return toReturn;
|
|
580
|
+
}).bind(node);
|
|
581
|
+
node.assignedElements = assignedFactory(true);
|
|
582
|
+
node.assignedNodes = assignedFactory(false);
|
|
583
|
+
}
|
|
584
|
+
function internalCall(node, method) {
|
|
585
|
+
if ("__" + method in node) {
|
|
586
|
+
const toReturn = node["__" + method];
|
|
587
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
588
|
+
return toReturn.bind(node);
|
|
589
|
+
} else {
|
|
590
|
+
if (typeof node[method] !== "function") return node[method];
|
|
591
|
+
return node[method].bind(node);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
300
594
|
var createTime = (fnName, tagName = "") => {
|
|
301
595
|
{
|
|
302
596
|
return () => {
|
|
@@ -422,13 +716,427 @@ var convertToPrivate = (node) => {
|
|
|
422
716
|
vnode.$name$ = node.vname;
|
|
423
717
|
return vnode;
|
|
424
718
|
};
|
|
425
|
-
|
|
719
|
+
|
|
720
|
+
// src/runtime/client-hydrate.ts
|
|
721
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
722
|
+
var _a;
|
|
723
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
724
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
725
|
+
const childRenderNodes = [];
|
|
726
|
+
const slotNodes = [];
|
|
727
|
+
const slottedNodes = [];
|
|
728
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
729
|
+
const vnode = newVNode(tagName, null);
|
|
730
|
+
vnode.$elm$ = hostElm;
|
|
731
|
+
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
732
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
733
|
+
var _a2, _b;
|
|
734
|
+
if (!(memberFlags & 31 /* Prop */)) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
const attributeName = metaAttributeName || memberName;
|
|
738
|
+
const attrVal = hostElm.getAttribute(attributeName);
|
|
739
|
+
if (attrVal !== null) {
|
|
740
|
+
const attrPropVal = parsePropertyValue(
|
|
741
|
+
attrVal,
|
|
742
|
+
memberFlags,
|
|
743
|
+
!!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
|
|
744
|
+
);
|
|
745
|
+
(_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
749
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
750
|
+
}
|
|
751
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
752
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
753
|
+
hostRef.$vnode$ = clientHydrate(
|
|
754
|
+
vnode,
|
|
755
|
+
childRenderNodes,
|
|
756
|
+
slotNodes,
|
|
757
|
+
shadowRootNodes,
|
|
758
|
+
hostElm,
|
|
759
|
+
hostElm,
|
|
760
|
+
hostId,
|
|
761
|
+
slottedNodes
|
|
762
|
+
);
|
|
763
|
+
let crIndex = 0;
|
|
764
|
+
const crLength = childRenderNodes.length;
|
|
765
|
+
let childRenderNode;
|
|
766
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
767
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
768
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
769
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
770
|
+
const node = childRenderNode.$elm$;
|
|
771
|
+
if (!shadowRoot) {
|
|
772
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
773
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
774
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
778
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
779
|
+
if (childRenderNode.$children$) {
|
|
780
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
781
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
782
|
+
childRenderNode.$children$.forEach((c) => {
|
|
783
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
791
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
792
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
793
|
+
}
|
|
794
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
795
|
+
if (!shadowRoot) {
|
|
796
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
800
|
+
}
|
|
801
|
+
const hosts = [];
|
|
802
|
+
const snLen = slottedNodes.length;
|
|
803
|
+
let snIndex = 0;
|
|
804
|
+
let slotGroup;
|
|
805
|
+
let snGroupIdx;
|
|
806
|
+
let snGroupLen;
|
|
807
|
+
let slottedItem;
|
|
808
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
809
|
+
slotGroup = slottedNodes[snIndex];
|
|
810
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
811
|
+
snGroupLen = slotGroup.length;
|
|
812
|
+
snGroupIdx = 0;
|
|
813
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
814
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
815
|
+
if (!hosts[slottedItem.hostId]) {
|
|
816
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
817
|
+
}
|
|
818
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
819
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
820
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
821
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
822
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
823
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
824
|
+
} else {
|
|
825
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
826
|
+
}
|
|
827
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
828
|
+
}
|
|
829
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
830
|
+
hostEle.appendChild(slottedItem.node);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
if (shadowRoot && !shadowRoot.childNodes.length) {
|
|
835
|
+
let rnIdex = 0;
|
|
836
|
+
const rnLen = shadowRootNodes.length;
|
|
837
|
+
if (rnLen) {
|
|
838
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
839
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
840
|
+
}
|
|
841
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
842
|
+
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
843
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
844
|
+
node.removeAttribute("hidden");
|
|
845
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
846
|
+
node.parentNode.removeChild(node);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
853
|
+
hostRef.$hostElement$ = hostElm;
|
|
854
|
+
endHydrate();
|
|
855
|
+
};
|
|
856
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
857
|
+
let childNodeType;
|
|
858
|
+
let childIdSplt;
|
|
859
|
+
let childVNode;
|
|
860
|
+
let i2;
|
|
861
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
862
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
863
|
+
if (childNodeType) {
|
|
864
|
+
childIdSplt = childNodeType.split(".");
|
|
865
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
866
|
+
childVNode = createSimpleVNode({
|
|
867
|
+
$flags$: 0,
|
|
868
|
+
$hostId$: childIdSplt[0],
|
|
869
|
+
$nodeId$: childIdSplt[1],
|
|
870
|
+
$depth$: childIdSplt[2],
|
|
871
|
+
$index$: childIdSplt[3],
|
|
872
|
+
$tag$: node.tagName.toLowerCase(),
|
|
873
|
+
$elm$: node,
|
|
874
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
875
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
876
|
+
$attrs$: { class: node.className || "" }
|
|
877
|
+
});
|
|
878
|
+
childRenderNodes.push(childVNode);
|
|
879
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
880
|
+
if (!parentVNode.$children$) {
|
|
881
|
+
parentVNode.$children$ = [];
|
|
882
|
+
}
|
|
883
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
884
|
+
if (typeof slotName === "string") {
|
|
885
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
886
|
+
addSlot(
|
|
887
|
+
slotName,
|
|
888
|
+
childIdSplt[2],
|
|
889
|
+
childVNode,
|
|
890
|
+
node,
|
|
891
|
+
parentVNode,
|
|
892
|
+
childRenderNodes,
|
|
893
|
+
slotNodes,
|
|
894
|
+
shadowRootNodes,
|
|
895
|
+
slottedNodes
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
899
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
900
|
+
}
|
|
901
|
+
if (childVNode.$index$ !== void 0) {
|
|
902
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
903
|
+
}
|
|
904
|
+
parentVNode = childVNode;
|
|
905
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
906
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (node.shadowRoot) {
|
|
911
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
912
|
+
clientHydrate(
|
|
913
|
+
parentVNode,
|
|
914
|
+
childRenderNodes,
|
|
915
|
+
slotNodes,
|
|
916
|
+
shadowRootNodes,
|
|
917
|
+
hostElm,
|
|
918
|
+
node.shadowRoot.childNodes[i2],
|
|
919
|
+
hostId,
|
|
920
|
+
slottedNodes
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
925
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
926
|
+
clientHydrate(
|
|
927
|
+
parentVNode,
|
|
928
|
+
childRenderNodes,
|
|
929
|
+
slotNodes,
|
|
930
|
+
shadowRootNodes,
|
|
931
|
+
hostElm,
|
|
932
|
+
nonShadowNodes[i2],
|
|
933
|
+
hostId,
|
|
934
|
+
slottedNodes
|
|
935
|
+
);
|
|
936
|
+
}
|
|
937
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
938
|
+
childIdSplt = node.nodeValue.split(".");
|
|
939
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
940
|
+
childNodeType = childIdSplt[0];
|
|
941
|
+
childVNode = createSimpleVNode({
|
|
942
|
+
$hostId$: childIdSplt[1],
|
|
943
|
+
$nodeId$: childIdSplt[2],
|
|
944
|
+
$depth$: childIdSplt[3],
|
|
945
|
+
$index$: childIdSplt[4] || "0",
|
|
946
|
+
$elm$: node,
|
|
947
|
+
$attrs$: null,
|
|
948
|
+
$children$: null,
|
|
949
|
+
$key$: null,
|
|
950
|
+
$name$: null,
|
|
951
|
+
$tag$: null,
|
|
952
|
+
$text$: null
|
|
953
|
+
});
|
|
954
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
955
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
956
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
957
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
958
|
+
childRenderNodes.push(childVNode);
|
|
959
|
+
node.remove();
|
|
960
|
+
if (hostId === childVNode.$hostId$) {
|
|
961
|
+
if (!parentVNode.$children$) {
|
|
962
|
+
parentVNode.$children$ = [];
|
|
963
|
+
}
|
|
964
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
965
|
+
}
|
|
966
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
967
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
971
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
972
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
973
|
+
childRenderNodes.push(childVNode);
|
|
974
|
+
node.remove();
|
|
975
|
+
}
|
|
976
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
977
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
978
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
979
|
+
addSlot(
|
|
980
|
+
slotName,
|
|
981
|
+
childIdSplt[2],
|
|
982
|
+
childVNode,
|
|
983
|
+
node,
|
|
984
|
+
parentVNode,
|
|
985
|
+
childRenderNodes,
|
|
986
|
+
slotNodes,
|
|
987
|
+
shadowRootNodes,
|
|
988
|
+
slottedNodes
|
|
989
|
+
);
|
|
990
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
991
|
+
if (shadowRootNodes) {
|
|
992
|
+
node.remove();
|
|
993
|
+
} else {
|
|
994
|
+
hostElm["s-cr"] = node;
|
|
995
|
+
node["s-cn"] = true;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1001
|
+
const vnode = newVNode(null, node.textContent);
|
|
1002
|
+
vnode.$elm$ = node;
|
|
1003
|
+
vnode.$index$ = "0";
|
|
1004
|
+
parentVNode.$children$ = [vnode];
|
|
1005
|
+
} else {
|
|
1006
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1007
|
+
node.remove();
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return parentVNode;
|
|
1011
|
+
};
|
|
1012
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
1013
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1014
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
1015
|
+
if (componentId) {
|
|
1016
|
+
orgLocNodes.set(componentId, node);
|
|
1017
|
+
}
|
|
1018
|
+
let i2 = 0;
|
|
1019
|
+
if (node.shadowRoot) {
|
|
1020
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1021
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1025
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
1026
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1027
|
+
}
|
|
1028
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1029
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
1030
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1031
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1032
|
+
node.nodeValue = "";
|
|
1033
|
+
node["s-en"] = childIdSplt[3];
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
var createSimpleVNode = (vnode) => {
|
|
1038
|
+
const defaultVNode = {
|
|
1039
|
+
$flags$: 0,
|
|
1040
|
+
$hostId$: null,
|
|
1041
|
+
$nodeId$: null,
|
|
1042
|
+
$depth$: null,
|
|
1043
|
+
$index$: "0",
|
|
1044
|
+
$elm$: null,
|
|
1045
|
+
$attrs$: null,
|
|
1046
|
+
$children$: null,
|
|
1047
|
+
$key$: null,
|
|
1048
|
+
$name$: null,
|
|
1049
|
+
$tag$: null,
|
|
1050
|
+
$text$: null
|
|
1051
|
+
};
|
|
1052
|
+
return { ...defaultVNode, ...vnode };
|
|
1053
|
+
};
|
|
1054
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1055
|
+
node["s-sr"] = true;
|
|
1056
|
+
childVNode.$name$ = slotName || null;
|
|
1057
|
+
childVNode.$tag$ = "slot";
|
|
1058
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1059
|
+
if (shadowRootNodes && win.document) {
|
|
1060
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1061
|
+
if (childVNode.$name$) {
|
|
1062
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1063
|
+
}
|
|
1064
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1065
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1066
|
+
} else {
|
|
1067
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1068
|
+
}
|
|
1069
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1070
|
+
node.remove();
|
|
1071
|
+
if (childVNode.$depth$ === "0") {
|
|
1072
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1073
|
+
}
|
|
1074
|
+
} else {
|
|
1075
|
+
const slot = childVNode.$elm$;
|
|
1076
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1077
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1078
|
+
patchSlotNode(node);
|
|
1079
|
+
if (shouldMove) {
|
|
1080
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1081
|
+
}
|
|
1082
|
+
childRenderNodes.push(childVNode);
|
|
1083
|
+
}
|
|
1084
|
+
slotNodes.push(childVNode);
|
|
1085
|
+
if (!parentVNode.$children$) {
|
|
1086
|
+
parentVNode.$children$ = [];
|
|
1087
|
+
}
|
|
1088
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1089
|
+
}
|
|
1090
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1091
|
+
let slottedNode = slotNode.nextSibling;
|
|
1092
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1093
|
+
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 */))) {
|
|
1094
|
+
slottedNode["s-sn"] = slotName;
|
|
1095
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1096
|
+
slottedNode = slottedNode.nextSibling;
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
var findCorrespondingNode = (node, type) => {
|
|
1100
|
+
let sibling = node;
|
|
1101
|
+
do {
|
|
1102
|
+
sibling = sibling.nextSibling;
|
|
1103
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
1104
|
+
return sibling;
|
|
1105
|
+
};
|
|
1106
|
+
var createSupportsRuleRe = (selector) => {
|
|
1107
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
1108
|
+
return new RegExp(
|
|
1109
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
1110
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
1111
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
1112
|
+
"g"
|
|
1113
|
+
);
|
|
1114
|
+
};
|
|
1115
|
+
createSupportsRuleRe("::slotted");
|
|
1116
|
+
createSupportsRuleRe(":host");
|
|
1117
|
+
createSupportsRuleRe(":host-context");
|
|
1118
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
1119
|
+
if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
1120
|
+
try {
|
|
1121
|
+
propValue = JSON.parse(propValue);
|
|
1122
|
+
return propValue;
|
|
1123
|
+
} catch (e) {
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1127
|
+
propValue = deserializeProperty(propValue);
|
|
1128
|
+
return propValue;
|
|
1129
|
+
}
|
|
426
1130
|
if (propValue != null && !isComplexType(propValue)) {
|
|
427
1131
|
if (propType & 4 /* Boolean */) {
|
|
428
|
-
|
|
1132
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1133
|
+
return propValue === "" || !!propValue;
|
|
1134
|
+
} else {
|
|
1135
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1136
|
+
}
|
|
429
1137
|
}
|
|
430
1138
|
if (propType & 2 /* Number */) {
|
|
431
|
-
return parseFloat(propValue);
|
|
1139
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
432
1140
|
}
|
|
433
1141
|
if (propType & 1 /* String */) {
|
|
434
1142
|
return String(propValue);
|
|
@@ -445,9 +1153,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
445
1153
|
return {
|
|
446
1154
|
emit: (detail) => {
|
|
447
1155
|
return emitEvent(elm, name, {
|
|
448
|
-
bubbles:
|
|
449
|
-
composed:
|
|
450
|
-
cancelable:
|
|
1156
|
+
bubbles: true,
|
|
1157
|
+
composed: true,
|
|
1158
|
+
cancelable: true,
|
|
451
1159
|
detail
|
|
452
1160
|
});
|
|
453
1161
|
}
|
|
@@ -477,7 +1185,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
477
1185
|
var _a;
|
|
478
1186
|
const scopeId2 = getScopeId(cmpMeta);
|
|
479
1187
|
const style = styles.get(scopeId2);
|
|
480
|
-
|
|
1188
|
+
if (!win.document) {
|
|
1189
|
+
return scopeId2;
|
|
1190
|
+
}
|
|
1191
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
481
1192
|
if (style) {
|
|
482
1193
|
if (typeof style === "string") {
|
|
483
1194
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -487,14 +1198,43 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
487
1198
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
488
1199
|
}
|
|
489
1200
|
if (!appliedStyles.has(scopeId2)) {
|
|
490
|
-
{
|
|
491
|
-
styleElm = doc.createElement("style");
|
|
1201
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
492
1202
|
styleElm.innerHTML = style;
|
|
493
|
-
|
|
1203
|
+
} else {
|
|
1204
|
+
styleElm = win.document.createElement("style");
|
|
1205
|
+
styleElm.innerHTML = style;
|
|
1206
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
494
1207
|
if (nonce != null) {
|
|
495
1208
|
styleElm.setAttribute("nonce", nonce);
|
|
496
1209
|
}
|
|
497
|
-
|
|
1210
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
1211
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
1212
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
1213
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
1214
|
+
styleContainerNode.insertBefore(
|
|
1215
|
+
styleElm,
|
|
1216
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
1217
|
+
);
|
|
1218
|
+
} else if ("host" in styleContainerNode) {
|
|
1219
|
+
if (supportsConstructableStylesheets) {
|
|
1220
|
+
const stylesheet = new CSSStyleSheet();
|
|
1221
|
+
stylesheet.replaceSync(style);
|
|
1222
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1223
|
+
} else {
|
|
1224
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
1225
|
+
if (existingStyleContainer) {
|
|
1226
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1227
|
+
} else {
|
|
1228
|
+
styleContainerNode.prepend(styleElm);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
} else {
|
|
1232
|
+
styleContainerNode.append(styleElm);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1236
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
1237
|
+
}
|
|
498
1238
|
}
|
|
499
1239
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
500
1240
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -524,121 +1264,170 @@ var attachStyles = (hostRef) => {
|
|
|
524
1264
|
endAttachStyles();
|
|
525
1265
|
};
|
|
526
1266
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
527
|
-
var
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
1267
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1268
|
+
var hydrateScopedToShadow = () => {
|
|
1269
|
+
if (!win.document) {
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1273
|
+
let i2 = 0;
|
|
1274
|
+
for (; i2 < styles2.length; i2++) {
|
|
1275
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
1279
|
+
if (oldValue === newValue) {
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
1283
|
+
let ln = memberName.toLowerCase();
|
|
1284
|
+
if (memberName === "class") {
|
|
1285
|
+
const classList = elm.classList;
|
|
1286
|
+
const oldClasses = parseClassList(oldValue);
|
|
1287
|
+
let newClasses = parseClassList(newValue);
|
|
1288
|
+
if (elm["s-si"] && initialRender) {
|
|
1289
|
+
newClasses.push(elm["s-si"]);
|
|
1290
|
+
oldClasses.forEach((c) => {
|
|
1291
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1292
|
+
});
|
|
1293
|
+
newClasses = [...new Set(newClasses)];
|
|
1294
|
+
classList.add(...newClasses);
|
|
1295
|
+
} else {
|
|
535
1296
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
536
1297
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
elm.style.removeProperty(prop);
|
|
543
|
-
} else {
|
|
544
|
-
elm.style[prop] = "";
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
for (const prop in newValue) {
|
|
550
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1298
|
+
}
|
|
1299
|
+
} else if (memberName === "style") {
|
|
1300
|
+
{
|
|
1301
|
+
for (const prop in oldValue) {
|
|
1302
|
+
if (!newValue || newValue[prop] == null) {
|
|
551
1303
|
if (prop.includes("-")) {
|
|
552
|
-
elm.style.
|
|
1304
|
+
elm.style.removeProperty(prop);
|
|
553
1305
|
} else {
|
|
554
|
-
elm.style[prop] =
|
|
1306
|
+
elm.style[prop] = "";
|
|
555
1307
|
}
|
|
556
1308
|
}
|
|
557
1309
|
}
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
} else if (isMemberInElement(win, ln)) {
|
|
566
|
-
memberName = ln.slice(2);
|
|
567
|
-
} else {
|
|
568
|
-
memberName = ln[2] + memberName.slice(3);
|
|
569
|
-
}
|
|
570
|
-
if (oldValue || newValue) {
|
|
571
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
572
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
573
|
-
if (oldValue) {
|
|
574
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
575
|
-
}
|
|
576
|
-
if (newValue) {
|
|
577
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
1310
|
+
}
|
|
1311
|
+
for (const prop in newValue) {
|
|
1312
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1313
|
+
if (prop.includes("-")) {
|
|
1314
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
1315
|
+
} else {
|
|
1316
|
+
elm.style[prop] = newValue[prop];
|
|
578
1317
|
}
|
|
579
1318
|
}
|
|
1319
|
+
}
|
|
1320
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
1321
|
+
if (newValue) {
|
|
1322
|
+
newValue(elm);
|
|
1323
|
+
}
|
|
1324
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1325
|
+
if (memberName[2] === "-") {
|
|
1326
|
+
memberName = memberName.slice(3);
|
|
1327
|
+
} else if (isMemberInElement(win, ln)) {
|
|
1328
|
+
memberName = ln.slice(2);
|
|
580
1329
|
} else {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
1330
|
+
memberName = ln[2] + memberName.slice(3);
|
|
1331
|
+
}
|
|
1332
|
+
if (oldValue || newValue) {
|
|
1333
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
1334
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
1335
|
+
if (oldValue) {
|
|
1336
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
1337
|
+
}
|
|
1338
|
+
if (newValue) {
|
|
1339
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
} else {
|
|
1343
|
+
const isComplex = isComplexType(newValue);
|
|
1344
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1345
|
+
try {
|
|
1346
|
+
if (!elm.tagName.includes("-")) {
|
|
1347
|
+
const n = newValue == null ? "" : newValue;
|
|
1348
|
+
if (memberName === "list") {
|
|
1349
|
+
isProp = false;
|
|
1350
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
1351
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
589
1352
|
elm[memberName] = n;
|
|
1353
|
+
} else {
|
|
1354
|
+
elm.setAttribute(memberName, n);
|
|
590
1355
|
}
|
|
591
|
-
} else {
|
|
592
|
-
elm[memberName] = newValue;
|
|
593
1356
|
}
|
|
594
|
-
}
|
|
1357
|
+
} else if (elm[memberName] !== newValue) {
|
|
1358
|
+
elm[memberName] = newValue;
|
|
595
1359
|
}
|
|
1360
|
+
} catch (e) {
|
|
596
1361
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
1362
|
+
}
|
|
1363
|
+
let xlink = false;
|
|
1364
|
+
{
|
|
1365
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1366
|
+
memberName = ln;
|
|
1367
|
+
xlink = true;
|
|
603
1368
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
608
|
-
} else {
|
|
609
|
-
elm.removeAttribute(memberName);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
613
|
-
newValue = newValue === true ? "" : newValue;
|
|
1369
|
+
}
|
|
1370
|
+
if (newValue == null || newValue === false) {
|
|
1371
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
614
1372
|
if (xlink) {
|
|
615
|
-
elm.
|
|
1373
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
616
1374
|
} else {
|
|
617
|
-
elm.
|
|
1375
|
+
elm.removeAttribute(memberName);
|
|
618
1376
|
}
|
|
619
1377
|
}
|
|
1378
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
1379
|
+
newValue = newValue === true ? "" : newValue;
|
|
1380
|
+
if (xlink) {
|
|
1381
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1382
|
+
} else {
|
|
1383
|
+
elm.setAttribute(memberName, newValue);
|
|
1384
|
+
}
|
|
620
1385
|
}
|
|
621
1386
|
}
|
|
622
1387
|
};
|
|
623
1388
|
var parseClassListRegex = /\s/;
|
|
624
|
-
var parseClassList = (value) =>
|
|
1389
|
+
var parseClassList = (value) => {
|
|
1390
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
1391
|
+
value = value.baseVal;
|
|
1392
|
+
}
|
|
1393
|
+
if (!value || typeof value !== "string") {
|
|
1394
|
+
return [];
|
|
1395
|
+
}
|
|
1396
|
+
return value.split(parseClassListRegex);
|
|
1397
|
+
};
|
|
625
1398
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
626
1399
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
627
1400
|
|
|
628
1401
|
// src/runtime/vdom/update-element.ts
|
|
629
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
1402
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
630
1403
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
631
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
632
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
1404
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1405
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
633
1406
|
{
|
|
634
1407
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
635
1408
|
if (!(memberName in newVnodeAttrs)) {
|
|
636
|
-
setAccessor(
|
|
1409
|
+
setAccessor(
|
|
1410
|
+
elm,
|
|
1411
|
+
memberName,
|
|
1412
|
+
oldVnodeAttrs[memberName],
|
|
1413
|
+
void 0,
|
|
1414
|
+
isSvgMode2,
|
|
1415
|
+
newVnode.$flags$,
|
|
1416
|
+
isInitialRender
|
|
1417
|
+
);
|
|
637
1418
|
}
|
|
638
1419
|
}
|
|
639
1420
|
}
|
|
640
1421
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
641
|
-
setAccessor(
|
|
1422
|
+
setAccessor(
|
|
1423
|
+
elm,
|
|
1424
|
+
memberName,
|
|
1425
|
+
oldVnodeAttrs[memberName],
|
|
1426
|
+
newVnodeAttrs[memberName],
|
|
1427
|
+
isSvgMode2,
|
|
1428
|
+
newVnode.$flags$,
|
|
1429
|
+
isInitialRender
|
|
1430
|
+
);
|
|
642
1431
|
}
|
|
643
1432
|
};
|
|
644
1433
|
function sortedAttrNames(attrNames) {
|
|
@@ -650,16 +1439,13 @@ function sortedAttrNames(attrNames) {
|
|
|
650
1439
|
attrNames
|
|
651
1440
|
);
|
|
652
1441
|
}
|
|
653
|
-
|
|
654
|
-
// src/runtime/vdom/vdom-render.ts
|
|
655
|
-
var scopeId;
|
|
656
1442
|
var contentRef;
|
|
657
1443
|
var hostTagName;
|
|
658
1444
|
var useNativeShadowDom = false;
|
|
659
1445
|
var checkSlotFallbackVisibility = false;
|
|
660
1446
|
var checkSlotRelocate = false;
|
|
661
1447
|
var isSvgMode = false;
|
|
662
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
1448
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
663
1449
|
var _a;
|
|
664
1450
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
665
1451
|
let i2 = 0;
|
|
@@ -669,9 +1455,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
669
1455
|
if (!useNativeShadowDom) {
|
|
670
1456
|
checkSlotRelocate = true;
|
|
671
1457
|
if (newVNode2.$tag$ === "slot") {
|
|
672
|
-
if (scopeId) {
|
|
673
|
-
parentElm.classList.add(scopeId + "-s");
|
|
674
|
-
}
|
|
675
1458
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
676
1459
|
// slot element has fallback content
|
|
677
1460
|
// still create an element that "mocks" the slot element
|
|
@@ -685,14 +1468,22 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
685
1468
|
}
|
|
686
1469
|
}
|
|
687
1470
|
if (newVNode2.$text$ !== null) {
|
|
688
|
-
elm = newVNode2.$elm$ =
|
|
1471
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
689
1472
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
690
|
-
elm = newVNode2.$elm$ =
|
|
1473
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
1474
|
+
{
|
|
1475
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
1476
|
+
}
|
|
691
1477
|
} else {
|
|
692
1478
|
if (!isSvgMode) {
|
|
693
1479
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
694
1480
|
}
|
|
695
|
-
|
|
1481
|
+
if (!win.document) {
|
|
1482
|
+
throw new Error(
|
|
1483
|
+
"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."
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
696
1487
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
697
1488
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
698
1489
|
) ;
|
|
@@ -702,12 +1493,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
702
1493
|
{
|
|
703
1494
|
updateElement(null, newVNode2, isSvgMode);
|
|
704
1495
|
}
|
|
705
|
-
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
706
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
707
|
-
}
|
|
708
1496
|
if (newVNode2.$children$) {
|
|
709
1497
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
710
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
1498
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
711
1499
|
if (childNode) {
|
|
712
1500
|
elm.appendChild(childNode);
|
|
713
1501
|
}
|
|
@@ -728,6 +1516,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
728
1516
|
elm["s-cr"] = contentRef;
|
|
729
1517
|
elm["s-sn"] = newVNode2.$name$ || "";
|
|
730
1518
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1519
|
+
patchSlotNode(elm);
|
|
731
1520
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
732
1521
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
733
1522
|
{
|
|
@@ -740,19 +1529,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
740
1529
|
};
|
|
741
1530
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
742
1531
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
743
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
744
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
745
|
-
let node = parentElm;
|
|
746
|
-
while (node = node.nextSibling) {
|
|
747
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
748
|
-
oldSlotChildNodes.push(node);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
1532
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
752
1533
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
753
1534
|
const childNode = oldSlotChildNodes[i2];
|
|
754
1535
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
755
|
-
insertBefore(
|
|
1536
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
756
1537
|
childNode["s-ol"].remove();
|
|
757
1538
|
childNode["s-ol"] = void 0;
|
|
758
1539
|
childNode["s-sh"] = void 0;
|
|
@@ -762,7 +1543,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
762
1543
|
putBackInOriginalLocation(childNode, recursive);
|
|
763
1544
|
}
|
|
764
1545
|
}
|
|
765
|
-
plt.$flags$ &=
|
|
1546
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
766
1547
|
};
|
|
767
1548
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
768
1549
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
@@ -772,7 +1553,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
772
1553
|
}
|
|
773
1554
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
774
1555
|
if (vnodes[startIdx]) {
|
|
775
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
1556
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
776
1557
|
if (childNode) {
|
|
777
1558
|
vnodes[startIdx].$elm$ = childNode;
|
|
778
1559
|
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
@@ -859,7 +1640,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
859
1640
|
if (idxInOld >= 0) {
|
|
860
1641
|
elmToMove = oldCh[idxInOld];
|
|
861
1642
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
862
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1643
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
863
1644
|
} else {
|
|
864
1645
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
865
1646
|
oldCh[idxInOld] = void 0;
|
|
@@ -867,12 +1648,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
867
1648
|
}
|
|
868
1649
|
newStartVnode = newCh[++newStartIdx];
|
|
869
1650
|
} else {
|
|
870
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1651
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
871
1652
|
newStartVnode = newCh[++newStartIdx];
|
|
872
1653
|
}
|
|
873
1654
|
if (node) {
|
|
874
1655
|
{
|
|
875
|
-
insertBefore(
|
|
1656
|
+
insertBefore(
|
|
1657
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1658
|
+
node,
|
|
1659
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1660
|
+
);
|
|
876
1661
|
}
|
|
877
1662
|
}
|
|
878
1663
|
}
|
|
@@ -898,14 +1683,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
898
1683
|
if (!isInitialRender) {
|
|
899
1684
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
900
1685
|
}
|
|
1686
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1687
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1688
|
+
}
|
|
901
1689
|
return true;
|
|
902
1690
|
}
|
|
903
1691
|
return false;
|
|
904
1692
|
};
|
|
905
|
-
var referenceNode = (node) =>
|
|
906
|
-
return node && node["s-ol"] || node;
|
|
907
|
-
};
|
|
908
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1693
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
909
1694
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
910
1695
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
911
1696
|
const oldChildren = oldVNode.$children$;
|
|
@@ -918,9 +1703,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
918
1703
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
919
1704
|
}
|
|
920
1705
|
{
|
|
921
|
-
|
|
922
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
923
|
-
}
|
|
1706
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
924
1707
|
}
|
|
925
1708
|
if (oldChildren !== null && newChildren !== null) {
|
|
926
1709
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -929,7 +1712,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
929
1712
|
elm.textContent = "";
|
|
930
1713
|
}
|
|
931
1714
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
932
|
-
} else if (
|
|
1715
|
+
} else if (
|
|
1716
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1717
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1718
|
+
) {
|
|
933
1719
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
934
1720
|
}
|
|
935
1721
|
if (isSvgMode && tag === "svg") {
|
|
@@ -941,45 +1727,19 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
941
1727
|
elm.data = text;
|
|
942
1728
|
}
|
|
943
1729
|
};
|
|
944
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
945
|
-
const childNodes = elm.childNodes;
|
|
946
|
-
for (const childNode of childNodes) {
|
|
947
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
948
|
-
if (childNode["s-sr"]) {
|
|
949
|
-
const slotName = childNode["s-sn"];
|
|
950
|
-
childNode.hidden = false;
|
|
951
|
-
for (const siblingNode of childNodes) {
|
|
952
|
-
if (siblingNode !== childNode) {
|
|
953
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
954
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
955
|
-
childNode.hidden = true;
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
958
|
-
} else {
|
|
959
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
960
|
-
childNode.hidden = true;
|
|
961
|
-
break;
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
updateFallbackSlotVisibility(childNode);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
1730
|
var relocateNodes = [];
|
|
972
1731
|
var markSlotContentForRelocation = (elm) => {
|
|
973
1732
|
let node;
|
|
974
1733
|
let hostContentNodes;
|
|
975
1734
|
let j;
|
|
976
|
-
|
|
1735
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1736
|
+
for (const childNode of children) {
|
|
977
1737
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
978
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1738
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
979
1739
|
const slotName = childNode["s-sn"];
|
|
980
1740
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
981
1741
|
node = hostContentNodes[j];
|
|
982
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (
|
|
1742
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
983
1743
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
984
1744
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
985
1745
|
checkSlotFallbackVisibility = true;
|
|
@@ -1017,21 +1777,6 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1017
1777
|
}
|
|
1018
1778
|
}
|
|
1019
1779
|
};
|
|
1020
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1021
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1022
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1023
|
-
return true;
|
|
1024
|
-
}
|
|
1025
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1026
|
-
return true;
|
|
1027
|
-
}
|
|
1028
|
-
return false;
|
|
1029
|
-
}
|
|
1030
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1031
|
-
return true;
|
|
1032
|
-
}
|
|
1033
|
-
return slotName === "";
|
|
1034
|
-
};
|
|
1035
1780
|
var nullifyVNodeRefs = (vNode) => {
|
|
1036
1781
|
{
|
|
1037
1782
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -1039,15 +1784,17 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
1039
1784
|
}
|
|
1040
1785
|
};
|
|
1041
1786
|
var insertBefore = (parent, newNode, reference) => {
|
|
1042
|
-
|
|
1043
|
-
|
|
1787
|
+
{
|
|
1788
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1789
|
+
}
|
|
1044
1790
|
};
|
|
1045
1791
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1046
1792
|
var _a, _b, _c, _d;
|
|
1047
1793
|
const hostElm = hostRef.$hostElement$;
|
|
1048
1794
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1049
1795
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1050
|
-
const
|
|
1796
|
+
const isHostElement = isHost(renderFnResults);
|
|
1797
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1051
1798
|
hostTagName = hostElm.tagName;
|
|
1052
1799
|
if (cmpMeta.$attrsToReflect$) {
|
|
1053
1800
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
@@ -1066,10 +1813,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1066
1813
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1067
1814
|
hostRef.$vnode$ = rootVnode;
|
|
1068
1815
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1069
|
-
|
|
1070
|
-
scopeId = hostElm["s-sc"];
|
|
1071
|
-
}
|
|
1072
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1816
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1073
1817
|
{
|
|
1074
1818
|
contentRef = hostElm["s-cr"];
|
|
1075
1819
|
checkSlotFallbackVisibility = false;
|
|
@@ -1081,8 +1825,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1081
1825
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1082
1826
|
for (const relocateData of relocateNodes) {
|
|
1083
1827
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1084
|
-
if (!nodeToRelocate["s-ol"]) {
|
|
1085
|
-
const orgLocationNode =
|
|
1828
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1829
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1086
1830
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1087
1831
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1088
1832
|
}
|
|
@@ -1097,7 +1841,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1097
1841
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1098
1842
|
while (orgLocationNode) {
|
|
1099
1843
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1100
|
-
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
|
|
1844
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1101
1845
|
refNode = refNode.nextSibling;
|
|
1102
1846
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1103
1847
|
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
@@ -1110,18 +1854,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1110
1854
|
orgLocationNode = orgLocationNode.previousSibling;
|
|
1111
1855
|
}
|
|
1112
1856
|
}
|
|
1113
|
-
|
|
1857
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1858
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1859
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1114
1860
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1115
1861
|
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1116
1862
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1117
1863
|
}
|
|
1118
1864
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1119
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1865
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1120
1866
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1121
1867
|
}
|
|
1122
1868
|
}
|
|
1123
1869
|
}
|
|
1124
|
-
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](
|
|
1870
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1125
1871
|
} else {
|
|
1126
1872
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1127
1873
|
if (isInitialLoad) {
|
|
@@ -1135,7 +1881,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1135
1881
|
if (checkSlotFallbackVisibility) {
|
|
1136
1882
|
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1137
1883
|
}
|
|
1138
|
-
plt.$flags$ &=
|
|
1884
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1139
1885
|
relocateNodes.length = 0;
|
|
1140
1886
|
}
|
|
1141
1887
|
contentRef = void 0;
|
|
@@ -1144,7 +1890,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1144
1890
|
// src/runtime/update-component.ts
|
|
1145
1891
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1146
1892
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1147
|
-
ancestorComponent["s-p"].push(
|
|
1893
|
+
const index = ancestorComponent["s-p"].push(
|
|
1894
|
+
new Promise(
|
|
1895
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1896
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1897
|
+
r();
|
|
1898
|
+
}
|
|
1899
|
+
)
|
|
1900
|
+
);
|
|
1148
1901
|
}
|
|
1149
1902
|
};
|
|
1150
1903
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1173,17 +1926,15 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1173
1926
|
{
|
|
1174
1927
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1175
1928
|
if (hostRef.$queuedListeners$) {
|
|
1176
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1929
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
1177
1930
|
hostRef.$queuedListeners$ = void 0;
|
|
1178
1931
|
}
|
|
1179
1932
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
}
|
|
1184
|
-
{
|
|
1185
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1933
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1934
|
+
} else {
|
|
1935
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1186
1936
|
}
|
|
1937
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1187
1938
|
endSchedule();
|
|
1188
1939
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1189
1940
|
};
|
|
@@ -1226,7 +1977,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1226
1977
|
try {
|
|
1227
1978
|
instance = instance.render() ;
|
|
1228
1979
|
{
|
|
1229
|
-
hostRef.$flags$ &=
|
|
1980
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1230
1981
|
}
|
|
1231
1982
|
{
|
|
1232
1983
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -1249,17 +2000,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1249
2000
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1250
2001
|
const instance = hostRef.$lazyInstance$ ;
|
|
1251
2002
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1252
|
-
|
|
1253
|
-
safeCall(instance, "componentDidRender");
|
|
1254
|
-
}
|
|
2003
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1255
2004
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1256
2005
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1257
2006
|
{
|
|
1258
2007
|
addHydratedFlag(elm);
|
|
1259
2008
|
}
|
|
1260
|
-
|
|
1261
|
-
safeCall(instance, "componentDidLoad");
|
|
1262
|
-
}
|
|
2009
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1263
2010
|
endPostUpdate();
|
|
1264
2011
|
{
|
|
1265
2012
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1268,6 +2015,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1268
2015
|
}
|
|
1269
2016
|
}
|
|
1270
2017
|
} else {
|
|
2018
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1271
2019
|
endPostUpdate();
|
|
1272
2020
|
}
|
|
1273
2021
|
{
|
|
@@ -1281,21 +2029,18 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1281
2029
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1282
2030
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1283
2031
|
}
|
|
1284
|
-
hostRef.$flags$ &=
|
|
2032
|
+
hostRef.$flags$ &= -517;
|
|
1285
2033
|
}
|
|
1286
2034
|
};
|
|
1287
2035
|
var appDidLoad = (who) => {
|
|
1288
|
-
{
|
|
1289
|
-
addHydratedFlag(doc.documentElement);
|
|
1290
|
-
}
|
|
1291
2036
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1292
2037
|
};
|
|
1293
|
-
var safeCall = (instance, method, arg) => {
|
|
2038
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1294
2039
|
if (instance && instance[method]) {
|
|
1295
2040
|
try {
|
|
1296
2041
|
return instance[method](arg);
|
|
1297
2042
|
} catch (e) {
|
|
1298
|
-
consoleError(e);
|
|
2043
|
+
consoleError(e, elm);
|
|
1299
2044
|
}
|
|
1300
2045
|
}
|
|
1301
2046
|
return void 0;
|
|
@@ -1311,14 +2056,18 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1311
2056
|
const hostRef = getHostRef(ref);
|
|
1312
2057
|
if (!hostRef) {
|
|
1313
2058
|
throw new Error(
|
|
1314
|
-
`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/
|
|
2059
|
+
`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).`
|
|
1315
2060
|
);
|
|
1316
2061
|
}
|
|
1317
2062
|
const elm = hostRef.$hostElement$ ;
|
|
1318
2063
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1319
2064
|
const flags = hostRef.$flags$;
|
|
1320
2065
|
const instance = hostRef.$lazyInstance$ ;
|
|
1321
|
-
newVal = parsePropertyValue(
|
|
2066
|
+
newVal = parsePropertyValue(
|
|
2067
|
+
newVal,
|
|
2068
|
+
cmpMeta.$members$[propName][0],
|
|
2069
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2070
|
+
);
|
|
1322
2071
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1323
2072
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1324
2073
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -1337,6 +2086,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1337
2086
|
}
|
|
1338
2087
|
}
|
|
1339
2088
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2089
|
+
if (instance.componentShouldUpdate) {
|
|
2090
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
1340
2094
|
scheduleUpdate(hostRef, false);
|
|
1341
2095
|
}
|
|
1342
2096
|
}
|
|
@@ -1348,23 +2102,23 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1348
2102
|
var _a, _b;
|
|
1349
2103
|
const prototype = Cstr.prototype;
|
|
1350
2104
|
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1351
|
-
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
|
|
1352
|
-
|
|
2105
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2106
|
+
Object.defineProperty(prototype, cbName, {
|
|
1353
2107
|
value(...args) {
|
|
1354
2108
|
const hostRef = getHostRef(this);
|
|
1355
2109
|
const instance = hostRef.$lazyInstance$ ;
|
|
1356
2110
|
if (!instance) {
|
|
1357
|
-
hostRef.$onReadyPromise$.then((
|
|
1358
|
-
const cb =
|
|
1359
|
-
typeof cb === "function" && cb.call(
|
|
2111
|
+
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2112
|
+
const cb = asyncInstance[cbName];
|
|
2113
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1360
2114
|
});
|
|
1361
2115
|
} else {
|
|
1362
|
-
const cb = instance[cbName];
|
|
2116
|
+
const cb = instance[cbName] ;
|
|
1363
2117
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
1364
2118
|
}
|
|
1365
2119
|
}
|
|
1366
|
-
})
|
|
1367
|
-
);
|
|
2120
|
+
});
|
|
2121
|
+
});
|
|
1368
2122
|
}
|
|
1369
2123
|
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
1370
2124
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
@@ -1373,15 +2127,78 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1373
2127
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1374
2128
|
members.map(([memberName, [memberFlags]]) => {
|
|
1375
2129
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2130
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
2131
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
2132
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
2133
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
2134
|
+
Object.defineProperty(prototype, memberName, {
|
|
2135
|
+
get() {
|
|
2136
|
+
{
|
|
2137
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
2138
|
+
return getValue(this, memberName);
|
|
2139
|
+
}
|
|
2140
|
+
const ref = getHostRef(this);
|
|
2141
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
2142
|
+
if (!instance) return;
|
|
2143
|
+
return instance[memberName];
|
|
2144
|
+
}
|
|
2145
|
+
},
|
|
2146
|
+
configurable: true,
|
|
2147
|
+
enumerable: true
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
1376
2150
|
Object.defineProperty(prototype, memberName, {
|
|
1377
|
-
get() {
|
|
1378
|
-
return getValue(this, memberName);
|
|
1379
|
-
},
|
|
1380
2151
|
set(newValue) {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
2152
|
+
const ref = getHostRef(this);
|
|
2153
|
+
if (origSetter) {
|
|
2154
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2155
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
2156
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
2157
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2158
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2159
|
+
}
|
|
2160
|
+
origSetter.apply(this, [
|
|
2161
|
+
parsePropertyValue(
|
|
2162
|
+
newValue,
|
|
2163
|
+
memberFlags,
|
|
2164
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2165
|
+
)
|
|
2166
|
+
]);
|
|
2167
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2168
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2169
|
+
return;
|
|
2170
|
+
}
|
|
2171
|
+
{
|
|
2172
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
2173
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2174
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
2175
|
+
ref.$onReadyPromise$.then(() => {
|
|
2176
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
2177
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
const setterSetVal = () => {
|
|
2184
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2185
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2186
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2187
|
+
}
|
|
2188
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
2189
|
+
newValue,
|
|
2190
|
+
memberFlags,
|
|
2191
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2192
|
+
);
|
|
2193
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2194
|
+
};
|
|
2195
|
+
if (ref.$lazyInstance$) {
|
|
2196
|
+
setterSetVal();
|
|
2197
|
+
} else {
|
|
2198
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
1385
2202
|
});
|
|
1386
2203
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1387
2204
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -1402,10 +2219,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1402
2219
|
plt.jmp(() => {
|
|
1403
2220
|
var _a2;
|
|
1404
2221
|
const propName = attrNameToPropName.get(attrName);
|
|
1405
|
-
if (this.hasOwnProperty(propName)) {
|
|
2222
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1406
2223
|
newValue = this[propName];
|
|
1407
2224
|
delete this[propName];
|
|
1408
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
2225
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
2226
|
+
this[propName] == newValue) {
|
|
1409
2227
|
return;
|
|
1410
2228
|
} else if (propName == null) {
|
|
1411
2229
|
const hostRef = getHostRef(this);
|
|
@@ -1421,7 +2239,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1421
2239
|
}
|
|
1422
2240
|
return;
|
|
1423
2241
|
}
|
|
1424
|
-
|
|
2242
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2243
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2244
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
2245
|
+
this[propName] = newValue;
|
|
2246
|
+
}
|
|
1425
2247
|
});
|
|
1426
2248
|
};
|
|
1427
2249
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1450,7 +2272,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1450
2272
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1451
2273
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1452
2274
|
if (bundleId) {
|
|
1453
|
-
const CstrImport = loadModule(cmpMeta);
|
|
2275
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1454
2276
|
if (CstrImport && "then" in CstrImport) {
|
|
1455
2277
|
const endLoad = uniqueTime();
|
|
1456
2278
|
Cstr = await CstrImport;
|
|
@@ -1475,16 +2297,16 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1475
2297
|
try {
|
|
1476
2298
|
new Cstr(hostRef);
|
|
1477
2299
|
} catch (e) {
|
|
1478
|
-
consoleError(e);
|
|
2300
|
+
consoleError(e, elm);
|
|
1479
2301
|
}
|
|
1480
2302
|
{
|
|
1481
|
-
hostRef.$flags$ &=
|
|
2303
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1482
2304
|
}
|
|
1483
2305
|
{
|
|
1484
2306
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1485
2307
|
}
|
|
1486
2308
|
endNewInstance();
|
|
1487
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2309
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1488
2310
|
} else {
|
|
1489
2311
|
Cstr = elm.constructor;
|
|
1490
2312
|
const cmpTag = elm.localName;
|
|
@@ -1511,9 +2333,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1511
2333
|
schedule();
|
|
1512
2334
|
}
|
|
1513
2335
|
};
|
|
1514
|
-
var fireConnectedCallback = (instance) => {
|
|
2336
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1515
2337
|
{
|
|
1516
|
-
safeCall(instance, "connectedCallback");
|
|
2338
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1517
2339
|
}
|
|
1518
2340
|
};
|
|
1519
2341
|
|
|
@@ -1525,7 +2347,18 @@ var connectedCallback = (elm) => {
|
|
|
1525
2347
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1526
2348
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1527
2349
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2350
|
+
let hostId;
|
|
1528
2351
|
{
|
|
2352
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2353
|
+
if (hostId) {
|
|
2354
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2355
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2356
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2357
|
+
}
|
|
2358
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
if (!hostId) {
|
|
1529
2362
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1530
2363
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1531
2364
|
setContentReference(elm);
|
|
@@ -1534,7 +2367,7 @@ var connectedCallback = (elm) => {
|
|
|
1534
2367
|
{
|
|
1535
2368
|
let ancestorComponent = elm;
|
|
1536
2369
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1537
|
-
if (ancestorComponent["s-p"]) {
|
|
2370
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1538
2371
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1539
2372
|
break;
|
|
1540
2373
|
}
|
|
@@ -1555,24 +2388,27 @@ var connectedCallback = (elm) => {
|
|
|
1555
2388
|
} else {
|
|
1556
2389
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1557
2390
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1558
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2391
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1559
2392
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1560
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
2393
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1561
2394
|
}
|
|
1562
2395
|
}
|
|
1563
2396
|
endConnected();
|
|
1564
2397
|
}
|
|
1565
2398
|
};
|
|
1566
2399
|
var setContentReference = (elm) => {
|
|
1567
|
-
|
|
2400
|
+
if (!win.document) {
|
|
2401
|
+
return;
|
|
2402
|
+
}
|
|
2403
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1568
2404
|
""
|
|
1569
2405
|
);
|
|
1570
2406
|
contentRefElm["s-cn"] = true;
|
|
1571
2407
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1572
2408
|
};
|
|
1573
|
-
var disconnectInstance = (instance) => {
|
|
2409
|
+
var disconnectInstance = (instance, elm) => {
|
|
1574
2410
|
{
|
|
1575
|
-
safeCall(instance, "disconnectedCallback");
|
|
2411
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1576
2412
|
}
|
|
1577
2413
|
};
|
|
1578
2414
|
var disconnectedCallback = async (elm) => {
|
|
@@ -1585,28 +2421,44 @@ var disconnectedCallback = async (elm) => {
|
|
|
1585
2421
|
}
|
|
1586
2422
|
}
|
|
1587
2423
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1588
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
2424
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1589
2425
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1590
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
2426
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1591
2427
|
}
|
|
1592
2428
|
}
|
|
2429
|
+
if (rootAppliedStyles.has(elm)) {
|
|
2430
|
+
rootAppliedStyles.delete(elm);
|
|
2431
|
+
}
|
|
2432
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
2433
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
2434
|
+
}
|
|
1593
2435
|
};
|
|
1594
2436
|
|
|
1595
2437
|
// src/runtime/bootstrap-lazy.ts
|
|
1596
2438
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1597
2439
|
var _a;
|
|
2440
|
+
if (!win.document) {
|
|
2441
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
1598
2444
|
const endBootstrap = createTime();
|
|
1599
2445
|
const cmpTags = [];
|
|
1600
2446
|
const exclude = options.exclude || [];
|
|
1601
2447
|
const customElements2 = win.customElements;
|
|
1602
|
-
const head =
|
|
2448
|
+
const head = win.document.head;
|
|
1603
2449
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1604
|
-
const dataStyles = /* @__PURE__ */
|
|
2450
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1605
2451
|
const deferredConnectedCallbacks = [];
|
|
1606
2452
|
let appLoadFallback;
|
|
1607
2453
|
let isBootstrapping = true;
|
|
1608
2454
|
Object.assign(plt, options);
|
|
1609
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
|
2455
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
2456
|
+
{
|
|
2457
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
2458
|
+
}
|
|
2459
|
+
{
|
|
2460
|
+
hydrateScopedToShadow();
|
|
2461
|
+
}
|
|
1610
2462
|
let hasSlotRelocation = false;
|
|
1611
2463
|
lazyBundles.map((lazyBundle) => {
|
|
1612
2464
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1643,9 +2495,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1643
2495
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1644
2496
|
{
|
|
1645
2497
|
if (!self.shadowRoot) {
|
|
1646
|
-
|
|
1647
|
-
self.attachShadow({ mode: "open" });
|
|
1648
|
-
}
|
|
2498
|
+
createShadowRoot.call(self, cmpMeta);
|
|
1649
2499
|
} else {
|
|
1650
2500
|
if (self.shadowRoot.mode !== "open") {
|
|
1651
2501
|
throw new Error(
|
|
@@ -1674,6 +2524,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1674
2524
|
}
|
|
1675
2525
|
disconnectedCallback() {
|
|
1676
2526
|
plt.jmp(() => disconnectedCallback(this));
|
|
2527
|
+
plt.raf(() => {
|
|
2528
|
+
var _a3;
|
|
2529
|
+
const hostRef = getHostRef(this);
|
|
2530
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
2531
|
+
if (i2 > -1) {
|
|
2532
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
2533
|
+
}
|
|
2534
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
2535
|
+
delete hostRef.$vnode$.$elm$;
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
1677
2538
|
}
|
|
1678
2539
|
componentOnReady() {
|
|
1679
2540
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1696,12 +2557,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1696
2557
|
if (hasSlotRelocation) {
|
|
1697
2558
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
1698
2559
|
}
|
|
1699
|
-
{
|
|
1700
|
-
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1701
|
-
}
|
|
1702
2560
|
if (dataStyles.innerHTML.length) {
|
|
1703
2561
|
dataStyles.setAttribute("data-styles", "");
|
|
1704
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
2562
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1705
2563
|
if (nonce != null) {
|
|
1706
2564
|
dataStyles.setAttribute("nonce", nonce);
|
|
1707
2565
|
}
|
|
@@ -1719,9 +2577,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1719
2577
|
endBootstrap();
|
|
1720
2578
|
};
|
|
1721
2579
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1722
|
-
if (listeners) {
|
|
2580
|
+
if (listeners && win.document) {
|
|
1723
2581
|
listeners.map(([flags, name, method]) => {
|
|
1724
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2582
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1725
2583
|
const handler = hostListenerProxy(hostRef, method);
|
|
1726
2584
|
const opts = hostListenerOpts(flags);
|
|
1727
2585
|
plt.ael(target, name, handler, opts);
|
|
@@ -1740,11 +2598,13 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1740
2598
|
}
|
|
1741
2599
|
}
|
|
1742
2600
|
} catch (e) {
|
|
1743
|
-
consoleError(e);
|
|
2601
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1744
2602
|
}
|
|
1745
2603
|
};
|
|
1746
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1747
|
-
if (flags & 8 /* TargetWindow */)
|
|
2604
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2605
|
+
if (flags & 8 /* TargetWindow */) {
|
|
2606
|
+
return win;
|
|
2607
|
+
}
|
|
1748
2608
|
return elm;
|
|
1749
2609
|
};
|
|
1750
2610
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -1755,4 +2615,4 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1755
2615
|
// src/runtime/nonce.ts
|
|
1756
2616
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1757
2617
|
|
|
1758
|
-
export { Host as H, bootstrapLazy as b, createEvent as c,
|
|
2618
|
+
export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|