@xplortech/apollo-core 1.0.0-beta.7 → 1.0.0-beta.9
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/apollo-core/apollo-core.css +5841 -9
- package/dist/apollo-core/apollo-core.esm.js +163 -1
- package/dist/apollo-core/apollo-core.esm.js.map +1 -0
- package/dist/apollo-core/app-globals-0f993ce5.js +5 -0
- package/dist/apollo-core/app-globals-0f993ce5.js.map +1 -0
- package/dist/apollo-core/css-shim-6210ce77.js +6 -0
- package/dist/apollo-core/css-shim-6210ce77.js.map +1 -0
- package/dist/apollo-core/dom-423bdd70.js +75 -0
- package/dist/apollo-core/dom-423bdd70.js.map +1 -0
- package/dist/apollo-core/index-307c7018.js +3397 -0
- package/dist/apollo-core/index-307c7018.js.map +1 -0
- package/dist/apollo-core/index-912d1a21.js +586 -0
- package/dist/apollo-core/index-912d1a21.js.map +1 -0
- package/dist/apollo-core/index.esm.js +3 -0
- package/dist/apollo-core/index.esm.js.map +1 -0
- package/dist/apollo-core/p-08abab41.entry.js +2 -0
- package/dist/apollo-core/p-08abab41.entry.js.map +1 -0
- package/dist/apollo-core/p-16654189.entry.js +2 -0
- package/dist/apollo-core/p-16654189.entry.js.map +1 -0
- package/dist/apollo-core/p-2f90296c.js +3 -3
- package/dist/apollo-core/p-2f90296c.js.map +1 -0
- package/dist/apollo-core/p-315920cd.entry.js +2 -0
- package/dist/apollo-core/p-315920cd.entry.js.map +1 -0
- package/dist/apollo-core/p-3c934536.entry.js +2 -0
- package/dist/apollo-core/p-3c934536.entry.js.map +1 -0
- package/dist/apollo-core/p-47a55fa9.entry.js +2 -0
- package/dist/apollo-core/p-47a55fa9.entry.js.map +1 -0
- package/dist/apollo-core/p-485d0c40.entry.js +2 -0
- package/dist/apollo-core/p-485d0c40.entry.js.map +1 -0
- package/dist/apollo-core/p-5a038a8e.entry.js +2 -0
- package/dist/apollo-core/p-5a038a8e.entry.js.map +1 -0
- package/dist/apollo-core/p-88135928.entry.js +2 -0
- package/dist/apollo-core/p-88135928.entry.js.map +1 -0
- package/dist/apollo-core/p-91d6572c.entry.js +2 -0
- package/dist/apollo-core/p-91d6572c.entry.js.map +1 -0
- package/dist/apollo-core/p-ad90fe4d.js +2 -1
- package/dist/apollo-core/p-ad90fe4d.js.map +1 -0
- package/dist/apollo-core/p-ae99c266.entry.js +2 -0
- package/dist/apollo-core/p-ae99c266.entry.js.map +1 -0
- package/dist/apollo-core/p-aeef61dd.entry.js +2 -0
- package/dist/apollo-core/p-aeef61dd.entry.js.map +1 -0
- package/dist/apollo-core/p-c1b28f32.entry.js +2 -0
- package/dist/apollo-core/p-c1b28f32.entry.js.map +1 -0
- package/dist/apollo-core/p-ce6cb219.entry.js +2 -0
- package/dist/apollo-core/p-ce6cb219.entry.js.map +1 -0
- package/dist/apollo-core/p-cf2e6132.js +3 -0
- package/dist/apollo-core/p-cf2e6132.js.map +1 -0
- package/dist/apollo-core/p-e9cd309e.entry.js +2 -0
- package/dist/apollo-core/p-e9cd309e.entry.js.map +1 -0
- package/dist/apollo-core/p-f5561238.entry.js +2 -0
- package/dist/apollo-core/p-f5561238.entry.js.map +1 -0
- package/dist/apollo-core/p-ff46d20f.entry.js +2 -0
- package/dist/apollo-core/p-ff46d20f.entry.js.map +1 -0
- package/dist/{custom-elements/index.js → apollo-core/regular-133c23b5.js} +13 -4197
- package/dist/apollo-core/regular-133c23b5.js.map +1 -0
- package/dist/apollo-core/shadow-css-f0279020.js +389 -0
- package/dist/apollo-core/shadow-css-f0279020.js.map +1 -0
- package/dist/apollo-core/xpl-application-shell.entry.js +51 -0
- package/dist/apollo-core/xpl-application-shell.entry.js.map +1 -0
- package/dist/apollo-core/xpl-avatar.entry.js +28 -0
- package/dist/apollo-core/xpl-avatar.entry.js.map +1 -0
- package/dist/apollo-core/xpl-backdrop.entry.js +19 -0
- package/dist/apollo-core/xpl-backdrop.entry.js.map +1 -0
- package/dist/apollo-core/xpl-badge.entry.js +21 -0
- package/dist/apollo-core/xpl-badge.entry.js.map +1 -0
- package/dist/apollo-core/xpl-breadcrumb-item.entry.js +19 -0
- package/dist/apollo-core/xpl-breadcrumb-item.entry.js.map +1 -0
- package/dist/apollo-core/xpl-breadcrumbs.entry.js +14 -0
- package/dist/apollo-core/xpl-breadcrumbs.entry.js.map +1 -0
- package/dist/apollo-core/xpl-button-row.entry.js +23 -0
- package/dist/apollo-core/xpl-button-row.entry.js.map +1 -0
- package/dist/apollo-core/xpl-button.entry.js +60 -0
- package/dist/apollo-core/xpl-button.entry.js.map +1 -0
- package/dist/apollo-core/xpl-checkbox.entry.js +35 -0
- package/dist/apollo-core/xpl-checkbox.entry.js.map +1 -0
- package/dist/apollo-core/xpl-choicelist.entry.js +48 -0
- package/dist/apollo-core/xpl-choicelist.entry.js.map +1 -0
- package/dist/apollo-core/xpl-content-area.entry.js +15 -0
- package/dist/apollo-core/xpl-content-area.entry.js.map +1 -0
- package/dist/apollo-core/xpl-divider.entry.js +17 -0
- package/dist/apollo-core/xpl-divider.entry.js.map +1 -0
- package/dist/apollo-core/xpl-dropdown-group.entry.js +35 -0
- package/dist/apollo-core/xpl-dropdown-group.entry.js.map +1 -0
- package/dist/apollo-core/xpl-dropdown-heading.entry.js +15 -0
- package/dist/apollo-core/xpl-dropdown-heading.entry.js.map +1 -0
- package/dist/apollo-core/xpl-dropdown-option.entry.js +70 -0
- package/dist/apollo-core/xpl-dropdown-option.entry.js.map +1 -0
- package/dist/apollo-core/xpl-dropdown.entry.js +106 -0
- package/dist/apollo-core/xpl-dropdown.entry.js.map +1 -0
- package/dist/apollo-core/xpl-grid-item.entry.js +23 -0
- package/dist/apollo-core/xpl-grid-item.entry.js.map +1 -0
- package/dist/apollo-core/xpl-grid.entry.js +33 -0
- package/dist/apollo-core/xpl-grid.entry.js.map +1 -0
- package/dist/apollo-core/xpl-input.entry.js +2553 -0
- package/dist/apollo-core/xpl-input.entry.js.map +1 -0
- package/dist/apollo-core/xpl-list.entry.js +37 -0
- package/dist/apollo-core/xpl-list.entry.js.map +1 -0
- package/dist/apollo-core/xpl-main-nav.entry.js +25 -0
- package/dist/apollo-core/xpl-main-nav.entry.js.map +1 -0
- package/dist/apollo-core/xpl-nav-item.entry.js +25 -0
- package/dist/apollo-core/xpl-nav-item.entry.js.map +1 -0
- package/dist/apollo-core/xpl-pagination.entry.js +77 -0
- package/dist/apollo-core/xpl-pagination.entry.js.map +1 -0
- package/dist/apollo-core/xpl-radio.entry.js +34 -0
- package/dist/apollo-core/xpl-radio.entry.js.map +1 -0
- package/dist/apollo-core/xpl-secondary-nav.entry.js +14 -0
- package/dist/apollo-core/xpl-secondary-nav.entry.js.map +1 -0
- package/dist/apollo-core/xpl-select.entry.js +680 -0
- package/dist/apollo-core/xpl-select.entry.js.map +1 -0
- package/dist/apollo-core/xpl-table.entry.js +109 -0
- package/dist/apollo-core/xpl-table.entry.js.map +1 -0
- package/dist/apollo-core/xpl-tag.entry.js +19 -0
- package/dist/apollo-core/xpl-tag.entry.js.map +1 -0
- package/dist/apollo-core/xpl-toggle.entry.js +35 -0
- package/dist/apollo-core/xpl-toggle.entry.js.map +1 -0
- package/dist/apollo-core/xpl-utility-bar.entry.js +31 -0
- package/dist/apollo-core/xpl-utility-bar.entry.js.map +1 -0
- package/dist/cjs/apollo-core.cjs.js +154 -5
- package/dist/cjs/apollo-core.cjs.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/css-shim-0a6fd78d.js +8 -0
- package/dist/cjs/css-shim-0a6fd78d.js.map +1 -0
- package/dist/cjs/dom-2c6adc90.js +77 -0
- package/dist/cjs/dom-2c6adc90.js.map +1 -0
- package/dist/cjs/index-0fdb260e.js +3564 -0
- package/dist/cjs/index-0fdb260e.js.map +1 -0
- package/dist/cjs/index-318d5fc7.js +588 -0
- package/dist/cjs/index-318d5fc7.js.map +1 -0
- package/dist/cjs/{index-acf3dd7a.js → index-e53b018b.js} +675 -215
- package/dist/cjs/index-e53b018b.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/regular-503465f4.js +16056 -0
- package/dist/cjs/regular-503465f4.js.map +1 -0
- package/dist/cjs/regular-872f5226.js +2 -0
- package/dist/cjs/regular-872f5226.js.map +1 -0
- package/dist/cjs/shadow-css-39dfcfae.js +391 -0
- package/dist/cjs/shadow-css-39dfcfae.js.map +1 -0
- package/dist/cjs/v4-14140ff3.js +2 -0
- package/dist/cjs/v4-14140ff3.js.map +1 -0
- package/dist/cjs/xpl-application-shell.cjs.entry.js +4 -13
- package/dist/cjs/xpl-application-shell.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-avatar.cjs.entry.js +32 -0
- package/dist/cjs/xpl-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +74 -38
- package/dist/cjs/xpl-avatar_12.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-backdrop.cjs.entry.js +3 -5
- package/dist/cjs/xpl-backdrop.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-badge.cjs.entry.js +25 -0
- package/dist/cjs/xpl-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +23 -0
- package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +18 -0
- package/dist/cjs/xpl-breadcrumbs.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-button-row.cjs.entry.js +6 -1
- package/dist/cjs/xpl-button-row.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-button.cjs.entry.js +64 -0
- package/dist/cjs/xpl-button.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-checkbox.cjs.entry.js +39 -0
- package/dist/cjs/xpl-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-choicelist.cjs.entry.js +10 -1
- package/dist/cjs/xpl-choicelist.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-content-area.cjs.entry.js +19 -0
- package/dist/cjs/xpl-content-area.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-divider.cjs.entry.js +4 -1
- package/dist/cjs/xpl-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown-group.cjs.entry.js +39 -0
- package/dist/cjs/xpl-dropdown-group.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +12 -3
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown-heading.cjs.entry.js +19 -0
- package/dist/cjs/xpl-dropdown-heading.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown-option.cjs.entry.js +74 -0
- package/dist/cjs/xpl-dropdown-option.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown.cjs.entry.js +110 -0
- package/dist/cjs/xpl-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +13 -10
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-grid-item.cjs.entry.js +3 -1
- package/dist/cjs/xpl-grid-item.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-grid.cjs.entry.js +3 -1
- package/dist/cjs/xpl-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-input.cjs.entry.js +40 -17
- package/dist/cjs/xpl-input.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-list.cjs.entry.js +4 -24
- package/dist/cjs/xpl-list.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-main-nav.cjs.entry.js +3 -4
- package/dist/cjs/xpl-main-nav.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-nav-item.cjs.entry.js +29 -0
- package/dist/cjs/xpl-nav-item.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-pagination.cjs.entry.js +7 -2
- package/dist/cjs/xpl-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-radio.cjs.entry.js +38 -0
- package/dist/cjs/xpl-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-secondary-nav.cjs.entry.js +18 -0
- package/dist/cjs/xpl-secondary-nav.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-select.cjs.entry.js +86 -27
- package/dist/cjs/xpl-select.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-table.cjs.entry.js +113 -0
- package/dist/cjs/xpl-table.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-tag.cjs.entry.js +23 -0
- package/dist/cjs/xpl-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-toggle.cjs.entry.js +11 -6
- package/dist/cjs/xpl-toggle.cjs.entry.js.map +1 -0
- package/dist/cjs/xpl-utility-bar.cjs.entry.js +35 -0
- package/dist/cjs/xpl-utility-bar.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +119 -132
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js.map +1 -0
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +151 -144
- package/dist/collection/components/xpl-avatar/xpl-avatar.js.map +1 -0
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +27 -28
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js.map +1 -0
- package/dist/collection/components/xpl-badge/xpl-badge.js +44 -39
- package/dist/collection/components/xpl-badge/xpl-badge.js.map +1 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +3 -5
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js.map +1 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +3 -5
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js.map +1 -0
- package/dist/collection/components/xpl-button/xpl-button.js +205 -205
- package/dist/collection/components/xpl-button/xpl-button.js.map +1 -0
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +106 -104
- package/dist/collection/components/xpl-button-row/xpl-button-row.js.map +1 -0
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +182 -171
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js.map +1 -0
- package/dist/collection/components/xpl-choicelist/choice.js +1 -0
- package/dist/collection/components/xpl-choicelist/choice.js.map +1 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +134 -126
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js.map +1 -0
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +28 -31
- package/dist/collection/components/xpl-content-area/xpl-content-area.js.map +1 -0
- package/dist/collection/components/xpl-divider/xpl-divider.js +27 -23
- package/dist/collection/components/xpl-divider/xpl-divider.js.map +1 -0
- package/dist/collection/components/xpl-dropdown/dropdownoption.js +1 -0
- package/dist/collection/components/xpl-dropdown/dropdownoption.js.map +1 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +47 -42
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js.map +1 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +27 -22
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js.map +1 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +79 -54
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js.map +1 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +168 -168
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js.map +1 -0
- package/dist/collection/components/xpl-grid/xpl-grid.js +2 -1
- package/dist/collection/components/xpl-grid/xpl-grid.js.map +1 -0
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +76 -74
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js.map +1 -0
- package/dist/collection/components/xpl-input/xpl-input.js +405 -417
- package/dist/collection/components/xpl-input/xpl-input.js.map +1 -0
- package/dist/collection/components/xpl-list/listitem.js +1 -0
- package/dist/collection/components/xpl-list/listitem.js.map +1 -0
- package/dist/collection/components/xpl-list/xpl-list.js +43 -75
- package/dist/collection/components/xpl-list/xpl-list.js.map +1 -0
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +48 -54
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js.map +1 -0
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +48 -49
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js.map +1 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +117 -128
- package/dist/collection/components/xpl-pagination/xpl-pagination.js.map +1 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +158 -148
- package/dist/collection/components/xpl-radio/xpl-radio.js.map +1 -0
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +3 -4
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js.map +1 -0
- package/dist/collection/components/xpl-select/xpl-select.js +296 -236
- package/dist/collection/components/xpl-select/xpl-select.js.map +1 -0
- package/dist/collection/components/xpl-table/xpl-table.js +169 -151
- package/dist/collection/components/xpl-table/xpl-table.js.map +1 -0
- package/dist/collection/components/xpl-tag/xpl-tag.js +25 -25
- package/dist/collection/components/xpl-tag/xpl-tag.js.map +1 -0
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +138 -135
- package/dist/collection/components/xpl-toggle/xpl-toggle.js.map +1 -0
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +74 -70
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js.map +1 -0
- package/dist/components/index.d.ts +39 -0
- package/dist/components/index.js +81 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +586 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/regular.js +16054 -0
- package/dist/components/regular.js.map +1 -0
- package/dist/components/v4.js +77 -0
- package/dist/components/v4.js.map +1 -0
- package/dist/components/xpl-application-shell.d.ts +11 -0
- package/dist/components/xpl-application-shell.js +80 -0
- package/dist/components/xpl-application-shell.js.map +1 -0
- package/dist/components/xpl-avatar.d.ts +11 -0
- package/dist/components/xpl-avatar.js +8 -0
- package/dist/components/xpl-avatar.js.map +1 -0
- package/dist/components/xpl-avatar2.js +51 -0
- package/dist/components/xpl-avatar2.js.map +1 -0
- package/dist/components/xpl-backdrop.d.ts +11 -0
- package/dist/components/xpl-backdrop.js +8 -0
- package/dist/components/xpl-backdrop.js.map +1 -0
- package/dist/components/xpl-backdrop2.js +35 -0
- package/dist/components/xpl-backdrop2.js.map +1 -0
- package/dist/components/xpl-badge.d.ts +11 -0
- package/dist/components/xpl-badge.js +8 -0
- package/dist/components/xpl-badge.js.map +1 -0
- package/dist/components/xpl-badge2.js +38 -0
- package/dist/components/xpl-badge2.js.map +1 -0
- package/dist/components/xpl-breadcrumb-item.d.ts +11 -0
- package/dist/components/xpl-breadcrumb-item.js +36 -0
- package/dist/components/xpl-breadcrumb-item.js.map +1 -0
- package/dist/components/xpl-breadcrumbs.d.ts +11 -0
- package/dist/components/xpl-breadcrumbs.js +31 -0
- package/dist/components/xpl-breadcrumbs.js.map +1 -0
- package/dist/components/xpl-button-row.d.ts +11 -0
- package/dist/components/xpl-button-row.js +50 -0
- package/dist/components/xpl-button-row.js.map +1 -0
- package/dist/components/xpl-button.d.ts +11 -0
- package/dist/components/xpl-button.js +8 -0
- package/dist/components/xpl-button.js.map +1 -0
- package/dist/components/xpl-button2.js +85 -0
- package/dist/components/xpl-button2.js.map +1 -0
- package/dist/components/xpl-checkbox.d.ts +11 -0
- package/dist/components/xpl-checkbox.js +8 -0
- package/dist/components/xpl-checkbox.js.map +1 -0
- package/dist/components/xpl-checkbox2.js +59 -0
- package/dist/components/xpl-checkbox2.js.map +1 -0
- package/dist/components/xpl-choicelist.d.ts +11 -0
- package/dist/components/xpl-choicelist.js +85 -0
- package/dist/components/xpl-choicelist.js.map +1 -0
- package/dist/components/xpl-content-area.d.ts +11 -0
- package/dist/components/xpl-content-area.js +34 -0
- package/dist/components/xpl-content-area.js.map +1 -0
- package/dist/components/xpl-divider.d.ts +11 -0
- package/dist/components/xpl-divider.js +36 -0
- package/dist/components/xpl-divider.js.map +1 -0
- package/dist/components/xpl-dropdown-group.d.ts +11 -0
- package/dist/components/xpl-dropdown-group.js +8 -0
- package/dist/components/xpl-dropdown-group.js.map +1 -0
- package/dist/components/xpl-dropdown-group2.js +69 -0
- package/dist/components/xpl-dropdown-group2.js.map +1 -0
- package/dist/components/xpl-dropdown-heading.d.ts +11 -0
- package/dist/components/xpl-dropdown-heading.js +8 -0
- package/dist/components/xpl-dropdown-heading.js.map +1 -0
- package/dist/components/xpl-dropdown-heading2.js +31 -0
- package/dist/components/xpl-dropdown-heading2.js.map +1 -0
- package/dist/components/xpl-dropdown-option.d.ts +11 -0
- package/dist/components/xpl-dropdown-option.js +8 -0
- package/dist/components/xpl-dropdown-option.js.map +1 -0
- package/dist/components/xpl-dropdown-option2.js +89 -0
- package/dist/components/xpl-dropdown-option2.js.map +1 -0
- package/dist/components/xpl-dropdown.d.ts +11 -0
- package/dist/components/xpl-dropdown.js +8 -0
- package/dist/components/xpl-dropdown.js.map +1 -0
- package/dist/components/xpl-dropdown2.js +147 -0
- package/dist/components/xpl-dropdown2.js.map +1 -0
- package/dist/components/xpl-grid-item.d.ts +11 -0
- package/dist/components/xpl-grid-item.js +45 -0
- package/dist/components/xpl-grid-item.js.map +1 -0
- package/dist/components/xpl-grid.d.ts +11 -0
- package/dist/components/xpl-grid.js +50 -0
- package/dist/components/xpl-grid.js.map +1 -0
- package/dist/components/xpl-input.d.ts +11 -0
- package/dist/components/xpl-input.js +2594 -0
- package/dist/components/xpl-input.js.map +1 -0
- package/dist/components/xpl-list.d.ts +11 -0
- package/dist/components/xpl-list.js +68 -0
- package/dist/components/xpl-list.js.map +1 -0
- package/dist/components/xpl-main-nav.d.ts +11 -0
- package/dist/components/xpl-main-nav.js +44 -0
- package/dist/components/xpl-main-nav.js.map +1 -0
- package/dist/components/xpl-nav-item.d.ts +11 -0
- package/dist/components/xpl-nav-item.js +44 -0
- package/dist/components/xpl-nav-item.js.map +1 -0
- package/dist/components/xpl-pagination.d.ts +11 -0
- package/dist/components/xpl-pagination.js +100 -0
- package/dist/components/xpl-pagination.js.map +1 -0
- package/dist/components/xpl-radio.d.ts +11 -0
- package/dist/components/xpl-radio.js +8 -0
- package/dist/components/xpl-radio.js.map +1 -0
- package/dist/components/xpl-radio2.js +57 -0
- package/dist/components/xpl-radio2.js.map +1 -0
- package/dist/components/xpl-secondary-nav.d.ts +11 -0
- package/dist/components/xpl-secondary-nav.js +31 -0
- package/dist/components/xpl-secondary-nav.js.map +1 -0
- package/dist/components/xpl-select.d.ts +11 -0
- package/dist/components/xpl-select.js +745 -0
- package/dist/components/xpl-select.js.map +1 -0
- package/dist/components/xpl-table.d.ts +11 -0
- package/dist/components/xpl-table.js +136 -0
- package/dist/components/xpl-table.js.map +1 -0
- package/dist/components/xpl-tag.d.ts +11 -0
- package/dist/components/xpl-tag.js +8 -0
- package/dist/components/xpl-tag.js.map +1 -0
- package/dist/components/xpl-tag2.js +33 -0
- package/dist/components/xpl-tag2.js.map +1 -0
- package/dist/components/xpl-toggle.d.ts +11 -0
- package/dist/components/xpl-toggle.js +61 -0
- package/dist/components/xpl-toggle.js.map +1 -0
- package/dist/components/xpl-utility-bar.d.ts +11 -0
- package/dist/components/xpl-utility-bar.js +52 -0
- package/dist/components/xpl-utility-bar.js.map +1 -0
- package/dist/esm/apollo-core.js +151 -5
- package/dist/esm/apollo-core.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/css-shim-6210ce77.js +6 -0
- package/dist/esm/css-shim-6210ce77.js.map +1 -0
- package/dist/esm/dom-423bdd70.js +75 -0
- package/dist/esm/dom-423bdd70.js.map +1 -0
- package/dist/esm/index-307c7018.js +3526 -0
- package/dist/esm/index-307c7018.js.map +1 -0
- package/dist/esm/index-912d1a21.js +586 -0
- package/dist/esm/index-912d1a21.js.map +1 -0
- package/dist/esm/{index-e3c4bb97.js → index-df9b48b4.js} +675 -216
- package/dist/esm/index-df9b48b4.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +24 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/regular-133c23b5.js +16054 -0
- package/dist/esm/regular-133c23b5.js.map +1 -0
- package/dist/esm/regular-86225e9d.js +2 -0
- package/dist/esm/regular-86225e9d.js.map +1 -0
- package/dist/esm/shadow-css-f0279020.js +389 -0
- package/dist/esm/shadow-css-f0279020.js.map +1 -0
- package/dist/esm/v4-929670b7.js +2 -0
- package/dist/esm/v4-929670b7.js.map +1 -0
- package/dist/esm/xpl-application-shell.entry.js +4 -13
- package/dist/esm/xpl-application-shell.entry.js.map +1 -0
- package/dist/esm/xpl-avatar.entry.js +28 -0
- package/dist/esm/xpl-avatar.entry.js.map +1 -0
- package/dist/esm/xpl-avatar_12.entry.js +74 -38
- package/dist/esm/xpl-avatar_12.entry.js.map +1 -0
- package/dist/esm/xpl-backdrop.entry.js +3 -5
- package/dist/esm/xpl-backdrop.entry.js.map +1 -0
- package/dist/esm/xpl-badge.entry.js +21 -0
- package/dist/esm/xpl-badge.entry.js.map +1 -0
- package/dist/esm/xpl-breadcrumb-item.entry.js +19 -0
- package/dist/esm/xpl-breadcrumb-item.entry.js.map +1 -0
- package/dist/esm/xpl-breadcrumbs.entry.js +14 -0
- package/dist/esm/xpl-breadcrumbs.entry.js.map +1 -0
- package/dist/esm/xpl-button-row.entry.js +6 -1
- package/dist/esm/xpl-button-row.entry.js.map +1 -0
- package/dist/esm/xpl-button.entry.js +60 -0
- package/dist/esm/xpl-button.entry.js.map +1 -0
- package/dist/esm/xpl-checkbox.entry.js +35 -0
- package/dist/esm/xpl-checkbox.entry.js.map +1 -0
- package/dist/esm/xpl-choicelist.entry.js +10 -1
- package/dist/esm/xpl-choicelist.entry.js.map +1 -0
- package/dist/esm/xpl-content-area.entry.js +15 -0
- package/dist/esm/xpl-content-area.entry.js.map +1 -0
- package/dist/esm/xpl-divider.entry.js +4 -1
- package/dist/esm/xpl-divider.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown-group.entry.js +35 -0
- package/dist/esm/xpl-dropdown-group.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown-group_3.entry.js +12 -3
- package/dist/esm/xpl-dropdown-group_3.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown-heading.entry.js +15 -0
- package/dist/esm/xpl-dropdown-heading.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown-option.entry.js +70 -0
- package/dist/esm/xpl-dropdown-option.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown.entry.js +106 -0
- package/dist/esm/xpl-dropdown.entry.js.map +1 -0
- package/dist/esm/xpl-dropdown_2.entry.js +13 -10
- package/dist/esm/xpl-dropdown_2.entry.js.map +1 -0
- package/dist/esm/xpl-grid-item.entry.js +3 -1
- package/dist/esm/xpl-grid-item.entry.js.map +1 -0
- package/dist/esm/xpl-grid.entry.js +3 -1
- package/dist/esm/xpl-grid.entry.js.map +1 -0
- package/dist/esm/xpl-input.entry.js +39 -16
- package/dist/esm/xpl-input.entry.js.map +1 -0
- package/dist/esm/xpl-list.entry.js +4 -24
- package/dist/esm/xpl-list.entry.js.map +1 -0
- package/dist/esm/xpl-main-nav.entry.js +3 -4
- package/dist/esm/xpl-main-nav.entry.js.map +1 -0
- package/dist/esm/xpl-nav-item.entry.js +25 -0
- package/dist/esm/xpl-nav-item.entry.js.map +1 -0
- package/dist/esm/xpl-pagination.entry.js +7 -2
- package/dist/esm/xpl-pagination.entry.js.map +1 -0
- package/dist/esm/xpl-radio.entry.js +34 -0
- package/dist/esm/xpl-radio.entry.js.map +1 -0
- package/dist/esm/xpl-secondary-nav.entry.js +14 -0
- package/dist/esm/xpl-secondary-nav.entry.js.map +1 -0
- package/dist/esm/xpl-select.entry.js +85 -26
- package/dist/esm/xpl-select.entry.js.map +1 -0
- package/dist/esm/xpl-table.entry.js +109 -0
- package/dist/esm/xpl-table.entry.js.map +1 -0
- package/dist/esm/xpl-tag.entry.js +19 -0
- package/dist/esm/xpl-tag.entry.js.map +1 -0
- package/dist/esm/xpl-toggle.entry.js +10 -5
- package/dist/esm/xpl-toggle.entry.js.map +1 -0
- package/dist/esm/xpl-utility-bar.entry.js +31 -0
- package/dist/esm/xpl-utility-bar.entry.js.map +1 -0
- package/dist/stories/application-shell.stories.js +1 -0
- package/dist/stories/application-shell.stories.js.map +1 -0
- package/dist/stories/avatar.stories.js +1 -0
- package/dist/stories/avatar.stories.js.map +1 -0
- package/dist/stories/backdrop.stories.js +1 -0
- package/dist/stories/backdrop.stories.js.map +1 -0
- package/dist/stories/badge.stories.js +1 -0
- package/dist/stories/badge.stories.js.map +1 -0
- package/dist/stories/breadcrumbs.stories.js +1 -0
- package/dist/stories/breadcrumbs.stories.js.map +1 -0
- package/dist/stories/button-row.stories.js +1 -0
- package/dist/stories/button-row.stories.js.map +1 -0
- package/dist/stories/button.stories.js +1 -0
- package/dist/stories/button.stories.js.map +1 -0
- package/dist/stories/checkbox.stories.js +1 -0
- package/dist/stories/checkbox.stories.js.map +1 -0
- package/dist/stories/choicelist.stories.js +1 -0
- package/dist/stories/choicelist.stories.js.map +1 -0
- package/dist/stories/content-area.stories.js +1 -0
- package/dist/stories/content-area.stories.js.map +1 -0
- package/dist/stories/divider.stories.js +1 -0
- package/dist/stories/divider.stories.js.map +1 -0
- package/dist/stories/dropdown.stories.js +74 -65
- package/dist/stories/dropdown.stories.js.map +1 -0
- package/dist/stories/grid.stories.js +1 -0
- package/dist/stories/grid.stories.js.map +1 -0
- package/dist/stories/input.stories.js +1 -0
- package/dist/stories/input.stories.js.map +1 -0
- package/dist/stories/list.stories.js +1 -0
- package/dist/stories/list.stories.js.map +1 -0
- package/dist/stories/main-nav.stories.js +1 -0
- package/dist/stories/main-nav.stories.js.map +1 -0
- package/dist/stories/pagination.stories.js +1 -0
- package/dist/stories/pagination.stories.js.map +1 -0
- package/dist/stories/radio.stories.js +1 -0
- package/dist/stories/radio.stories.js.map +1 -0
- package/dist/stories/secondary-nav.stories.js +1 -0
- package/dist/stories/secondary-nav.stories.js.map +1 -0
- package/dist/stories/select.stories.js +109 -32
- package/dist/stories/select.stories.js.map +1 -0
- package/dist/stories/table.stories.js +1 -0
- package/dist/stories/table.stories.js.map +1 -0
- package/dist/stories/tabs.stories.js +1 -0
- package/dist/stories/tabs.stories.js.map +1 -0
- package/dist/stories/toggle.stories.js +1 -0
- package/dist/stories/toggle.stories.js.map +1 -0
- package/dist/stories/utility-bar.stories.js +1 -0
- package/dist/stories/utility-bar.stories.js.map +1 -0
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/dropdown.stories.d.ts +17 -1
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/select.stories.d.ts +60 -0
- package/dist/types/components/xpl-dropdown/dropdownoption.d.ts +2 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +7 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +2 -2
- package/dist/types/components/xpl-select/xpl-select.d.ts +16 -2
- package/dist/types/components/xpl-table/xpl-table.d.ts +2 -0
- package/dist/types/components.d.ts +88 -23
- package/dist/types/stencil-public-runtime.d.ts +97 -23
- package/loader/index.d.ts +9 -1
- package/loader/package.json +1 -0
- package/package.json +7 -6
- package/CHANGELOG.md +0 -106
- package/dist/apollo-core/p-25f84d39.entry.js +0 -1
- package/dist/apollo-core/p-2ce2fe5c.entry.js +0 -1
- package/dist/apollo-core/p-3ff1ff38.entry.js +0 -1
- package/dist/apollo-core/p-63dd9a65.entry.js +0 -1
- package/dist/apollo-core/p-6c3c1e3d.entry.js +0 -1
- package/dist/apollo-core/p-81a6ce4c.entry.js +0 -1
- package/dist/apollo-core/p-918b0731.entry.js +0 -1
- package/dist/apollo-core/p-a43e2d1f.entry.js +0 -1
- package/dist/apollo-core/p-a7cc4114.entry.js +0 -1
- package/dist/apollo-core/p-b6d1b135.entry.js +0 -1
- package/dist/apollo-core/p-bc0ebed2.entry.js +0 -1
- package/dist/apollo-core/p-c8af4ed6.entry.js +0 -1
- package/dist/apollo-core/p-d4aa2fa9.js +0 -1
- package/dist/apollo-core/p-d4e5d3aa.entry.js +0 -1
- package/dist/apollo-core/p-dad11011.entry.js +0 -1
- package/dist/apollo-core/p-db74c99c.entry.js +0 -1
- package/dist/apollo-core/p-ee16942f.entry.js +0 -1
- package/dist/collection/components/xpl-select/selectchoice.js +0 -1
- package/dist/custom-elements/index.d.ts +0 -219
- package/dist/types/components/xpl-select/selectchoice.d.ts +0 -4
|
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'apollo-core';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
+
* Simon Friis Vindum (@paldepind)
|
|
28
|
+
* Licensed under the MIT License
|
|
29
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
+
*
|
|
31
|
+
* Modified for Stencil's renderer and slot projection
|
|
32
|
+
*/
|
|
25
33
|
let contentRef;
|
|
26
34
|
let hostTagName;
|
|
27
35
|
let useNativeShadowDom = false;
|
|
@@ -29,54 +37,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
29
37
|
let checkSlotRelocate = false;
|
|
30
38
|
let isSvgMode = false;
|
|
31
39
|
let queuePending = false;
|
|
32
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
33
|
-
const doc = win.document || { head: {} };
|
|
34
|
-
const plt = {
|
|
35
|
-
$flags$: 0,
|
|
36
|
-
$resourcesUrl$: '',
|
|
37
|
-
jmp: (h) => h(),
|
|
38
|
-
raf: (h) => requestAnimationFrame(h),
|
|
39
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
40
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
41
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
42
|
-
};
|
|
43
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
44
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
45
|
-
if (listeners) {
|
|
46
|
-
listeners.map(([flags, name, method]) => {
|
|
47
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
48
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
49
|
-
const opts = hostListenerOpts(flags);
|
|
50
|
-
plt.ael(target, name, handler, opts);
|
|
51
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
56
|
-
try {
|
|
57
|
-
{
|
|
58
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
59
|
-
// instance is ready, let's call it's member method for this event
|
|
60
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
consoleError(e);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
72
|
-
if (flags & 8 /* TargetWindow */)
|
|
73
|
-
return win;
|
|
74
|
-
return elm;
|
|
75
|
-
};
|
|
76
|
-
// prettier-ignore
|
|
77
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
78
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
79
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
80
40
|
const createTime = (fnName, tagName = '') => {
|
|
81
41
|
{
|
|
82
42
|
return () => {
|
|
@@ -91,6 +51,8 @@ const uniqueTime = (key, measureText) => {
|
|
|
91
51
|
};
|
|
92
52
|
}
|
|
93
53
|
};
|
|
54
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
55
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
94
56
|
/**
|
|
95
57
|
* Default style mode id
|
|
96
58
|
*/
|
|
@@ -104,11 +66,30 @@ const EMPTY_OBJ = {};
|
|
|
104
66
|
*/
|
|
105
67
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
106
68
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
69
|
+
/**
|
|
70
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
71
|
+
* function.
|
|
72
|
+
*
|
|
73
|
+
* @param o the value to check
|
|
74
|
+
* @returns whether it's a complex type or not
|
|
75
|
+
*/
|
|
107
76
|
const isComplexType = (o) => {
|
|
108
77
|
// https://jsperf.com/typeof-fn-object/5
|
|
109
78
|
o = typeof o;
|
|
110
79
|
return o === 'object' || o === 'function';
|
|
111
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
83
|
+
* out of a DOM's head.
|
|
84
|
+
*
|
|
85
|
+
* @param doc The DOM containing the `head` to query against
|
|
86
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
87
|
+
* exists or the tag has no content.
|
|
88
|
+
*/
|
|
89
|
+
function queryNonceMetaTagContent(doc) {
|
|
90
|
+
var _a, _b, _c;
|
|
91
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
92
|
+
}
|
|
112
93
|
/**
|
|
113
94
|
* Production h() function based on Preact by
|
|
114
95
|
* Jason Miller (@developit)
|
|
@@ -117,7 +98,6 @@ const isComplexType = (o) => {
|
|
|
117
98
|
*
|
|
118
99
|
* Modified for Stencil's compiler and vdom
|
|
119
100
|
*/
|
|
120
|
-
// const stack: any[] = [];
|
|
121
101
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
122
102
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
123
103
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -126,7 +106,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
126
106
|
let slotName = null;
|
|
127
107
|
let simple = false;
|
|
128
108
|
let lastSimple = false;
|
|
129
|
-
|
|
109
|
+
const vNodeChildren = [];
|
|
130
110
|
const walk = (c) => {
|
|
131
111
|
for (let i = 0; i < c.length; i++) {
|
|
132
112
|
child = c[i];
|
|
@@ -187,6 +167,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
187
167
|
}
|
|
188
168
|
return vnode;
|
|
189
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
172
|
+
* possible text content.
|
|
173
|
+
*
|
|
174
|
+
* @param tag the tag for this element
|
|
175
|
+
* @param text possible text content for the node
|
|
176
|
+
* @returns a newly-minted virtual DOM node
|
|
177
|
+
*/
|
|
190
178
|
const newVNode = (tag, text) => {
|
|
191
179
|
const vnode = {
|
|
192
180
|
$flags$: 0,
|
|
@@ -207,11 +195,31 @@ const newVNode = (tag, text) => {
|
|
|
207
195
|
return vnode;
|
|
208
196
|
};
|
|
209
197
|
const Host = {};
|
|
198
|
+
/**
|
|
199
|
+
* Check whether a given node is a Host node or not
|
|
200
|
+
*
|
|
201
|
+
* @param node the virtual DOM node to check
|
|
202
|
+
* @returns whether it's a Host node or not
|
|
203
|
+
*/
|
|
210
204
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
205
|
+
/**
|
|
206
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
207
|
+
*
|
|
208
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
209
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
210
|
+
* interface.
|
|
211
|
+
*/
|
|
211
212
|
const vdomFnUtils = {
|
|
212
213
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
213
214
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
214
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
218
|
+
* friendlier public interface (hence, 'convertToPublic').
|
|
219
|
+
*
|
|
220
|
+
* @param node the virtual DOM node to convert
|
|
221
|
+
* @returns a converted child node
|
|
222
|
+
*/
|
|
215
223
|
const convertToPublic = (node) => ({
|
|
216
224
|
vattrs: node.$attrs$,
|
|
217
225
|
vchildren: node.$children$,
|
|
@@ -220,6 +228,15 @@ const convertToPublic = (node) => ({
|
|
|
220
228
|
vtag: node.$tag$,
|
|
221
229
|
vtext: node.$text$,
|
|
222
230
|
});
|
|
231
|
+
/**
|
|
232
|
+
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
233
|
+
* order to use the resulting object in the virtual DOM. The initial object was
|
|
234
|
+
* likely created as part of presenting a public API, so converting it back
|
|
235
|
+
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
236
|
+
*
|
|
237
|
+
* @param node the child node to convert
|
|
238
|
+
* @returns a converted virtual DOM node
|
|
239
|
+
*/
|
|
223
240
|
const convertToPrivate = (node) => {
|
|
224
241
|
if (typeof node.vtag === 'function') {
|
|
225
242
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -238,6 +255,79 @@ const convertToPrivate = (node) => {
|
|
|
238
255
|
vnode.$name$ = node.vname;
|
|
239
256
|
return vnode;
|
|
240
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* Parse a new property value for a given property type.
|
|
260
|
+
*
|
|
261
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
262
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
263
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
264
|
+
* 2. the type stored from `propType`.
|
|
265
|
+
*
|
|
266
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
267
|
+
*
|
|
268
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
269
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
270
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
271
|
+
* ```tsx
|
|
272
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* HTML prop values on the other hand, will always a string
|
|
276
|
+
*
|
|
277
|
+
* @param propValue the new value to coerce to some type
|
|
278
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
279
|
+
* @returns the parsed/coerced value
|
|
280
|
+
*/
|
|
281
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
282
|
+
// ensure this value is of the correct prop type
|
|
283
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
284
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
285
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
286
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
287
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
288
|
+
}
|
|
289
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
290
|
+
// force it to be a number
|
|
291
|
+
return parseFloat(propValue);
|
|
292
|
+
}
|
|
293
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
294
|
+
// could have been passed as a number or boolean
|
|
295
|
+
// but we still want it as a string
|
|
296
|
+
return String(propValue);
|
|
297
|
+
}
|
|
298
|
+
// redundant return here for better minification
|
|
299
|
+
return propValue;
|
|
300
|
+
}
|
|
301
|
+
// not sure exactly what type we want
|
|
302
|
+
// so no need to change to a different type
|
|
303
|
+
return propValue;
|
|
304
|
+
};
|
|
305
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
306
|
+
const createEvent = (ref, name, flags) => {
|
|
307
|
+
const elm = getElement(ref);
|
|
308
|
+
return {
|
|
309
|
+
emit: (detail) => {
|
|
310
|
+
return emitEvent(elm, name, {
|
|
311
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
312
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
313
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
314
|
+
detail,
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
321
|
+
* @param elm the target of the Event
|
|
322
|
+
* @param name the name to give the custom Event
|
|
323
|
+
* @param opts options for configuring a custom Event
|
|
324
|
+
* @returns the custom Event
|
|
325
|
+
*/
|
|
326
|
+
const emitEvent = (elm, name, opts) => {
|
|
327
|
+
const ev = plt.ce(name, opts);
|
|
328
|
+
elm.dispatchEvent(ev);
|
|
329
|
+
return ev;
|
|
330
|
+
};
|
|
241
331
|
/**
|
|
242
332
|
* Production setAccessor() function based on Preact by
|
|
243
333
|
* Jason Miller (@developit)
|
|
@@ -335,11 +425,10 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
335
425
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
336
426
|
try {
|
|
337
427
|
if (!elm.tagName.includes('-')) {
|
|
338
|
-
|
|
428
|
+
const n = newValue == null ? '' : newValue;
|
|
339
429
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
340
430
|
if (memberName === 'list') {
|
|
341
431
|
isProp = false;
|
|
342
|
-
// tslint:disable-next-line: triple-equals
|
|
343
432
|
}
|
|
344
433
|
else if (oldValue == null || elm[memberName] != n) {
|
|
345
434
|
elm[memberName] = n;
|
|
@@ -375,7 +464,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
375
464
|
}
|
|
376
465
|
}
|
|
377
466
|
}
|
|
378
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
467
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
379
468
|
newValue = newValue === true ? '' : newValue;
|
|
380
469
|
if (xlink) {
|
|
381
470
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -393,7 +482,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
393
482
|
// if the element passed in is a shadow root, which is a document fragment
|
|
394
483
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
395
484
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
396
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
485
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
397
486
|
? newVnode.$elm$.host
|
|
398
487
|
: newVnode.$elm$;
|
|
399
488
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -411,9 +500,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
411
500
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
412
501
|
}
|
|
413
502
|
};
|
|
503
|
+
/**
|
|
504
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
505
|
+
*
|
|
506
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
507
|
+
* @param newParentVNode the parent VNode from the current render
|
|
508
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
509
|
+
* children, for which we will create a new DOM node
|
|
510
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
511
|
+
* @returns the newly created node
|
|
512
|
+
*/
|
|
414
513
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
415
514
|
// tslint:disable-next-line: prefer-const
|
|
416
|
-
|
|
515
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
417
516
|
let i = 0;
|
|
418
517
|
let elm;
|
|
419
518
|
let childNode;
|
|
@@ -424,16 +523,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
424
523
|
if (newVNode.$tag$ === 'slot') {
|
|
425
524
|
newVNode.$flags$ |= newVNode.$children$
|
|
426
525
|
? // slot element has fallback content
|
|
427
|
-
2 /* isSlotFallback */
|
|
526
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
428
527
|
: // slot element does not have fallback content
|
|
429
|
-
1 /* isSlotReference */;
|
|
528
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
430
529
|
}
|
|
431
530
|
}
|
|
432
531
|
if (newVNode.$text$ !== null) {
|
|
433
532
|
// create text node
|
|
434
533
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
435
534
|
}
|
|
436
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
535
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
437
536
|
// create a slot reference node
|
|
438
537
|
elm = newVNode.$elm$ =
|
|
439
538
|
doc.createTextNode('');
|
|
@@ -443,7 +542,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
443
542
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
444
543
|
}
|
|
445
544
|
// create element
|
|
446
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
545
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
447
546
|
? 'slot-fb'
|
|
448
547
|
: newVNode.$tag$)
|
|
449
548
|
);
|
|
@@ -478,7 +577,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
478
577
|
}
|
|
479
578
|
{
|
|
480
579
|
elm['s-hn'] = hostTagName;
|
|
481
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
580
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
482
581
|
// remember the content reference comment
|
|
483
582
|
elm['s-sr'] = true;
|
|
484
583
|
// remember the content reference comment
|
|
@@ -497,7 +596,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
497
596
|
return elm;
|
|
498
597
|
};
|
|
499
598
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
500
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
599
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
501
600
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
502
601
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
503
602
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -518,8 +617,23 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
518
617
|
putBackInOriginalLocation(childNode, recursive);
|
|
519
618
|
}
|
|
520
619
|
}
|
|
521
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
620
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
522
621
|
};
|
|
622
|
+
/**
|
|
623
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
624
|
+
* add them to the DOM in the appropriate place.
|
|
625
|
+
*
|
|
626
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
627
|
+
* DOM nodes
|
|
628
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
629
|
+
* inserted before (optional)
|
|
630
|
+
* @param parentVNode the parent virtual DOM node
|
|
631
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
632
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
633
|
+
* creating DOM nodes (inclusive)
|
|
634
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
635
|
+
* creating DOM nodes (inclusive)
|
|
636
|
+
*/
|
|
523
637
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
524
638
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
525
639
|
let childNode;
|
|
@@ -533,6 +647,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
533
647
|
}
|
|
534
648
|
}
|
|
535
649
|
};
|
|
650
|
+
/**
|
|
651
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
652
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
653
|
+
* should no longer be shown.
|
|
654
|
+
*
|
|
655
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
656
|
+
*
|
|
657
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
658
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
659
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
660
|
+
* @param vnode a VNode
|
|
661
|
+
* @param elm an element
|
|
662
|
+
*/
|
|
536
663
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
537
664
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
538
665
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -557,6 +684,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
557
684
|
}
|
|
558
685
|
}
|
|
559
686
|
};
|
|
687
|
+
/**
|
|
688
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
689
|
+
* traversing the two collections of children, identifying nodes that are
|
|
690
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
691
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
692
|
+
*
|
|
693
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
694
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
695
|
+
* 'windows' by storing start and end indices and references to the
|
|
696
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
697
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
698
|
+
* no children left to update by doing the following:
|
|
699
|
+
*
|
|
700
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
701
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
702
|
+
* only with a window bounded by the highlighted elements:
|
|
703
|
+
*
|
|
704
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
705
|
+
* ^^^^^^ ^^^^^^
|
|
706
|
+
*
|
|
707
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
708
|
+
* across the windows. This will basically detect elements which haven't
|
|
709
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
710
|
+
* VNode elements (represented as HTML):
|
|
711
|
+
*
|
|
712
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
713
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
714
|
+
*
|
|
715
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
716
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
717
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
718
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
719
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
720
|
+
*
|
|
721
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
722
|
+
* window corresponds to the element at the end of the other window. This is
|
|
723
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
724
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
725
|
+
* children nodes themselves have not changed but merely moved in the
|
|
726
|
+
* following example:
|
|
727
|
+
*
|
|
728
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
729
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
730
|
+
*
|
|
731
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
732
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
733
|
+
* DOM.
|
|
734
|
+
*
|
|
735
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
736
|
+
* nodes in the old children which have the same key as the first element in
|
|
737
|
+
* our window on the new children. If we find such a node we handle calling
|
|
738
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
739
|
+
* what we find.
|
|
740
|
+
*
|
|
741
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
742
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
743
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
744
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
745
|
+
* children has collapsed we still have more nodes on the new children that
|
|
746
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
747
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
748
|
+
* sure the corresponding DOM nodes are removed.
|
|
749
|
+
*
|
|
750
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
751
|
+
* @param oldCh the old children of the parent node
|
|
752
|
+
* @param newVNode the new VNode which will replace the parent
|
|
753
|
+
* @param newCh the new children of the parent node
|
|
754
|
+
*/
|
|
560
755
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
561
756
|
let oldStartIdx = 0;
|
|
562
757
|
let newStartIdx = 0;
|
|
@@ -572,7 +767,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
572
767
|
let elmToMove;
|
|
573
768
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
574
769
|
if (oldStartVnode == null) {
|
|
575
|
-
//
|
|
770
|
+
// VNode might have been moved left
|
|
576
771
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
577
772
|
}
|
|
578
773
|
else if (oldEndVnode == null) {
|
|
@@ -585,37 +780,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
585
780
|
newEndVnode = newCh[--newEndIdx];
|
|
586
781
|
}
|
|
587
782
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
783
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
784
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
785
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
786
|
+
// since things are matched up in order.
|
|
588
787
|
patch(oldStartVnode, newStartVnode);
|
|
589
788
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
590
789
|
newStartVnode = newCh[++newStartIdx];
|
|
591
790
|
}
|
|
592
791
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
792
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
793
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
794
|
+
// need to move any DOM Nodes.
|
|
593
795
|
patch(oldEndVnode, newEndVnode);
|
|
594
796
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
595
797
|
newEndVnode = newCh[--newEndIdx];
|
|
596
798
|
}
|
|
597
799
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
598
|
-
// Vnode moved right
|
|
800
|
+
// case: "Vnode moved right"
|
|
801
|
+
//
|
|
802
|
+
// We've found that the last node in our window on the new children is
|
|
803
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
804
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
805
|
+
// nodes:
|
|
806
|
+
//
|
|
807
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
808
|
+
// ^^^^^^^^^^^
|
|
809
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
810
|
+
// ^^^^^^^^^^^^^
|
|
811
|
+
//
|
|
812
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
813
|
+
// and move the DOM element for `oldStartVnode`.
|
|
599
814
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
600
815
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
601
816
|
}
|
|
602
817
|
patch(oldStartVnode, newEndVnode);
|
|
818
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
819
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
820
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
821
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
822
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
823
|
+
//
|
|
824
|
+
// <old-start-node />
|
|
825
|
+
// <some-intervening-node />
|
|
826
|
+
// <old-end-node />
|
|
827
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
828
|
+
// <next-sibling />
|
|
829
|
+
//
|
|
830
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
831
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
832
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
833
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
834
|
+
// append it to the children of the parent element.
|
|
603
835
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
604
836
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
605
837
|
newEndVnode = newCh[--newEndIdx];
|
|
606
838
|
}
|
|
607
839
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
608
|
-
// Vnode moved left
|
|
840
|
+
// case: "Vnode moved left"
|
|
841
|
+
//
|
|
842
|
+
// We've found that the first node in our window on the new children is
|
|
843
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
844
|
+
// Visually, this is the layout of these two nodes:
|
|
845
|
+
//
|
|
846
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
847
|
+
// ^^^^^^^^^^^^^
|
|
848
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
849
|
+
// ^^^^^^^^^^^
|
|
850
|
+
//
|
|
851
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
852
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
853
|
+
// children etc) but we also need to move the DOM node to which
|
|
854
|
+
// `oldEndVnode` corresponds.
|
|
609
855
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
610
856
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
611
857
|
}
|
|
612
858
|
patch(oldEndVnode, newStartVnode);
|
|
859
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
860
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
861
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
862
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
863
|
+
// future.
|
|
613
864
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
614
865
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
615
866
|
newStartVnode = newCh[++newStartIdx];
|
|
616
867
|
}
|
|
617
868
|
else {
|
|
618
|
-
//
|
|
869
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
870
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
871
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
872
|
+
// component.
|
|
873
|
+
//
|
|
874
|
+
// First we check to see if there are any nodes in the array of old
|
|
875
|
+
// children which have the same key as the first node in the new
|
|
876
|
+
// children.
|
|
619
877
|
idxInOld = -1;
|
|
620
878
|
{
|
|
621
879
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -626,23 +884,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
626
884
|
}
|
|
627
885
|
}
|
|
628
886
|
if (idxInOld >= 0) {
|
|
887
|
+
// We found a node in the old children which matches up with the first
|
|
888
|
+
// node in the new children! So let's deal with that
|
|
629
889
|
elmToMove = oldCh[idxInOld];
|
|
630
890
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
891
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
631
892
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
632
893
|
}
|
|
633
894
|
else {
|
|
634
895
|
patch(elmToMove, newStartVnode);
|
|
896
|
+
// invalidate the matching old node so that we won't try to update it
|
|
897
|
+
// again later on
|
|
635
898
|
oldCh[idxInOld] = undefined;
|
|
636
899
|
node = elmToMove.$elm$;
|
|
637
900
|
}
|
|
638
901
|
newStartVnode = newCh[++newStartIdx];
|
|
639
902
|
}
|
|
640
903
|
else {
|
|
641
|
-
//
|
|
904
|
+
// We either didn't find an element in the old children that matches
|
|
905
|
+
// the key of the first new child OR the build is not using `key`
|
|
906
|
+
// attributes at all. In either case we need to create a new element
|
|
907
|
+
// for the new node.
|
|
642
908
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
643
909
|
newStartVnode = newCh[++newStartIdx];
|
|
644
910
|
}
|
|
645
911
|
if (node) {
|
|
912
|
+
// if we created a new node then handle inserting it to the DOM
|
|
646
913
|
{
|
|
647
914
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
648
915
|
}
|
|
@@ -650,21 +917,44 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
650
917
|
}
|
|
651
918
|
}
|
|
652
919
|
if (oldStartIdx > oldEndIdx) {
|
|
920
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
653
921
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
654
922
|
}
|
|
655
923
|
else if (newStartIdx > newEndIdx) {
|
|
924
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
925
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
926
|
+
// relevant DOM nodes)
|
|
656
927
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
657
928
|
}
|
|
658
929
|
};
|
|
659
|
-
|
|
930
|
+
/**
|
|
931
|
+
* Compare two VNodes to determine if they are the same
|
|
932
|
+
*
|
|
933
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
934
|
+
* information set on the two VNodes and can be misleading under certain
|
|
935
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
936
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
937
|
+
* checking that they have the same tag.
|
|
938
|
+
*
|
|
939
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
940
|
+
* changing order within a `children` array or something along those lines then
|
|
941
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
942
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
943
|
+
*
|
|
944
|
+
* @param leftVNode the first VNode to check
|
|
945
|
+
* @param rightVNode the second VNode to check
|
|
946
|
+
* @returns whether they're equal or not
|
|
947
|
+
*/
|
|
948
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
660
949
|
// compare if two vnode to see if they're "technically" the same
|
|
661
950
|
// need to have the same element tag, and same key to be the same
|
|
662
|
-
if (
|
|
663
|
-
if (
|
|
664
|
-
return
|
|
951
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
952
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
953
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
665
954
|
}
|
|
955
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
666
956
|
{
|
|
667
|
-
return
|
|
957
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
668
958
|
}
|
|
669
959
|
}
|
|
670
960
|
return false;
|
|
@@ -677,6 +967,14 @@ const referenceNode = (node) => {
|
|
|
677
967
|
return (node && node['s-ol']) || node;
|
|
678
968
|
};
|
|
679
969
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
970
|
+
/**
|
|
971
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
972
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
973
|
+
* children of the two nodes (if any).
|
|
974
|
+
*
|
|
975
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
976
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
977
|
+
*/
|
|
680
978
|
const patch = (oldVNode, newVNode) => {
|
|
681
979
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
682
980
|
const oldChildren = oldVNode.$children$;
|
|
@@ -690,7 +988,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
690
988
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
691
989
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
692
990
|
}
|
|
693
|
-
// element node
|
|
694
991
|
{
|
|
695
992
|
if (tag === 'slot')
|
|
696
993
|
;
|
|
@@ -703,6 +1000,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
703
1000
|
}
|
|
704
1001
|
if (oldChildren !== null && newChildren !== null) {
|
|
705
1002
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1003
|
+
// so we need to call `updateChildren` to reconcile them
|
|
706
1004
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
707
1005
|
}
|
|
708
1006
|
else if (newChildren !== null) {
|
|
@@ -734,7 +1032,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
734
1032
|
};
|
|
735
1033
|
const updateFallbackSlotVisibility = (elm) => {
|
|
736
1034
|
// tslint:disable-next-line: prefer-const
|
|
737
|
-
|
|
1035
|
+
const childNodes = elm.childNodes;
|
|
738
1036
|
let childNode;
|
|
739
1037
|
let i;
|
|
740
1038
|
let ilen;
|
|
@@ -743,7 +1041,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
743
1041
|
let nodeType;
|
|
744
1042
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
745
1043
|
childNode = childNodes[i];
|
|
746
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1044
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
747
1045
|
if (childNode['s-sr']) {
|
|
748
1046
|
// this is a slot fallback node
|
|
749
1047
|
// get the slot name for this slot reference node
|
|
@@ -755,7 +1053,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
755
1053
|
nodeType = childNodes[j].nodeType;
|
|
756
1054
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
757
1055
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
758
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1056
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
759
1057
|
childNode.hidden = true;
|
|
760
1058
|
break;
|
|
761
1059
|
}
|
|
@@ -764,8 +1062,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
764
1062
|
// this is a default fallback slot node
|
|
765
1063
|
// any element or text node (with content)
|
|
766
1064
|
// should hide the default fallback slot node
|
|
767
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
768
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1065
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1066
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
769
1067
|
childNode.hidden = true;
|
|
770
1068
|
break;
|
|
771
1069
|
}
|
|
@@ -787,8 +1085,8 @@ const relocateSlotContent = (elm) => {
|
|
|
787
1085
|
let relocateNodeData;
|
|
788
1086
|
let j;
|
|
789
1087
|
let i = 0;
|
|
790
|
-
|
|
791
|
-
|
|
1088
|
+
const childNodes = elm.childNodes;
|
|
1089
|
+
const ilen = childNodes.length;
|
|
792
1090
|
for (; i < ilen; i++) {
|
|
793
1091
|
childNode = childNodes[i];
|
|
794
1092
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -843,13 +1141,13 @@ const relocateSlotContent = (elm) => {
|
|
|
843
1141
|
}
|
|
844
1142
|
}
|
|
845
1143
|
}
|
|
846
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1144
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
847
1145
|
relocateSlotContent(childNode);
|
|
848
1146
|
}
|
|
849
1147
|
}
|
|
850
1148
|
};
|
|
851
1149
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
852
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1150
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
853
1151
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
854
1152
|
return true;
|
|
855
1153
|
}
|
|
@@ -869,6 +1167,18 @@ const callNodeRefs = (vNode) => {
|
|
|
869
1167
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
870
1168
|
}
|
|
871
1169
|
};
|
|
1170
|
+
/**
|
|
1171
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1172
|
+
*
|
|
1173
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1174
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1175
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1176
|
+
* relocation, and reflecting attributes.
|
|
1177
|
+
*
|
|
1178
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1179
|
+
* the DOM node into which it should be rendered.
|
|
1180
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1181
|
+
*/
|
|
872
1182
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
873
1183
|
const hostElm = hostRef.$hostElement$;
|
|
874
1184
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -880,12 +1190,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
880
1190
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
881
1191
|
}
|
|
882
1192
|
rootVnode.$tag$ = null;
|
|
883
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1193
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
884
1194
|
hostRef.$vnode$ = rootVnode;
|
|
885
1195
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
886
1196
|
{
|
|
887
1197
|
contentRef = hostElm['s-cr'];
|
|
888
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1198
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
889
1199
|
// always reset
|
|
890
1200
|
checkSlotFallbackVisibility = false;
|
|
891
1201
|
}
|
|
@@ -894,7 +1204,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
894
1204
|
{
|
|
895
1205
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
896
1206
|
// the disconnectCallback from working
|
|
897
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1207
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
898
1208
|
if (checkSlotRelocate) {
|
|
899
1209
|
relocateSlotContent(rootVnode.$elm$);
|
|
900
1210
|
let relocateData;
|
|
@@ -952,7 +1262,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
952
1262
|
}
|
|
953
1263
|
else {
|
|
954
1264
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
955
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1265
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
956
1266
|
nodeToRelocate.hidden = true;
|
|
957
1267
|
}
|
|
958
1268
|
}
|
|
@@ -963,30 +1273,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
963
1273
|
}
|
|
964
1274
|
// done moving nodes around
|
|
965
1275
|
// allow the disconnect callback to work again
|
|
966
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1276
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
967
1277
|
// always reset
|
|
968
1278
|
relocateNodes.length = 0;
|
|
969
1279
|
}
|
|
970
1280
|
};
|
|
971
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
972
|
-
const createEvent = (ref, name, flags) => {
|
|
973
|
-
const elm = getElement(ref);
|
|
974
|
-
return {
|
|
975
|
-
emit: (detail) => {
|
|
976
|
-
return emitEvent(elm, name, {
|
|
977
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
978
|
-
composed: !!(flags & 2 /* Composed */),
|
|
979
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
980
|
-
detail,
|
|
981
|
-
});
|
|
982
|
-
},
|
|
983
|
-
};
|
|
984
|
-
};
|
|
985
|
-
const emitEvent = (elm, name, opts) => {
|
|
986
|
-
const ev = plt.ce(name, opts);
|
|
987
|
-
elm.dispatchEvent(ev);
|
|
988
|
-
return ev;
|
|
989
|
-
};
|
|
990
1281
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
991
1282
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
992
1283
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -994,10 +1285,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
994
1285
|
};
|
|
995
1286
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
996
1287
|
{
|
|
997
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1288
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
998
1289
|
}
|
|
999
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1000
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1290
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1291
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1001
1292
|
return;
|
|
1002
1293
|
}
|
|
1003
1294
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1013,7 +1304,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1013
1304
|
let promise;
|
|
1014
1305
|
if (isInitialLoad) {
|
|
1015
1306
|
{
|
|
1016
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1307
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1017
1308
|
if (hostRef.$queuedListeners$) {
|
|
1018
1309
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1019
1310
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1052,7 +1343,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1052
1343
|
}
|
|
1053
1344
|
else {
|
|
1054
1345
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1055
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1346
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1056
1347
|
childrenPromises.length = 0;
|
|
1057
1348
|
}
|
|
1058
1349
|
}
|
|
@@ -1061,10 +1352,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1061
1352
|
try {
|
|
1062
1353
|
instance = instance.render() ;
|
|
1063
1354
|
{
|
|
1064
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1355
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1065
1356
|
}
|
|
1066
1357
|
{
|
|
1067
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1358
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1068
1359
|
}
|
|
1069
1360
|
{
|
|
1070
1361
|
{
|
|
@@ -1091,8 +1382,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1091
1382
|
{
|
|
1092
1383
|
safeCall(instance, 'componentDidRender');
|
|
1093
1384
|
}
|
|
1094
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1095
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1385
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1386
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1096
1387
|
{
|
|
1097
1388
|
// DOM WRITE!
|
|
1098
1389
|
addHydratedFlag(elm);
|
|
@@ -1124,10 +1415,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1124
1415
|
hostRef.$onRenderResolve$();
|
|
1125
1416
|
hostRef.$onRenderResolve$ = undefined;
|
|
1126
1417
|
}
|
|
1127
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1418
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1128
1419
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1129
1420
|
}
|
|
1130
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1421
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1131
1422
|
}
|
|
1132
1423
|
// ( •_•)
|
|
1133
1424
|
// ( •_•)>⌐■-■
|
|
@@ -1157,44 +1448,40 @@ const then = (promise, thenFn) => {
|
|
|
1157
1448
|
};
|
|
1158
1449
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1159
1450
|
;
|
|
1160
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1161
|
-
// ensure this value is of the correct prop type
|
|
1162
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1163
|
-
if (propType & 4 /* Boolean */) {
|
|
1164
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1165
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1166
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1167
|
-
}
|
|
1168
|
-
if (propType & 2 /* Number */) {
|
|
1169
|
-
// force it to be a number
|
|
1170
|
-
return parseFloat(propValue);
|
|
1171
|
-
}
|
|
1172
|
-
if (propType & 1 /* String */) {
|
|
1173
|
-
// could have been passed as a number or boolean
|
|
1174
|
-
// but we still want it as a string
|
|
1175
|
-
return String(propValue);
|
|
1176
|
-
}
|
|
1177
|
-
// redundant return here for better minification
|
|
1178
|
-
return propValue;
|
|
1179
|
-
}
|
|
1180
|
-
// not sure exactly what type we want
|
|
1181
|
-
// so no need to change to a different type
|
|
1182
|
-
return propValue;
|
|
1183
|
-
};
|
|
1184
1451
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1185
1452
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1186
1453
|
// check our new property value against our internal value
|
|
1187
1454
|
const hostRef = getHostRef(ref);
|
|
1455
|
+
const elm = hostRef.$hostElement$ ;
|
|
1188
1456
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1189
1457
|
const flags = hostRef.$flags$;
|
|
1190
1458
|
const instance = hostRef.$lazyInstance$ ;
|
|
1191
1459
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1192
|
-
|
|
1460
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1461
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1462
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1463
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1193
1464
|
// gadzooks! the property's value has changed!!
|
|
1194
1465
|
// set our new value!
|
|
1195
1466
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1196
1467
|
if (instance) {
|
|
1197
|
-
|
|
1468
|
+
// get an array of method names of watch functions to call
|
|
1469
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1470
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1471
|
+
if (watchMethods) {
|
|
1472
|
+
// this instance is watching for when this property changed
|
|
1473
|
+
watchMethods.map((watchMethodName) => {
|
|
1474
|
+
try {
|
|
1475
|
+
// fire off each of the watch methods that are watching this property
|
|
1476
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1477
|
+
}
|
|
1478
|
+
catch (e) {
|
|
1479
|
+
consoleError(e, elm);
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1198
1485
|
// looks like this value actually changed, so we've got work to do!
|
|
1199
1486
|
// but only if we've already rendered, otherwise just chill out
|
|
1200
1487
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1204,14 +1491,27 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1204
1491
|
}
|
|
1205
1492
|
}
|
|
1206
1493
|
};
|
|
1494
|
+
/**
|
|
1495
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1496
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1497
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1498
|
+
*
|
|
1499
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1500
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1501
|
+
* @param flags a number used to store a series of bit flags
|
|
1502
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1503
|
+
*/
|
|
1207
1504
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1208
1505
|
if (cmpMeta.$members$) {
|
|
1506
|
+
if (Cstr.watchers) {
|
|
1507
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1508
|
+
}
|
|
1209
1509
|
// It's better to have a const than two Object.entries()
|
|
1210
1510
|
const members = Object.entries(cmpMeta.$members$);
|
|
1211
1511
|
const prototype = Cstr.prototype;
|
|
1212
1512
|
members.map(([memberName, [memberFlags]]) => {
|
|
1213
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1214
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1513
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1514
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1215
1515
|
// proxyComponent - prop
|
|
1216
1516
|
Object.defineProperty(prototype, memberName, {
|
|
1217
1517
|
get() {
|
|
@@ -1226,8 +1526,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1226
1526
|
enumerable: true,
|
|
1227
1527
|
});
|
|
1228
1528
|
}
|
|
1229
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1230
|
-
memberFlags & 64 /* Method */) {
|
|
1529
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1530
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1231
1531
|
// proxyComponent - method
|
|
1232
1532
|
Object.defineProperty(prototype, memberName, {
|
|
1233
1533
|
value(...args) {
|
|
@@ -1237,19 +1537,19 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1237
1537
|
});
|
|
1238
1538
|
}
|
|
1239
1539
|
});
|
|
1240
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1540
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1241
1541
|
const attrNameToPropName = new Map();
|
|
1242
1542
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1243
1543
|
plt.jmp(() => {
|
|
1244
1544
|
const propName = attrNameToPropName.get(attrName);
|
|
1245
|
-
// In a
|
|
1545
|
+
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1246
1546
|
// in the case where an attribute was set inline.
|
|
1247
1547
|
// ```html
|
|
1248
1548
|
// <my-component some-attribute="some-value"></my-component>
|
|
1249
1549
|
// ```
|
|
1250
1550
|
//
|
|
1251
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1252
|
-
// changes it before it has been upgraded as shown below:
|
|
1551
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1552
|
+
// programmatically changes it before it has been upgraded as shown below:
|
|
1253
1553
|
//
|
|
1254
1554
|
// ```html
|
|
1255
1555
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1259,13 +1559,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1259
1559
|
// el = document.querySelector("#test");
|
|
1260
1560
|
// el.someAttribute = "another-value";
|
|
1261
1561
|
// // upgrade component
|
|
1262
|
-
//
|
|
1562
|
+
// customElements.define('my-component', MyComponent);
|
|
1263
1563
|
// </script>
|
|
1264
1564
|
// ```
|
|
1265
1565
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1266
1566
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1267
1567
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1268
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1568
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
|
|
1269
1569
|
//
|
|
1270
1570
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1271
1571
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1279,17 +1579,25 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1279
1579
|
newValue = this[propName];
|
|
1280
1580
|
delete this[propName];
|
|
1281
1581
|
}
|
|
1582
|
+
else if (prototype.hasOwnProperty(propName) &&
|
|
1583
|
+
typeof this[propName] === 'number' &&
|
|
1584
|
+
this[propName] == newValue) {
|
|
1585
|
+
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1586
|
+
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1587
|
+
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1282
1590
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1283
1591
|
});
|
|
1284
1592
|
};
|
|
1285
1593
|
// create an array of attributes to observe
|
|
1286
1594
|
// and also create a map of html attribute name to js property name
|
|
1287
1595
|
Cstr.observedAttributes = members
|
|
1288
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1596
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1289
1597
|
.map(([propName, m]) => {
|
|
1290
1598
|
const attrName = m[1] || propName;
|
|
1291
1599
|
attrNameToPropName.set(attrName, propName);
|
|
1292
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1600
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1293
1601
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1294
1602
|
}
|
|
1295
1603
|
return attrName;
|
|
@@ -1300,10 +1608,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1300
1608
|
};
|
|
1301
1609
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1302
1610
|
// initializeComponent
|
|
1303
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1611
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1304
1612
|
{
|
|
1305
1613
|
// we haven't initialized this element yet
|
|
1306
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1614
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1307
1615
|
// lazy loaded components
|
|
1308
1616
|
// request the component's implementation to be
|
|
1309
1617
|
// wired up with the host element
|
|
@@ -1315,7 +1623,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1315
1623
|
endLoad();
|
|
1316
1624
|
}
|
|
1317
1625
|
if (!Cstr.isProxied) {
|
|
1318
|
-
|
|
1626
|
+
// we've never proxied this Constructor before
|
|
1627
|
+
// let's add the getters/setters to its prototype before
|
|
1628
|
+
// the first time we create an instance of the implementation
|
|
1629
|
+
{
|
|
1630
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1631
|
+
}
|
|
1632
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1319
1633
|
Cstr.isProxied = true;
|
|
1320
1634
|
}
|
|
1321
1635
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1323,7 +1637,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1323
1637
|
// but let's keep track of when we start and stop
|
|
1324
1638
|
// so that the getters/setters don't incorrectly step on data
|
|
1325
1639
|
{
|
|
1326
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1640
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1327
1641
|
}
|
|
1328
1642
|
// construct the lazy-loaded component implementation
|
|
1329
1643
|
// passing the hostRef is very important during
|
|
@@ -1336,7 +1650,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1336
1650
|
consoleError(e);
|
|
1337
1651
|
}
|
|
1338
1652
|
{
|
|
1339
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1653
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1654
|
+
}
|
|
1655
|
+
{
|
|
1656
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1340
1657
|
}
|
|
1341
1658
|
endNewInstance();
|
|
1342
1659
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1346,7 +1663,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1346
1663
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1347
1664
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1348
1665
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1349
|
-
// this is the
|
|
1666
|
+
// this is the initial load and this component it has an ancestor component
|
|
1350
1667
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1351
1668
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1352
1669
|
// this will get fired off when the ancestor component
|
|
@@ -1364,19 +1681,20 @@ const fireConnectedCallback = (instance) => {
|
|
|
1364
1681
|
}
|
|
1365
1682
|
};
|
|
1366
1683
|
const connectedCallback = (elm) => {
|
|
1367
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1684
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1368
1685
|
const hostRef = getHostRef(elm);
|
|
1369
1686
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1370
1687
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1371
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1688
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1372
1689
|
// first time this component has connected
|
|
1373
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1690
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1374
1691
|
{
|
|
1375
1692
|
// initUpdate
|
|
1376
1693
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1377
1694
|
// in here to act as original content anchors as we move nodes around
|
|
1378
1695
|
// host element has been connected to the DOM
|
|
1379
|
-
if ((
|
|
1696
|
+
if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
1697
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1380
1698
|
setContentReference(elm);
|
|
1381
1699
|
}
|
|
1382
1700
|
}
|
|
@@ -1399,7 +1717,7 @@ const connectedCallback = (elm) => {
|
|
|
1399
1717
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1400
1718
|
if (cmpMeta.$members$) {
|
|
1401
1719
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1402
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1720
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1403
1721
|
const value = elm[memberName];
|
|
1404
1722
|
delete elm[memberName];
|
|
1405
1723
|
elm[memberName] = value;
|
|
@@ -1433,7 +1751,7 @@ const setContentReference = (elm) => {
|
|
|
1433
1751
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1434
1752
|
};
|
|
1435
1753
|
const disconnectedCallback = (elm) => {
|
|
1436
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1754
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1437
1755
|
const hostRef = getHostRef(elm);
|
|
1438
1756
|
const instance = hostRef.$lazyInstance$ ;
|
|
1439
1757
|
{
|
|
@@ -1448,6 +1766,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1448
1766
|
}
|
|
1449
1767
|
};
|
|
1450
1768
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1769
|
+
var _a;
|
|
1451
1770
|
const endBootstrap = createTime();
|
|
1452
1771
|
const cmpTags = [];
|
|
1453
1772
|
const exclude = options.exclude || [];
|
|
@@ -1460,60 +1779,70 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1460
1779
|
let isBootstrapping = true;
|
|
1461
1780
|
Object.assign(plt, options);
|
|
1462
1781
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1463
|
-
lazyBundles.map((lazyBundle) =>
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
{
|
|
1474
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1475
|
-
}
|
|
1476
|
-
{
|
|
1477
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
1478
|
-
}
|
|
1479
|
-
const tagName = cmpMeta.$tagName$;
|
|
1480
|
-
const HostElement = class extends HTMLElement {
|
|
1481
|
-
// StencilLazyHost
|
|
1482
|
-
constructor(self) {
|
|
1483
|
-
// @ts-ignore
|
|
1484
|
-
super(self);
|
|
1485
|
-
self = this;
|
|
1486
|
-
registerHost(self, cmpMeta);
|
|
1782
|
+
lazyBundles.map((lazyBundle) => {
|
|
1783
|
+
lazyBundle[1].map((compactMeta) => {
|
|
1784
|
+
const cmpMeta = {
|
|
1785
|
+
$flags$: compactMeta[0],
|
|
1786
|
+
$tagName$: compactMeta[1],
|
|
1787
|
+
$members$: compactMeta[2],
|
|
1788
|
+
$listeners$: compactMeta[3],
|
|
1789
|
+
};
|
|
1790
|
+
{
|
|
1791
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1487
1792
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1793
|
+
{
|
|
1794
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1795
|
+
}
|
|
1796
|
+
{
|
|
1797
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1798
|
+
}
|
|
1799
|
+
{
|
|
1800
|
+
cmpMeta.$watchers$ = {};
|
|
1801
|
+
}
|
|
1802
|
+
const tagName = cmpMeta.$tagName$;
|
|
1803
|
+
const HostElement = class extends HTMLElement {
|
|
1804
|
+
// StencilLazyHost
|
|
1805
|
+
constructor(self) {
|
|
1806
|
+
// @ts-ignore
|
|
1807
|
+
super(self);
|
|
1808
|
+
self = this;
|
|
1809
|
+
registerHost(self, cmpMeta);
|
|
1810
|
+
}
|
|
1811
|
+
connectedCallback() {
|
|
1812
|
+
if (appLoadFallback) {
|
|
1813
|
+
clearTimeout(appLoadFallback);
|
|
1814
|
+
appLoadFallback = null;
|
|
1815
|
+
}
|
|
1816
|
+
if (isBootstrapping) {
|
|
1817
|
+
// connectedCallback will be processed once all components have been registered
|
|
1818
|
+
deferredConnectedCallbacks.push(this);
|
|
1819
|
+
}
|
|
1820
|
+
else {
|
|
1821
|
+
plt.jmp(() => connectedCallback(this));
|
|
1822
|
+
}
|
|
1492
1823
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
deferredConnectedCallbacks.push(this);
|
|
1824
|
+
disconnectedCallback() {
|
|
1825
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1496
1826
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1827
|
+
componentOnReady() {
|
|
1828
|
+
return getHostRef(this).$onReadyPromise$;
|
|
1499
1829
|
}
|
|
1830
|
+
};
|
|
1831
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1832
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1833
|
+
cmpTags.push(tagName);
|
|
1834
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1500
1835
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
componentOnReady() {
|
|
1505
|
-
return getHostRef(this).$onReadyPromise$;
|
|
1506
|
-
}
|
|
1507
|
-
};
|
|
1508
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1509
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1510
|
-
cmpTags.push(tagName);
|
|
1511
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1512
|
-
}
|
|
1513
|
-
}));
|
|
1836
|
+
});
|
|
1837
|
+
});
|
|
1514
1838
|
{
|
|
1515
1839
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1516
1840
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1841
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1842
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1843
|
+
if (nonce != null) {
|
|
1844
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1845
|
+
}
|
|
1517
1846
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1518
1847
|
}
|
|
1519
1848
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1530,7 +1859,48 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1530
1859
|
endBootstrap();
|
|
1531
1860
|
};
|
|
1532
1861
|
const Fragment = (_, children) => children;
|
|
1533
|
-
const
|
|
1862
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1863
|
+
if (listeners) {
|
|
1864
|
+
listeners.map(([flags, name, method]) => {
|
|
1865
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1866
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1867
|
+
const opts = hostListenerOpts(flags);
|
|
1868
|
+
plt.ael(target, name, handler, opts);
|
|
1869
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1874
|
+
try {
|
|
1875
|
+
{
|
|
1876
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1877
|
+
// instance is ready, let's call it's member method for this event
|
|
1878
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1879
|
+
}
|
|
1880
|
+
else {
|
|
1881
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
catch (e) {
|
|
1886
|
+
consoleError(e);
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1890
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1891
|
+
return win;
|
|
1892
|
+
return elm;
|
|
1893
|
+
};
|
|
1894
|
+
// prettier-ignore
|
|
1895
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1896
|
+
/**
|
|
1897
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1898
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1899
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1900
|
+
* @returns void
|
|
1901
|
+
*/
|
|
1902
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1903
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1534
1904
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1535
1905
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1536
1906
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1562,7 +1932,82 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1562
1932
|
if (module) {
|
|
1563
1933
|
return module[exportName];
|
|
1564
1934
|
}
|
|
1935
|
+
|
|
1936
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1937
|
+
const processMod = importedModule => {
|
|
1938
|
+
cmpModules.set(bundleId, importedModule);
|
|
1939
|
+
return importedModule[exportName];
|
|
1940
|
+
}
|
|
1941
|
+
switch(bundleId) {
|
|
1942
|
+
|
|
1943
|
+
case 'xpl-avatar_12.cjs':
|
|
1944
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1945
|
+
/* webpackMode: "lazy" */
|
|
1946
|
+
'./xpl-avatar_12.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1947
|
+
case 'xpl-application-shell.cjs':
|
|
1948
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1949
|
+
/* webpackMode: "lazy" */
|
|
1950
|
+
'./xpl-application-shell.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1951
|
+
case 'xpl-button-row.cjs':
|
|
1952
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1953
|
+
/* webpackMode: "lazy" */
|
|
1954
|
+
'./xpl-button-row.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1955
|
+
case 'xpl-choicelist.cjs':
|
|
1956
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1957
|
+
/* webpackMode: "lazy" */
|
|
1958
|
+
'./xpl-choicelist.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1959
|
+
case 'xpl-divider.cjs':
|
|
1960
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1961
|
+
/* webpackMode: "lazy" */
|
|
1962
|
+
'./xpl-divider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1963
|
+
case 'xpl-grid.cjs':
|
|
1964
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1965
|
+
/* webpackMode: "lazy" */
|
|
1966
|
+
'./xpl-grid.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1967
|
+
case 'xpl-grid-item.cjs':
|
|
1968
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1969
|
+
/* webpackMode: "lazy" */
|
|
1970
|
+
'./xpl-grid-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1971
|
+
case 'xpl-input.cjs':
|
|
1972
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1973
|
+
/* webpackMode: "lazy" */
|
|
1974
|
+
'./xpl-input.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1975
|
+
case 'xpl-list.cjs':
|
|
1976
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1977
|
+
/* webpackMode: "lazy" */
|
|
1978
|
+
'./xpl-list.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1979
|
+
case 'xpl-main-nav.cjs':
|
|
1980
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1981
|
+
/* webpackMode: "lazy" */
|
|
1982
|
+
'./xpl-main-nav.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1983
|
+
case 'xpl-pagination.cjs':
|
|
1984
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1985
|
+
/* webpackMode: "lazy" */
|
|
1986
|
+
'./xpl-pagination.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1987
|
+
case 'xpl-select.cjs':
|
|
1988
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1989
|
+
/* webpackMode: "lazy" */
|
|
1990
|
+
'./xpl-select.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1991
|
+
case 'xpl-toggle.cjs':
|
|
1992
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1993
|
+
/* webpackMode: "lazy" */
|
|
1994
|
+
'./xpl-toggle.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1995
|
+
case 'xpl-backdrop.cjs':
|
|
1996
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1997
|
+
/* webpackMode: "lazy" */
|
|
1998
|
+
'./xpl-backdrop.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1999
|
+
case 'xpl-dropdown_2.cjs':
|
|
2000
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2001
|
+
/* webpackMode: "lazy" */
|
|
2002
|
+
'./xpl-dropdown_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2003
|
+
case 'xpl-dropdown-group_3.cjs':
|
|
2004
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2005
|
+
/* webpackMode: "lazy" */
|
|
2006
|
+
'./xpl-dropdown-group_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
1565
2009
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2010
|
+
/* @vite-ignore */
|
|
1566
2011
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1567
2012
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1568
2013
|
/* webpackMode: "lazy" */
|
|
@@ -1573,13 +2018,25 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1573
2018
|
return importedModule[exportName];
|
|
1574
2019
|
}, consoleError);
|
|
1575
2020
|
};
|
|
2021
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
2022
|
+
const doc = win.document || { head: {} };
|
|
2023
|
+
const plt = {
|
|
2024
|
+
$flags$: 0,
|
|
2025
|
+
$resourcesUrl$: '',
|
|
2026
|
+
jmp: (h) => h(),
|
|
2027
|
+
raf: (h) => requestAnimationFrame(h),
|
|
2028
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2029
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2030
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2031
|
+
};
|
|
2032
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
1576
2033
|
const queueDomReads = [];
|
|
1577
2034
|
const queueDomWrites = [];
|
|
1578
2035
|
const queueTask = (queue, write) => (cb) => {
|
|
1579
2036
|
queue.push(cb);
|
|
1580
2037
|
if (!queuePending) {
|
|
1581
2038
|
queuePending = true;
|
|
1582
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2039
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1583
2040
|
nextTick(flush);
|
|
1584
2041
|
}
|
|
1585
2042
|
else {
|
|
@@ -1624,3 +2081,6 @@ exports.getElement = getElement;
|
|
|
1624
2081
|
exports.h = h;
|
|
1625
2082
|
exports.promiseResolve = promiseResolve;
|
|
1626
2083
|
exports.registerInstance = registerInstance;
|
|
2084
|
+
exports.setNonce = setNonce;
|
|
2085
|
+
|
|
2086
|
+
//# sourceMappingURL=index-e53b018b.js.map
|