@xplortech/apollo-core 1.0.0-beta.17 → 1.0.0-beta.2
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/CHANGELOG.md +106 -0
- package/build/style.css +2758 -1516
- package/dist/apollo-core/apollo-core.css +14 -4597
- package/dist/apollo-core/apollo-core.esm.js +1 -2
- package/dist/apollo-core/index.esm.js +0 -2
- package/dist/apollo-core/p-09b2f746.entry.js +1 -0
- package/dist/apollo-core/p-1b1e7207.entry.js +1 -0
- package/dist/apollo-core/p-20389bb6.entry.js +1 -0
- package/dist/apollo-core/p-25983fde.entry.js +1 -0
- package/dist/apollo-core/p-2f90296c.js +10 -0
- package/dist/apollo-core/p-4a348764.entry.js +1 -0
- package/dist/apollo-core/p-4e2b69e8.entry.js +1 -0
- package/dist/apollo-core/p-84bf6b2d.entry.js +1 -0
- package/dist/apollo-core/p-880c0359.entry.js +1 -0
- package/dist/apollo-core/p-8e47a5be.entry.js +1 -0
- package/dist/apollo-core/p-93958292.entry.js +1 -0
- package/dist/apollo-core/p-93c27db5.entry.js +1 -0
- package/dist/apollo-core/p-ad90fe4d.js +1 -2
- package/dist/apollo-core/p-b2327e2c.entry.js +1 -0
- package/dist/apollo-core/p-c3a12469.entry.js +1 -0
- package/dist/apollo-core/p-c55b5d9c.entry.js +1 -0
- package/dist/apollo-core/p-e369d7af.entry.js +1 -0
- package/dist/apollo-core/p-e60ecaef.entry.js +1 -0
- package/dist/apollo-core/p-f929c958.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -12
- package/dist/cjs/{index-000e170c.js → index-54ba5804.js} +216 -768
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +3 -6
- package/dist/cjs/regular-872f5226.js +16043 -0
- package/dist/cjs/v4-14140ff3.js +0 -2
- package/dist/cjs/xpl-application-shell.cjs.entry.js +13 -10
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +299 -0
- package/dist/cjs/xpl-backdrop.cjs.entry.js +5 -3
- package/dist/cjs/xpl-button-row.cjs.entry.js +1 -6
- package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -10
- package/dist/cjs/xpl-divider.cjs.entry.js +1 -4
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +4 -16
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +12 -14
- package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -3
- package/dist/cjs/xpl-grid.cjs.entry.js +1 -3
- package/dist/cjs/xpl-input.cjs.entry.js +25 -22
- package/dist/cjs/xpl-list.cjs.entry.js +25 -4
- package/dist/cjs/xpl-main-nav.cjs.entry.js +4 -3
- package/dist/cjs/xpl-pagination.cjs.entry.js +2 -7
- package/dist/cjs/xpl-select.cjs.entry.js +25 -43
- package/dist/cjs/xpl-toggle.cjs.entry.js +4 -9
- package/dist/collection/collection-manifest.json +3 -6
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +109 -125
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +144 -151
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +28 -27
- package/dist/collection/components/xpl-badge/xpl-badge.js +39 -44
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +5 -3
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +5 -3
- package/dist/collection/components/xpl-button/xpl-button.js +188 -228
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +104 -106
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +171 -182
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +126 -134
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +31 -28
- package/dist/collection/components/xpl-divider/xpl-divider.js +23 -27
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +41 -47
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +22 -27
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +55 -83
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +161 -169
- package/dist/collection/components/xpl-grid/xpl-grid.js +1 -2
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +74 -76
- package/dist/collection/components/xpl-input/xpl-input.js +419 -397
- package/dist/collection/components/xpl-list/xpl-list.js +77 -43
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +54 -48
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +49 -48
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +128 -117
- package/dist/collection/components/xpl-radio/xpl-radio.js +148 -158
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +4 -3
- package/dist/collection/components/xpl-select/xpl-select.js +235 -296
- package/dist/collection/components/xpl-table/xpl-table.js +148 -215
- package/dist/collection/components/xpl-tag/xpl-tag.js +25 -25
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +135 -138
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +52 -79
- package/dist/custom-elements/index.d.ts +219 -0
- package/dist/custom-elements/index.js +20201 -0
- package/dist/esm/apollo-core.js +3 -9
- package/dist/esm/{index-56581b5c.js → index-3df6db84.js} +217 -768
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +3 -6
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/regular-86225e9d.js +16041 -0
- package/dist/esm/v4-929670b7.js +0 -2
- package/dist/esm/xpl-application-shell.entry.js +13 -10
- package/dist/esm/xpl-avatar_12.entry.js +284 -0
- package/dist/esm/xpl-backdrop.entry.js +5 -3
- package/dist/esm/xpl-button-row.entry.js +1 -6
- package/dist/esm/xpl-choicelist.entry.js +1 -10
- package/dist/esm/xpl-divider.entry.js +1 -4
- package/dist/esm/xpl-dropdown-group_3.entry.js +4 -16
- package/dist/esm/xpl-dropdown_2.entry.js +12 -14
- package/dist/esm/xpl-grid-item.entry.js +1 -3
- package/dist/esm/xpl-grid.entry.js +1 -3
- package/dist/esm/xpl-input.entry.js +25 -22
- package/dist/esm/xpl-list.entry.js +25 -4
- package/dist/esm/xpl-main-nav.entry.js +4 -3
- package/dist/esm/xpl-pagination.entry.js +2 -7
- package/dist/esm/xpl-select.entry.js +25 -43
- package/dist/esm/xpl-toggle.entry.js +4 -9
- package/dist/stories/application-shell.stories.js +8 -18
- package/dist/stories/avatar.stories.js +0 -1
- package/dist/stories/backdrop.stories.js +0 -1
- package/dist/stories/badge.stories.js +0 -1
- package/dist/stories/breadcrumbs.stories.js +0 -1
- package/dist/stories/button-row.stories.js +0 -1
- package/dist/stories/button.stories.js +5 -18
- package/dist/stories/checkbox.stories.js +0 -1
- package/dist/stories/choicelist.stories.js +0 -1
- package/dist/stories/content-area.stories.js +0 -1
- package/dist/stories/divider.stories.js +0 -1
- package/dist/stories/dropdown.stories.js +65 -74
- package/dist/stories/grid.stories.js +0 -1
- package/dist/stories/input.stories.js +0 -1
- package/dist/stories/list.stories.js +2 -3
- package/dist/stories/main-nav.stories.js +0 -1
- package/dist/stories/pagination.stories.js +0 -1
- package/dist/stories/radio.stories.js +0 -1
- package/dist/stories/secondary-nav.stories.js +0 -1
- package/dist/stories/select.stories.js +32 -109
- package/dist/stories/table.stories.js +7 -24
- package/dist/stories/tabs.stories.js +0 -1
- package/dist/stories/toggle.stories.js +0 -1
- package/dist/stories/utility-bar.stories.js +6 -2
- package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/application-shell.stories.d.ts +5 -14
- package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/button.stories.d.ts +2 -10
- package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/dropdown.stories.d.ts +1 -17
- package/dist/types/Users/fernandogelin/Projects/apollo-admin/packages/apollo/.stencil/stories/select.stories.d.ts +74 -0
- package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/table.stories.d.ts +1 -22
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +1 -6
- package/dist/types/components/xpl-button/xpl-button.d.ts +0 -6
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -2
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +0 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +1 -7
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +5 -7
- package/dist/types/components/xpl-input/xpl-input.d.ts +2 -0
- package/dist/types/components/xpl-list/xpl-list.d.ts +3 -2
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -16
- package/dist/types/components/xpl-table/xpl-table.d.ts +7 -29
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +1 -5
- package/dist/types/components.d.ts +21 -276
- package/dist/types/stencil-public-runtime.d.ts +23 -97
- package/loader/index.d.ts +1 -9
- package/loader/package.json +0 -1
- package/package.json +28 -21
- package/LICENSE +0 -21
- package/dist/apollo-core/apollo-core.esm.js.map +0 -1
- package/dist/apollo-core/index.esm.js.map +0 -1
- package/dist/apollo-core/p-1fa46bc3.entry.js +0 -2
- package/dist/apollo-core/p-1fa46bc3.entry.js.map +0 -1
- package/dist/apollo-core/p-29f4679d.entry.js +0 -2
- package/dist/apollo-core/p-29f4679d.entry.js.map +0 -1
- package/dist/apollo-core/p-3f3cc34e.entry.js +0 -2
- package/dist/apollo-core/p-3f3cc34e.entry.js.map +0 -1
- package/dist/apollo-core/p-5372bf3e.entry.js +0 -2
- package/dist/apollo-core/p-5372bf3e.entry.js.map +0 -1
- package/dist/apollo-core/p-5ceaec87.entry.js +0 -2
- package/dist/apollo-core/p-5ceaec87.entry.js.map +0 -1
- package/dist/apollo-core/p-60d4d252.entry.js +0 -2
- package/dist/apollo-core/p-60d4d252.entry.js.map +0 -1
- package/dist/apollo-core/p-6797b2b7.entry.js +0 -7
- package/dist/apollo-core/p-6797b2b7.entry.js.map +0 -1
- package/dist/apollo-core/p-6acc4122.entry.js +0 -2
- package/dist/apollo-core/p-6acc4122.entry.js.map +0 -1
- package/dist/apollo-core/p-787bac91.entry.js +0 -2
- package/dist/apollo-core/p-787bac91.entry.js.map +0 -1
- package/dist/apollo-core/p-7a8e818a.entry.js +0 -2
- package/dist/apollo-core/p-7a8e818a.entry.js.map +0 -1
- package/dist/apollo-core/p-807d8de9.entry.js +0 -2
- package/dist/apollo-core/p-807d8de9.entry.js.map +0 -1
- package/dist/apollo-core/p-ad90fe4d.js.map +0 -1
- package/dist/apollo-core/p-bcb81e30.entry.js +0 -2
- package/dist/apollo-core/p-bcb81e30.entry.js.map +0 -1
- package/dist/apollo-core/p-db29ebe0.entry.js +0 -2
- package/dist/apollo-core/p-db29ebe0.entry.js.map +0 -1
- package/dist/apollo-core/p-e0541e23.entry.js +0 -2
- package/dist/apollo-core/p-e0541e23.entry.js.map +0 -1
- package/dist/apollo-core/p-e215fc5f.entry.js +0 -2
- package/dist/apollo-core/p-e215fc5f.entry.js.map +0 -1
- package/dist/apollo-core/p-e8953b60.js +0 -3
- package/dist/apollo-core/p-e8953b60.js.map +0 -1
- package/dist/apollo-core/p-efa8a79d.entry.js +0 -2
- package/dist/apollo-core/p-efa8a79d.entry.js.map +0 -1
- package/dist/cjs/apollo-core.cjs.js.map +0 -1
- package/dist/cjs/index-000e170c.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/v4-14140ff3.js.map +0 -1
- package/dist/cjs/xpl-application-shell.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-avatar_15.cjs.entry.js +0 -2278
- package/dist/cjs/xpl-avatar_15.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-backdrop.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-button-row.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-choicelist.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-divider.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-grid-item.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-grid.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-input.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-list.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-main-nav.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-select.cjs.entry.js.map +0 -1
- package/dist/cjs/xpl-toggle.cjs.entry.js.map +0 -1
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js.map +0 -1
- package/dist/collection/components/xpl-avatar/xpl-avatar.js.map +0 -1
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js.map +0 -1
- package/dist/collection/components/xpl-badge/xpl-badge.js.map +0 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js.map +0 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js.map +0 -1
- package/dist/collection/components/xpl-button/xpl-button.js.map +0 -1
- package/dist/collection/components/xpl-button-row/xpl-button-row.js.map +0 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js.map +0 -1
- package/dist/collection/components/xpl-choicelist/choice.js +0 -2
- package/dist/collection/components/xpl-choicelist/choice.js.map +0 -1
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js.map +0 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js.map +0 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +0 -8
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js.map +0 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +0 -162
- package/dist/collection/components/xpl-data-card/xpl-data-card.js.map +0 -1
- package/dist/collection/components/xpl-divider/xpl-divider.js.map +0 -1
- package/dist/collection/components/xpl-dropdown/dropdownoption.js +0 -2
- package/dist/collection/components/xpl-dropdown/dropdownoption.js.map +0 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js.map +0 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js.map +0 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js.map +0 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js.map +0 -1
- package/dist/collection/components/xpl-grid/xpl-grid.js.map +0 -1
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js.map +0 -1
- package/dist/collection/components/xpl-icon/xpl-icon.css +0 -5
- package/dist/collection/components/xpl-icon/xpl-icon.js +0 -93
- package/dist/collection/components/xpl-icon/xpl-icon.js.map +0 -1
- package/dist/collection/components/xpl-input/xpl-input.js.map +0 -1
- package/dist/collection/components/xpl-list/listitem.js +0 -2
- package/dist/collection/components/xpl-list/listitem.js.map +0 -1
- package/dist/collection/components/xpl-list/xpl-list.js.map +0 -1
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js.map +0 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js.map +0 -1
- package/dist/collection/components/xpl-pagination/xpl-pagination.js.map +0 -1
- package/dist/collection/components/xpl-radio/xpl-radio.js.map +0 -1
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js.map +0 -1
- package/dist/collection/components/xpl-select/xpl-select.js.map +0 -1
- package/dist/collection/components/xpl-table/xpl-table.js.map +0 -1
- package/dist/collection/components/xpl-tag/xpl-tag.js.map +0 -1
- package/dist/collection/components/xpl-toggle/xpl-toggle.js.map +0 -1
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js.map +0 -1
- package/dist/components/index.d.ts +0 -39
- package/dist/components/index.js +0 -82
- package/dist/components/index.js.map +0 -1
- package/dist/components/v4.js +0 -77
- package/dist/components/v4.js.map +0 -1
- package/dist/components/xpl-application-shell.d.ts +0 -11
- package/dist/components/xpl-application-shell.js +0 -80
- package/dist/components/xpl-application-shell.js.map +0 -1
- package/dist/components/xpl-avatar.d.ts +0 -11
- package/dist/components/xpl-avatar.js +0 -8
- package/dist/components/xpl-avatar.js.map +0 -1
- package/dist/components/xpl-avatar2.js +0 -51
- package/dist/components/xpl-avatar2.js.map +0 -1
- package/dist/components/xpl-backdrop.d.ts +0 -11
- package/dist/components/xpl-backdrop.js +0 -8
- package/dist/components/xpl-backdrop.js.map +0 -1
- package/dist/components/xpl-backdrop2.js +0 -35
- package/dist/components/xpl-backdrop2.js.map +0 -1
- package/dist/components/xpl-badge.d.ts +0 -11
- package/dist/components/xpl-badge.js +0 -8
- package/dist/components/xpl-badge.js.map +0 -1
- package/dist/components/xpl-badge2.js +0 -38
- package/dist/components/xpl-badge2.js.map +0 -1
- package/dist/components/xpl-breadcrumb-item.d.ts +0 -11
- package/dist/components/xpl-breadcrumb-item.js +0 -36
- package/dist/components/xpl-breadcrumb-item.js.map +0 -1
- package/dist/components/xpl-breadcrumbs.d.ts +0 -11
- package/dist/components/xpl-breadcrumbs.js +0 -31
- package/dist/components/xpl-breadcrumbs.js.map +0 -1
- package/dist/components/xpl-button-row.d.ts +0 -11
- package/dist/components/xpl-button-row.js +0 -50
- package/dist/components/xpl-button-row.js.map +0 -1
- package/dist/components/xpl-button.d.ts +0 -11
- package/dist/components/xpl-button.js +0 -8
- package/dist/components/xpl-button.js.map +0 -1
- package/dist/components/xpl-button2.js +0 -85
- package/dist/components/xpl-button2.js.map +0 -1
- package/dist/components/xpl-checkbox.d.ts +0 -11
- package/dist/components/xpl-checkbox.js +0 -8
- package/dist/components/xpl-checkbox.js.map +0 -1
- package/dist/components/xpl-checkbox2.js +0 -59
- package/dist/components/xpl-checkbox2.js.map +0 -1
- package/dist/components/xpl-choicelist.d.ts +0 -11
- package/dist/components/xpl-choicelist.js +0 -85
- package/dist/components/xpl-choicelist.js.map +0 -1
- package/dist/components/xpl-content-area.d.ts +0 -11
- package/dist/components/xpl-content-area.js +0 -34
- package/dist/components/xpl-content-area.js.map +0 -1
- package/dist/components/xpl-dashboard.d.ts +0 -11
- package/dist/components/xpl-dashboard.js +0 -31
- package/dist/components/xpl-dashboard.js.map +0 -1
- package/dist/components/xpl-data-card.d.ts +0 -11
- package/dist/components/xpl-data-card.js +0 -80
- package/dist/components/xpl-data-card.js.map +0 -1
- package/dist/components/xpl-divider.d.ts +0 -11
- package/dist/components/xpl-divider.js +0 -36
- package/dist/components/xpl-divider.js.map +0 -1
- package/dist/components/xpl-dropdown-group.d.ts +0 -11
- package/dist/components/xpl-dropdown-group.js +0 -8
- package/dist/components/xpl-dropdown-group.js.map +0 -1
- package/dist/components/xpl-dropdown-group2.js +0 -69
- package/dist/components/xpl-dropdown-group2.js.map +0 -1
- package/dist/components/xpl-dropdown-heading.d.ts +0 -11
- package/dist/components/xpl-dropdown-heading.js +0 -8
- package/dist/components/xpl-dropdown-heading.js.map +0 -1
- package/dist/components/xpl-dropdown-heading2.js +0 -31
- package/dist/components/xpl-dropdown-heading2.js.map +0 -1
- package/dist/components/xpl-dropdown-option.d.ts +0 -11
- package/dist/components/xpl-dropdown-option.js +0 -8
- package/dist/components/xpl-dropdown-option.js.map +0 -1
- package/dist/components/xpl-dropdown-option2.js +0 -89
- package/dist/components/xpl-dropdown-option2.js.map +0 -1
- package/dist/components/xpl-dropdown.d.ts +0 -11
- package/dist/components/xpl-dropdown.js +0 -8
- package/dist/components/xpl-dropdown.js.map +0 -1
- package/dist/components/xpl-dropdown2.js +0 -147
- package/dist/components/xpl-dropdown2.js.map +0 -1
- package/dist/components/xpl-grid-item.d.ts +0 -11
- package/dist/components/xpl-grid-item.js +0 -45
- package/dist/components/xpl-grid-item.js.map +0 -1
- package/dist/components/xpl-grid.d.ts +0 -11
- package/dist/components/xpl-grid.js +0 -50
- package/dist/components/xpl-grid.js.map +0 -1
- package/dist/components/xpl-icon.d.ts +0 -11
- package/dist/components/xpl-icon.js +0 -8
- package/dist/components/xpl-icon.js.map +0 -1
- package/dist/components/xpl-icon2.js +0 -1850
- package/dist/components/xpl-icon2.js.map +0 -1
- package/dist/components/xpl-input.d.ts +0 -11
- package/dist/components/xpl-input.js +0 -2574
- package/dist/components/xpl-input.js.map +0 -1
- package/dist/components/xpl-list.d.ts +0 -11
- package/dist/components/xpl-list.js +0 -73
- package/dist/components/xpl-list.js.map +0 -1
- package/dist/components/xpl-main-nav.d.ts +0 -11
- package/dist/components/xpl-main-nav.js +0 -44
- package/dist/components/xpl-main-nav.js.map +0 -1
- package/dist/components/xpl-nav-item.d.ts +0 -11
- package/dist/components/xpl-nav-item.js +0 -44
- package/dist/components/xpl-nav-item.js.map +0 -1
- package/dist/components/xpl-pagination.d.ts +0 -11
- package/dist/components/xpl-pagination.js +0 -100
- package/dist/components/xpl-pagination.js.map +0 -1
- package/dist/components/xpl-radio.d.ts +0 -11
- package/dist/components/xpl-radio.js +0 -8
- package/dist/components/xpl-radio.js.map +0 -1
- package/dist/components/xpl-radio2.js +0 -57
- package/dist/components/xpl-radio2.js.map +0 -1
- package/dist/components/xpl-secondary-nav.d.ts +0 -11
- package/dist/components/xpl-secondary-nav.js +0 -31
- package/dist/components/xpl-secondary-nav.js.map +0 -1
- package/dist/components/xpl-select.d.ts +0 -11
- package/dist/components/xpl-select.js +0 -704
- package/dist/components/xpl-select.js.map +0 -1
- package/dist/components/xpl-table.d.ts +0 -11
- package/dist/components/xpl-table.js +0 -170
- package/dist/components/xpl-table.js.map +0 -1
- package/dist/components/xpl-tag.d.ts +0 -11
- package/dist/components/xpl-tag.js +0 -8
- package/dist/components/xpl-tag.js.map +0 -1
- package/dist/components/xpl-tag2.js +0 -33
- package/dist/components/xpl-tag2.js.map +0 -1
- package/dist/components/xpl-toggle.d.ts +0 -11
- package/dist/components/xpl-toggle.js +0 -61
- package/dist/components/xpl-toggle.js.map +0 -1
- package/dist/components/xpl-utility-bar.d.ts +0 -11
- package/dist/components/xpl-utility-bar.js +0 -55
- package/dist/components/xpl-utility-bar.js.map +0 -1
- package/dist/esm/apollo-core.js.map +0 -1
- package/dist/esm/index-56581b5c.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/v4-929670b7.js.map +0 -1
- package/dist/esm/xpl-application-shell.entry.js.map +0 -1
- package/dist/esm/xpl-avatar_15.entry.js +0 -2260
- package/dist/esm/xpl-avatar_15.entry.js.map +0 -1
- package/dist/esm/xpl-backdrop.entry.js.map +0 -1
- package/dist/esm/xpl-button-row.entry.js.map +0 -1
- package/dist/esm/xpl-choicelist.entry.js.map +0 -1
- package/dist/esm/xpl-divider.entry.js.map +0 -1
- package/dist/esm/xpl-dropdown-group_3.entry.js.map +0 -1
- package/dist/esm/xpl-dropdown_2.entry.js.map +0 -1
- package/dist/esm/xpl-grid-item.entry.js.map +0 -1
- package/dist/esm/xpl-grid.entry.js.map +0 -1
- package/dist/esm/xpl-input.entry.js.map +0 -1
- package/dist/esm/xpl-list.entry.js.map +0 -1
- package/dist/esm/xpl-main-nav.entry.js.map +0 -1
- package/dist/esm/xpl-pagination.entry.js.map +0 -1
- package/dist/esm/xpl-select.entry.js.map +0 -1
- package/dist/esm/xpl-toggle.entry.js.map +0 -1
- package/dist/stories/application-shell.stories.js.map +0 -1
- package/dist/stories/avatar.stories.js.map +0 -1
- package/dist/stories/backdrop.stories.js.map +0 -1
- package/dist/stories/badge.stories.js.map +0 -1
- package/dist/stories/breadcrumbs.stories.js.map +0 -1
- package/dist/stories/button-row.stories.js.map +0 -1
- package/dist/stories/button.stories.js.map +0 -1
- package/dist/stories/checkbox.stories.js.map +0 -1
- package/dist/stories/choicelist.stories.js.map +0 -1
- package/dist/stories/content-area.stories.js.map +0 -1
- package/dist/stories/dashboard.stories.js +0 -51
- package/dist/stories/dashboard.stories.js.map +0 -1
- package/dist/stories/data-card.stories.js +0 -70
- package/dist/stories/data-card.stories.js.map +0 -1
- package/dist/stories/divider.stories.js.map +0 -1
- package/dist/stories/dropdown.stories.js.map +0 -1
- package/dist/stories/grid.stories.js.map +0 -1
- package/dist/stories/icons.stories.js +0 -69
- package/dist/stories/icons.stories.js.map +0 -1
- package/dist/stories/input.stories.js.map +0 -1
- package/dist/stories/list.stories.js.map +0 -1
- package/dist/stories/main-nav.stories.js.map +0 -1
- package/dist/stories/pagination.stories.js.map +0 -1
- package/dist/stories/radio.stories.js.map +0 -1
- package/dist/stories/secondary-nav.stories.js.map +0 -1
- package/dist/stories/select.stories.js.map +0 -1
- package/dist/stories/table.stories.js.map +0 -1
- package/dist/stories/tabs.stories.js.map +0 -1
- package/dist/stories/toggle.stories.js.map +0 -1
- package/dist/stories/utility-bar.stories.js.map +0 -1
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/dashboard.stories.d.ts +0 -31
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/data-card.stories.d.ts +0 -71
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/icons.stories.d.ts +0 -77
- package/dist/types/Users/roc/Sites/apollo/.stencil/stories/select.stories.d.ts +0 -134
- package/dist/types/components/xpl-choicelist/choice.d.ts +0 -6
- package/dist/types/components/xpl-dashboard/xpl-dashboard.d.ts +0 -3
- package/dist/types/components/xpl-data-card/xpl-data-card.d.ts +0 -38
- package/dist/types/components/xpl-dropdown/dropdownoption.d.ts +0 -11
- package/dist/types/components/xpl-icon/xpl-icon.d.ts +0 -17
- package/dist/types/components/xpl-list/listitem.d.ts +0 -16
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/backdrop.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/button-row.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/checkbox.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/choicelist.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/content-area.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/divider.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/grid.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/input.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/list.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/main-nav.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/radio.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/toggle.stories.d.ts +0 -0
- /package/dist/types/Users/{roc/Sites → fernandogelin/Projects/apollo-admin/packages}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
|
@@ -22,14 +22,6 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'apollo-core';
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
-
* Simon Friis Vindum (@paldepind)
|
|
28
|
-
* Licensed under the MIT License
|
|
29
|
-
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
-
*
|
|
31
|
-
* Modified for Stencil's renderer and slot projection
|
|
32
|
-
*/
|
|
33
25
|
let contentRef;
|
|
34
26
|
let hostTagName;
|
|
35
27
|
let useNativeShadowDom = false;
|
|
@@ -37,6 +29,54 @@ let checkSlotFallbackVisibility = false;
|
|
|
37
29
|
let checkSlotRelocate = false;
|
|
38
30
|
let isSvgMode = false;
|
|
39
31
|
let queuePending = false;
|
|
32
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
33
|
+
const doc = win.document || { head: {} };
|
|
34
|
+
const plt = {
|
|
35
|
+
$flags$: 0,
|
|
36
|
+
$resourcesUrl$: '',
|
|
37
|
+
jmp: (h) => h(),
|
|
38
|
+
raf: (h) => requestAnimationFrame(h),
|
|
39
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
40
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
41
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
42
|
+
};
|
|
43
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
44
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
45
|
+
if (listeners) {
|
|
46
|
+
listeners.map(([flags, name, method]) => {
|
|
47
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
48
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
49
|
+
const opts = hostListenerOpts(flags);
|
|
50
|
+
plt.ael(target, name, handler, opts);
|
|
51
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
56
|
+
try {
|
|
57
|
+
{
|
|
58
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
59
|
+
// instance is ready, let's call it's member method for this event
|
|
60
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
consoleError(e);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
72
|
+
if (flags & 8 /* TargetWindow */)
|
|
73
|
+
return win;
|
|
74
|
+
return elm;
|
|
75
|
+
};
|
|
76
|
+
// prettier-ignore
|
|
77
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
78
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
79
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
40
80
|
const createTime = (fnName, tagName = '') => {
|
|
41
81
|
{
|
|
42
82
|
return () => {
|
|
@@ -51,8 +91,6 @@ const uniqueTime = (key, measureText) => {
|
|
|
51
91
|
};
|
|
52
92
|
}
|
|
53
93
|
};
|
|
54
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
55
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
56
94
|
/**
|
|
57
95
|
* Default style mode id
|
|
58
96
|
*/
|
|
@@ -66,30 +104,11 @@ const EMPTY_OBJ = {};
|
|
|
66
104
|
*/
|
|
67
105
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
68
106
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
69
|
-
/**
|
|
70
|
-
* Check whether a value is a 'complex type', defined here as an object or a
|
|
71
|
-
* function.
|
|
72
|
-
*
|
|
73
|
-
* @param o the value to check
|
|
74
|
-
* @returns whether it's a complex type or not
|
|
75
|
-
*/
|
|
76
107
|
const isComplexType = (o) => {
|
|
77
108
|
// https://jsperf.com/typeof-fn-object/5
|
|
78
109
|
o = typeof o;
|
|
79
110
|
return o === 'object' || o === 'function';
|
|
80
111
|
};
|
|
81
|
-
/**
|
|
82
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
|
83
|
-
* out of a DOM's head.
|
|
84
|
-
*
|
|
85
|
-
* @param doc The DOM containing the `head` to query against
|
|
86
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
87
|
-
* exists or the tag has no content.
|
|
88
|
-
*/
|
|
89
|
-
function queryNonceMetaTagContent(doc) {
|
|
90
|
-
var _a, _b, _c;
|
|
91
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
92
|
-
}
|
|
93
112
|
/**
|
|
94
113
|
* Production h() function based on Preact by
|
|
95
114
|
* Jason Miller (@developit)
|
|
@@ -98,6 +117,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
98
117
|
*
|
|
99
118
|
* Modified for Stencil's compiler and vdom
|
|
100
119
|
*/
|
|
120
|
+
// const stack: any[] = [];
|
|
101
121
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
102
122
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
103
123
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -106,7 +126,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
106
126
|
let slotName = null;
|
|
107
127
|
let simple = false;
|
|
108
128
|
let lastSimple = false;
|
|
109
|
-
|
|
129
|
+
let vNodeChildren = [];
|
|
110
130
|
const walk = (c) => {
|
|
111
131
|
for (let i = 0; i < c.length; i++) {
|
|
112
132
|
child = c[i];
|
|
@@ -167,14 +187,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
167
187
|
}
|
|
168
188
|
return vnode;
|
|
169
189
|
};
|
|
170
|
-
/**
|
|
171
|
-
* A utility function for creating a virtual DOM node from a tag and some
|
|
172
|
-
* possible text content.
|
|
173
|
-
*
|
|
174
|
-
* @param tag the tag for this element
|
|
175
|
-
* @param text possible text content for the node
|
|
176
|
-
* @returns a newly-minted virtual DOM node
|
|
177
|
-
*/
|
|
178
190
|
const newVNode = (tag, text) => {
|
|
179
191
|
const vnode = {
|
|
180
192
|
$flags$: 0,
|
|
@@ -195,31 +207,11 @@ const newVNode = (tag, text) => {
|
|
|
195
207
|
return vnode;
|
|
196
208
|
};
|
|
197
209
|
const Host = {};
|
|
198
|
-
/**
|
|
199
|
-
* Check whether a given node is a Host node or not
|
|
200
|
-
*
|
|
201
|
-
* @param node the virtual DOM node to check
|
|
202
|
-
* @returns whether it's a Host node or not
|
|
203
|
-
*/
|
|
204
210
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
205
|
-
/**
|
|
206
|
-
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
207
|
-
*
|
|
208
|
-
* Note that these functions convert from {@link d.VNode} to
|
|
209
|
-
* {@link d.ChildNode} to give functional component developers a friendly
|
|
210
|
-
* interface.
|
|
211
|
-
*/
|
|
212
211
|
const vdomFnUtils = {
|
|
213
212
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
214
213
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
215
214
|
};
|
|
216
|
-
/**
|
|
217
|
-
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
218
|
-
* friendlier public interface (hence, 'convertToPublic').
|
|
219
|
-
*
|
|
220
|
-
* @param node the virtual DOM node to convert
|
|
221
|
-
* @returns a converted child node
|
|
222
|
-
*/
|
|
223
215
|
const convertToPublic = (node) => ({
|
|
224
216
|
vattrs: node.$attrs$,
|
|
225
217
|
vchildren: node.$children$,
|
|
@@ -228,15 +220,6 @@ const convertToPublic = (node) => ({
|
|
|
228
220
|
vtag: node.$tag$,
|
|
229
221
|
vtext: node.$text$,
|
|
230
222
|
});
|
|
231
|
-
/**
|
|
232
|
-
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
233
|
-
* order to use the resulting object in the virtual DOM. The initial object was
|
|
234
|
-
* likely created as part of presenting a public API, so converting it back
|
|
235
|
-
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
236
|
-
*
|
|
237
|
-
* @param node the child node to convert
|
|
238
|
-
* @returns a converted virtual DOM node
|
|
239
|
-
*/
|
|
240
223
|
const convertToPrivate = (node) => {
|
|
241
224
|
if (typeof node.vtag === 'function') {
|
|
242
225
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -255,144 +238,6 @@ const convertToPrivate = (node) => {
|
|
|
255
238
|
vnode.$name$ = node.vname;
|
|
256
239
|
return vnode;
|
|
257
240
|
};
|
|
258
|
-
/**
|
|
259
|
-
* Parse a new property value for a given property type.
|
|
260
|
-
*
|
|
261
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
262
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
263
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
264
|
-
* 2. the type stored from `propType`.
|
|
265
|
-
*
|
|
266
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
267
|
-
*
|
|
268
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
269
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
270
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
271
|
-
* ```tsx
|
|
272
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
273
|
-
* ```
|
|
274
|
-
*
|
|
275
|
-
* HTML prop values on the other hand, will always a string
|
|
276
|
-
*
|
|
277
|
-
* @param propValue the new value to coerce to some type
|
|
278
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
279
|
-
* @returns the parsed/coerced value
|
|
280
|
-
*/
|
|
281
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
282
|
-
// ensure this value is of the correct prop type
|
|
283
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
284
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
285
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
286
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
287
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
288
|
-
}
|
|
289
|
-
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
290
|
-
// force it to be a number
|
|
291
|
-
return parseFloat(propValue);
|
|
292
|
-
}
|
|
293
|
-
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
294
|
-
// could have been passed as a number or boolean
|
|
295
|
-
// but we still want it as a string
|
|
296
|
-
return String(propValue);
|
|
297
|
-
}
|
|
298
|
-
// redundant return here for better minification
|
|
299
|
-
return propValue;
|
|
300
|
-
}
|
|
301
|
-
// not sure exactly what type we want
|
|
302
|
-
// so no need to change to a different type
|
|
303
|
-
return propValue;
|
|
304
|
-
};
|
|
305
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
306
|
-
const createEvent = (ref, name, flags) => {
|
|
307
|
-
const elm = getElement(ref);
|
|
308
|
-
return {
|
|
309
|
-
emit: (detail) => {
|
|
310
|
-
return emitEvent(elm, name, {
|
|
311
|
-
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
312
|
-
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
313
|
-
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
314
|
-
detail,
|
|
315
|
-
});
|
|
316
|
-
},
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
321
|
-
* @param elm the target of the Event
|
|
322
|
-
* @param name the name to give the custom Event
|
|
323
|
-
* @param opts options for configuring a custom Event
|
|
324
|
-
* @returns the custom Event
|
|
325
|
-
*/
|
|
326
|
-
const emitEvent = (elm, name, opts) => {
|
|
327
|
-
const ev = plt.ce(name, opts);
|
|
328
|
-
elm.dispatchEvent(ev);
|
|
329
|
-
return ev;
|
|
330
|
-
};
|
|
331
|
-
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
332
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
333
|
-
let style = styles.get(scopeId);
|
|
334
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
335
|
-
style = (style || new CSSStyleSheet());
|
|
336
|
-
if (typeof style === 'string') {
|
|
337
|
-
style = cssText;
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
style.replaceSync(cssText);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
style = cssText;
|
|
345
|
-
}
|
|
346
|
-
styles.set(scopeId, style);
|
|
347
|
-
};
|
|
348
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
349
|
-
var _a;
|
|
350
|
-
let scopeId = getScopeId(cmpMeta);
|
|
351
|
-
const style = styles.get(scopeId);
|
|
352
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
353
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
354
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
355
|
-
if (style) {
|
|
356
|
-
if (typeof style === 'string') {
|
|
357
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
358
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
359
|
-
let styleElm;
|
|
360
|
-
if (!appliedStyles) {
|
|
361
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
362
|
-
}
|
|
363
|
-
if (!appliedStyles.has(scopeId)) {
|
|
364
|
-
{
|
|
365
|
-
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
366
|
-
{
|
|
367
|
-
styleElm = doc.createElement('style');
|
|
368
|
-
styleElm.innerHTML = style;
|
|
369
|
-
}
|
|
370
|
-
// Apply CSP nonce to the style tag if it exists
|
|
371
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
372
|
-
if (nonce != null) {
|
|
373
|
-
styleElm.setAttribute('nonce', nonce);
|
|
374
|
-
}
|
|
375
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
376
|
-
}
|
|
377
|
-
if (appliedStyles) {
|
|
378
|
-
appliedStyles.add(scopeId);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
383
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return scopeId;
|
|
387
|
-
};
|
|
388
|
-
const attachStyles = (hostRef) => {
|
|
389
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
390
|
-
const elm = hostRef.$hostElement$;
|
|
391
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
392
|
-
addStyle(elm.getRootNode(), cmpMeta);
|
|
393
|
-
endAttachStyles();
|
|
394
|
-
};
|
|
395
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
396
241
|
/**
|
|
397
242
|
* Production setAccessor() function based on Preact by
|
|
398
243
|
* Jason Miller (@developit)
|
|
@@ -490,10 +335,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
490
335
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
491
336
|
try {
|
|
492
337
|
if (!elm.tagName.includes('-')) {
|
|
493
|
-
|
|
338
|
+
let n = newValue == null ? '' : newValue;
|
|
494
339
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
495
340
|
if (memberName === 'list') {
|
|
496
341
|
isProp = false;
|
|
342
|
+
// tslint:disable-next-line: triple-equals
|
|
497
343
|
}
|
|
498
344
|
else if (oldValue == null || elm[memberName] != n) {
|
|
499
345
|
elm[memberName] = n;
|
|
@@ -529,7 +375,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
529
375
|
}
|
|
530
376
|
}
|
|
531
377
|
}
|
|
532
|
-
else if ((!isProp || flags & 4 /*
|
|
378
|
+
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
533
379
|
newValue = newValue === true ? '' : newValue;
|
|
534
380
|
if (xlink) {
|
|
535
381
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -547,7 +393,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
547
393
|
// if the element passed in is a shadow root, which is a document fragment
|
|
548
394
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
549
395
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
550
|
-
const elm = newVnode.$elm$.nodeType === 11 /*
|
|
396
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
551
397
|
? newVnode.$elm$.host
|
|
552
398
|
: newVnode.$elm$;
|
|
553
399
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -565,19 +411,9 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
565
411
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
566
412
|
}
|
|
567
413
|
};
|
|
568
|
-
/**
|
|
569
|
-
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
570
|
-
*
|
|
571
|
-
* @param oldParentVNode the parent VNode from the previous render
|
|
572
|
-
* @param newParentVNode the parent VNode from the current render
|
|
573
|
-
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
574
|
-
* children, for which we will create a new DOM node
|
|
575
|
-
* @param parentElm the parent DOM node which our new node will be a child of
|
|
576
|
-
* @returns the newly created node
|
|
577
|
-
*/
|
|
578
414
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
579
415
|
// tslint:disable-next-line: prefer-const
|
|
580
|
-
|
|
416
|
+
let newVNode = newParentVNode.$children$[childIndex];
|
|
581
417
|
let i = 0;
|
|
582
418
|
let elm;
|
|
583
419
|
let childNode;
|
|
@@ -588,16 +424,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
588
424
|
if (newVNode.$tag$ === 'slot') {
|
|
589
425
|
newVNode.$flags$ |= newVNode.$children$
|
|
590
426
|
? // slot element has fallback content
|
|
591
|
-
2 /*
|
|
427
|
+
2 /* isSlotFallback */
|
|
592
428
|
: // slot element does not have fallback content
|
|
593
|
-
1 /*
|
|
429
|
+
1 /* isSlotReference */;
|
|
594
430
|
}
|
|
595
431
|
}
|
|
596
432
|
if (newVNode.$text$ !== null) {
|
|
597
433
|
// create text node
|
|
598
434
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
599
435
|
}
|
|
600
|
-
else if (newVNode.$flags$ & 1 /*
|
|
436
|
+
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
601
437
|
// create a slot reference node
|
|
602
438
|
elm = newVNode.$elm$ =
|
|
603
439
|
doc.createTextNode('');
|
|
@@ -607,7 +443,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
607
443
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
608
444
|
}
|
|
609
445
|
// create element
|
|
610
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /*
|
|
446
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
611
447
|
? 'slot-fb'
|
|
612
448
|
: newVNode.$tag$)
|
|
613
449
|
);
|
|
@@ -642,7 +478,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
642
478
|
}
|
|
643
479
|
{
|
|
644
480
|
elm['s-hn'] = hostTagName;
|
|
645
|
-
if (newVNode.$flags$ & (2 /*
|
|
481
|
+
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
646
482
|
// remember the content reference comment
|
|
647
483
|
elm['s-sr'] = true;
|
|
648
484
|
// remember the content reference comment
|
|
@@ -661,7 +497,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
661
497
|
return elm;
|
|
662
498
|
};
|
|
663
499
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
664
|
-
plt.$flags$ |= 1 /*
|
|
500
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
665
501
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
666
502
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
667
503
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -682,23 +518,8 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
682
518
|
putBackInOriginalLocation(childNode, recursive);
|
|
683
519
|
}
|
|
684
520
|
}
|
|
685
|
-
plt.$flags$ &= ~1 /*
|
|
521
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
686
522
|
};
|
|
687
|
-
/**
|
|
688
|
-
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
689
|
-
* add them to the DOM in the appropriate place.
|
|
690
|
-
*
|
|
691
|
-
* @param parentElm the DOM node which should be used as a parent for the new
|
|
692
|
-
* DOM nodes
|
|
693
|
-
* @param before a child of the `parentElm` which the new children should be
|
|
694
|
-
* inserted before (optional)
|
|
695
|
-
* @param parentVNode the parent virtual DOM node
|
|
696
|
-
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
697
|
-
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
698
|
-
* creating DOM nodes (inclusive)
|
|
699
|
-
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
700
|
-
* creating DOM nodes (inclusive)
|
|
701
|
-
*/
|
|
702
523
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
703
524
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
704
525
|
let childNode;
|
|
@@ -712,19 +533,6 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
712
533
|
}
|
|
713
534
|
}
|
|
714
535
|
};
|
|
715
|
-
/**
|
|
716
|
-
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
717
|
-
* This can be used to, for instance, clean up after a list of children which
|
|
718
|
-
* should no longer be shown.
|
|
719
|
-
*
|
|
720
|
-
* This function also handles some of Stencil's slot relocation logic.
|
|
721
|
-
*
|
|
722
|
-
* @param vnodes a list of virtual DOM nodes to remove
|
|
723
|
-
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
724
|
-
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
725
|
-
* @param vnode a VNode
|
|
726
|
-
* @param elm an element
|
|
727
|
-
*/
|
|
728
536
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
729
537
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
730
538
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -749,74 +557,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
749
557
|
}
|
|
750
558
|
}
|
|
751
559
|
};
|
|
752
|
-
/**
|
|
753
|
-
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
754
|
-
* traversing the two collections of children, identifying nodes that are
|
|
755
|
-
* conserved or changed, calling out to `patch` to make any necessary
|
|
756
|
-
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
757
|
-
*
|
|
758
|
-
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
759
|
-
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
760
|
-
* 'windows' by storing start and end indices and references to the
|
|
761
|
-
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
762
|
-
* to the entire array, but we progressively narrow the windows until there are
|
|
763
|
-
* no children left to update by doing the following:
|
|
764
|
-
*
|
|
765
|
-
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
766
|
-
* that if we have an initial array like the following we'll end up dealing
|
|
767
|
-
* only with a window bounded by the highlighted elements:
|
|
768
|
-
*
|
|
769
|
-
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
770
|
-
* ^^^^^^ ^^^^^^
|
|
771
|
-
*
|
|
772
|
-
* 2. Check to see if the elements at the head and tail positions are equal
|
|
773
|
-
* across the windows. This will basically detect elements which haven't
|
|
774
|
-
* been added, removed, or changed position, i.e. if you had the following
|
|
775
|
-
* VNode elements (represented as HTML):
|
|
776
|
-
*
|
|
777
|
-
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
778
|
-
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
779
|
-
*
|
|
780
|
-
* Then when comparing the children of the `<div>` tag we check the equality
|
|
781
|
-
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
782
|
-
* same tag in the same position, we'd be able to avoid completely
|
|
783
|
-
* re-rendering the subtree under them with a new DOM element and would just
|
|
784
|
-
* call out to `patch` to handle reconciling their children and so on.
|
|
785
|
-
*
|
|
786
|
-
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
787
|
-
* window corresponds to the element at the end of the other window. This is
|
|
788
|
-
* a heuristic which will let us identify _some_ situations in which
|
|
789
|
-
* elements have changed position, for instance it _should_ detect that the
|
|
790
|
-
* children nodes themselves have not changed but merely moved in the
|
|
791
|
-
* following example:
|
|
792
|
-
*
|
|
793
|
-
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
794
|
-
* newVNode: `<div><element-two /><element-one /></div>`
|
|
795
|
-
*
|
|
796
|
-
* If we find cases like this then we also need to move the concrete DOM
|
|
797
|
-
* elements corresponding to the moved children to write the re-order to the
|
|
798
|
-
* DOM.
|
|
799
|
-
*
|
|
800
|
-
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
801
|
-
* nodes in the old children which have the same key as the first element in
|
|
802
|
-
* our window on the new children. If we find such a node we handle calling
|
|
803
|
-
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
804
|
-
* what we find.
|
|
805
|
-
*
|
|
806
|
-
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
807
|
-
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
808
|
-
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
809
|
-
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
810
|
-
* children has collapsed we still have more nodes on the new children that
|
|
811
|
-
* we haven't dealt with yet then we need to add them, or if the new children
|
|
812
|
-
* collapse but we still have unhandled _old_ children then we need to make
|
|
813
|
-
* sure the corresponding DOM nodes are removed.
|
|
814
|
-
*
|
|
815
|
-
* @param parentElm the node into which the parent VNode is rendered
|
|
816
|
-
* @param oldCh the old children of the parent node
|
|
817
|
-
* @param newVNode the new VNode which will replace the parent
|
|
818
|
-
* @param newCh the new children of the parent node
|
|
819
|
-
*/
|
|
820
560
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
821
561
|
let oldStartIdx = 0;
|
|
822
562
|
let newStartIdx = 0;
|
|
@@ -832,7 +572,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
832
572
|
let elmToMove;
|
|
833
573
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
834
574
|
if (oldStartVnode == null) {
|
|
835
|
-
//
|
|
575
|
+
// Vnode might have been moved left
|
|
836
576
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
837
577
|
}
|
|
838
578
|
else if (oldEndVnode == null) {
|
|
@@ -845,100 +585,37 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
845
585
|
newEndVnode = newCh[--newEndIdx];
|
|
846
586
|
}
|
|
847
587
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
848
|
-
// if the start nodes are the same then we should patch the new VNode
|
|
849
|
-
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
850
|
-
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
851
|
-
// since things are matched up in order.
|
|
852
588
|
patch(oldStartVnode, newStartVnode);
|
|
853
589
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
854
590
|
newStartVnode = newCh[++newStartIdx];
|
|
855
591
|
}
|
|
856
592
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
857
|
-
// likewise, if the end nodes are the same we patch new onto old and
|
|
858
|
-
// decrement our end indices, and also likewise in this case we don't
|
|
859
|
-
// need to move any DOM Nodes.
|
|
860
593
|
patch(oldEndVnode, newEndVnode);
|
|
861
594
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
862
595
|
newEndVnode = newCh[--newEndIdx];
|
|
863
596
|
}
|
|
864
597
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
865
|
-
//
|
|
866
|
-
//
|
|
867
|
-
// We've found that the last node in our window on the new children is
|
|
868
|
-
// the same VNode as the _first_ node in our window on the old children
|
|
869
|
-
// we're dealing with now. Visually, this is the layout of these two
|
|
870
|
-
// nodes:
|
|
871
|
-
//
|
|
872
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
873
|
-
// ^^^^^^^^^^^
|
|
874
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
875
|
-
// ^^^^^^^^^^^^^
|
|
876
|
-
//
|
|
877
|
-
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
878
|
-
// and move the DOM element for `oldStartVnode`.
|
|
598
|
+
// Vnode moved right
|
|
879
599
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
880
600
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
881
601
|
}
|
|
882
602
|
patch(oldStartVnode, newEndVnode);
|
|
883
|
-
// We need to move the element for `oldStartVnode` into a position which
|
|
884
|
-
// will be appropriate for `newEndVnode`. For this we can use
|
|
885
|
-
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
886
|
-
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
887
|
-
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
888
|
-
//
|
|
889
|
-
// <old-start-node />
|
|
890
|
-
// <some-intervening-node />
|
|
891
|
-
// <old-end-node />
|
|
892
|
-
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
893
|
-
// <next-sibling />
|
|
894
|
-
//
|
|
895
|
-
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
896
|
-
// the node for `oldStartVnode` at the end of the children of
|
|
897
|
-
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
898
|
-
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
899
|
-
// append it to the children of the parent element.
|
|
900
603
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
901
604
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
902
605
|
newEndVnode = newCh[--newEndIdx];
|
|
903
606
|
}
|
|
904
607
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
905
|
-
//
|
|
906
|
-
//
|
|
907
|
-
// We've found that the first node in our window on the new children is
|
|
908
|
-
// the same VNode as the _last_ node in our window on the old children.
|
|
909
|
-
// Visually, this is the layout of these two nodes:
|
|
910
|
-
//
|
|
911
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
912
|
-
// ^^^^^^^^^^^^^
|
|
913
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
914
|
-
// ^^^^^^^^^^^
|
|
915
|
-
//
|
|
916
|
-
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
917
|
-
// (which will handle updating any changed attributes, reconciling their
|
|
918
|
-
// children etc) but we also need to move the DOM node to which
|
|
919
|
-
// `oldEndVnode` corresponds.
|
|
608
|
+
// Vnode moved left
|
|
920
609
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
921
610
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
922
611
|
}
|
|
923
612
|
patch(oldEndVnode, newStartVnode);
|
|
924
|
-
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
925
|
-
// the same node, so since we're here we know that they are not. Thus we
|
|
926
|
-
// can move the element for `oldEndVnode` _before_ the element for
|
|
927
|
-
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
928
|
-
// future.
|
|
929
613
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
930
614
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
931
615
|
newStartVnode = newCh[++newStartIdx];
|
|
932
616
|
}
|
|
933
617
|
else {
|
|
934
|
-
//
|
|
935
|
-
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
936
|
-
// in the JSX for a DOM element in the implementation of a Stencil
|
|
937
|
-
// component.
|
|
938
|
-
//
|
|
939
|
-
// First we check to see if there are any nodes in the array of old
|
|
940
|
-
// children which have the same key as the first node in the new
|
|
941
|
-
// children.
|
|
618
|
+
// createKeyToOldIdx
|
|
942
619
|
idxInOld = -1;
|
|
943
620
|
{
|
|
944
621
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -949,32 +626,23 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
949
626
|
}
|
|
950
627
|
}
|
|
951
628
|
if (idxInOld >= 0) {
|
|
952
|
-
// We found a node in the old children which matches up with the first
|
|
953
|
-
// node in the new children! So let's deal with that
|
|
954
629
|
elmToMove = oldCh[idxInOld];
|
|
955
630
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
956
|
-
// the tag doesn't match so we'll need a new DOM element
|
|
957
631
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
958
632
|
}
|
|
959
633
|
else {
|
|
960
634
|
patch(elmToMove, newStartVnode);
|
|
961
|
-
// invalidate the matching old node so that we won't try to update it
|
|
962
|
-
// again later on
|
|
963
635
|
oldCh[idxInOld] = undefined;
|
|
964
636
|
node = elmToMove.$elm$;
|
|
965
637
|
}
|
|
966
638
|
newStartVnode = newCh[++newStartIdx];
|
|
967
639
|
}
|
|
968
640
|
else {
|
|
969
|
-
//
|
|
970
|
-
// the key of the first new child OR the build is not using `key`
|
|
971
|
-
// attributes at all. In either case we need to create a new element
|
|
972
|
-
// for the new node.
|
|
641
|
+
// new element
|
|
973
642
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
974
643
|
newStartVnode = newCh[++newStartIdx];
|
|
975
644
|
}
|
|
976
645
|
if (node) {
|
|
977
|
-
// if we created a new node then handle inserting it to the DOM
|
|
978
646
|
{
|
|
979
647
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
980
648
|
}
|
|
@@ -982,44 +650,21 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
982
650
|
}
|
|
983
651
|
}
|
|
984
652
|
if (oldStartIdx > oldEndIdx) {
|
|
985
|
-
// we have some more new nodes to add which don't match up with old nodes
|
|
986
653
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
987
654
|
}
|
|
988
655
|
else if (newStartIdx > newEndIdx) {
|
|
989
|
-
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
990
|
-
// in the new array, so lets remove them (which entails cleaning up the
|
|
991
|
-
// relevant DOM nodes)
|
|
992
656
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
993
657
|
}
|
|
994
658
|
};
|
|
995
|
-
|
|
996
|
-
* Compare two VNodes to determine if they are the same
|
|
997
|
-
*
|
|
998
|
-
* **NB**: This function is an equality _heuristic_ based on the available
|
|
999
|
-
* information set on the two VNodes and can be misleading under certain
|
|
1000
|
-
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
1001
|
-
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
1002
|
-
* checking that they have the same tag.
|
|
1003
|
-
*
|
|
1004
|
-
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
1005
|
-
* changing order within a `children` array or something along those lines then
|
|
1006
|
-
* we could obtain a false negative and then have to do needless re-rendering
|
|
1007
|
-
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
1008
|
-
*
|
|
1009
|
-
* @param leftVNode the first VNode to check
|
|
1010
|
-
* @param rightVNode the second VNode to check
|
|
1011
|
-
* @returns whether they're equal or not
|
|
1012
|
-
*/
|
|
1013
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
659
|
+
const isSameVnode = (vnode1, vnode2) => {
|
|
1014
660
|
// compare if two vnode to see if they're "technically" the same
|
|
1015
661
|
// need to have the same element tag, and same key to be the same
|
|
1016
|
-
if (
|
|
1017
|
-
if (
|
|
1018
|
-
return
|
|
662
|
+
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
663
|
+
if (vnode1.$tag$ === 'slot') {
|
|
664
|
+
return vnode1.$name$ === vnode2.$name$;
|
|
1019
665
|
}
|
|
1020
|
-
// this will be set if components in the build have `key` attrs set on them
|
|
1021
666
|
{
|
|
1022
|
-
return
|
|
667
|
+
return vnode1.$key$ === vnode2.$key$;
|
|
1023
668
|
}
|
|
1024
669
|
}
|
|
1025
670
|
return false;
|
|
@@ -1032,14 +677,6 @@ const referenceNode = (node) => {
|
|
|
1032
677
|
return (node && node['s-ol']) || node;
|
|
1033
678
|
};
|
|
1034
679
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
1035
|
-
/**
|
|
1036
|
-
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1037
|
-
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1038
|
-
* children of the two nodes (if any).
|
|
1039
|
-
*
|
|
1040
|
-
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1041
|
-
* @param newVNode a new VNode representing an updated version of the old one
|
|
1042
|
-
*/
|
|
1043
680
|
const patch = (oldVNode, newVNode) => {
|
|
1044
681
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
1045
682
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1053,6 +690,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1053
690
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1054
691
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1055
692
|
}
|
|
693
|
+
// element node
|
|
1056
694
|
{
|
|
1057
695
|
if (tag === 'slot')
|
|
1058
696
|
;
|
|
@@ -1065,7 +703,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1065
703
|
}
|
|
1066
704
|
if (oldChildren !== null && newChildren !== null) {
|
|
1067
705
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1068
|
-
// so we need to call `updateChildren` to reconcile them
|
|
1069
706
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
1070
707
|
}
|
|
1071
708
|
else if (newChildren !== null) {
|
|
@@ -1097,7 +734,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1097
734
|
};
|
|
1098
735
|
const updateFallbackSlotVisibility = (elm) => {
|
|
1099
736
|
// tslint:disable-next-line: prefer-const
|
|
1100
|
-
|
|
737
|
+
let childNodes = elm.childNodes;
|
|
1101
738
|
let childNode;
|
|
1102
739
|
let i;
|
|
1103
740
|
let ilen;
|
|
@@ -1106,7 +743,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1106
743
|
let nodeType;
|
|
1107
744
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1108
745
|
childNode = childNodes[i];
|
|
1109
|
-
if (childNode.nodeType === 1 /*
|
|
746
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1110
747
|
if (childNode['s-sr']) {
|
|
1111
748
|
// this is a slot fallback node
|
|
1112
749
|
// get the slot name for this slot reference node
|
|
@@ -1118,7 +755,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1118
755
|
nodeType = childNodes[j].nodeType;
|
|
1119
756
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
1120
757
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
1121
|
-
if (nodeType === 1 /*
|
|
758
|
+
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1122
759
|
childNode.hidden = true;
|
|
1123
760
|
break;
|
|
1124
761
|
}
|
|
@@ -1127,8 +764,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1127
764
|
// this is a default fallback slot node
|
|
1128
765
|
// any element or text node (with content)
|
|
1129
766
|
// should hide the default fallback slot node
|
|
1130
|
-
if (nodeType === 1 /*
|
|
1131
|
-
(nodeType === 3 /*
|
|
767
|
+
if (nodeType === 1 /* ElementNode */ ||
|
|
768
|
+
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1132
769
|
childNode.hidden = true;
|
|
1133
770
|
break;
|
|
1134
771
|
}
|
|
@@ -1150,8 +787,8 @@ const relocateSlotContent = (elm) => {
|
|
|
1150
787
|
let relocateNodeData;
|
|
1151
788
|
let j;
|
|
1152
789
|
let i = 0;
|
|
1153
|
-
|
|
1154
|
-
|
|
790
|
+
let childNodes = elm.childNodes;
|
|
791
|
+
let ilen = childNodes.length;
|
|
1155
792
|
for (; i < ilen; i++) {
|
|
1156
793
|
childNode = childNodes[i];
|
|
1157
794
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -1206,13 +843,13 @@ const relocateSlotContent = (elm) => {
|
|
|
1206
843
|
}
|
|
1207
844
|
}
|
|
1208
845
|
}
|
|
1209
|
-
if (childNode.nodeType === 1 /*
|
|
846
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1210
847
|
relocateSlotContent(childNode);
|
|
1211
848
|
}
|
|
1212
849
|
}
|
|
1213
850
|
};
|
|
1214
851
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
1215
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
852
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1216
853
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
1217
854
|
return true;
|
|
1218
855
|
}
|
|
@@ -1232,18 +869,6 @@ const callNodeRefs = (vNode) => {
|
|
|
1232
869
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1233
870
|
}
|
|
1234
871
|
};
|
|
1235
|
-
/**
|
|
1236
|
-
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1237
|
-
*
|
|
1238
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1239
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1240
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1241
|
-
* relocation, and reflecting attributes.
|
|
1242
|
-
*
|
|
1243
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1244
|
-
* the DOM node into which it should be rendered.
|
|
1245
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1246
|
-
*/
|
|
1247
872
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
1248
873
|
const hostElm = hostRef.$hostElement$;
|
|
1249
874
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -1255,12 +880,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1255
880
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1256
881
|
}
|
|
1257
882
|
rootVnode.$tag$ = null;
|
|
1258
|
-
rootVnode.$flags$ |= 4 /*
|
|
883
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1259
884
|
hostRef.$vnode$ = rootVnode;
|
|
1260
885
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
1261
886
|
{
|
|
1262
887
|
contentRef = hostElm['s-cr'];
|
|
1263
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /*
|
|
888
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1264
889
|
// always reset
|
|
1265
890
|
checkSlotFallbackVisibility = false;
|
|
1266
891
|
}
|
|
@@ -1269,7 +894,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1269
894
|
{
|
|
1270
895
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1271
896
|
// the disconnectCallback from working
|
|
1272
|
-
plt.$flags$ |= 1 /*
|
|
897
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1273
898
|
if (checkSlotRelocate) {
|
|
1274
899
|
relocateSlotContent(rootVnode.$elm$);
|
|
1275
900
|
let relocateData;
|
|
@@ -1327,7 +952,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1327
952
|
}
|
|
1328
953
|
else {
|
|
1329
954
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1330
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
955
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1331
956
|
nodeToRelocate.hidden = true;
|
|
1332
957
|
}
|
|
1333
958
|
}
|
|
@@ -1338,11 +963,30 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1338
963
|
}
|
|
1339
964
|
// done moving nodes around
|
|
1340
965
|
// allow the disconnect callback to work again
|
|
1341
|
-
plt.$flags$ &= ~1 /*
|
|
966
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1342
967
|
// always reset
|
|
1343
968
|
relocateNodes.length = 0;
|
|
1344
969
|
}
|
|
1345
970
|
};
|
|
971
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
972
|
+
const createEvent = (ref, name, flags) => {
|
|
973
|
+
const elm = getElement(ref);
|
|
974
|
+
return {
|
|
975
|
+
emit: (detail) => {
|
|
976
|
+
return emitEvent(elm, name, {
|
|
977
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
978
|
+
composed: !!(flags & 2 /* Composed */),
|
|
979
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
980
|
+
detail,
|
|
981
|
+
});
|
|
982
|
+
},
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
const emitEvent = (elm, name, opts) => {
|
|
986
|
+
const ev = plt.ce(name, opts);
|
|
987
|
+
elm.dispatchEvent(ev);
|
|
988
|
+
return ev;
|
|
989
|
+
};
|
|
1346
990
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1347
991
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1348
992
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1350,10 +994,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1350
994
|
};
|
|
1351
995
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1352
996
|
{
|
|
1353
|
-
hostRef.$flags$ |= 16 /*
|
|
997
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1354
998
|
}
|
|
1355
|
-
if (hostRef.$flags$ & 4 /*
|
|
1356
|
-
hostRef.$flags$ |= 512 /*
|
|
999
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1000
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1357
1001
|
return;
|
|
1358
1002
|
}
|
|
1359
1003
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1369,7 +1013,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1369
1013
|
let promise;
|
|
1370
1014
|
if (isInitialLoad) {
|
|
1371
1015
|
{
|
|
1372
|
-
hostRef.$flags$ |= 256 /*
|
|
1016
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1373
1017
|
if (hostRef.$queuedListeners$) {
|
|
1374
1018
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1375
1019
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1380,17 +1024,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1380
1024
|
}
|
|
1381
1025
|
}
|
|
1382
1026
|
endSchedule();
|
|
1383
|
-
return then(promise, () => updateComponent(hostRef, instance
|
|
1027
|
+
return then(promise, () => updateComponent(hostRef, instance));
|
|
1384
1028
|
};
|
|
1385
1029
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1386
1030
|
// updateComponent
|
|
1387
1031
|
const elm = hostRef.$hostElement$;
|
|
1388
1032
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1389
1033
|
const rc = elm['s-rc'];
|
|
1390
|
-
if (isInitialLoad) {
|
|
1391
|
-
// DOM WRITE!
|
|
1392
|
-
attachStyles(hostRef);
|
|
1393
|
-
}
|
|
1394
1034
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1395
1035
|
{
|
|
1396
1036
|
callRender(hostRef, instance);
|
|
@@ -1412,7 +1052,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1412
1052
|
}
|
|
1413
1053
|
else {
|
|
1414
1054
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1415
|
-
hostRef.$flags$ |= 4 /*
|
|
1055
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1416
1056
|
childrenPromises.length = 0;
|
|
1417
1057
|
}
|
|
1418
1058
|
}
|
|
@@ -1421,10 +1061,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1421
1061
|
try {
|
|
1422
1062
|
instance = instance.render() ;
|
|
1423
1063
|
{
|
|
1424
|
-
hostRef.$flags$ &= ~16 /*
|
|
1064
|
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1425
1065
|
}
|
|
1426
1066
|
{
|
|
1427
|
-
hostRef.$flags$ |= 2 /*
|
|
1067
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1428
1068
|
}
|
|
1429
1069
|
{
|
|
1430
1070
|
{
|
|
@@ -1448,11 +1088,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1448
1088
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1449
1089
|
const instance = hostRef.$lazyInstance$ ;
|
|
1450
1090
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1451
|
-
{
|
|
1452
|
-
|
|
1453
|
-
}
|
|
1454
|
-
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1455
|
-
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1091
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1092
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1456
1093
|
{
|
|
1457
1094
|
// DOM WRITE!
|
|
1458
1095
|
addHydratedFlag(elm);
|
|
@@ -1484,10 +1121,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1484
1121
|
hostRef.$onRenderResolve$();
|
|
1485
1122
|
hostRef.$onRenderResolve$ = undefined;
|
|
1486
1123
|
}
|
|
1487
|
-
if (hostRef.$flags$ & 512 /*
|
|
1124
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1488
1125
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1489
1126
|
}
|
|
1490
|
-
hostRef.$flags$ &= ~(4 /*
|
|
1127
|
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1491
1128
|
}
|
|
1492
1129
|
// ( •_•)
|
|
1493
1130
|
// ( •_•)>⌐■-■
|
|
@@ -1517,40 +1154,44 @@ const then = (promise, thenFn) => {
|
|
|
1517
1154
|
};
|
|
1518
1155
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1519
1156
|
;
|
|
1157
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
1158
|
+
// ensure this value is of the correct prop type
|
|
1159
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
1160
|
+
if (propType & 4 /* Boolean */) {
|
|
1161
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
1162
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1163
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1164
|
+
}
|
|
1165
|
+
if (propType & 2 /* Number */) {
|
|
1166
|
+
// force it to be a number
|
|
1167
|
+
return parseFloat(propValue);
|
|
1168
|
+
}
|
|
1169
|
+
if (propType & 1 /* String */) {
|
|
1170
|
+
// could have been passed as a number or boolean
|
|
1171
|
+
// but we still want it as a string
|
|
1172
|
+
return String(propValue);
|
|
1173
|
+
}
|
|
1174
|
+
// redundant return here for better minification
|
|
1175
|
+
return propValue;
|
|
1176
|
+
}
|
|
1177
|
+
// not sure exactly what type we want
|
|
1178
|
+
// so no need to change to a different type
|
|
1179
|
+
return propValue;
|
|
1180
|
+
};
|
|
1520
1181
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1521
1182
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1522
1183
|
// check our new property value against our internal value
|
|
1523
1184
|
const hostRef = getHostRef(ref);
|
|
1524
|
-
const elm = hostRef.$hostElement$ ;
|
|
1525
1185
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1526
1186
|
const flags = hostRef.$flags$;
|
|
1527
1187
|
const instance = hostRef.$lazyInstance$ ;
|
|
1528
1188
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1529
|
-
|
|
1530
|
-
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1531
|
-
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1532
|
-
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1189
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
|
1533
1190
|
// gadzooks! the property's value has changed!!
|
|
1534
1191
|
// set our new value!
|
|
1535
1192
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1536
1193
|
if (instance) {
|
|
1537
|
-
|
|
1538
|
-
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1539
|
-
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1540
|
-
if (watchMethods) {
|
|
1541
|
-
// this instance is watching for when this property changed
|
|
1542
|
-
watchMethods.map((watchMethodName) => {
|
|
1543
|
-
try {
|
|
1544
|
-
// fire off each of the watch methods that are watching this property
|
|
1545
|
-
instance[watchMethodName](newVal, oldVal, propName);
|
|
1546
|
-
}
|
|
1547
|
-
catch (e) {
|
|
1548
|
-
consoleError(e, elm);
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1194
|
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1554
1195
|
// looks like this value actually changed, so we've got work to do!
|
|
1555
1196
|
// but only if we've already rendered, otherwise just chill out
|
|
1556
1197
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1560,27 +1201,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1560
1201
|
}
|
|
1561
1202
|
}
|
|
1562
1203
|
};
|
|
1563
|
-
/**
|
|
1564
|
-
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1565
|
-
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1566
|
-
* decorators, callbacks for when attributes change, and so on.
|
|
1567
|
-
*
|
|
1568
|
-
* @param Cstr the constructor for a component that we need to process
|
|
1569
|
-
* @param cmpMeta metadata collected previously about the component
|
|
1570
|
-
* @param flags a number used to store a series of bit flags
|
|
1571
|
-
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1572
|
-
*/
|
|
1573
1204
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1574
1205
|
if (cmpMeta.$members$) {
|
|
1575
|
-
if (Cstr.watchers) {
|
|
1576
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1577
|
-
}
|
|
1578
1206
|
// It's better to have a const than two Object.entries()
|
|
1579
1207
|
const members = Object.entries(cmpMeta.$members$);
|
|
1580
1208
|
const prototype = Cstr.prototype;
|
|
1581
1209
|
members.map(([memberName, [memberFlags]]) => {
|
|
1582
|
-
if ((memberFlags & 31 /*
|
|
1583
|
-
((flags & 2 /*
|
|
1210
|
+
if ((memberFlags & 31 /* Prop */ ||
|
|
1211
|
+
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1584
1212
|
// proxyComponent - prop
|
|
1585
1213
|
Object.defineProperty(prototype, memberName, {
|
|
1586
1214
|
get() {
|
|
@@ -1595,8 +1223,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1595
1223
|
enumerable: true,
|
|
1596
1224
|
});
|
|
1597
1225
|
}
|
|
1598
|
-
else if (flags & 1 /*
|
|
1599
|
-
memberFlags & 64 /*
|
|
1226
|
+
else if (flags & 1 /* isElementConstructor */ &&
|
|
1227
|
+
memberFlags & 64 /* Method */) {
|
|
1600
1228
|
// proxyComponent - method
|
|
1601
1229
|
Object.defineProperty(prototype, memberName, {
|
|
1602
1230
|
value(...args) {
|
|
@@ -1606,19 +1234,19 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1606
1234
|
});
|
|
1607
1235
|
}
|
|
1608
1236
|
});
|
|
1609
|
-
if ((flags & 1 /*
|
|
1237
|
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
1610
1238
|
const attrNameToPropName = new Map();
|
|
1611
1239
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1612
1240
|
plt.jmp(() => {
|
|
1613
1241
|
const propName = attrNameToPropName.get(attrName);
|
|
1614
|
-
// In a
|
|
1242
|
+
// In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
|
|
1615
1243
|
// in the case where an attribute was set inline.
|
|
1616
1244
|
// ```html
|
|
1617
1245
|
// <my-component some-attribute="some-value"></my-component>
|
|
1618
1246
|
// ```
|
|
1619
1247
|
//
|
|
1620
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1621
|
-
//
|
|
1248
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then programatically
|
|
1249
|
+
// changes it before it has been upgraded as shown below:
|
|
1622
1250
|
//
|
|
1623
1251
|
// ```html
|
|
1624
1252
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1628,13 +1256,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1628
1256
|
// el = document.querySelector("#test");
|
|
1629
1257
|
// el.someAttribute = "another-value";
|
|
1630
1258
|
// // upgrade component
|
|
1631
|
-
//
|
|
1259
|
+
// cutsomElements.define('my-component', MyComponent);
|
|
1632
1260
|
// </script>
|
|
1633
1261
|
// ```
|
|
1634
1262
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1635
1263
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1636
1264
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1637
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1265
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
|
|
1638
1266
|
//
|
|
1639
1267
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1640
1268
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1648,25 +1276,17 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1648
1276
|
newValue = this[propName];
|
|
1649
1277
|
delete this[propName];
|
|
1650
1278
|
}
|
|
1651
|
-
else if (prototype.hasOwnProperty(propName) &&
|
|
1652
|
-
typeof this[propName] === 'number' &&
|
|
1653
|
-
this[propName] == newValue) {
|
|
1654
|
-
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1655
|
-
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1656
|
-
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1657
|
-
return;
|
|
1658
|
-
}
|
|
1659
1279
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1660
1280
|
});
|
|
1661
1281
|
};
|
|
1662
1282
|
// create an array of attributes to observe
|
|
1663
1283
|
// and also create a map of html attribute name to js property name
|
|
1664
1284
|
Cstr.observedAttributes = members
|
|
1665
|
-
.filter(([_, m]) => m[0] & 15 /*
|
|
1285
|
+
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1666
1286
|
.map(([propName, m]) => {
|
|
1667
1287
|
const attrName = m[1] || propName;
|
|
1668
1288
|
attrNameToPropName.set(attrName, propName);
|
|
1669
|
-
if (m[0] & 512 /*
|
|
1289
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1670
1290
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1671
1291
|
}
|
|
1672
1292
|
return attrName;
|
|
@@ -1677,10 +1297,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1677
1297
|
};
|
|
1678
1298
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1679
1299
|
// initializeComponent
|
|
1680
|
-
if ((hostRef.$flags$ & 32 /*
|
|
1300
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1681
1301
|
{
|
|
1682
1302
|
// we haven't initialized this element yet
|
|
1683
|
-
hostRef.$flags$ |= 32 /*
|
|
1303
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1684
1304
|
// lazy loaded components
|
|
1685
1305
|
// request the component's implementation to be
|
|
1686
1306
|
// wired up with the host element
|
|
@@ -1692,13 +1312,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1692
1312
|
endLoad();
|
|
1693
1313
|
}
|
|
1694
1314
|
if (!Cstr.isProxied) {
|
|
1695
|
-
|
|
1696
|
-
// let's add the getters/setters to its prototype before
|
|
1697
|
-
// the first time we create an instance of the implementation
|
|
1698
|
-
{
|
|
1699
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1700
|
-
}
|
|
1701
|
-
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1315
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1702
1316
|
Cstr.isProxied = true;
|
|
1703
1317
|
}
|
|
1704
1318
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1706,7 +1320,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1706
1320
|
// but let's keep track of when we start and stop
|
|
1707
1321
|
// so that the getters/setters don't incorrectly step on data
|
|
1708
1322
|
{
|
|
1709
|
-
hostRef.$flags$ |= 8 /*
|
|
1323
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1710
1324
|
}
|
|
1711
1325
|
// construct the lazy-loaded component implementation
|
|
1712
1326
|
// passing the hostRef is very important during
|
|
@@ -1719,30 +1333,17 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1719
1333
|
consoleError(e);
|
|
1720
1334
|
}
|
|
1721
1335
|
{
|
|
1722
|
-
hostRef.$flags$ &= ~8 /*
|
|
1723
|
-
}
|
|
1724
|
-
{
|
|
1725
|
-
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1336
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1726
1337
|
}
|
|
1727
1338
|
endNewInstance();
|
|
1728
1339
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1729
1340
|
}
|
|
1730
|
-
if (Cstr.style) {
|
|
1731
|
-
// this component has styles but we haven't registered them yet
|
|
1732
|
-
let style = Cstr.style;
|
|
1733
|
-
const scopeId = getScopeId(cmpMeta);
|
|
1734
|
-
if (!styles.has(scopeId)) {
|
|
1735
|
-
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1736
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1737
|
-
endRegisterStyles();
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
1341
|
}
|
|
1741
1342
|
// we've successfully created a lazy instance
|
|
1742
1343
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1743
1344
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1744
1345
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1745
|
-
// this is the
|
|
1346
|
+
// this is the intial load and this component it has an ancestor component
|
|
1746
1347
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1747
1348
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1748
1349
|
// this will get fired off when the ancestor component
|
|
@@ -1760,20 +1361,19 @@ const fireConnectedCallback = (instance) => {
|
|
|
1760
1361
|
}
|
|
1761
1362
|
};
|
|
1762
1363
|
const connectedCallback = (elm) => {
|
|
1763
|
-
if ((plt.$flags$ & 1 /*
|
|
1364
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1764
1365
|
const hostRef = getHostRef(elm);
|
|
1765
1366
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1766
1367
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1767
|
-
if (!(hostRef.$flags$ & 1 /*
|
|
1368
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1768
1369
|
// first time this component has connected
|
|
1769
|
-
hostRef.$flags$ |= 1 /*
|
|
1370
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1770
1371
|
{
|
|
1771
1372
|
// initUpdate
|
|
1772
1373
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1773
1374
|
// in here to act as original content anchors as we move nodes around
|
|
1774
1375
|
// host element has been connected to the DOM
|
|
1775
|
-
if ((
|
|
1776
|
-
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1376
|
+
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1777
1377
|
setContentReference(elm);
|
|
1778
1378
|
}
|
|
1779
1379
|
}
|
|
@@ -1796,7 +1396,7 @@ const connectedCallback = (elm) => {
|
|
|
1796
1396
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1797
1397
|
if (cmpMeta.$members$) {
|
|
1798
1398
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1799
|
-
if (memberFlags & 31 /*
|
|
1399
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1800
1400
|
const value = elm[memberName];
|
|
1801
1401
|
delete elm[memberName];
|
|
1802
1402
|
elm[memberName] = value;
|
|
@@ -1830,7 +1430,7 @@ const setContentReference = (elm) => {
|
|
|
1830
1430
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1831
1431
|
};
|
|
1832
1432
|
const disconnectedCallback = (elm) => {
|
|
1833
|
-
if ((plt.$flags$ & 1 /*
|
|
1433
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1834
1434
|
const hostRef = getHostRef(elm);
|
|
1835
1435
|
const instance = hostRef.$lazyInstance$ ;
|
|
1836
1436
|
{
|
|
@@ -1845,7 +1445,6 @@ const disconnectedCallback = (elm) => {
|
|
|
1845
1445
|
}
|
|
1846
1446
|
};
|
|
1847
1447
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1848
|
-
var _a;
|
|
1849
1448
|
const endBootstrap = createTime();
|
|
1850
1449
|
const cmpTags = [];
|
|
1851
1450
|
const exclude = options.exclude || [];
|
|
@@ -1858,70 +1457,60 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1858
1457
|
let isBootstrapping = true;
|
|
1859
1458
|
Object.assign(plt, options);
|
|
1860
1459
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1861
|
-
lazyBundles.map((lazyBundle) => {
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1460
|
+
lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
|
|
1461
|
+
const cmpMeta = {
|
|
1462
|
+
$flags$: compactMeta[0],
|
|
1463
|
+
$tagName$: compactMeta[1],
|
|
1464
|
+
$members$: compactMeta[2],
|
|
1465
|
+
$listeners$: compactMeta[3],
|
|
1466
|
+
};
|
|
1467
|
+
{
|
|
1468
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1469
|
+
}
|
|
1470
|
+
{
|
|
1471
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1472
|
+
}
|
|
1473
|
+
{
|
|
1474
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1475
|
+
}
|
|
1476
|
+
const tagName = cmpMeta.$tagName$;
|
|
1477
|
+
const HostElement = class extends HTMLElement {
|
|
1478
|
+
// StencilLazyHost
|
|
1479
|
+
constructor(self) {
|
|
1480
|
+
// @ts-ignore
|
|
1481
|
+
super(self);
|
|
1482
|
+
self = this;
|
|
1483
|
+
registerHost(self, cmpMeta);
|
|
1880
1484
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
// @ts-ignore
|
|
1886
|
-
super(self);
|
|
1887
|
-
self = this;
|
|
1888
|
-
registerHost(self, cmpMeta);
|
|
1485
|
+
connectedCallback() {
|
|
1486
|
+
if (appLoadFallback) {
|
|
1487
|
+
clearTimeout(appLoadFallback);
|
|
1488
|
+
appLoadFallback = null;
|
|
1889
1489
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
appLoadFallback = null;
|
|
1894
|
-
}
|
|
1895
|
-
if (isBootstrapping) {
|
|
1896
|
-
// connectedCallback will be processed once all components have been registered
|
|
1897
|
-
deferredConnectedCallbacks.push(this);
|
|
1898
|
-
}
|
|
1899
|
-
else {
|
|
1900
|
-
plt.jmp(() => connectedCallback(this));
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
disconnectedCallback() {
|
|
1904
|
-
plt.jmp(() => disconnectedCallback(this));
|
|
1490
|
+
if (isBootstrapping) {
|
|
1491
|
+
// connectedCallback will be processed once all components have been registered
|
|
1492
|
+
deferredConnectedCallbacks.push(this);
|
|
1905
1493
|
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1494
|
+
else {
|
|
1495
|
+
plt.jmp(() => connectedCallback(this));
|
|
1908
1496
|
}
|
|
1909
|
-
};
|
|
1910
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1911
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1912
|
-
cmpTags.push(tagName);
|
|
1913
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1914
1497
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1498
|
+
disconnectedCallback() {
|
|
1499
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1500
|
+
}
|
|
1501
|
+
componentOnReady() {
|
|
1502
|
+
return getHostRef(this).$onReadyPromise$;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1506
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1507
|
+
cmpTags.push(tagName);
|
|
1508
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1509
|
+
}
|
|
1510
|
+
}));
|
|
1917
1511
|
{
|
|
1918
1512
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1919
1513
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1920
|
-
// Apply CSP nonce to the style tag if it exists
|
|
1921
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1922
|
-
if (nonce != null) {
|
|
1923
|
-
visibilityStyle.setAttribute('nonce', nonce);
|
|
1924
|
-
}
|
|
1925
1514
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1926
1515
|
}
|
|
1927
1516
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1938,48 +1527,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1938
1527
|
endBootstrap();
|
|
1939
1528
|
};
|
|
1940
1529
|
const Fragment = (_, children) => children;
|
|
1941
|
-
const
|
|
1942
|
-
if (listeners) {
|
|
1943
|
-
listeners.map(([flags, name, method]) => {
|
|
1944
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
1945
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1946
|
-
const opts = hostListenerOpts(flags);
|
|
1947
|
-
plt.ael(target, name, handler, opts);
|
|
1948
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1949
|
-
});
|
|
1950
|
-
}
|
|
1951
|
-
};
|
|
1952
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1953
|
-
try {
|
|
1954
|
-
{
|
|
1955
|
-
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1956
|
-
// instance is ready, let's call it's member method for this event
|
|
1957
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
1958
|
-
}
|
|
1959
|
-
else {
|
|
1960
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
catch (e) {
|
|
1965
|
-
consoleError(e);
|
|
1966
|
-
}
|
|
1967
|
-
};
|
|
1968
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
1969
|
-
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1970
|
-
return win;
|
|
1971
|
-
return elm;
|
|
1972
|
-
};
|
|
1973
|
-
// prettier-ignore
|
|
1974
|
-
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1975
|
-
/**
|
|
1976
|
-
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1977
|
-
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1978
|
-
* @param nonce The value to be assigned to the platform nonce property.
|
|
1979
|
-
* @returns void
|
|
1980
|
-
*/
|
|
1981
|
-
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1982
|
-
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1530
|
+
const hostRefs = new WeakMap();
|
|
1983
1531
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1984
1532
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1985
1533
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -2011,82 +1559,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2011
1559
|
if (module) {
|
|
2012
1560
|
return module[exportName];
|
|
2013
1561
|
}
|
|
2014
|
-
|
|
2015
|
-
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
2016
|
-
const processMod = importedModule => {
|
|
2017
|
-
cmpModules.set(bundleId, importedModule);
|
|
2018
|
-
return importedModule[exportName];
|
|
2019
|
-
}
|
|
2020
|
-
switch(bundleId) {
|
|
2021
|
-
|
|
2022
|
-
case 'xpl-avatar_15.cjs':
|
|
2023
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2024
|
-
/* webpackMode: "lazy" */
|
|
2025
|
-
'./xpl-avatar_15.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2026
|
-
case 'xpl-application-shell.cjs':
|
|
2027
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2028
|
-
/* webpackMode: "lazy" */
|
|
2029
|
-
'./xpl-application-shell.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2030
|
-
case 'xpl-button-row.cjs':
|
|
2031
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2032
|
-
/* webpackMode: "lazy" */
|
|
2033
|
-
'./xpl-button-row.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2034
|
-
case 'xpl-choicelist.cjs':
|
|
2035
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2036
|
-
/* webpackMode: "lazy" */
|
|
2037
|
-
'./xpl-choicelist.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2038
|
-
case 'xpl-divider.cjs':
|
|
2039
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2040
|
-
/* webpackMode: "lazy" */
|
|
2041
|
-
'./xpl-divider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2042
|
-
case 'xpl-grid.cjs':
|
|
2043
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2044
|
-
/* webpackMode: "lazy" */
|
|
2045
|
-
'./xpl-grid.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2046
|
-
case 'xpl-grid-item.cjs':
|
|
2047
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2048
|
-
/* webpackMode: "lazy" */
|
|
2049
|
-
'./xpl-grid-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2050
|
-
case 'xpl-input.cjs':
|
|
2051
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2052
|
-
/* webpackMode: "lazy" */
|
|
2053
|
-
'./xpl-input.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2054
|
-
case 'xpl-list.cjs':
|
|
2055
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2056
|
-
/* webpackMode: "lazy" */
|
|
2057
|
-
'./xpl-list.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2058
|
-
case 'xpl-main-nav.cjs':
|
|
2059
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2060
|
-
/* webpackMode: "lazy" */
|
|
2061
|
-
'./xpl-main-nav.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2062
|
-
case 'xpl-pagination.cjs':
|
|
2063
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2064
|
-
/* webpackMode: "lazy" */
|
|
2065
|
-
'./xpl-pagination.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2066
|
-
case 'xpl-select.cjs':
|
|
2067
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2068
|
-
/* webpackMode: "lazy" */
|
|
2069
|
-
'./xpl-select.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2070
|
-
case 'xpl-toggle.cjs':
|
|
2071
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2072
|
-
/* webpackMode: "lazy" */
|
|
2073
|
-
'./xpl-toggle.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2074
|
-
case 'xpl-backdrop.cjs':
|
|
2075
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2076
|
-
/* webpackMode: "lazy" */
|
|
2077
|
-
'./xpl-backdrop.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2078
|
-
case 'xpl-dropdown_2.cjs':
|
|
2079
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2080
|
-
/* webpackMode: "lazy" */
|
|
2081
|
-
'./xpl-dropdown_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2082
|
-
case 'xpl-dropdown-group_3.cjs':
|
|
2083
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2084
|
-
/* webpackMode: "lazy" */
|
|
2085
|
-
'./xpl-dropdown-group_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
1562
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2089
|
-
/* @vite-ignore */
|
|
2090
1563
|
/* webpackInclude: /\.entry\.js$/ */
|
|
2091
1564
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2092
1565
|
/* webpackMode: "lazy" */
|
|
@@ -2097,35 +1570,13 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2097
1570
|
return importedModule[exportName];
|
|
2098
1571
|
}, consoleError);
|
|
2099
1572
|
};
|
|
2100
|
-
const styles = /*@__PURE__*/ new Map();
|
|
2101
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
2102
|
-
const doc = win.document || { head: {} };
|
|
2103
|
-
const plt = {
|
|
2104
|
-
$flags$: 0,
|
|
2105
|
-
$resourcesUrl$: '',
|
|
2106
|
-
jmp: (h) => h(),
|
|
2107
|
-
raf: (h) => requestAnimationFrame(h),
|
|
2108
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2109
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2110
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2111
|
-
};
|
|
2112
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
2113
|
-
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2114
|
-
try {
|
|
2115
|
-
new CSSStyleSheet();
|
|
2116
|
-
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2117
|
-
}
|
|
2118
|
-
catch (e) { }
|
|
2119
|
-
return false;
|
|
2120
|
-
})()
|
|
2121
|
-
;
|
|
2122
1573
|
const queueDomReads = [];
|
|
2123
1574
|
const queueDomWrites = [];
|
|
2124
1575
|
const queueTask = (queue, write) => (cb) => {
|
|
2125
1576
|
queue.push(cb);
|
|
2126
1577
|
if (!queuePending) {
|
|
2127
1578
|
queuePending = true;
|
|
2128
|
-
if (write && plt.$flags$ & 4 /*
|
|
1579
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2129
1580
|
nextTick(flush);
|
|
2130
1581
|
}
|
|
2131
1582
|
else {
|
|
@@ -2170,6 +1621,3 @@ exports.getElement = getElement;
|
|
|
2170
1621
|
exports.h = h;
|
|
2171
1622
|
exports.promiseResolve = promiseResolve;
|
|
2172
1623
|
exports.registerInstance = registerInstance;
|
|
2173
|
-
exports.setNonce = setNonce;
|
|
2174
|
-
|
|
2175
|
-
//# sourceMappingURL=index-000e170c.js.map
|