@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
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
const NAMESPACE = 'apollo-core';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
5
|
+
* Simon Friis Vindum (@paldepind)
|
|
6
|
+
* Licensed under the MIT License
|
|
7
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
8
|
+
*
|
|
9
|
+
* Modified for Stencil's renderer and slot projection
|
|
10
|
+
*/
|
|
3
11
|
let contentRef;
|
|
4
12
|
let hostTagName;
|
|
5
13
|
let useNativeShadowDom = false;
|
|
@@ -7,54 +15,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
7
15
|
let checkSlotRelocate = false;
|
|
8
16
|
let isSvgMode = false;
|
|
9
17
|
let queuePending = false;
|
|
10
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
11
|
-
const doc = win.document || { head: {} };
|
|
12
|
-
const plt = {
|
|
13
|
-
$flags$: 0,
|
|
14
|
-
$resourcesUrl$: '',
|
|
15
|
-
jmp: (h) => h(),
|
|
16
|
-
raf: (h) => requestAnimationFrame(h),
|
|
17
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
18
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
19
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
20
|
-
};
|
|
21
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
22
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
23
|
-
if (listeners) {
|
|
24
|
-
listeners.map(([flags, name, method]) => {
|
|
25
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
26
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
27
|
-
const opts = hostListenerOpts(flags);
|
|
28
|
-
plt.ael(target, name, handler, opts);
|
|
29
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
34
|
-
try {
|
|
35
|
-
{
|
|
36
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
37
|
-
// instance is ready, let's call it's member method for this event
|
|
38
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
consoleError(e);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
50
|
-
if (flags & 8 /* TargetWindow */)
|
|
51
|
-
return win;
|
|
52
|
-
return elm;
|
|
53
|
-
};
|
|
54
|
-
// prettier-ignore
|
|
55
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
56
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
57
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
58
18
|
const createTime = (fnName, tagName = '') => {
|
|
59
19
|
{
|
|
60
20
|
return () => {
|
|
@@ -69,6 +29,8 @@ const uniqueTime = (key, measureText) => {
|
|
|
69
29
|
};
|
|
70
30
|
}
|
|
71
31
|
};
|
|
32
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
33
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
72
34
|
/**
|
|
73
35
|
* Default style mode id
|
|
74
36
|
*/
|
|
@@ -82,11 +44,30 @@ const EMPTY_OBJ = {};
|
|
|
82
44
|
*/
|
|
83
45
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
84
46
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
47
|
+
/**
|
|
48
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
49
|
+
* function.
|
|
50
|
+
*
|
|
51
|
+
* @param o the value to check
|
|
52
|
+
* @returns whether it's a complex type or not
|
|
53
|
+
*/
|
|
85
54
|
const isComplexType = (o) => {
|
|
86
55
|
// https://jsperf.com/typeof-fn-object/5
|
|
87
56
|
o = typeof o;
|
|
88
57
|
return o === 'object' || o === 'function';
|
|
89
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
61
|
+
* out of a DOM's head.
|
|
62
|
+
*
|
|
63
|
+
* @param doc The DOM containing the `head` to query against
|
|
64
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
65
|
+
* exists or the tag has no content.
|
|
66
|
+
*/
|
|
67
|
+
function queryNonceMetaTagContent(doc) {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
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;
|
|
70
|
+
}
|
|
90
71
|
/**
|
|
91
72
|
* Production h() function based on Preact by
|
|
92
73
|
* Jason Miller (@developit)
|
|
@@ -95,7 +76,6 @@ const isComplexType = (o) => {
|
|
|
95
76
|
*
|
|
96
77
|
* Modified for Stencil's compiler and vdom
|
|
97
78
|
*/
|
|
98
|
-
// const stack: any[] = [];
|
|
99
79
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
100
80
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
101
81
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -104,7 +84,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
104
84
|
let slotName = null;
|
|
105
85
|
let simple = false;
|
|
106
86
|
let lastSimple = false;
|
|
107
|
-
|
|
87
|
+
const vNodeChildren = [];
|
|
108
88
|
const walk = (c) => {
|
|
109
89
|
for (let i = 0; i < c.length; i++) {
|
|
110
90
|
child = c[i];
|
|
@@ -165,6 +145,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
165
145
|
}
|
|
166
146
|
return vnode;
|
|
167
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
150
|
+
* possible text content.
|
|
151
|
+
*
|
|
152
|
+
* @param tag the tag for this element
|
|
153
|
+
* @param text possible text content for the node
|
|
154
|
+
* @returns a newly-minted virtual DOM node
|
|
155
|
+
*/
|
|
168
156
|
const newVNode = (tag, text) => {
|
|
169
157
|
const vnode = {
|
|
170
158
|
$flags$: 0,
|
|
@@ -185,11 +173,31 @@ const newVNode = (tag, text) => {
|
|
|
185
173
|
return vnode;
|
|
186
174
|
};
|
|
187
175
|
const Host = {};
|
|
176
|
+
/**
|
|
177
|
+
* Check whether a given node is a Host node or not
|
|
178
|
+
*
|
|
179
|
+
* @param node the virtual DOM node to check
|
|
180
|
+
* @returns whether it's a Host node or not
|
|
181
|
+
*/
|
|
188
182
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
183
|
+
/**
|
|
184
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
185
|
+
*
|
|
186
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
187
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
188
|
+
* interface.
|
|
189
|
+
*/
|
|
189
190
|
const vdomFnUtils = {
|
|
190
191
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
191
192
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
192
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
196
|
+
* friendlier public interface (hence, 'convertToPublic').
|
|
197
|
+
*
|
|
198
|
+
* @param node the virtual DOM node to convert
|
|
199
|
+
* @returns a converted child node
|
|
200
|
+
*/
|
|
193
201
|
const convertToPublic = (node) => ({
|
|
194
202
|
vattrs: node.$attrs$,
|
|
195
203
|
vchildren: node.$children$,
|
|
@@ -198,6 +206,15 @@ const convertToPublic = (node) => ({
|
|
|
198
206
|
vtag: node.$tag$,
|
|
199
207
|
vtext: node.$text$,
|
|
200
208
|
});
|
|
209
|
+
/**
|
|
210
|
+
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
211
|
+
* order to use the resulting object in the virtual DOM. The initial object was
|
|
212
|
+
* likely created as part of presenting a public API, so converting it back
|
|
213
|
+
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
214
|
+
*
|
|
215
|
+
* @param node the child node to convert
|
|
216
|
+
* @returns a converted virtual DOM node
|
|
217
|
+
*/
|
|
201
218
|
const convertToPrivate = (node) => {
|
|
202
219
|
if (typeof node.vtag === 'function') {
|
|
203
220
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -216,6 +233,79 @@ const convertToPrivate = (node) => {
|
|
|
216
233
|
vnode.$name$ = node.vname;
|
|
217
234
|
return vnode;
|
|
218
235
|
};
|
|
236
|
+
/**
|
|
237
|
+
* Parse a new property value for a given property type.
|
|
238
|
+
*
|
|
239
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
240
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
241
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
242
|
+
* 2. the type stored from `propType`.
|
|
243
|
+
*
|
|
244
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
245
|
+
*
|
|
246
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
247
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
248
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
249
|
+
* ```tsx
|
|
250
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* HTML prop values on the other hand, will always a string
|
|
254
|
+
*
|
|
255
|
+
* @param propValue the new value to coerce to some type
|
|
256
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
257
|
+
* @returns the parsed/coerced value
|
|
258
|
+
*/
|
|
259
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
260
|
+
// ensure this value is of the correct prop type
|
|
261
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
262
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
263
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
264
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
265
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
266
|
+
}
|
|
267
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
268
|
+
// force it to be a number
|
|
269
|
+
return parseFloat(propValue);
|
|
270
|
+
}
|
|
271
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
272
|
+
// could have been passed as a number or boolean
|
|
273
|
+
// but we still want it as a string
|
|
274
|
+
return String(propValue);
|
|
275
|
+
}
|
|
276
|
+
// redundant return here for better minification
|
|
277
|
+
return propValue;
|
|
278
|
+
}
|
|
279
|
+
// not sure exactly what type we want
|
|
280
|
+
// so no need to change to a different type
|
|
281
|
+
return propValue;
|
|
282
|
+
};
|
|
283
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
284
|
+
const createEvent = (ref, name, flags) => {
|
|
285
|
+
const elm = getElement(ref);
|
|
286
|
+
return {
|
|
287
|
+
emit: (detail) => {
|
|
288
|
+
return emitEvent(elm, name, {
|
|
289
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
290
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
291
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
292
|
+
detail,
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
299
|
+
* @param elm the target of the Event
|
|
300
|
+
* @param name the name to give the custom Event
|
|
301
|
+
* @param opts options for configuring a custom Event
|
|
302
|
+
* @returns the custom Event
|
|
303
|
+
*/
|
|
304
|
+
const emitEvent = (elm, name, opts) => {
|
|
305
|
+
const ev = plt.ce(name, opts);
|
|
306
|
+
elm.dispatchEvent(ev);
|
|
307
|
+
return ev;
|
|
308
|
+
};
|
|
219
309
|
/**
|
|
220
310
|
* Production setAccessor() function based on Preact by
|
|
221
311
|
* Jason Miller (@developit)
|
|
@@ -313,11 +403,10 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
313
403
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
314
404
|
try {
|
|
315
405
|
if (!elm.tagName.includes('-')) {
|
|
316
|
-
|
|
406
|
+
const n = newValue == null ? '' : newValue;
|
|
317
407
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
318
408
|
if (memberName === 'list') {
|
|
319
409
|
isProp = false;
|
|
320
|
-
// tslint:disable-next-line: triple-equals
|
|
321
410
|
}
|
|
322
411
|
else if (oldValue == null || elm[memberName] != n) {
|
|
323
412
|
elm[memberName] = n;
|
|
@@ -353,7 +442,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
353
442
|
}
|
|
354
443
|
}
|
|
355
444
|
}
|
|
356
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
445
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
357
446
|
newValue = newValue === true ? '' : newValue;
|
|
358
447
|
if (xlink) {
|
|
359
448
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -371,7 +460,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
371
460
|
// if the element passed in is a shadow root, which is a document fragment
|
|
372
461
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
373
462
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
374
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
463
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
375
464
|
? newVnode.$elm$.host
|
|
376
465
|
: newVnode.$elm$;
|
|
377
466
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -389,9 +478,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
389
478
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
390
479
|
}
|
|
391
480
|
};
|
|
481
|
+
/**
|
|
482
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
483
|
+
*
|
|
484
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
485
|
+
* @param newParentVNode the parent VNode from the current render
|
|
486
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
487
|
+
* children, for which we will create a new DOM node
|
|
488
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
489
|
+
* @returns the newly created node
|
|
490
|
+
*/
|
|
392
491
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
393
492
|
// tslint:disable-next-line: prefer-const
|
|
394
|
-
|
|
493
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
395
494
|
let i = 0;
|
|
396
495
|
let elm;
|
|
397
496
|
let childNode;
|
|
@@ -402,16 +501,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
402
501
|
if (newVNode.$tag$ === 'slot') {
|
|
403
502
|
newVNode.$flags$ |= newVNode.$children$
|
|
404
503
|
? // slot element has fallback content
|
|
405
|
-
2 /* isSlotFallback */
|
|
504
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
406
505
|
: // slot element does not have fallback content
|
|
407
|
-
1 /* isSlotReference */;
|
|
506
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
408
507
|
}
|
|
409
508
|
}
|
|
410
509
|
if (newVNode.$text$ !== null) {
|
|
411
510
|
// create text node
|
|
412
511
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
413
512
|
}
|
|
414
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
513
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
415
514
|
// create a slot reference node
|
|
416
515
|
elm = newVNode.$elm$ =
|
|
417
516
|
doc.createTextNode('');
|
|
@@ -421,7 +520,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
421
520
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
422
521
|
}
|
|
423
522
|
// create element
|
|
424
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
523
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
425
524
|
? 'slot-fb'
|
|
426
525
|
: newVNode.$tag$)
|
|
427
526
|
);
|
|
@@ -456,7 +555,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
456
555
|
}
|
|
457
556
|
{
|
|
458
557
|
elm['s-hn'] = hostTagName;
|
|
459
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
558
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
460
559
|
// remember the content reference comment
|
|
461
560
|
elm['s-sr'] = true;
|
|
462
561
|
// remember the content reference comment
|
|
@@ -475,7 +574,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
475
574
|
return elm;
|
|
476
575
|
};
|
|
477
576
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
478
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
577
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
479
578
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
480
579
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
481
580
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -496,8 +595,23 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
496
595
|
putBackInOriginalLocation(childNode, recursive);
|
|
497
596
|
}
|
|
498
597
|
}
|
|
499
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
598
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
500
599
|
};
|
|
600
|
+
/**
|
|
601
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
602
|
+
* add them to the DOM in the appropriate place.
|
|
603
|
+
*
|
|
604
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
605
|
+
* DOM nodes
|
|
606
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
607
|
+
* inserted before (optional)
|
|
608
|
+
* @param parentVNode the parent virtual DOM node
|
|
609
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
610
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
611
|
+
* creating DOM nodes (inclusive)
|
|
612
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
613
|
+
* creating DOM nodes (inclusive)
|
|
614
|
+
*/
|
|
501
615
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
502
616
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
503
617
|
let childNode;
|
|
@@ -511,6 +625,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
511
625
|
}
|
|
512
626
|
}
|
|
513
627
|
};
|
|
628
|
+
/**
|
|
629
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
630
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
631
|
+
* should no longer be shown.
|
|
632
|
+
*
|
|
633
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
634
|
+
*
|
|
635
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
636
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
637
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
638
|
+
* @param vnode a VNode
|
|
639
|
+
* @param elm an element
|
|
640
|
+
*/
|
|
514
641
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
515
642
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
516
643
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -535,6 +662,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
535
662
|
}
|
|
536
663
|
}
|
|
537
664
|
};
|
|
665
|
+
/**
|
|
666
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
667
|
+
* traversing the two collections of children, identifying nodes that are
|
|
668
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
669
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
670
|
+
*
|
|
671
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
672
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
673
|
+
* 'windows' by storing start and end indices and references to the
|
|
674
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
675
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
676
|
+
* no children left to update by doing the following:
|
|
677
|
+
*
|
|
678
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
679
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
680
|
+
* only with a window bounded by the highlighted elements:
|
|
681
|
+
*
|
|
682
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
683
|
+
* ^^^^^^ ^^^^^^
|
|
684
|
+
*
|
|
685
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
686
|
+
* across the windows. This will basically detect elements which haven't
|
|
687
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
688
|
+
* VNode elements (represented as HTML):
|
|
689
|
+
*
|
|
690
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
691
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
692
|
+
*
|
|
693
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
694
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
695
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
696
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
697
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
698
|
+
*
|
|
699
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
700
|
+
* window corresponds to the element at the end of the other window. This is
|
|
701
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
702
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
703
|
+
* children nodes themselves have not changed but merely moved in the
|
|
704
|
+
* following example:
|
|
705
|
+
*
|
|
706
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
707
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
708
|
+
*
|
|
709
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
710
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
711
|
+
* DOM.
|
|
712
|
+
*
|
|
713
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
714
|
+
* nodes in the old children which have the same key as the first element in
|
|
715
|
+
* our window on the new children. If we find such a node we handle calling
|
|
716
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
717
|
+
* what we find.
|
|
718
|
+
*
|
|
719
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
720
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
721
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
722
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
723
|
+
* children has collapsed we still have more nodes on the new children that
|
|
724
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
725
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
726
|
+
* sure the corresponding DOM nodes are removed.
|
|
727
|
+
*
|
|
728
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
729
|
+
* @param oldCh the old children of the parent node
|
|
730
|
+
* @param newVNode the new VNode which will replace the parent
|
|
731
|
+
* @param newCh the new children of the parent node
|
|
732
|
+
*/
|
|
538
733
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
539
734
|
let oldStartIdx = 0;
|
|
540
735
|
let newStartIdx = 0;
|
|
@@ -550,7 +745,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
550
745
|
let elmToMove;
|
|
551
746
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
552
747
|
if (oldStartVnode == null) {
|
|
553
|
-
//
|
|
748
|
+
// VNode might have been moved left
|
|
554
749
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
555
750
|
}
|
|
556
751
|
else if (oldEndVnode == null) {
|
|
@@ -563,37 +758,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
563
758
|
newEndVnode = newCh[--newEndIdx];
|
|
564
759
|
}
|
|
565
760
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
761
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
762
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
763
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
764
|
+
// since things are matched up in order.
|
|
566
765
|
patch(oldStartVnode, newStartVnode);
|
|
567
766
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
568
767
|
newStartVnode = newCh[++newStartIdx];
|
|
569
768
|
}
|
|
570
769
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
770
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
771
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
772
|
+
// need to move any DOM Nodes.
|
|
571
773
|
patch(oldEndVnode, newEndVnode);
|
|
572
774
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
573
775
|
newEndVnode = newCh[--newEndIdx];
|
|
574
776
|
}
|
|
575
777
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
576
|
-
// Vnode moved right
|
|
778
|
+
// case: "Vnode moved right"
|
|
779
|
+
//
|
|
780
|
+
// We've found that the last node in our window on the new children is
|
|
781
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
782
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
783
|
+
// nodes:
|
|
784
|
+
//
|
|
785
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
786
|
+
// ^^^^^^^^^^^
|
|
787
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
788
|
+
// ^^^^^^^^^^^^^
|
|
789
|
+
//
|
|
790
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
791
|
+
// and move the DOM element for `oldStartVnode`.
|
|
577
792
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
578
793
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
579
794
|
}
|
|
580
795
|
patch(oldStartVnode, newEndVnode);
|
|
796
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
797
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
798
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
799
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
800
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
801
|
+
//
|
|
802
|
+
// <old-start-node />
|
|
803
|
+
// <some-intervening-node />
|
|
804
|
+
// <old-end-node />
|
|
805
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
806
|
+
// <next-sibling />
|
|
807
|
+
//
|
|
808
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
809
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
810
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
811
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
812
|
+
// append it to the children of the parent element.
|
|
581
813
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
582
814
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
583
815
|
newEndVnode = newCh[--newEndIdx];
|
|
584
816
|
}
|
|
585
817
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
586
|
-
// Vnode moved left
|
|
818
|
+
// case: "Vnode moved left"
|
|
819
|
+
//
|
|
820
|
+
// We've found that the first node in our window on the new children is
|
|
821
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
822
|
+
// Visually, this is the layout of these two nodes:
|
|
823
|
+
//
|
|
824
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
825
|
+
// ^^^^^^^^^^^^^
|
|
826
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
827
|
+
// ^^^^^^^^^^^
|
|
828
|
+
//
|
|
829
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
830
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
831
|
+
// children etc) but we also need to move the DOM node to which
|
|
832
|
+
// `oldEndVnode` corresponds.
|
|
587
833
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
588
834
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
589
835
|
}
|
|
590
836
|
patch(oldEndVnode, newStartVnode);
|
|
837
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
838
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
839
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
840
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
841
|
+
// future.
|
|
591
842
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
592
843
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
593
844
|
newStartVnode = newCh[++newStartIdx];
|
|
594
845
|
}
|
|
595
846
|
else {
|
|
596
|
-
//
|
|
847
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
848
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
849
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
850
|
+
// component.
|
|
851
|
+
//
|
|
852
|
+
// First we check to see if there are any nodes in the array of old
|
|
853
|
+
// children which have the same key as the first node in the new
|
|
854
|
+
// children.
|
|
597
855
|
idxInOld = -1;
|
|
598
856
|
{
|
|
599
857
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -604,23 +862,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
604
862
|
}
|
|
605
863
|
}
|
|
606
864
|
if (idxInOld >= 0) {
|
|
865
|
+
// We found a node in the old children which matches up with the first
|
|
866
|
+
// node in the new children! So let's deal with that
|
|
607
867
|
elmToMove = oldCh[idxInOld];
|
|
608
868
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
869
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
609
870
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
610
871
|
}
|
|
611
872
|
else {
|
|
612
873
|
patch(elmToMove, newStartVnode);
|
|
874
|
+
// invalidate the matching old node so that we won't try to update it
|
|
875
|
+
// again later on
|
|
613
876
|
oldCh[idxInOld] = undefined;
|
|
614
877
|
node = elmToMove.$elm$;
|
|
615
878
|
}
|
|
616
879
|
newStartVnode = newCh[++newStartIdx];
|
|
617
880
|
}
|
|
618
881
|
else {
|
|
619
|
-
//
|
|
882
|
+
// We either didn't find an element in the old children that matches
|
|
883
|
+
// the key of the first new child OR the build is not using `key`
|
|
884
|
+
// attributes at all. In either case we need to create a new element
|
|
885
|
+
// for the new node.
|
|
620
886
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
621
887
|
newStartVnode = newCh[++newStartIdx];
|
|
622
888
|
}
|
|
623
889
|
if (node) {
|
|
890
|
+
// if we created a new node then handle inserting it to the DOM
|
|
624
891
|
{
|
|
625
892
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
626
893
|
}
|
|
@@ -628,21 +895,44 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
628
895
|
}
|
|
629
896
|
}
|
|
630
897
|
if (oldStartIdx > oldEndIdx) {
|
|
898
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
631
899
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
632
900
|
}
|
|
633
901
|
else if (newStartIdx > newEndIdx) {
|
|
902
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
903
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
904
|
+
// relevant DOM nodes)
|
|
634
905
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
635
906
|
}
|
|
636
907
|
};
|
|
637
|
-
|
|
908
|
+
/**
|
|
909
|
+
* Compare two VNodes to determine if they are the same
|
|
910
|
+
*
|
|
911
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
912
|
+
* information set on the two VNodes and can be misleading under certain
|
|
913
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
914
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
915
|
+
* checking that they have the same tag.
|
|
916
|
+
*
|
|
917
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
918
|
+
* changing order within a `children` array or something along those lines then
|
|
919
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
920
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
921
|
+
*
|
|
922
|
+
* @param leftVNode the first VNode to check
|
|
923
|
+
* @param rightVNode the second VNode to check
|
|
924
|
+
* @returns whether they're equal or not
|
|
925
|
+
*/
|
|
926
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
638
927
|
// compare if two vnode to see if they're "technically" the same
|
|
639
928
|
// need to have the same element tag, and same key to be the same
|
|
640
|
-
if (
|
|
641
|
-
if (
|
|
642
|
-
return
|
|
929
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
930
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
931
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
643
932
|
}
|
|
933
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
644
934
|
{
|
|
645
|
-
return
|
|
935
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
646
936
|
}
|
|
647
937
|
}
|
|
648
938
|
return false;
|
|
@@ -655,6 +945,14 @@ const referenceNode = (node) => {
|
|
|
655
945
|
return (node && node['s-ol']) || node;
|
|
656
946
|
};
|
|
657
947
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
948
|
+
/**
|
|
949
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
950
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
951
|
+
* children of the two nodes (if any).
|
|
952
|
+
*
|
|
953
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
954
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
955
|
+
*/
|
|
658
956
|
const patch = (oldVNode, newVNode) => {
|
|
659
957
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
660
958
|
const oldChildren = oldVNode.$children$;
|
|
@@ -668,7 +966,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
668
966
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
669
967
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
670
968
|
}
|
|
671
|
-
// element node
|
|
672
969
|
{
|
|
673
970
|
if (tag === 'slot')
|
|
674
971
|
;
|
|
@@ -681,6 +978,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
681
978
|
}
|
|
682
979
|
if (oldChildren !== null && newChildren !== null) {
|
|
683
980
|
// looks like there's child vnodes for both the old and new vnodes
|
|
981
|
+
// so we need to call `updateChildren` to reconcile them
|
|
684
982
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
685
983
|
}
|
|
686
984
|
else if (newChildren !== null) {
|
|
@@ -712,7 +1010,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
712
1010
|
};
|
|
713
1011
|
const updateFallbackSlotVisibility = (elm) => {
|
|
714
1012
|
// tslint:disable-next-line: prefer-const
|
|
715
|
-
|
|
1013
|
+
const childNodes = elm.childNodes;
|
|
716
1014
|
let childNode;
|
|
717
1015
|
let i;
|
|
718
1016
|
let ilen;
|
|
@@ -721,7 +1019,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
721
1019
|
let nodeType;
|
|
722
1020
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
723
1021
|
childNode = childNodes[i];
|
|
724
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1022
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
725
1023
|
if (childNode['s-sr']) {
|
|
726
1024
|
// this is a slot fallback node
|
|
727
1025
|
// get the slot name for this slot reference node
|
|
@@ -733,7 +1031,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
733
1031
|
nodeType = childNodes[j].nodeType;
|
|
734
1032
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
735
1033
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
736
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1034
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
737
1035
|
childNode.hidden = true;
|
|
738
1036
|
break;
|
|
739
1037
|
}
|
|
@@ -742,8 +1040,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
742
1040
|
// this is a default fallback slot node
|
|
743
1041
|
// any element or text node (with content)
|
|
744
1042
|
// should hide the default fallback slot node
|
|
745
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
746
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1043
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1044
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
747
1045
|
childNode.hidden = true;
|
|
748
1046
|
break;
|
|
749
1047
|
}
|
|
@@ -765,8 +1063,8 @@ const relocateSlotContent = (elm) => {
|
|
|
765
1063
|
let relocateNodeData;
|
|
766
1064
|
let j;
|
|
767
1065
|
let i = 0;
|
|
768
|
-
|
|
769
|
-
|
|
1066
|
+
const childNodes = elm.childNodes;
|
|
1067
|
+
const ilen = childNodes.length;
|
|
770
1068
|
for (; i < ilen; i++) {
|
|
771
1069
|
childNode = childNodes[i];
|
|
772
1070
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -821,13 +1119,13 @@ const relocateSlotContent = (elm) => {
|
|
|
821
1119
|
}
|
|
822
1120
|
}
|
|
823
1121
|
}
|
|
824
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1122
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
825
1123
|
relocateSlotContent(childNode);
|
|
826
1124
|
}
|
|
827
1125
|
}
|
|
828
1126
|
};
|
|
829
1127
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
830
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1128
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
831
1129
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
832
1130
|
return true;
|
|
833
1131
|
}
|
|
@@ -847,6 +1145,18 @@ const callNodeRefs = (vNode) => {
|
|
|
847
1145
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
848
1146
|
}
|
|
849
1147
|
};
|
|
1148
|
+
/**
|
|
1149
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1150
|
+
*
|
|
1151
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1152
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1153
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1154
|
+
* relocation, and reflecting attributes.
|
|
1155
|
+
*
|
|
1156
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1157
|
+
* the DOM node into which it should be rendered.
|
|
1158
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1159
|
+
*/
|
|
850
1160
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
851
1161
|
const hostElm = hostRef.$hostElement$;
|
|
852
1162
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -858,12 +1168,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
858
1168
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
859
1169
|
}
|
|
860
1170
|
rootVnode.$tag$ = null;
|
|
861
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1171
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
862
1172
|
hostRef.$vnode$ = rootVnode;
|
|
863
1173
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
864
1174
|
{
|
|
865
1175
|
contentRef = hostElm['s-cr'];
|
|
866
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1176
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
867
1177
|
// always reset
|
|
868
1178
|
checkSlotFallbackVisibility = false;
|
|
869
1179
|
}
|
|
@@ -872,7 +1182,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
872
1182
|
{
|
|
873
1183
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
874
1184
|
// the disconnectCallback from working
|
|
875
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1185
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
876
1186
|
if (checkSlotRelocate) {
|
|
877
1187
|
relocateSlotContent(rootVnode.$elm$);
|
|
878
1188
|
let relocateData;
|
|
@@ -930,7 +1240,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
930
1240
|
}
|
|
931
1241
|
else {
|
|
932
1242
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
933
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1243
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
934
1244
|
nodeToRelocate.hidden = true;
|
|
935
1245
|
}
|
|
936
1246
|
}
|
|
@@ -941,30 +1251,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
941
1251
|
}
|
|
942
1252
|
// done moving nodes around
|
|
943
1253
|
// allow the disconnect callback to work again
|
|
944
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1254
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
945
1255
|
// always reset
|
|
946
1256
|
relocateNodes.length = 0;
|
|
947
1257
|
}
|
|
948
1258
|
};
|
|
949
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
950
|
-
const createEvent = (ref, name, flags) => {
|
|
951
|
-
const elm = getElement(ref);
|
|
952
|
-
return {
|
|
953
|
-
emit: (detail) => {
|
|
954
|
-
return emitEvent(elm, name, {
|
|
955
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
956
|
-
composed: !!(flags & 2 /* Composed */),
|
|
957
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
958
|
-
detail,
|
|
959
|
-
});
|
|
960
|
-
},
|
|
961
|
-
};
|
|
962
|
-
};
|
|
963
|
-
const emitEvent = (elm, name, opts) => {
|
|
964
|
-
const ev = plt.ce(name, opts);
|
|
965
|
-
elm.dispatchEvent(ev);
|
|
966
|
-
return ev;
|
|
967
|
-
};
|
|
968
1259
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
969
1260
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
970
1261
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -972,10 +1263,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
972
1263
|
};
|
|
973
1264
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
974
1265
|
{
|
|
975
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1266
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
976
1267
|
}
|
|
977
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
978
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1268
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1269
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
979
1270
|
return;
|
|
980
1271
|
}
|
|
981
1272
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -991,7 +1282,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
991
1282
|
let promise;
|
|
992
1283
|
if (isInitialLoad) {
|
|
993
1284
|
{
|
|
994
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1285
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
995
1286
|
if (hostRef.$queuedListeners$) {
|
|
996
1287
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
997
1288
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1030,7 +1321,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1030
1321
|
}
|
|
1031
1322
|
else {
|
|
1032
1323
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1033
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1324
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1034
1325
|
childrenPromises.length = 0;
|
|
1035
1326
|
}
|
|
1036
1327
|
}
|
|
@@ -1039,10 +1330,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1039
1330
|
try {
|
|
1040
1331
|
instance = instance.render() ;
|
|
1041
1332
|
{
|
|
1042
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1333
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1043
1334
|
}
|
|
1044
1335
|
{
|
|
1045
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1336
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1046
1337
|
}
|
|
1047
1338
|
{
|
|
1048
1339
|
{
|
|
@@ -1069,8 +1360,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1069
1360
|
{
|
|
1070
1361
|
safeCall(instance, 'componentDidRender');
|
|
1071
1362
|
}
|
|
1072
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1073
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1363
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1364
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1074
1365
|
{
|
|
1075
1366
|
// DOM WRITE!
|
|
1076
1367
|
addHydratedFlag(elm);
|
|
@@ -1102,10 +1393,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1102
1393
|
hostRef.$onRenderResolve$();
|
|
1103
1394
|
hostRef.$onRenderResolve$ = undefined;
|
|
1104
1395
|
}
|
|
1105
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1396
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1106
1397
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1107
1398
|
}
|
|
1108
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1399
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1109
1400
|
}
|
|
1110
1401
|
// ( •_•)
|
|
1111
1402
|
// ( •_•)>⌐■-■
|
|
@@ -1135,44 +1426,40 @@ const then = (promise, thenFn) => {
|
|
|
1135
1426
|
};
|
|
1136
1427
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1137
1428
|
;
|
|
1138
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1139
|
-
// ensure this value is of the correct prop type
|
|
1140
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1141
|
-
if (propType & 4 /* Boolean */) {
|
|
1142
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1143
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1144
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1145
|
-
}
|
|
1146
|
-
if (propType & 2 /* Number */) {
|
|
1147
|
-
// force it to be a number
|
|
1148
|
-
return parseFloat(propValue);
|
|
1149
|
-
}
|
|
1150
|
-
if (propType & 1 /* String */) {
|
|
1151
|
-
// could have been passed as a number or boolean
|
|
1152
|
-
// but we still want it as a string
|
|
1153
|
-
return String(propValue);
|
|
1154
|
-
}
|
|
1155
|
-
// redundant return here for better minification
|
|
1156
|
-
return propValue;
|
|
1157
|
-
}
|
|
1158
|
-
// not sure exactly what type we want
|
|
1159
|
-
// so no need to change to a different type
|
|
1160
|
-
return propValue;
|
|
1161
|
-
};
|
|
1162
1429
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1163
1430
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1164
1431
|
// check our new property value against our internal value
|
|
1165
1432
|
const hostRef = getHostRef(ref);
|
|
1433
|
+
const elm = hostRef.$hostElement$ ;
|
|
1166
1434
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1167
1435
|
const flags = hostRef.$flags$;
|
|
1168
1436
|
const instance = hostRef.$lazyInstance$ ;
|
|
1169
1437
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1170
|
-
|
|
1438
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1439
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1440
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1441
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1171
1442
|
// gadzooks! the property's value has changed!!
|
|
1172
1443
|
// set our new value!
|
|
1173
1444
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1174
1445
|
if (instance) {
|
|
1175
|
-
|
|
1446
|
+
// get an array of method names of watch functions to call
|
|
1447
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1448
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1449
|
+
if (watchMethods) {
|
|
1450
|
+
// this instance is watching for when this property changed
|
|
1451
|
+
watchMethods.map((watchMethodName) => {
|
|
1452
|
+
try {
|
|
1453
|
+
// fire off each of the watch methods that are watching this property
|
|
1454
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1455
|
+
}
|
|
1456
|
+
catch (e) {
|
|
1457
|
+
consoleError(e, elm);
|
|
1458
|
+
}
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1176
1463
|
// looks like this value actually changed, so we've got work to do!
|
|
1177
1464
|
// but only if we've already rendered, otherwise just chill out
|
|
1178
1465
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1182,14 +1469,27 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1182
1469
|
}
|
|
1183
1470
|
}
|
|
1184
1471
|
};
|
|
1472
|
+
/**
|
|
1473
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1474
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1475
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1476
|
+
*
|
|
1477
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1478
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1479
|
+
* @param flags a number used to store a series of bit flags
|
|
1480
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1481
|
+
*/
|
|
1185
1482
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1186
1483
|
if (cmpMeta.$members$) {
|
|
1484
|
+
if (Cstr.watchers) {
|
|
1485
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1486
|
+
}
|
|
1187
1487
|
// It's better to have a const than two Object.entries()
|
|
1188
1488
|
const members = Object.entries(cmpMeta.$members$);
|
|
1189
1489
|
const prototype = Cstr.prototype;
|
|
1190
1490
|
members.map(([memberName, [memberFlags]]) => {
|
|
1191
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1192
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1491
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1492
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1193
1493
|
// proxyComponent - prop
|
|
1194
1494
|
Object.defineProperty(prototype, memberName, {
|
|
1195
1495
|
get() {
|
|
@@ -1204,8 +1504,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1204
1504
|
enumerable: true,
|
|
1205
1505
|
});
|
|
1206
1506
|
}
|
|
1207
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1208
|
-
memberFlags & 64 /* Method */) {
|
|
1507
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1508
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1209
1509
|
// proxyComponent - method
|
|
1210
1510
|
Object.defineProperty(prototype, memberName, {
|
|
1211
1511
|
value(...args) {
|
|
@@ -1215,19 +1515,19 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1215
1515
|
});
|
|
1216
1516
|
}
|
|
1217
1517
|
});
|
|
1218
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1518
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1219
1519
|
const attrNameToPropName = new Map();
|
|
1220
1520
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1221
1521
|
plt.jmp(() => {
|
|
1222
1522
|
const propName = attrNameToPropName.get(attrName);
|
|
1223
|
-
// In a
|
|
1523
|
+
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1224
1524
|
// in the case where an attribute was set inline.
|
|
1225
1525
|
// ```html
|
|
1226
1526
|
// <my-component some-attribute="some-value"></my-component>
|
|
1227
1527
|
// ```
|
|
1228
1528
|
//
|
|
1229
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1230
|
-
// changes it before it has been upgraded as shown below:
|
|
1529
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1530
|
+
// programmatically changes it before it has been upgraded as shown below:
|
|
1231
1531
|
//
|
|
1232
1532
|
// ```html
|
|
1233
1533
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1237,13 +1537,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1237
1537
|
// el = document.querySelector("#test");
|
|
1238
1538
|
// el.someAttribute = "another-value";
|
|
1239
1539
|
// // upgrade component
|
|
1240
|
-
//
|
|
1540
|
+
// customElements.define('my-component', MyComponent);
|
|
1241
1541
|
// </script>
|
|
1242
1542
|
// ```
|
|
1243
1543
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1244
1544
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1245
1545
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1246
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1546
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
|
|
1247
1547
|
//
|
|
1248
1548
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1249
1549
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1257,17 +1557,25 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1257
1557
|
newValue = this[propName];
|
|
1258
1558
|
delete this[propName];
|
|
1259
1559
|
}
|
|
1560
|
+
else if (prototype.hasOwnProperty(propName) &&
|
|
1561
|
+
typeof this[propName] === 'number' &&
|
|
1562
|
+
this[propName] == newValue) {
|
|
1563
|
+
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1564
|
+
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1565
|
+
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1566
|
+
return;
|
|
1567
|
+
}
|
|
1260
1568
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1261
1569
|
});
|
|
1262
1570
|
};
|
|
1263
1571
|
// create an array of attributes to observe
|
|
1264
1572
|
// and also create a map of html attribute name to js property name
|
|
1265
1573
|
Cstr.observedAttributes = members
|
|
1266
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1574
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1267
1575
|
.map(([propName, m]) => {
|
|
1268
1576
|
const attrName = m[1] || propName;
|
|
1269
1577
|
attrNameToPropName.set(attrName, propName);
|
|
1270
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1578
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1271
1579
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1272
1580
|
}
|
|
1273
1581
|
return attrName;
|
|
@@ -1278,10 +1586,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1278
1586
|
};
|
|
1279
1587
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1280
1588
|
// initializeComponent
|
|
1281
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1589
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1282
1590
|
{
|
|
1283
1591
|
// we haven't initialized this element yet
|
|
1284
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1592
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1285
1593
|
// lazy loaded components
|
|
1286
1594
|
// request the component's implementation to be
|
|
1287
1595
|
// wired up with the host element
|
|
@@ -1293,7 +1601,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1293
1601
|
endLoad();
|
|
1294
1602
|
}
|
|
1295
1603
|
if (!Cstr.isProxied) {
|
|
1296
|
-
|
|
1604
|
+
// we've never proxied this Constructor before
|
|
1605
|
+
// let's add the getters/setters to its prototype before
|
|
1606
|
+
// the first time we create an instance of the implementation
|
|
1607
|
+
{
|
|
1608
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1609
|
+
}
|
|
1610
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1297
1611
|
Cstr.isProxied = true;
|
|
1298
1612
|
}
|
|
1299
1613
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1301,7 +1615,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1301
1615
|
// but let's keep track of when we start and stop
|
|
1302
1616
|
// so that the getters/setters don't incorrectly step on data
|
|
1303
1617
|
{
|
|
1304
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1618
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1305
1619
|
}
|
|
1306
1620
|
// construct the lazy-loaded component implementation
|
|
1307
1621
|
// passing the hostRef is very important during
|
|
@@ -1314,7 +1628,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1314
1628
|
consoleError(e);
|
|
1315
1629
|
}
|
|
1316
1630
|
{
|
|
1317
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1631
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1632
|
+
}
|
|
1633
|
+
{
|
|
1634
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1318
1635
|
}
|
|
1319
1636
|
endNewInstance();
|
|
1320
1637
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1324,7 +1641,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1324
1641
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1325
1642
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1326
1643
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1327
|
-
// this is the
|
|
1644
|
+
// this is the initial load and this component it has an ancestor component
|
|
1328
1645
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1329
1646
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1330
1647
|
// this will get fired off when the ancestor component
|
|
@@ -1342,19 +1659,20 @@ const fireConnectedCallback = (instance) => {
|
|
|
1342
1659
|
}
|
|
1343
1660
|
};
|
|
1344
1661
|
const connectedCallback = (elm) => {
|
|
1345
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1662
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1346
1663
|
const hostRef = getHostRef(elm);
|
|
1347
1664
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1348
1665
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1349
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1666
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1350
1667
|
// first time this component has connected
|
|
1351
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1668
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1352
1669
|
{
|
|
1353
1670
|
// initUpdate
|
|
1354
1671
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1355
1672
|
// in here to act as original content anchors as we move nodes around
|
|
1356
1673
|
// host element has been connected to the DOM
|
|
1357
|
-
if ((
|
|
1674
|
+
if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
1675
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1358
1676
|
setContentReference(elm);
|
|
1359
1677
|
}
|
|
1360
1678
|
}
|
|
@@ -1377,7 +1695,7 @@ const connectedCallback = (elm) => {
|
|
|
1377
1695
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1378
1696
|
if (cmpMeta.$members$) {
|
|
1379
1697
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1380
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1698
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1381
1699
|
const value = elm[memberName];
|
|
1382
1700
|
delete elm[memberName];
|
|
1383
1701
|
elm[memberName] = value;
|
|
@@ -1411,7 +1729,7 @@ const setContentReference = (elm) => {
|
|
|
1411
1729
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1412
1730
|
};
|
|
1413
1731
|
const disconnectedCallback = (elm) => {
|
|
1414
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1732
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1415
1733
|
const hostRef = getHostRef(elm);
|
|
1416
1734
|
const instance = hostRef.$lazyInstance$ ;
|
|
1417
1735
|
{
|
|
@@ -1426,6 +1744,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1426
1744
|
}
|
|
1427
1745
|
};
|
|
1428
1746
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1747
|
+
var _a;
|
|
1429
1748
|
const endBootstrap = createTime();
|
|
1430
1749
|
const cmpTags = [];
|
|
1431
1750
|
const exclude = options.exclude || [];
|
|
@@ -1438,60 +1757,70 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1438
1757
|
let isBootstrapping = true;
|
|
1439
1758
|
Object.assign(plt, options);
|
|
1440
1759
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1441
|
-
lazyBundles.map((lazyBundle) =>
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
{
|
|
1452
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1453
|
-
}
|
|
1454
|
-
{
|
|
1455
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
1456
|
-
}
|
|
1457
|
-
const tagName = cmpMeta.$tagName$;
|
|
1458
|
-
const HostElement = class extends HTMLElement {
|
|
1459
|
-
// StencilLazyHost
|
|
1460
|
-
constructor(self) {
|
|
1461
|
-
// @ts-ignore
|
|
1462
|
-
super(self);
|
|
1463
|
-
self = this;
|
|
1464
|
-
registerHost(self, cmpMeta);
|
|
1760
|
+
lazyBundles.map((lazyBundle) => {
|
|
1761
|
+
lazyBundle[1].map((compactMeta) => {
|
|
1762
|
+
const cmpMeta = {
|
|
1763
|
+
$flags$: compactMeta[0],
|
|
1764
|
+
$tagName$: compactMeta[1],
|
|
1765
|
+
$members$: compactMeta[2],
|
|
1766
|
+
$listeners$: compactMeta[3],
|
|
1767
|
+
};
|
|
1768
|
+
{
|
|
1769
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1465
1770
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1771
|
+
{
|
|
1772
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1773
|
+
}
|
|
1774
|
+
{
|
|
1775
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1776
|
+
}
|
|
1777
|
+
{
|
|
1778
|
+
cmpMeta.$watchers$ = {};
|
|
1779
|
+
}
|
|
1780
|
+
const tagName = cmpMeta.$tagName$;
|
|
1781
|
+
const HostElement = class extends HTMLElement {
|
|
1782
|
+
// StencilLazyHost
|
|
1783
|
+
constructor(self) {
|
|
1784
|
+
// @ts-ignore
|
|
1785
|
+
super(self);
|
|
1786
|
+
self = this;
|
|
1787
|
+
registerHost(self, cmpMeta);
|
|
1788
|
+
}
|
|
1789
|
+
connectedCallback() {
|
|
1790
|
+
if (appLoadFallback) {
|
|
1791
|
+
clearTimeout(appLoadFallback);
|
|
1792
|
+
appLoadFallback = null;
|
|
1793
|
+
}
|
|
1794
|
+
if (isBootstrapping) {
|
|
1795
|
+
// connectedCallback will be processed once all components have been registered
|
|
1796
|
+
deferredConnectedCallbacks.push(this);
|
|
1797
|
+
}
|
|
1798
|
+
else {
|
|
1799
|
+
plt.jmp(() => connectedCallback(this));
|
|
1800
|
+
}
|
|
1470
1801
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
deferredConnectedCallbacks.push(this);
|
|
1802
|
+
disconnectedCallback() {
|
|
1803
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1474
1804
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1805
|
+
componentOnReady() {
|
|
1806
|
+
return getHostRef(this).$onReadyPromise$;
|
|
1477
1807
|
}
|
|
1808
|
+
};
|
|
1809
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1810
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1811
|
+
cmpTags.push(tagName);
|
|
1812
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1478
1813
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
}
|
|
1482
|
-
componentOnReady() {
|
|
1483
|
-
return getHostRef(this).$onReadyPromise$;
|
|
1484
|
-
}
|
|
1485
|
-
};
|
|
1486
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1487
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1488
|
-
cmpTags.push(tagName);
|
|
1489
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1490
|
-
}
|
|
1491
|
-
}));
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1492
1816
|
{
|
|
1493
1817
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1494
1818
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1819
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1820
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1821
|
+
if (nonce != null) {
|
|
1822
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1823
|
+
}
|
|
1495
1824
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1496
1825
|
}
|
|
1497
1826
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1508,7 +1837,48 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1508
1837
|
endBootstrap();
|
|
1509
1838
|
};
|
|
1510
1839
|
const Fragment = (_, children) => children;
|
|
1511
|
-
const
|
|
1840
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1841
|
+
if (listeners) {
|
|
1842
|
+
listeners.map(([flags, name, method]) => {
|
|
1843
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1844
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1845
|
+
const opts = hostListenerOpts(flags);
|
|
1846
|
+
plt.ael(target, name, handler, opts);
|
|
1847
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1852
|
+
try {
|
|
1853
|
+
{
|
|
1854
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1855
|
+
// instance is ready, let's call it's member method for this event
|
|
1856
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1857
|
+
}
|
|
1858
|
+
else {
|
|
1859
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
catch (e) {
|
|
1864
|
+
consoleError(e);
|
|
1865
|
+
}
|
|
1866
|
+
};
|
|
1867
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1868
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1869
|
+
return win;
|
|
1870
|
+
return elm;
|
|
1871
|
+
};
|
|
1872
|
+
// prettier-ignore
|
|
1873
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1874
|
+
/**
|
|
1875
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1876
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1877
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1878
|
+
* @returns void
|
|
1879
|
+
*/
|
|
1880
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1881
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1512
1882
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1513
1883
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1514
1884
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1540,7 +1910,82 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1540
1910
|
if (module) {
|
|
1541
1911
|
return module[exportName];
|
|
1542
1912
|
}
|
|
1913
|
+
|
|
1914
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1915
|
+
const processMod = importedModule => {
|
|
1916
|
+
cmpModules.set(bundleId, importedModule);
|
|
1917
|
+
return importedModule[exportName];
|
|
1918
|
+
}
|
|
1919
|
+
switch(bundleId) {
|
|
1920
|
+
|
|
1921
|
+
case 'xpl-avatar_12':
|
|
1922
|
+
return import(
|
|
1923
|
+
/* webpackMode: "lazy" */
|
|
1924
|
+
'./xpl-avatar_12.entry.js').then(processMod, consoleError);
|
|
1925
|
+
case 'xpl-application-shell':
|
|
1926
|
+
return import(
|
|
1927
|
+
/* webpackMode: "lazy" */
|
|
1928
|
+
'./xpl-application-shell.entry.js').then(processMod, consoleError);
|
|
1929
|
+
case 'xpl-button-row':
|
|
1930
|
+
return import(
|
|
1931
|
+
/* webpackMode: "lazy" */
|
|
1932
|
+
'./xpl-button-row.entry.js').then(processMod, consoleError);
|
|
1933
|
+
case 'xpl-choicelist':
|
|
1934
|
+
return import(
|
|
1935
|
+
/* webpackMode: "lazy" */
|
|
1936
|
+
'./xpl-choicelist.entry.js').then(processMod, consoleError);
|
|
1937
|
+
case 'xpl-divider':
|
|
1938
|
+
return import(
|
|
1939
|
+
/* webpackMode: "lazy" */
|
|
1940
|
+
'./xpl-divider.entry.js').then(processMod, consoleError);
|
|
1941
|
+
case 'xpl-grid':
|
|
1942
|
+
return import(
|
|
1943
|
+
/* webpackMode: "lazy" */
|
|
1944
|
+
'./xpl-grid.entry.js').then(processMod, consoleError);
|
|
1945
|
+
case 'xpl-grid-item':
|
|
1946
|
+
return import(
|
|
1947
|
+
/* webpackMode: "lazy" */
|
|
1948
|
+
'./xpl-grid-item.entry.js').then(processMod, consoleError);
|
|
1949
|
+
case 'xpl-input':
|
|
1950
|
+
return import(
|
|
1951
|
+
/* webpackMode: "lazy" */
|
|
1952
|
+
'./xpl-input.entry.js').then(processMod, consoleError);
|
|
1953
|
+
case 'xpl-list':
|
|
1954
|
+
return import(
|
|
1955
|
+
/* webpackMode: "lazy" */
|
|
1956
|
+
'./xpl-list.entry.js').then(processMod, consoleError);
|
|
1957
|
+
case 'xpl-main-nav':
|
|
1958
|
+
return import(
|
|
1959
|
+
/* webpackMode: "lazy" */
|
|
1960
|
+
'./xpl-main-nav.entry.js').then(processMod, consoleError);
|
|
1961
|
+
case 'xpl-pagination':
|
|
1962
|
+
return import(
|
|
1963
|
+
/* webpackMode: "lazy" */
|
|
1964
|
+
'./xpl-pagination.entry.js').then(processMod, consoleError);
|
|
1965
|
+
case 'xpl-select':
|
|
1966
|
+
return import(
|
|
1967
|
+
/* webpackMode: "lazy" */
|
|
1968
|
+
'./xpl-select.entry.js').then(processMod, consoleError);
|
|
1969
|
+
case 'xpl-toggle':
|
|
1970
|
+
return import(
|
|
1971
|
+
/* webpackMode: "lazy" */
|
|
1972
|
+
'./xpl-toggle.entry.js').then(processMod, consoleError);
|
|
1973
|
+
case 'xpl-backdrop':
|
|
1974
|
+
return import(
|
|
1975
|
+
/* webpackMode: "lazy" */
|
|
1976
|
+
'./xpl-backdrop.entry.js').then(processMod, consoleError);
|
|
1977
|
+
case 'xpl-dropdown_2':
|
|
1978
|
+
return import(
|
|
1979
|
+
/* webpackMode: "lazy" */
|
|
1980
|
+
'./xpl-dropdown_2.entry.js').then(processMod, consoleError);
|
|
1981
|
+
case 'xpl-dropdown-group_3':
|
|
1982
|
+
return import(
|
|
1983
|
+
/* webpackMode: "lazy" */
|
|
1984
|
+
'./xpl-dropdown-group_3.entry.js').then(processMod, consoleError);
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1543
1987
|
return import(
|
|
1988
|
+
/* @vite-ignore */
|
|
1544
1989
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1545
1990
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1546
1991
|
/* webpackMode: "lazy" */
|
|
@@ -1551,13 +1996,25 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1551
1996
|
return importedModule[exportName];
|
|
1552
1997
|
}, consoleError);
|
|
1553
1998
|
};
|
|
1999
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
2000
|
+
const doc = win.document || { head: {} };
|
|
2001
|
+
const plt = {
|
|
2002
|
+
$flags$: 0,
|
|
2003
|
+
$resourcesUrl$: '',
|
|
2004
|
+
jmp: (h) => h(),
|
|
2005
|
+
raf: (h) => requestAnimationFrame(h),
|
|
2006
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2007
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2008
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2009
|
+
};
|
|
2010
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
1554
2011
|
const queueDomReads = [];
|
|
1555
2012
|
const queueDomWrites = [];
|
|
1556
2013
|
const queueTask = (queue, write) => (cb) => {
|
|
1557
2014
|
queue.push(cb);
|
|
1558
2015
|
if (!queuePending) {
|
|
1559
2016
|
queuePending = true;
|
|
1560
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2017
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1561
2018
|
nextTick(flush);
|
|
1562
2019
|
}
|
|
1563
2020
|
else {
|
|
@@ -1594,4 +2051,6 @@ const flush = () => {
|
|
|
1594
2051
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1595
2052
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1596
2053
|
|
|
1597
|
-
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|
|
2054
|
+
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2055
|
+
|
|
2056
|
+
//# sourceMappingURL=index-df9b48b4.js.map
|