@swisspost/design-system-components 10.0.0-next.40 → 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 -309
- package/dist/cjs/index.cjs.js +0 -70
- package/dist/cjs/loader.cjs.js +3 -6
- package/dist/cjs/{package-b731881e.js → package-C2pR6Vs2.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +177 -10
- 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.js +39 -23
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +26 -11
- 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.js +8 -7
- 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-list/post-list.js +12 -3
- package/dist/collection/components/post-logo/post-logo.js +3 -4
- 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 +19 -5
- 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 +25 -5
- 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 +7 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +24 -6
- 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/{loaders/post-breadcrumb-item2.js → dist/components/p-Cpaqct04.js} +9 -11
- package/dist/components/{post-accordion-item2.js → p-CtNCtg2z.js} +32 -21
- package/dist/components/p-Cx0AiN2A.js +182 -0
- package/dist/components/{post-collapsible-trigger2.js → 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} +41 -28
- package/{loaders/post-collapsible2.js → dist/components/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 +416 -116
- 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 -305
- package/dist/esm/index.js +1 -29
- package/dist/esm/loader.js +3 -4
- package/dist/esm/package-1KLiMO0w.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +180 -7
- 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-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/post-accordion-item-5c879102.js +0 -161
- package/dist/cjs/post-avatar-4f1681df.js +0 -162
- package/dist/cjs/post-back-to-top-abbb4ac4.js +0 -93
- package/dist/cjs/post-banner-4d99c51c.js +0 -87
- package/dist/cjs/post-breadcrumbs-5ceabb10.js +0 -126
- package/dist/cjs/post-card-control-b657aeaa.js +0 -290
- package/dist/cjs/post-collapsible-trigger-33f09d6c.js +0 -190
- package/dist/cjs/post-footer-022cf408.js +0 -66
- package/dist/cjs/post-linkarea-5fbb2e25.js +0 -30
- package/dist/cjs/post-menu-item-d4cc4742.js +0 -68
- package/dist/cjs/post-popover-b7cd0091.js +0 -150
- package/dist/cjs/post-rating-c81d1ac3.js +0 -109
- package/dist/cjs/post-tab-header-1db15093.js +0 -34
- package/dist/cjs/post-tab-panel-698981b8.js +0 -36
- package/dist/cjs/post-tabs-79eab811.js +0 -173
- package/dist/cjs/post-tag-66a52727.js +0 -60
- package/dist/cjs/post-togglebutton-a6b8b75d.js +0 -4491
- package/dist/cjs/post-tooltip-560cf42c.js +0 -74
- package/dist/cjs/post-tooltip-trigger-2a54e3e4.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-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-breadcrumb-item2.js +0 -82
- 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-collapsible2.js +0 -108
- package/dist/components/post-footer2.js +0 -115
- 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/package-9374eb90.js +0 -3
- package/dist/esm/post-accordion-item-f416bd95.js +0 -158
- package/dist/esm/post-avatar-2cb5190b.js +0 -160
- package/dist/esm/post-back-to-top-f877d4c6.js +0 -91
- package/dist/esm/post-banner-576a5adb.js +0 -85
- package/dist/esm/post-breadcrumbs-63223336.js +0 -124
- package/dist/esm/post-card-control-2eebe7b4.js +0 -288
- package/dist/esm/post-collapsible-trigger-561df34e.js +0 -187
- package/dist/esm/post-footer-a270f67b.js +0 -64
- package/dist/esm/post-linkarea-456ce63d.js +0 -28
- package/dist/esm/post-menu-item-e051284c.js +0 -65
- package/dist/esm/post-popover-7c3c9072.js +0 -148
- package/dist/esm/post-rating-2c9dd11f.js +0 -107
- package/dist/esm/post-tab-header-f90b2f93.js +0 -32
- package/dist/esm/post-tab-panel-c19b5e30.js +0 -34
- package/dist/esm/post-tabs-0dadedf2.js +0 -171
- package/dist/esm/post-tag-b8be3b0c.js +0 -58
- package/dist/esm/post-togglebutton-83339cc9.js +0 -4475
- package/dist/esm/post-tooltip-3cc82984.js +0 -72
- package/dist/esm/post-tooltip-trigger-898c3dbc.js +0 -4683
- package/dist/post-components/p-0889c759.js +0 -1
- package/dist/post-components/p-104ddc50.js +0 -1
- package/dist/post-components/p-13b41e32.entry.js +0 -1
- package/dist/post-components/p-1906d77c.js +0 -1
- package/dist/post-components/p-19d0e6ea.entry.js +0 -1
- package/dist/post-components/p-1b9afb34.entry.js +0 -1
- package/dist/post-components/p-1fbffc90.js +0 -1
- package/dist/post-components/p-234925fa.js +0 -1
- package/dist/post-components/p-23fb976f.entry.js +0 -1
- package/dist/post-components/p-24c42ebe.entry.js +0 -1
- package/dist/post-components/p-28c19671.js +0 -8
- package/dist/post-components/p-37aaa30f.js +0 -1
- package/dist/post-components/p-3baf0b40.entry.js +0 -1
- package/dist/post-components/p-4390192f.js +0 -1
- package/dist/post-components/p-4a071696.js +0 -1
- package/dist/post-components/p-4c2d5072.js +0 -1
- package/dist/post-components/p-51b6114c.entry.js +0 -1
- package/dist/post-components/p-5fb4fc65.js +0 -1
- package/dist/post-components/p-64c13aaf.entry.js +0 -1
- package/dist/post-components/p-66679f9d.entry.js +0 -1
- package/dist/post-components/p-68a98f0b.js +0 -1
- package/dist/post-components/p-6a4dc55e.js +0 -1
- package/dist/post-components/p-722ffaae.js +0 -1
- package/dist/post-components/p-789f9a23.entry.js +0 -1
- package/dist/post-components/p-7e6eae42.js +0 -1
- package/dist/post-components/p-8117dd0c.js +0 -1
- package/dist/post-components/p-814c0c4d.entry.js +0 -1
- package/dist/post-components/p-87e0d6fa.js +0 -1
- package/dist/post-components/p-988d20f4.js +0 -1
- package/dist/post-components/p-9b1e4e52.entry.js +0 -1
- package/dist/post-components/p-9e461613.js +0 -2
- package/dist/post-components/p-ab44a18c.entry.js +0 -1
- package/dist/post-components/p-b2952b0e.entry.js +0 -1
- package/dist/post-components/p-c10b2a2f.js +0 -1
- package/dist/post-components/p-c80cb846.js +0 -1
- package/dist/post-components/p-da4704c1.js +0 -1
- package/dist/post-components/p-dc4de84a.entry.js +0 -1
- package/dist/post-components/p-e1255160.js +0 -1
- package/dist/post-components/p-f1f0ace3.entry.js +0 -1
- package/dist/post-components/p-f34fb6c4.entry.js +0 -1
- package/dist/post-components/p-f6f914bb.js +0 -1
- package/dist/post-components/p-fe7e64cf.entry.js +0 -1
- package/dist/post-components/p-fee94252.entry.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 -6
- package/loaders/post-accordion2.js +0 -126
- 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-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-trigger2.js +0 -125
- package/loaders/post-collapsible.d.ts +0 -11
- package/loaders/post-collapsible.js +0 -6
- package/loaders/post-footer.d.ts +0 -11
- package/loaders/post-footer.js +0 -118
- 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,10 +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
97
|
case 'post-avatar':
|
|
60
98
|
return import(
|
|
61
99
|
/* webpackMode: "lazy" */
|
|
@@ -64,14 +102,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
64
102
|
return import(
|
|
65
103
|
/* webpackMode: "lazy" */
|
|
66
104
|
'./post-back-to-top.entry.js').then(processMod, consoleError);
|
|
67
|
-
case 'post-banner':
|
|
68
|
-
return import(
|
|
69
|
-
/* webpackMode: "lazy" */
|
|
70
|
-
'./post-banner.entry.js').then(processMod, consoleError);
|
|
71
|
-
case 'post-breadcrumbs':
|
|
72
|
-
return import(
|
|
73
|
-
/* webpackMode: "lazy" */
|
|
74
|
-
'./post-breadcrumbs.entry.js').then(processMod, consoleError);
|
|
75
105
|
case 'post-card-control':
|
|
76
106
|
return import(
|
|
77
107
|
/* webpackMode: "lazy" */
|
|
@@ -84,10 +114,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
84
114
|
return import(
|
|
85
115
|
/* webpackMode: "lazy" */
|
|
86
116
|
'./post-linkarea.entry.js').then(processMod, consoleError);
|
|
87
|
-
case 'post-popover':
|
|
88
|
-
return import(
|
|
89
|
-
/* webpackMode: "lazy" */
|
|
90
|
-
'./post-popover.entry.js').then(processMod, consoleError);
|
|
91
117
|
case 'post-rating':
|
|
92
118
|
return import(
|
|
93
119
|
/* webpackMode: "lazy" */
|
|
@@ -100,10 +126,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
100
126
|
return import(
|
|
101
127
|
/* webpackMode: "lazy" */
|
|
102
128
|
'./post-tab-panel.entry.js').then(processMod, consoleError);
|
|
103
|
-
case 'post-tabs':
|
|
104
|
-
return import(
|
|
105
|
-
/* webpackMode: "lazy" */
|
|
106
|
-
'./post-tabs.entry.js').then(processMod, consoleError);
|
|
107
129
|
case 'post-tag':
|
|
108
130
|
return import(
|
|
109
131
|
/* webpackMode: "lazy" */
|
|
@@ -112,22 +134,42 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
112
134
|
return import(
|
|
113
135
|
/* webpackMode: "lazy" */
|
|
114
136
|
'./post-tooltip.entry.js').then(processMod, consoleError);
|
|
115
|
-
case 'post-
|
|
137
|
+
case 'post-banner':
|
|
116
138
|
return import(
|
|
117
139
|
/* webpackMode: "lazy" */
|
|
118
|
-
'./post-
|
|
119
|
-
case 'post-
|
|
140
|
+
'./post-banner.entry.js').then(processMod, consoleError);
|
|
141
|
+
case 'post-breadcrumbs':
|
|
120
142
|
return import(
|
|
121
143
|
/* webpackMode: "lazy" */
|
|
122
|
-
'./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);
|
|
123
153
|
case 'post-breadcrumb-item_2':
|
|
124
154
|
return import(
|
|
125
155
|
/* webpackMode: "lazy" */
|
|
126
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);
|
|
127
161
|
case 'post-collapsible_2':
|
|
128
162
|
return import(
|
|
129
163
|
/* webpackMode: "lazy" */
|
|
130
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);
|
|
131
173
|
}
|
|
132
174
|
}
|
|
133
175
|
return import(
|
|
@@ -136,17 +178,31 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
136
178
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
137
179
|
/* webpackMode: "lazy" */
|
|
138
180
|
`./${bundleId}.entry.js${""}`
|
|
139
|
-
).then(
|
|
140
|
-
{
|
|
141
|
-
|
|
181
|
+
).then(
|
|
182
|
+
(importedModule) => {
|
|
183
|
+
{
|
|
184
|
+
cmpModules.set(bundleId, importedModule);
|
|
185
|
+
}
|
|
186
|
+
return importedModule[exportName];
|
|
187
|
+
},
|
|
188
|
+
(e) => {
|
|
189
|
+
consoleError(e, hostRef.$hostElement$);
|
|
142
190
|
}
|
|
143
|
-
|
|
144
|
-
}, consoleError);
|
|
191
|
+
);
|
|
145
192
|
};
|
|
146
193
|
|
|
147
194
|
// src/client/client-style.ts
|
|
148
195
|
var styles = /* @__PURE__ */ new Map();
|
|
149
|
-
|
|
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";
|
|
150
206
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
151
207
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
152
208
|
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
@@ -156,7 +212,6 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
156
212
|
"formStateRestoreCallback"
|
|
157
213
|
];
|
|
158
214
|
var win = typeof window !== "undefined" ? window : {};
|
|
159
|
-
var doc = win.document || { head: {} };
|
|
160
215
|
var plt = {
|
|
161
216
|
$flags$: 0,
|
|
162
217
|
$resourcesUrl$: "",
|
|
@@ -167,9 +222,10 @@ var plt = {
|
|
|
167
222
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
168
223
|
};
|
|
169
224
|
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
225
|
+
var _a;
|
|
170
226
|
let supportsListenerOptions2 = false;
|
|
171
227
|
try {
|
|
172
|
-
|
|
228
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
173
229
|
"e",
|
|
174
230
|
null,
|
|
175
231
|
Object.defineProperty({}, "passive", {
|
|
@@ -226,25 +282,117 @@ var flush = () => {
|
|
|
226
282
|
};
|
|
227
283
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
228
284
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
229
|
-
|
|
230
|
-
// src/utils/constants.ts
|
|
231
|
-
var EMPTY_OBJ = {};
|
|
232
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
233
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
234
|
-
|
|
235
|
-
// src/utils/helpers.ts
|
|
236
|
-
var isDef = (v) => v != null;
|
|
237
285
|
var isComplexType = (o) => {
|
|
238
286
|
o = typeof o;
|
|
239
287
|
return o === "object" || o === "function";
|
|
240
288
|
};
|
|
241
289
|
|
|
242
290
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
243
|
-
function queryNonceMetaTagContent(
|
|
291
|
+
function queryNonceMetaTagContent(doc) {
|
|
244
292
|
var _a, _b, _c;
|
|
245
|
-
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;
|
|
246
294
|
}
|
|
247
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
|
+
|
|
248
396
|
// src/utils/result.ts
|
|
249
397
|
var result_exports = {};
|
|
250
398
|
__export(result_exports, {
|
|
@@ -293,6 +441,156 @@ var unwrapErr = (result) => {
|
|
|
293
441
|
throw result.value;
|
|
294
442
|
}
|
|
295
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
|
+
}
|
|
296
594
|
var createTime = (fnName, tagName = "") => {
|
|
297
595
|
{
|
|
298
596
|
return () => {
|
|
@@ -418,13 +716,427 @@ var convertToPrivate = (node) => {
|
|
|
418
716
|
vnode.$name$ = node.vname;
|
|
419
717
|
return vnode;
|
|
420
718
|
};
|
|
421
|
-
|
|
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
|
+
}
|
|
422
1130
|
if (propValue != null && !isComplexType(propValue)) {
|
|
423
1131
|
if (propType & 4 /* Boolean */) {
|
|
424
|
-
|
|
1132
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1133
|
+
return propValue === "" || !!propValue;
|
|
1134
|
+
} else {
|
|
1135
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1136
|
+
}
|
|
425
1137
|
}
|
|
426
1138
|
if (propType & 2 /* Number */) {
|
|
427
|
-
return parseFloat(propValue);
|
|
1139
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
428
1140
|
}
|
|
429
1141
|
if (propType & 1 /* String */) {
|
|
430
1142
|
return String(propValue);
|
|
@@ -441,9 +1153,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
441
1153
|
return {
|
|
442
1154
|
emit: (detail) => {
|
|
443
1155
|
return emitEvent(elm, name, {
|
|
444
|
-
bubbles:
|
|
445
|
-
composed:
|
|
446
|
-
cancelable:
|
|
1156
|
+
bubbles: true,
|
|
1157
|
+
composed: true,
|
|
1158
|
+
cancelable: true,
|
|
447
1159
|
detail
|
|
448
1160
|
});
|
|
449
1161
|
}
|
|
@@ -473,7 +1185,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
473
1185
|
var _a;
|
|
474
1186
|
const scopeId2 = getScopeId(cmpMeta);
|
|
475
1187
|
const style = styles.get(scopeId2);
|
|
476
|
-
|
|
1188
|
+
if (!win.document) {
|
|
1189
|
+
return scopeId2;
|
|
1190
|
+
}
|
|
1191
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
477
1192
|
if (style) {
|
|
478
1193
|
if (typeof style === "string") {
|
|
479
1194
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -483,14 +1198,43 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
483
1198
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
484
1199
|
}
|
|
485
1200
|
if (!appliedStyles.has(scopeId2)) {
|
|
486
|
-
{
|
|
487
|
-
styleElm = doc.createElement("style");
|
|
1201
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
488
1202
|
styleElm.innerHTML = style;
|
|
489
|
-
|
|
1203
|
+
} else {
|
|
1204
|
+
styleElm = win.document.createElement("style");
|
|
1205
|
+
styleElm.innerHTML = style;
|
|
1206
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
490
1207
|
if (nonce != null) {
|
|
491
1208
|
styleElm.setAttribute("nonce", nonce);
|
|
492
1209
|
}
|
|
493
|
-
|
|
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
|
+
}
|
|
494
1238
|
}
|
|
495
1239
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
496
1240
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -520,121 +1264,170 @@ var attachStyles = (hostRef) => {
|
|
|
520
1264
|
endAttachStyles();
|
|
521
1265
|
};
|
|
522
1266
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
523
|
-
var
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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 {
|
|
531
1296
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
532
1297
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
elm.style.removeProperty(prop);
|
|
539
|
-
} else {
|
|
540
|
-
elm.style[prop] = "";
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
for (const prop in newValue) {
|
|
546
|
-
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) {
|
|
547
1303
|
if (prop.includes("-")) {
|
|
548
|
-
elm.style.
|
|
1304
|
+
elm.style.removeProperty(prop);
|
|
549
1305
|
} else {
|
|
550
|
-
elm.style[prop] =
|
|
1306
|
+
elm.style[prop] = "";
|
|
551
1307
|
}
|
|
552
1308
|
}
|
|
553
1309
|
}
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
} else if (isMemberInElement(win, ln)) {
|
|
562
|
-
memberName = ln.slice(2);
|
|
563
|
-
} else {
|
|
564
|
-
memberName = ln[2] + memberName.slice(3);
|
|
565
|
-
}
|
|
566
|
-
if (oldValue || newValue) {
|
|
567
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
568
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
569
|
-
if (oldValue) {
|
|
570
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
571
|
-
}
|
|
572
|
-
if (newValue) {
|
|
573
|
-
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];
|
|
574
1317
|
}
|
|
575
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);
|
|
576
1329
|
} else {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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") {
|
|
585
1352
|
elm[memberName] = n;
|
|
1353
|
+
} else {
|
|
1354
|
+
elm.setAttribute(memberName, n);
|
|
586
1355
|
}
|
|
587
|
-
} else {
|
|
588
|
-
elm[memberName] = newValue;
|
|
589
1356
|
}
|
|
590
|
-
}
|
|
1357
|
+
} else if (elm[memberName] !== newValue) {
|
|
1358
|
+
elm[memberName] = newValue;
|
|
591
1359
|
}
|
|
1360
|
+
} catch (e) {
|
|
592
1361
|
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
1362
|
+
}
|
|
1363
|
+
let xlink = false;
|
|
1364
|
+
{
|
|
1365
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1366
|
+
memberName = ln;
|
|
1367
|
+
xlink = true;
|
|
599
1368
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
604
|
-
} else {
|
|
605
|
-
elm.removeAttribute(memberName);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
609
|
-
newValue = newValue === true ? "" : newValue;
|
|
1369
|
+
}
|
|
1370
|
+
if (newValue == null || newValue === false) {
|
|
1371
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
610
1372
|
if (xlink) {
|
|
611
|
-
elm.
|
|
1373
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
612
1374
|
} else {
|
|
613
|
-
elm.
|
|
1375
|
+
elm.removeAttribute(memberName);
|
|
614
1376
|
}
|
|
615
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
|
+
}
|
|
616
1385
|
}
|
|
617
1386
|
}
|
|
618
1387
|
};
|
|
619
1388
|
var parseClassListRegex = /\s/;
|
|
620
|
-
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
|
+
};
|
|
621
1398
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
622
1399
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
623
1400
|
|
|
624
1401
|
// src/runtime/vdom/update-element.ts
|
|
625
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
1402
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
626
1403
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
627
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
628
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
1404
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1405
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
629
1406
|
{
|
|
630
1407
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
631
1408
|
if (!(memberName in newVnodeAttrs)) {
|
|
632
|
-
setAccessor(
|
|
1409
|
+
setAccessor(
|
|
1410
|
+
elm,
|
|
1411
|
+
memberName,
|
|
1412
|
+
oldVnodeAttrs[memberName],
|
|
1413
|
+
void 0,
|
|
1414
|
+
isSvgMode2,
|
|
1415
|
+
newVnode.$flags$,
|
|
1416
|
+
isInitialRender
|
|
1417
|
+
);
|
|
633
1418
|
}
|
|
634
1419
|
}
|
|
635
1420
|
}
|
|
636
1421
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
637
|
-
setAccessor(
|
|
1422
|
+
setAccessor(
|
|
1423
|
+
elm,
|
|
1424
|
+
memberName,
|
|
1425
|
+
oldVnodeAttrs[memberName],
|
|
1426
|
+
newVnodeAttrs[memberName],
|
|
1427
|
+
isSvgMode2,
|
|
1428
|
+
newVnode.$flags$,
|
|
1429
|
+
isInitialRender
|
|
1430
|
+
);
|
|
638
1431
|
}
|
|
639
1432
|
};
|
|
640
1433
|
function sortedAttrNames(attrNames) {
|
|
@@ -646,16 +1439,13 @@ function sortedAttrNames(attrNames) {
|
|
|
646
1439
|
attrNames
|
|
647
1440
|
);
|
|
648
1441
|
}
|
|
649
|
-
|
|
650
|
-
// src/runtime/vdom/vdom-render.ts
|
|
651
|
-
var scopeId;
|
|
652
1442
|
var contentRef;
|
|
653
1443
|
var hostTagName;
|
|
654
1444
|
var useNativeShadowDom = false;
|
|
655
1445
|
var checkSlotFallbackVisibility = false;
|
|
656
1446
|
var checkSlotRelocate = false;
|
|
657
1447
|
var isSvgMode = false;
|
|
658
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
1448
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
659
1449
|
var _a;
|
|
660
1450
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
661
1451
|
let i2 = 0;
|
|
@@ -665,9 +1455,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
665
1455
|
if (!useNativeShadowDom) {
|
|
666
1456
|
checkSlotRelocate = true;
|
|
667
1457
|
if (newVNode2.$tag$ === "slot") {
|
|
668
|
-
if (scopeId) {
|
|
669
|
-
parentElm.classList.add(scopeId + "-s");
|
|
670
|
-
}
|
|
671
1458
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
672
1459
|
// slot element has fallback content
|
|
673
1460
|
// still create an element that "mocks" the slot element
|
|
@@ -681,14 +1468,22 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
681
1468
|
}
|
|
682
1469
|
}
|
|
683
1470
|
if (newVNode2.$text$ !== null) {
|
|
684
|
-
elm = newVNode2.$elm$ =
|
|
1471
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
685
1472
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
686
|
-
elm = newVNode2.$elm$ =
|
|
1473
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
1474
|
+
{
|
|
1475
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
1476
|
+
}
|
|
687
1477
|
} else {
|
|
688
1478
|
if (!isSvgMode) {
|
|
689
1479
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
690
1480
|
}
|
|
691
|
-
|
|
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(
|
|
692
1487
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
693
1488
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
694
1489
|
) ;
|
|
@@ -698,12 +1493,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
698
1493
|
{
|
|
699
1494
|
updateElement(null, newVNode2, isSvgMode);
|
|
700
1495
|
}
|
|
701
|
-
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
702
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
703
|
-
}
|
|
704
1496
|
if (newVNode2.$children$) {
|
|
705
1497
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
706
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
1498
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
707
1499
|
if (childNode) {
|
|
708
1500
|
elm.appendChild(childNode);
|
|
709
1501
|
}
|
|
@@ -724,6 +1516,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
724
1516
|
elm["s-cr"] = contentRef;
|
|
725
1517
|
elm["s-sn"] = newVNode2.$name$ || "";
|
|
726
1518
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1519
|
+
patchSlotNode(elm);
|
|
727
1520
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
728
1521
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
729
1522
|
{
|
|
@@ -736,19 +1529,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
736
1529
|
};
|
|
737
1530
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
738
1531
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
739
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
740
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
741
|
-
let node = parentElm;
|
|
742
|
-
while (node = node.nextSibling) {
|
|
743
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
744
|
-
oldSlotChildNodes.push(node);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
1532
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
748
1533
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
749
1534
|
const childNode = oldSlotChildNodes[i2];
|
|
750
1535
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
751
|
-
insertBefore(
|
|
1536
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
752
1537
|
childNode["s-ol"].remove();
|
|
753
1538
|
childNode["s-ol"] = void 0;
|
|
754
1539
|
childNode["s-sh"] = void 0;
|
|
@@ -758,7 +1543,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
758
1543
|
putBackInOriginalLocation(childNode, recursive);
|
|
759
1544
|
}
|
|
760
1545
|
}
|
|
761
|
-
plt.$flags$ &=
|
|
1546
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
762
1547
|
};
|
|
763
1548
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
764
1549
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
@@ -768,7 +1553,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
768
1553
|
}
|
|
769
1554
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
770
1555
|
if (vnodes[startIdx]) {
|
|
771
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
1556
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
772
1557
|
if (childNode) {
|
|
773
1558
|
vnodes[startIdx].$elm$ = childNode;
|
|
774
1559
|
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
@@ -855,7 +1640,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
855
1640
|
if (idxInOld >= 0) {
|
|
856
1641
|
elmToMove = oldCh[idxInOld];
|
|
857
1642
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
858
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1643
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
859
1644
|
} else {
|
|
860
1645
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
861
1646
|
oldCh[idxInOld] = void 0;
|
|
@@ -863,12 +1648,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
863
1648
|
}
|
|
864
1649
|
newStartVnode = newCh[++newStartIdx];
|
|
865
1650
|
} else {
|
|
866
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1651
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
867
1652
|
newStartVnode = newCh[++newStartIdx];
|
|
868
1653
|
}
|
|
869
1654
|
if (node) {
|
|
870
1655
|
{
|
|
871
|
-
insertBefore(
|
|
1656
|
+
insertBefore(
|
|
1657
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1658
|
+
node,
|
|
1659
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1660
|
+
);
|
|
872
1661
|
}
|
|
873
1662
|
}
|
|
874
1663
|
}
|
|
@@ -894,14 +1683,14 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
894
1683
|
if (!isInitialRender) {
|
|
895
1684
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
896
1685
|
}
|
|
1686
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1687
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1688
|
+
}
|
|
897
1689
|
return true;
|
|
898
1690
|
}
|
|
899
1691
|
return false;
|
|
900
1692
|
};
|
|
901
|
-
var referenceNode = (node) =>
|
|
902
|
-
return node && node["s-ol"] || node;
|
|
903
|
-
};
|
|
904
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1693
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
905
1694
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
906
1695
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
907
1696
|
const oldChildren = oldVNode.$children$;
|
|
@@ -914,9 +1703,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
914
1703
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
915
1704
|
}
|
|
916
1705
|
{
|
|
917
|
-
|
|
918
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
919
|
-
}
|
|
1706
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
920
1707
|
}
|
|
921
1708
|
if (oldChildren !== null && newChildren !== null) {
|
|
922
1709
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -925,7 +1712,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
925
1712
|
elm.textContent = "";
|
|
926
1713
|
}
|
|
927
1714
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
928
|
-
} 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
|
+
) {
|
|
929
1719
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
930
1720
|
}
|
|
931
1721
|
if (isSvgMode && tag === "svg") {
|
|
@@ -937,45 +1727,19 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
937
1727
|
elm.data = text;
|
|
938
1728
|
}
|
|
939
1729
|
};
|
|
940
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
941
|
-
const childNodes = elm.childNodes;
|
|
942
|
-
for (const childNode of childNodes) {
|
|
943
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
944
|
-
if (childNode["s-sr"]) {
|
|
945
|
-
const slotName = childNode["s-sn"];
|
|
946
|
-
childNode.hidden = false;
|
|
947
|
-
for (const siblingNode of childNodes) {
|
|
948
|
-
if (siblingNode !== childNode) {
|
|
949
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
950
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
951
|
-
childNode.hidden = true;
|
|
952
|
-
break;
|
|
953
|
-
}
|
|
954
|
-
} else {
|
|
955
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
956
|
-
childNode.hidden = true;
|
|
957
|
-
break;
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
updateFallbackSlotVisibility(childNode);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
};
|
|
967
1730
|
var relocateNodes = [];
|
|
968
1731
|
var markSlotContentForRelocation = (elm) => {
|
|
969
1732
|
let node;
|
|
970
1733
|
let hostContentNodes;
|
|
971
1734
|
let j;
|
|
972
|
-
|
|
1735
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1736
|
+
for (const childNode of children) {
|
|
973
1737
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
974
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1738
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
975
1739
|
const slotName = childNode["s-sn"];
|
|
976
1740
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
977
1741
|
node = hostContentNodes[j];
|
|
978
|
-
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)) {
|
|
979
1743
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
980
1744
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
981
1745
|
checkSlotFallbackVisibility = true;
|
|
@@ -1013,21 +1777,6 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1013
1777
|
}
|
|
1014
1778
|
}
|
|
1015
1779
|
};
|
|
1016
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1017
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1018
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1019
|
-
return true;
|
|
1020
|
-
}
|
|
1021
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1022
|
-
return true;
|
|
1023
|
-
}
|
|
1024
|
-
return false;
|
|
1025
|
-
}
|
|
1026
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1027
|
-
return true;
|
|
1028
|
-
}
|
|
1029
|
-
return slotName === "";
|
|
1030
|
-
};
|
|
1031
1780
|
var nullifyVNodeRefs = (vNode) => {
|
|
1032
1781
|
{
|
|
1033
1782
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
@@ -1035,15 +1784,17 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
1035
1784
|
}
|
|
1036
1785
|
};
|
|
1037
1786
|
var insertBefore = (parent, newNode, reference) => {
|
|
1038
|
-
|
|
1039
|
-
|
|
1787
|
+
{
|
|
1788
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1789
|
+
}
|
|
1040
1790
|
};
|
|
1041
1791
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1042
1792
|
var _a, _b, _c, _d;
|
|
1043
1793
|
const hostElm = hostRef.$hostElement$;
|
|
1044
1794
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1045
1795
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1046
|
-
const
|
|
1796
|
+
const isHostElement = isHost(renderFnResults);
|
|
1797
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1047
1798
|
hostTagName = hostElm.tagName;
|
|
1048
1799
|
if (cmpMeta.$attrsToReflect$) {
|
|
1049
1800
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
@@ -1062,10 +1813,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1062
1813
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1063
1814
|
hostRef.$vnode$ = rootVnode;
|
|
1064
1815
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1065
|
-
|
|
1066
|
-
scopeId = hostElm["s-sc"];
|
|
1067
|
-
}
|
|
1068
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1816
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1069
1817
|
{
|
|
1070
1818
|
contentRef = hostElm["s-cr"];
|
|
1071
1819
|
checkSlotFallbackVisibility = false;
|
|
@@ -1077,8 +1825,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1077
1825
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1078
1826
|
for (const relocateData of relocateNodes) {
|
|
1079
1827
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1080
|
-
if (!nodeToRelocate["s-ol"]) {
|
|
1081
|
-
const orgLocationNode =
|
|
1828
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1829
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1082
1830
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1083
1831
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1084
1832
|
}
|
|
@@ -1093,7 +1841,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1093
1841
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1094
1842
|
while (orgLocationNode) {
|
|
1095
1843
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1096
|
-
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)) {
|
|
1097
1845
|
refNode = refNode.nextSibling;
|
|
1098
1846
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1099
1847
|
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
@@ -1106,18 +1854,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1106
1854
|
orgLocationNode = orgLocationNode.previousSibling;
|
|
1107
1855
|
}
|
|
1108
1856
|
}
|
|
1109
|
-
|
|
1857
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1858
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1859
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1110
1860
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1111
1861
|
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1112
1862
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1113
1863
|
}
|
|
1114
1864
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1115
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1865
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1116
1866
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1117
1867
|
}
|
|
1118
1868
|
}
|
|
1119
1869
|
}
|
|
1120
|
-
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](
|
|
1870
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1121
1871
|
} else {
|
|
1122
1872
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1123
1873
|
if (isInitialLoad) {
|
|
@@ -1131,7 +1881,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1131
1881
|
if (checkSlotFallbackVisibility) {
|
|
1132
1882
|
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1133
1883
|
}
|
|
1134
|
-
plt.$flags$ &=
|
|
1884
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1135
1885
|
relocateNodes.length = 0;
|
|
1136
1886
|
}
|
|
1137
1887
|
contentRef = void 0;
|
|
@@ -1140,7 +1890,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1140
1890
|
// src/runtime/update-component.ts
|
|
1141
1891
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1142
1892
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1143
|
-
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
|
+
);
|
|
1144
1901
|
}
|
|
1145
1902
|
};
|
|
1146
1903
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1169,17 +1926,15 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1169
1926
|
{
|
|
1170
1927
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1171
1928
|
if (hostRef.$queuedListeners$) {
|
|
1172
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1929
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
1173
1930
|
hostRef.$queuedListeners$ = void 0;
|
|
1174
1931
|
}
|
|
1175
1932
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1180
|
-
{
|
|
1181
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1933
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1934
|
+
} else {
|
|
1935
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1182
1936
|
}
|
|
1937
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1183
1938
|
endSchedule();
|
|
1184
1939
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1185
1940
|
};
|
|
@@ -1222,7 +1977,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1222
1977
|
try {
|
|
1223
1978
|
instance = instance.render() ;
|
|
1224
1979
|
{
|
|
1225
|
-
hostRef.$flags$ &=
|
|
1980
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1226
1981
|
}
|
|
1227
1982
|
{
|
|
1228
1983
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -1245,17 +2000,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1245
2000
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1246
2001
|
const instance = hostRef.$lazyInstance$ ;
|
|
1247
2002
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1248
|
-
|
|
1249
|
-
safeCall(instance, "componentDidRender");
|
|
1250
|
-
}
|
|
2003
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1251
2004
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1252
2005
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1253
2006
|
{
|
|
1254
2007
|
addHydratedFlag(elm);
|
|
1255
2008
|
}
|
|
1256
|
-
|
|
1257
|
-
safeCall(instance, "componentDidLoad");
|
|
1258
|
-
}
|
|
2009
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1259
2010
|
endPostUpdate();
|
|
1260
2011
|
{
|
|
1261
2012
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1264,6 +2015,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1264
2015
|
}
|
|
1265
2016
|
}
|
|
1266
2017
|
} else {
|
|
2018
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1267
2019
|
endPostUpdate();
|
|
1268
2020
|
}
|
|
1269
2021
|
{
|
|
@@ -1277,21 +2029,18 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1277
2029
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1278
2030
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1279
2031
|
}
|
|
1280
|
-
hostRef.$flags$ &=
|
|
2032
|
+
hostRef.$flags$ &= -517;
|
|
1281
2033
|
}
|
|
1282
2034
|
};
|
|
1283
2035
|
var appDidLoad = (who) => {
|
|
1284
|
-
{
|
|
1285
|
-
addHydratedFlag(doc.documentElement);
|
|
1286
|
-
}
|
|
1287
2036
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1288
2037
|
};
|
|
1289
|
-
var safeCall = (instance, method, arg) => {
|
|
2038
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1290
2039
|
if (instance && instance[method]) {
|
|
1291
2040
|
try {
|
|
1292
2041
|
return instance[method](arg);
|
|
1293
2042
|
} catch (e) {
|
|
1294
|
-
consoleError(e);
|
|
2043
|
+
consoleError(e, elm);
|
|
1295
2044
|
}
|
|
1296
2045
|
}
|
|
1297
2046
|
return void 0;
|
|
@@ -1307,14 +2056,18 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1307
2056
|
const hostRef = getHostRef(ref);
|
|
1308
2057
|
if (!hostRef) {
|
|
1309
2058
|
throw new Error(
|
|
1310
|
-
`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).`
|
|
1311
2060
|
);
|
|
1312
2061
|
}
|
|
1313
2062
|
const elm = hostRef.$hostElement$ ;
|
|
1314
2063
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1315
2064
|
const flags = hostRef.$flags$;
|
|
1316
2065
|
const instance = hostRef.$lazyInstance$ ;
|
|
1317
|
-
newVal = parsePropertyValue(
|
|
2066
|
+
newVal = parsePropertyValue(
|
|
2067
|
+
newVal,
|
|
2068
|
+
cmpMeta.$members$[propName][0],
|
|
2069
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2070
|
+
);
|
|
1318
2071
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1319
2072
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1320
2073
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -1333,6 +2086,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1333
2086
|
}
|
|
1334
2087
|
}
|
|
1335
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
|
+
}
|
|
1336
2094
|
scheduleUpdate(hostRef, false);
|
|
1337
2095
|
}
|
|
1338
2096
|
}
|
|
@@ -1344,23 +2102,23 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1344
2102
|
var _a, _b;
|
|
1345
2103
|
const prototype = Cstr.prototype;
|
|
1346
2104
|
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1347
|
-
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
|
|
1348
|
-
|
|
2105
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2106
|
+
Object.defineProperty(prototype, cbName, {
|
|
1349
2107
|
value(...args) {
|
|
1350
2108
|
const hostRef = getHostRef(this);
|
|
1351
2109
|
const instance = hostRef.$lazyInstance$ ;
|
|
1352
2110
|
if (!instance) {
|
|
1353
|
-
hostRef.$onReadyPromise$.then((
|
|
1354
|
-
const cb =
|
|
1355
|
-
typeof cb === "function" && cb.call(
|
|
2111
|
+
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2112
|
+
const cb = asyncInstance[cbName];
|
|
2113
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1356
2114
|
});
|
|
1357
2115
|
} else {
|
|
1358
|
-
const cb = instance[cbName];
|
|
2116
|
+
const cb = instance[cbName] ;
|
|
1359
2117
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
1360
2118
|
}
|
|
1361
2119
|
}
|
|
1362
|
-
})
|
|
1363
|
-
);
|
|
2120
|
+
});
|
|
2121
|
+
});
|
|
1364
2122
|
}
|
|
1365
2123
|
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
1366
2124
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
@@ -1369,15 +2127,78 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1369
2127
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1370
2128
|
members.map(([memberName, [memberFlags]]) => {
|
|
1371
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
|
+
}
|
|
1372
2150
|
Object.defineProperty(prototype, memberName, {
|
|
1373
|
-
get() {
|
|
1374
|
-
return getValue(this, memberName);
|
|
1375
|
-
},
|
|
1376
2151
|
set(newValue) {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
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
|
+
}
|
|
1381
2202
|
});
|
|
1382
2203
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1383
2204
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -1398,10 +2219,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1398
2219
|
plt.jmp(() => {
|
|
1399
2220
|
var _a2;
|
|
1400
2221
|
const propName = attrNameToPropName.get(attrName);
|
|
1401
|
-
if (this.hasOwnProperty(propName)) {
|
|
2222
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1402
2223
|
newValue = this[propName];
|
|
1403
2224
|
delete this[propName];
|
|
1404
|
-
} 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) {
|
|
1405
2227
|
return;
|
|
1406
2228
|
} else if (propName == null) {
|
|
1407
2229
|
const hostRef = getHostRef(this);
|
|
@@ -1417,7 +2239,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1417
2239
|
}
|
|
1418
2240
|
return;
|
|
1419
2241
|
}
|
|
1420
|
-
|
|
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
|
+
}
|
|
1421
2247
|
});
|
|
1422
2248
|
};
|
|
1423
2249
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1446,7 +2272,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1446
2272
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1447
2273
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1448
2274
|
if (bundleId) {
|
|
1449
|
-
const CstrImport = loadModule(cmpMeta);
|
|
2275
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1450
2276
|
if (CstrImport && "then" in CstrImport) {
|
|
1451
2277
|
const endLoad = uniqueTime();
|
|
1452
2278
|
Cstr = await CstrImport;
|
|
@@ -1471,16 +2297,16 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1471
2297
|
try {
|
|
1472
2298
|
new Cstr(hostRef);
|
|
1473
2299
|
} catch (e) {
|
|
1474
|
-
consoleError(e);
|
|
2300
|
+
consoleError(e, elm);
|
|
1475
2301
|
}
|
|
1476
2302
|
{
|
|
1477
|
-
hostRef.$flags$ &=
|
|
2303
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1478
2304
|
}
|
|
1479
2305
|
{
|
|
1480
2306
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1481
2307
|
}
|
|
1482
2308
|
endNewInstance();
|
|
1483
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2309
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1484
2310
|
} else {
|
|
1485
2311
|
Cstr = elm.constructor;
|
|
1486
2312
|
const cmpTag = elm.localName;
|
|
@@ -1507,9 +2333,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1507
2333
|
schedule();
|
|
1508
2334
|
}
|
|
1509
2335
|
};
|
|
1510
|
-
var fireConnectedCallback = (instance) => {
|
|
2336
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1511
2337
|
{
|
|
1512
|
-
safeCall(instance, "connectedCallback");
|
|
2338
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1513
2339
|
}
|
|
1514
2340
|
};
|
|
1515
2341
|
|
|
@@ -1521,7 +2347,18 @@ var connectedCallback = (elm) => {
|
|
|
1521
2347
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1522
2348
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1523
2349
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2350
|
+
let hostId;
|
|
1524
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) {
|
|
1525
2362
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1526
2363
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1527
2364
|
setContentReference(elm);
|
|
@@ -1530,7 +2367,7 @@ var connectedCallback = (elm) => {
|
|
|
1530
2367
|
{
|
|
1531
2368
|
let ancestorComponent = elm;
|
|
1532
2369
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1533
|
-
if (ancestorComponent["s-p"]) {
|
|
2370
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1534
2371
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1535
2372
|
break;
|
|
1536
2373
|
}
|
|
@@ -1551,24 +2388,27 @@ var connectedCallback = (elm) => {
|
|
|
1551
2388
|
} else {
|
|
1552
2389
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1553
2390
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1554
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2391
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1555
2392
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1556
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
2393
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1557
2394
|
}
|
|
1558
2395
|
}
|
|
1559
2396
|
endConnected();
|
|
1560
2397
|
}
|
|
1561
2398
|
};
|
|
1562
2399
|
var setContentReference = (elm) => {
|
|
1563
|
-
|
|
2400
|
+
if (!win.document) {
|
|
2401
|
+
return;
|
|
2402
|
+
}
|
|
2403
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1564
2404
|
""
|
|
1565
2405
|
);
|
|
1566
2406
|
contentRefElm["s-cn"] = true;
|
|
1567
2407
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1568
2408
|
};
|
|
1569
|
-
var disconnectInstance = (instance) => {
|
|
2409
|
+
var disconnectInstance = (instance, elm) => {
|
|
1570
2410
|
{
|
|
1571
|
-
safeCall(instance, "disconnectedCallback");
|
|
2411
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1572
2412
|
}
|
|
1573
2413
|
};
|
|
1574
2414
|
var disconnectedCallback = async (elm) => {
|
|
@@ -1581,28 +2421,44 @@ var disconnectedCallback = async (elm) => {
|
|
|
1581
2421
|
}
|
|
1582
2422
|
}
|
|
1583
2423
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1584
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
2424
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1585
2425
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1586
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
2426
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1587
2427
|
}
|
|
1588
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
|
+
}
|
|
1589
2435
|
};
|
|
1590
2436
|
|
|
1591
2437
|
// src/runtime/bootstrap-lazy.ts
|
|
1592
2438
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1593
2439
|
var _a;
|
|
2440
|
+
if (!win.document) {
|
|
2441
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
1594
2444
|
const endBootstrap = createTime();
|
|
1595
2445
|
const cmpTags = [];
|
|
1596
2446
|
const exclude = options.exclude || [];
|
|
1597
2447
|
const customElements2 = win.customElements;
|
|
1598
|
-
const head =
|
|
2448
|
+
const head = win.document.head;
|
|
1599
2449
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1600
|
-
const dataStyles = /* @__PURE__ */
|
|
2450
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1601
2451
|
const deferredConnectedCallbacks = [];
|
|
1602
2452
|
let appLoadFallback;
|
|
1603
2453
|
let isBootstrapping = true;
|
|
1604
2454
|
Object.assign(plt, options);
|
|
1605
|
-
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
|
+
}
|
|
1606
2462
|
let hasSlotRelocation = false;
|
|
1607
2463
|
lazyBundles.map((lazyBundle) => {
|
|
1608
2464
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1639,9 +2495,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1639
2495
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1640
2496
|
{
|
|
1641
2497
|
if (!self.shadowRoot) {
|
|
1642
|
-
|
|
1643
|
-
self.attachShadow({ mode: "open" });
|
|
1644
|
-
}
|
|
2498
|
+
createShadowRoot.call(self, cmpMeta);
|
|
1645
2499
|
} else {
|
|
1646
2500
|
if (self.shadowRoot.mode !== "open") {
|
|
1647
2501
|
throw new Error(
|
|
@@ -1670,6 +2524,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1670
2524
|
}
|
|
1671
2525
|
disconnectedCallback() {
|
|
1672
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
|
+
});
|
|
1673
2538
|
}
|
|
1674
2539
|
componentOnReady() {
|
|
1675
2540
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1692,12 +2557,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1692
2557
|
if (hasSlotRelocation) {
|
|
1693
2558
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
1694
2559
|
}
|
|
1695
|
-
{
|
|
1696
|
-
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1697
|
-
}
|
|
1698
2560
|
if (dataStyles.innerHTML.length) {
|
|
1699
2561
|
dataStyles.setAttribute("data-styles", "");
|
|
1700
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
2562
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1701
2563
|
if (nonce != null) {
|
|
1702
2564
|
dataStyles.setAttribute("nonce", nonce);
|
|
1703
2565
|
}
|
|
@@ -1715,9 +2577,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1715
2577
|
endBootstrap();
|
|
1716
2578
|
};
|
|
1717
2579
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1718
|
-
if (listeners) {
|
|
2580
|
+
if (listeners && win.document) {
|
|
1719
2581
|
listeners.map(([flags, name, method]) => {
|
|
1720
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2582
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1721
2583
|
const handler = hostListenerProxy(hostRef, method);
|
|
1722
2584
|
const opts = hostListenerOpts(flags);
|
|
1723
2585
|
plt.ael(target, name, handler, opts);
|
|
@@ -1736,11 +2598,13 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1736
2598
|
}
|
|
1737
2599
|
}
|
|
1738
2600
|
} catch (e) {
|
|
1739
|
-
consoleError(e);
|
|
2601
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1740
2602
|
}
|
|
1741
2603
|
};
|
|
1742
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1743
|
-
if (flags & 8 /* TargetWindow */)
|
|
2604
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2605
|
+
if (flags & 8 /* TargetWindow */) {
|
|
2606
|
+
return win;
|
|
2607
|
+
}
|
|
1744
2608
|
return elm;
|
|
1745
2609
|
};
|
|
1746
2610
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -1751,4 +2615,4 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1751
2615
|
// src/runtime/nonce.ts
|
|
1752
2616
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1753
2617
|
|
|
1754
|
-
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 };
|