@xplortech/apollo-core 1.0.0-beta.18 → 1.0.0-beta.3
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 -1509
- 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-13e7d3ea.entry.js +1 -0
- package/dist/apollo-core/p-2ce2fe5c.entry.js +1 -0
- package/dist/apollo-core/p-2f90296c.js +10 -0
- package/dist/apollo-core/p-3ff1ff38.entry.js +1 -0
- package/dist/apollo-core/p-63dd9a65.entry.js +1 -0
- package/dist/apollo-core/p-6c3c1e3d.entry.js +1 -0
- package/dist/apollo-core/p-81a6ce4c.entry.js +1 -0
- package/dist/apollo-core/p-918b0731.entry.js +1 -0
- package/dist/apollo-core/p-97bdb450.entry.js +1 -0
- package/dist/apollo-core/p-a43e2d1f.entry.js +1 -0
- package/dist/apollo-core/p-a7cc4114.entry.js +1 -0
- package/dist/apollo-core/p-ad90fe4d.js +1 -2
- package/dist/apollo-core/p-b6d1b135.entry.js +1 -0
- package/dist/apollo-core/p-bc0ebed2.entry.js +1 -0
- package/dist/apollo-core/p-c8af4ed6.entry.js +1 -0
- package/dist/apollo-core/p-d4aa2fa9.js +1 -0
- package/dist/apollo-core/p-d4e5d3aa.entry.js +1 -0
- package/dist/apollo-core/p-dad11011.entry.js +1 -0
- package/dist/apollo-core/p-db74c99c.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -12
- package/dist/cjs/{index-000e170c.js → index-acf3dd7a.js} +216 -765
- 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 +322 -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 -51
- 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 +205 -205
- 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 -306
- 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 +20224 -0
- package/dist/esm/apollo-core.js +3 -9
- package/dist/esm/{index-56581b5c.js → index-e3c4bb97.js} +217 -765
- 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 +307 -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 -51
- 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 +0 -1
- 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/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-choicelist/choice.d.ts +5 -5
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -2
- package/dist/types/components/xpl-dropdown/dropdownoption.d.ts +10 -9
- 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/listitem.d.ts +19 -15
- package/dist/types/components/xpl-list/xpl-list.d.ts +3 -2
- package/dist/types/components/xpl-select/selectchoice.d.ts +3 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -21
- 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 -268
- 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-da5a8e74.entry.js +0 -2
- package/dist/apollo-core/p-da5a8e74.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 -712
- 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-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-icon/xpl-icon.d.ts +0 -17
- /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/button.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
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'apollo-core';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Virtual DOM patching algorithm based on Snabbdom by
|
|
5
|
-
* Simon Friis Vindum (@paldepind)
|
|
6
|
-
* Licensed under the MIT License
|
|
7
|
-
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
8
|
-
*
|
|
9
|
-
* Modified for Stencil's renderer and slot projection
|
|
10
|
-
*/
|
|
11
3
|
let contentRef;
|
|
12
4
|
let hostTagName;
|
|
13
5
|
let useNativeShadowDom = false;
|
|
@@ -15,6 +7,54 @@ let checkSlotFallbackVisibility = false;
|
|
|
15
7
|
let checkSlotRelocate = false;
|
|
16
8
|
let isSvgMode = false;
|
|
17
9
|
let queuePending = false;
|
|
10
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
11
|
+
const doc = win.document || { head: {} };
|
|
12
|
+
const plt = {
|
|
13
|
+
$flags$: 0,
|
|
14
|
+
$resourcesUrl$: '',
|
|
15
|
+
jmp: (h) => h(),
|
|
16
|
+
raf: (h) => requestAnimationFrame(h),
|
|
17
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
18
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
19
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
20
|
+
};
|
|
21
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
22
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
23
|
+
if (listeners) {
|
|
24
|
+
listeners.map(([flags, name, method]) => {
|
|
25
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
26
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
27
|
+
const opts = hostListenerOpts(flags);
|
|
28
|
+
plt.ael(target, name, handler, opts);
|
|
29
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
34
|
+
try {
|
|
35
|
+
{
|
|
36
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
37
|
+
// instance is ready, let's call it's member method for this event
|
|
38
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
consoleError(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
50
|
+
if (flags & 8 /* TargetWindow */)
|
|
51
|
+
return win;
|
|
52
|
+
return elm;
|
|
53
|
+
};
|
|
54
|
+
// prettier-ignore
|
|
55
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
56
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
57
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
18
58
|
const createTime = (fnName, tagName = '') => {
|
|
19
59
|
{
|
|
20
60
|
return () => {
|
|
@@ -29,8 +69,6 @@ const uniqueTime = (key, measureText) => {
|
|
|
29
69
|
};
|
|
30
70
|
}
|
|
31
71
|
};
|
|
32
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
33
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
34
72
|
/**
|
|
35
73
|
* Default style mode id
|
|
36
74
|
*/
|
|
@@ -44,30 +82,11 @@ const EMPTY_OBJ = {};
|
|
|
44
82
|
*/
|
|
45
83
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
46
84
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
47
|
-
/**
|
|
48
|
-
* Check whether a value is a 'complex type', defined here as an object or a
|
|
49
|
-
* function.
|
|
50
|
-
*
|
|
51
|
-
* @param o the value to check
|
|
52
|
-
* @returns whether it's a complex type or not
|
|
53
|
-
*/
|
|
54
85
|
const isComplexType = (o) => {
|
|
55
86
|
// https://jsperf.com/typeof-fn-object/5
|
|
56
87
|
o = typeof o;
|
|
57
88
|
return o === 'object' || o === 'function';
|
|
58
89
|
};
|
|
59
|
-
/**
|
|
60
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
|
61
|
-
* out of a DOM's head.
|
|
62
|
-
*
|
|
63
|
-
* @param doc The DOM containing the `head` to query against
|
|
64
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
65
|
-
* exists or the tag has no content.
|
|
66
|
-
*/
|
|
67
|
-
function queryNonceMetaTagContent(doc) {
|
|
68
|
-
var _a, _b, _c;
|
|
69
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
70
|
-
}
|
|
71
90
|
/**
|
|
72
91
|
* Production h() function based on Preact by
|
|
73
92
|
* Jason Miller (@developit)
|
|
@@ -76,6 +95,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
76
95
|
*
|
|
77
96
|
* Modified for Stencil's compiler and vdom
|
|
78
97
|
*/
|
|
98
|
+
// const stack: any[] = [];
|
|
79
99
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
80
100
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
81
101
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -84,7 +104,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
84
104
|
let slotName = null;
|
|
85
105
|
let simple = false;
|
|
86
106
|
let lastSimple = false;
|
|
87
|
-
|
|
107
|
+
let vNodeChildren = [];
|
|
88
108
|
const walk = (c) => {
|
|
89
109
|
for (let i = 0; i < c.length; i++) {
|
|
90
110
|
child = c[i];
|
|
@@ -145,14 +165,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
145
165
|
}
|
|
146
166
|
return vnode;
|
|
147
167
|
};
|
|
148
|
-
/**
|
|
149
|
-
* A utility function for creating a virtual DOM node from a tag and some
|
|
150
|
-
* possible text content.
|
|
151
|
-
*
|
|
152
|
-
* @param tag the tag for this element
|
|
153
|
-
* @param text possible text content for the node
|
|
154
|
-
* @returns a newly-minted virtual DOM node
|
|
155
|
-
*/
|
|
156
168
|
const newVNode = (tag, text) => {
|
|
157
169
|
const vnode = {
|
|
158
170
|
$flags$: 0,
|
|
@@ -173,31 +185,11 @@ const newVNode = (tag, text) => {
|
|
|
173
185
|
return vnode;
|
|
174
186
|
};
|
|
175
187
|
const Host = {};
|
|
176
|
-
/**
|
|
177
|
-
* Check whether a given node is a Host node or not
|
|
178
|
-
*
|
|
179
|
-
* @param node the virtual DOM node to check
|
|
180
|
-
* @returns whether it's a Host node or not
|
|
181
|
-
*/
|
|
182
188
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
183
|
-
/**
|
|
184
|
-
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
185
|
-
*
|
|
186
|
-
* Note that these functions convert from {@link d.VNode} to
|
|
187
|
-
* {@link d.ChildNode} to give functional component developers a friendly
|
|
188
|
-
* interface.
|
|
189
|
-
*/
|
|
190
189
|
const vdomFnUtils = {
|
|
191
190
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
192
191
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
193
192
|
};
|
|
194
|
-
/**
|
|
195
|
-
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
196
|
-
* friendlier public interface (hence, 'convertToPublic').
|
|
197
|
-
*
|
|
198
|
-
* @param node the virtual DOM node to convert
|
|
199
|
-
* @returns a converted child node
|
|
200
|
-
*/
|
|
201
193
|
const convertToPublic = (node) => ({
|
|
202
194
|
vattrs: node.$attrs$,
|
|
203
195
|
vchildren: node.$children$,
|
|
@@ -206,15 +198,6 @@ const convertToPublic = (node) => ({
|
|
|
206
198
|
vtag: node.$tag$,
|
|
207
199
|
vtext: node.$text$,
|
|
208
200
|
});
|
|
209
|
-
/**
|
|
210
|
-
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
211
|
-
* order to use the resulting object in the virtual DOM. The initial object was
|
|
212
|
-
* likely created as part of presenting a public API, so converting it back
|
|
213
|
-
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
214
|
-
*
|
|
215
|
-
* @param node the child node to convert
|
|
216
|
-
* @returns a converted virtual DOM node
|
|
217
|
-
*/
|
|
218
201
|
const convertToPrivate = (node) => {
|
|
219
202
|
if (typeof node.vtag === 'function') {
|
|
220
203
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -233,144 +216,6 @@ const convertToPrivate = (node) => {
|
|
|
233
216
|
vnode.$name$ = node.vname;
|
|
234
217
|
return vnode;
|
|
235
218
|
};
|
|
236
|
-
/**
|
|
237
|
-
* Parse a new property value for a given property type.
|
|
238
|
-
*
|
|
239
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
240
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
241
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
242
|
-
* 2. the type stored from `propType`.
|
|
243
|
-
*
|
|
244
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
245
|
-
*
|
|
246
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
247
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
248
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
249
|
-
* ```tsx
|
|
250
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
251
|
-
* ```
|
|
252
|
-
*
|
|
253
|
-
* HTML prop values on the other hand, will always a string
|
|
254
|
-
*
|
|
255
|
-
* @param propValue the new value to coerce to some type
|
|
256
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
257
|
-
* @returns the parsed/coerced value
|
|
258
|
-
*/
|
|
259
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
260
|
-
// ensure this value is of the correct prop type
|
|
261
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
262
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
263
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
264
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
265
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
266
|
-
}
|
|
267
|
-
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
268
|
-
// force it to be a number
|
|
269
|
-
return parseFloat(propValue);
|
|
270
|
-
}
|
|
271
|
-
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
272
|
-
// could have been passed as a number or boolean
|
|
273
|
-
// but we still want it as a string
|
|
274
|
-
return String(propValue);
|
|
275
|
-
}
|
|
276
|
-
// redundant return here for better minification
|
|
277
|
-
return propValue;
|
|
278
|
-
}
|
|
279
|
-
// not sure exactly what type we want
|
|
280
|
-
// so no need to change to a different type
|
|
281
|
-
return propValue;
|
|
282
|
-
};
|
|
283
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
284
|
-
const createEvent = (ref, name, flags) => {
|
|
285
|
-
const elm = getElement(ref);
|
|
286
|
-
return {
|
|
287
|
-
emit: (detail) => {
|
|
288
|
-
return emitEvent(elm, name, {
|
|
289
|
-
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
290
|
-
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
291
|
-
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
292
|
-
detail,
|
|
293
|
-
});
|
|
294
|
-
},
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
/**
|
|
298
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
299
|
-
* @param elm the target of the Event
|
|
300
|
-
* @param name the name to give the custom Event
|
|
301
|
-
* @param opts options for configuring a custom Event
|
|
302
|
-
* @returns the custom Event
|
|
303
|
-
*/
|
|
304
|
-
const emitEvent = (elm, name, opts) => {
|
|
305
|
-
const ev = plt.ce(name, opts);
|
|
306
|
-
elm.dispatchEvent(ev);
|
|
307
|
-
return ev;
|
|
308
|
-
};
|
|
309
|
-
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
310
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
311
|
-
let style = styles.get(scopeId);
|
|
312
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
313
|
-
style = (style || new CSSStyleSheet());
|
|
314
|
-
if (typeof style === 'string') {
|
|
315
|
-
style = cssText;
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
style.replaceSync(cssText);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
style = cssText;
|
|
323
|
-
}
|
|
324
|
-
styles.set(scopeId, style);
|
|
325
|
-
};
|
|
326
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
327
|
-
var _a;
|
|
328
|
-
let scopeId = getScopeId(cmpMeta);
|
|
329
|
-
const style = styles.get(scopeId);
|
|
330
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
331
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
332
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
333
|
-
if (style) {
|
|
334
|
-
if (typeof style === 'string') {
|
|
335
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
336
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
337
|
-
let styleElm;
|
|
338
|
-
if (!appliedStyles) {
|
|
339
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
340
|
-
}
|
|
341
|
-
if (!appliedStyles.has(scopeId)) {
|
|
342
|
-
{
|
|
343
|
-
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
344
|
-
{
|
|
345
|
-
styleElm = doc.createElement('style');
|
|
346
|
-
styleElm.innerHTML = style;
|
|
347
|
-
}
|
|
348
|
-
// Apply CSP nonce to the style tag if it exists
|
|
349
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
350
|
-
if (nonce != null) {
|
|
351
|
-
styleElm.setAttribute('nonce', nonce);
|
|
352
|
-
}
|
|
353
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
354
|
-
}
|
|
355
|
-
if (appliedStyles) {
|
|
356
|
-
appliedStyles.add(scopeId);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
361
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
return scopeId;
|
|
365
|
-
};
|
|
366
|
-
const attachStyles = (hostRef) => {
|
|
367
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
368
|
-
const elm = hostRef.$hostElement$;
|
|
369
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
370
|
-
addStyle(elm.getRootNode(), cmpMeta);
|
|
371
|
-
endAttachStyles();
|
|
372
|
-
};
|
|
373
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
374
219
|
/**
|
|
375
220
|
* Production setAccessor() function based on Preact by
|
|
376
221
|
* Jason Miller (@developit)
|
|
@@ -468,10 +313,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
468
313
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
469
314
|
try {
|
|
470
315
|
if (!elm.tagName.includes('-')) {
|
|
471
|
-
|
|
316
|
+
let n = newValue == null ? '' : newValue;
|
|
472
317
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
473
318
|
if (memberName === 'list') {
|
|
474
319
|
isProp = false;
|
|
320
|
+
// tslint:disable-next-line: triple-equals
|
|
475
321
|
}
|
|
476
322
|
else if (oldValue == null || elm[memberName] != n) {
|
|
477
323
|
elm[memberName] = n;
|
|
@@ -507,7 +353,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
507
353
|
}
|
|
508
354
|
}
|
|
509
355
|
}
|
|
510
|
-
else if ((!isProp || flags & 4 /*
|
|
356
|
+
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
511
357
|
newValue = newValue === true ? '' : newValue;
|
|
512
358
|
if (xlink) {
|
|
513
359
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -525,7 +371,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
525
371
|
// if the element passed in is a shadow root, which is a document fragment
|
|
526
372
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
527
373
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
528
|
-
const elm = newVnode.$elm$.nodeType === 11 /*
|
|
374
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
529
375
|
? newVnode.$elm$.host
|
|
530
376
|
: newVnode.$elm$;
|
|
531
377
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -543,19 +389,9 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
543
389
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
544
390
|
}
|
|
545
391
|
};
|
|
546
|
-
/**
|
|
547
|
-
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
548
|
-
*
|
|
549
|
-
* @param oldParentVNode the parent VNode from the previous render
|
|
550
|
-
* @param newParentVNode the parent VNode from the current render
|
|
551
|
-
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
552
|
-
* children, for which we will create a new DOM node
|
|
553
|
-
* @param parentElm the parent DOM node which our new node will be a child of
|
|
554
|
-
* @returns the newly created node
|
|
555
|
-
*/
|
|
556
392
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
557
393
|
// tslint:disable-next-line: prefer-const
|
|
558
|
-
|
|
394
|
+
let newVNode = newParentVNode.$children$[childIndex];
|
|
559
395
|
let i = 0;
|
|
560
396
|
let elm;
|
|
561
397
|
let childNode;
|
|
@@ -566,16 +402,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
566
402
|
if (newVNode.$tag$ === 'slot') {
|
|
567
403
|
newVNode.$flags$ |= newVNode.$children$
|
|
568
404
|
? // slot element has fallback content
|
|
569
|
-
2 /*
|
|
405
|
+
2 /* isSlotFallback */
|
|
570
406
|
: // slot element does not have fallback content
|
|
571
|
-
1 /*
|
|
407
|
+
1 /* isSlotReference */;
|
|
572
408
|
}
|
|
573
409
|
}
|
|
574
410
|
if (newVNode.$text$ !== null) {
|
|
575
411
|
// create text node
|
|
576
412
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
577
413
|
}
|
|
578
|
-
else if (newVNode.$flags$ & 1 /*
|
|
414
|
+
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
579
415
|
// create a slot reference node
|
|
580
416
|
elm = newVNode.$elm$ =
|
|
581
417
|
doc.createTextNode('');
|
|
@@ -585,7 +421,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
585
421
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
586
422
|
}
|
|
587
423
|
// create element
|
|
588
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /*
|
|
424
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
589
425
|
? 'slot-fb'
|
|
590
426
|
: newVNode.$tag$)
|
|
591
427
|
);
|
|
@@ -620,7 +456,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
620
456
|
}
|
|
621
457
|
{
|
|
622
458
|
elm['s-hn'] = hostTagName;
|
|
623
|
-
if (newVNode.$flags$ & (2 /*
|
|
459
|
+
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
624
460
|
// remember the content reference comment
|
|
625
461
|
elm['s-sr'] = true;
|
|
626
462
|
// remember the content reference comment
|
|
@@ -639,7 +475,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
639
475
|
return elm;
|
|
640
476
|
};
|
|
641
477
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
642
|
-
plt.$flags$ |= 1 /*
|
|
478
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
643
479
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
644
480
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
645
481
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -660,23 +496,8 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
660
496
|
putBackInOriginalLocation(childNode, recursive);
|
|
661
497
|
}
|
|
662
498
|
}
|
|
663
|
-
plt.$flags$ &= ~1 /*
|
|
499
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
664
500
|
};
|
|
665
|
-
/**
|
|
666
|
-
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
667
|
-
* add them to the DOM in the appropriate place.
|
|
668
|
-
*
|
|
669
|
-
* @param parentElm the DOM node which should be used as a parent for the new
|
|
670
|
-
* DOM nodes
|
|
671
|
-
* @param before a child of the `parentElm` which the new children should be
|
|
672
|
-
* inserted before (optional)
|
|
673
|
-
* @param parentVNode the parent virtual DOM node
|
|
674
|
-
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
675
|
-
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
676
|
-
* creating DOM nodes (inclusive)
|
|
677
|
-
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
678
|
-
* creating DOM nodes (inclusive)
|
|
679
|
-
*/
|
|
680
501
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
681
502
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
682
503
|
let childNode;
|
|
@@ -690,19 +511,6 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
690
511
|
}
|
|
691
512
|
}
|
|
692
513
|
};
|
|
693
|
-
/**
|
|
694
|
-
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
695
|
-
* This can be used to, for instance, clean up after a list of children which
|
|
696
|
-
* should no longer be shown.
|
|
697
|
-
*
|
|
698
|
-
* This function also handles some of Stencil's slot relocation logic.
|
|
699
|
-
*
|
|
700
|
-
* @param vnodes a list of virtual DOM nodes to remove
|
|
701
|
-
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
702
|
-
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
703
|
-
* @param vnode a VNode
|
|
704
|
-
* @param elm an element
|
|
705
|
-
*/
|
|
706
514
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
707
515
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
708
516
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -727,74 +535,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
727
535
|
}
|
|
728
536
|
}
|
|
729
537
|
};
|
|
730
|
-
/**
|
|
731
|
-
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
732
|
-
* traversing the two collections of children, identifying nodes that are
|
|
733
|
-
* conserved or changed, calling out to `patch` to make any necessary
|
|
734
|
-
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
735
|
-
*
|
|
736
|
-
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
737
|
-
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
738
|
-
* 'windows' by storing start and end indices and references to the
|
|
739
|
-
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
740
|
-
* to the entire array, but we progressively narrow the windows until there are
|
|
741
|
-
* no children left to update by doing the following:
|
|
742
|
-
*
|
|
743
|
-
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
744
|
-
* that if we have an initial array like the following we'll end up dealing
|
|
745
|
-
* only with a window bounded by the highlighted elements:
|
|
746
|
-
*
|
|
747
|
-
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
748
|
-
* ^^^^^^ ^^^^^^
|
|
749
|
-
*
|
|
750
|
-
* 2. Check to see if the elements at the head and tail positions are equal
|
|
751
|
-
* across the windows. This will basically detect elements which haven't
|
|
752
|
-
* been added, removed, or changed position, i.e. if you had the following
|
|
753
|
-
* VNode elements (represented as HTML):
|
|
754
|
-
*
|
|
755
|
-
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
756
|
-
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
757
|
-
*
|
|
758
|
-
* Then when comparing the children of the `<div>` tag we check the equality
|
|
759
|
-
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
760
|
-
* same tag in the same position, we'd be able to avoid completely
|
|
761
|
-
* re-rendering the subtree under them with a new DOM element and would just
|
|
762
|
-
* call out to `patch` to handle reconciling their children and so on.
|
|
763
|
-
*
|
|
764
|
-
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
765
|
-
* window corresponds to the element at the end of the other window. This is
|
|
766
|
-
* a heuristic which will let us identify _some_ situations in which
|
|
767
|
-
* elements have changed position, for instance it _should_ detect that the
|
|
768
|
-
* children nodes themselves have not changed but merely moved in the
|
|
769
|
-
* following example:
|
|
770
|
-
*
|
|
771
|
-
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
772
|
-
* newVNode: `<div><element-two /><element-one /></div>`
|
|
773
|
-
*
|
|
774
|
-
* If we find cases like this then we also need to move the concrete DOM
|
|
775
|
-
* elements corresponding to the moved children to write the re-order to the
|
|
776
|
-
* DOM.
|
|
777
|
-
*
|
|
778
|
-
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
779
|
-
* nodes in the old children which have the same key as the first element in
|
|
780
|
-
* our window on the new children. If we find such a node we handle calling
|
|
781
|
-
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
782
|
-
* what we find.
|
|
783
|
-
*
|
|
784
|
-
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
785
|
-
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
786
|
-
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
787
|
-
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
788
|
-
* children has collapsed we still have more nodes on the new children that
|
|
789
|
-
* we haven't dealt with yet then we need to add them, or if the new children
|
|
790
|
-
* collapse but we still have unhandled _old_ children then we need to make
|
|
791
|
-
* sure the corresponding DOM nodes are removed.
|
|
792
|
-
*
|
|
793
|
-
* @param parentElm the node into which the parent VNode is rendered
|
|
794
|
-
* @param oldCh the old children of the parent node
|
|
795
|
-
* @param newVNode the new VNode which will replace the parent
|
|
796
|
-
* @param newCh the new children of the parent node
|
|
797
|
-
*/
|
|
798
538
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
799
539
|
let oldStartIdx = 0;
|
|
800
540
|
let newStartIdx = 0;
|
|
@@ -810,7 +550,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
810
550
|
let elmToMove;
|
|
811
551
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
812
552
|
if (oldStartVnode == null) {
|
|
813
|
-
//
|
|
553
|
+
// Vnode might have been moved left
|
|
814
554
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
815
555
|
}
|
|
816
556
|
else if (oldEndVnode == null) {
|
|
@@ -823,100 +563,37 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
823
563
|
newEndVnode = newCh[--newEndIdx];
|
|
824
564
|
}
|
|
825
565
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
826
|
-
// if the start nodes are the same then we should patch the new VNode
|
|
827
|
-
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
828
|
-
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
829
|
-
// since things are matched up in order.
|
|
830
566
|
patch(oldStartVnode, newStartVnode);
|
|
831
567
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
832
568
|
newStartVnode = newCh[++newStartIdx];
|
|
833
569
|
}
|
|
834
570
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
835
|
-
// likewise, if the end nodes are the same we patch new onto old and
|
|
836
|
-
// decrement our end indices, and also likewise in this case we don't
|
|
837
|
-
// need to move any DOM Nodes.
|
|
838
571
|
patch(oldEndVnode, newEndVnode);
|
|
839
572
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
840
573
|
newEndVnode = newCh[--newEndIdx];
|
|
841
574
|
}
|
|
842
575
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
843
|
-
//
|
|
844
|
-
//
|
|
845
|
-
// We've found that the last node in our window on the new children is
|
|
846
|
-
// the same VNode as the _first_ node in our window on the old children
|
|
847
|
-
// we're dealing with now. Visually, this is the layout of these two
|
|
848
|
-
// nodes:
|
|
849
|
-
//
|
|
850
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
851
|
-
// ^^^^^^^^^^^
|
|
852
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
853
|
-
// ^^^^^^^^^^^^^
|
|
854
|
-
//
|
|
855
|
-
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
856
|
-
// and move the DOM element for `oldStartVnode`.
|
|
576
|
+
// Vnode moved right
|
|
857
577
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
858
578
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
859
579
|
}
|
|
860
580
|
patch(oldStartVnode, newEndVnode);
|
|
861
|
-
// We need to move the element for `oldStartVnode` into a position which
|
|
862
|
-
// will be appropriate for `newEndVnode`. For this we can use
|
|
863
|
-
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
864
|
-
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
865
|
-
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
866
|
-
//
|
|
867
|
-
// <old-start-node />
|
|
868
|
-
// <some-intervening-node />
|
|
869
|
-
// <old-end-node />
|
|
870
|
-
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
871
|
-
// <next-sibling />
|
|
872
|
-
//
|
|
873
|
-
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
874
|
-
// the node for `oldStartVnode` at the end of the children of
|
|
875
|
-
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
876
|
-
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
877
|
-
// append it to the children of the parent element.
|
|
878
581
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
879
582
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
880
583
|
newEndVnode = newCh[--newEndIdx];
|
|
881
584
|
}
|
|
882
585
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
883
|
-
//
|
|
884
|
-
//
|
|
885
|
-
// We've found that the first node in our window on the new children is
|
|
886
|
-
// the same VNode as the _last_ node in our window on the old children.
|
|
887
|
-
// Visually, this is the layout of these two nodes:
|
|
888
|
-
//
|
|
889
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
890
|
-
// ^^^^^^^^^^^^^
|
|
891
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
892
|
-
// ^^^^^^^^^^^
|
|
893
|
-
//
|
|
894
|
-
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
895
|
-
// (which will handle updating any changed attributes, reconciling their
|
|
896
|
-
// children etc) but we also need to move the DOM node to which
|
|
897
|
-
// `oldEndVnode` corresponds.
|
|
586
|
+
// Vnode moved left
|
|
898
587
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
899
588
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
900
589
|
}
|
|
901
590
|
patch(oldEndVnode, newStartVnode);
|
|
902
|
-
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
903
|
-
// the same node, so since we're here we know that they are not. Thus we
|
|
904
|
-
// can move the element for `oldEndVnode` _before_ the element for
|
|
905
|
-
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
906
|
-
// future.
|
|
907
591
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
908
592
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
909
593
|
newStartVnode = newCh[++newStartIdx];
|
|
910
594
|
}
|
|
911
595
|
else {
|
|
912
|
-
//
|
|
913
|
-
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
914
|
-
// in the JSX for a DOM element in the implementation of a Stencil
|
|
915
|
-
// component.
|
|
916
|
-
//
|
|
917
|
-
// First we check to see if there are any nodes in the array of old
|
|
918
|
-
// children which have the same key as the first node in the new
|
|
919
|
-
// children.
|
|
596
|
+
// createKeyToOldIdx
|
|
920
597
|
idxInOld = -1;
|
|
921
598
|
{
|
|
922
599
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -927,32 +604,23 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
927
604
|
}
|
|
928
605
|
}
|
|
929
606
|
if (idxInOld >= 0) {
|
|
930
|
-
// We found a node in the old children which matches up with the first
|
|
931
|
-
// node in the new children! So let's deal with that
|
|
932
607
|
elmToMove = oldCh[idxInOld];
|
|
933
608
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
934
|
-
// the tag doesn't match so we'll need a new DOM element
|
|
935
609
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
936
610
|
}
|
|
937
611
|
else {
|
|
938
612
|
patch(elmToMove, newStartVnode);
|
|
939
|
-
// invalidate the matching old node so that we won't try to update it
|
|
940
|
-
// again later on
|
|
941
613
|
oldCh[idxInOld] = undefined;
|
|
942
614
|
node = elmToMove.$elm$;
|
|
943
615
|
}
|
|
944
616
|
newStartVnode = newCh[++newStartIdx];
|
|
945
617
|
}
|
|
946
618
|
else {
|
|
947
|
-
//
|
|
948
|
-
// the key of the first new child OR the build is not using `key`
|
|
949
|
-
// attributes at all. In either case we need to create a new element
|
|
950
|
-
// for the new node.
|
|
619
|
+
// new element
|
|
951
620
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
952
621
|
newStartVnode = newCh[++newStartIdx];
|
|
953
622
|
}
|
|
954
623
|
if (node) {
|
|
955
|
-
// if we created a new node then handle inserting it to the DOM
|
|
956
624
|
{
|
|
957
625
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
958
626
|
}
|
|
@@ -960,44 +628,21 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
960
628
|
}
|
|
961
629
|
}
|
|
962
630
|
if (oldStartIdx > oldEndIdx) {
|
|
963
|
-
// we have some more new nodes to add which don't match up with old nodes
|
|
964
631
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
965
632
|
}
|
|
966
633
|
else if (newStartIdx > newEndIdx) {
|
|
967
|
-
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
968
|
-
// in the new array, so lets remove them (which entails cleaning up the
|
|
969
|
-
// relevant DOM nodes)
|
|
970
634
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
971
635
|
}
|
|
972
636
|
};
|
|
973
|
-
|
|
974
|
-
* Compare two VNodes to determine if they are the same
|
|
975
|
-
*
|
|
976
|
-
* **NB**: This function is an equality _heuristic_ based on the available
|
|
977
|
-
* information set on the two VNodes and can be misleading under certain
|
|
978
|
-
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
979
|
-
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
980
|
-
* checking that they have the same tag.
|
|
981
|
-
*
|
|
982
|
-
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
983
|
-
* changing order within a `children` array or something along those lines then
|
|
984
|
-
* we could obtain a false negative and then have to do needless re-rendering
|
|
985
|
-
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
986
|
-
*
|
|
987
|
-
* @param leftVNode the first VNode to check
|
|
988
|
-
* @param rightVNode the second VNode to check
|
|
989
|
-
* @returns whether they're equal or not
|
|
990
|
-
*/
|
|
991
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
637
|
+
const isSameVnode = (vnode1, vnode2) => {
|
|
992
638
|
// compare if two vnode to see if they're "technically" the same
|
|
993
639
|
// need to have the same element tag, and same key to be the same
|
|
994
|
-
if (
|
|
995
|
-
if (
|
|
996
|
-
return
|
|
640
|
+
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
641
|
+
if (vnode1.$tag$ === 'slot') {
|
|
642
|
+
return vnode1.$name$ === vnode2.$name$;
|
|
997
643
|
}
|
|
998
|
-
// this will be set if components in the build have `key` attrs set on them
|
|
999
644
|
{
|
|
1000
|
-
return
|
|
645
|
+
return vnode1.$key$ === vnode2.$key$;
|
|
1001
646
|
}
|
|
1002
647
|
}
|
|
1003
648
|
return false;
|
|
@@ -1010,14 +655,6 @@ const referenceNode = (node) => {
|
|
|
1010
655
|
return (node && node['s-ol']) || node;
|
|
1011
656
|
};
|
|
1012
657
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
1013
|
-
/**
|
|
1014
|
-
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1015
|
-
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1016
|
-
* children of the two nodes (if any).
|
|
1017
|
-
*
|
|
1018
|
-
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1019
|
-
* @param newVNode a new VNode representing an updated version of the old one
|
|
1020
|
-
*/
|
|
1021
658
|
const patch = (oldVNode, newVNode) => {
|
|
1022
659
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
1023
660
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1031,6 +668,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1031
668
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1032
669
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1033
670
|
}
|
|
671
|
+
// element node
|
|
1034
672
|
{
|
|
1035
673
|
if (tag === 'slot')
|
|
1036
674
|
;
|
|
@@ -1043,7 +681,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1043
681
|
}
|
|
1044
682
|
if (oldChildren !== null && newChildren !== null) {
|
|
1045
683
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1046
|
-
// so we need to call `updateChildren` to reconcile them
|
|
1047
684
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
1048
685
|
}
|
|
1049
686
|
else if (newChildren !== null) {
|
|
@@ -1075,7 +712,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1075
712
|
};
|
|
1076
713
|
const updateFallbackSlotVisibility = (elm) => {
|
|
1077
714
|
// tslint:disable-next-line: prefer-const
|
|
1078
|
-
|
|
715
|
+
let childNodes = elm.childNodes;
|
|
1079
716
|
let childNode;
|
|
1080
717
|
let i;
|
|
1081
718
|
let ilen;
|
|
@@ -1084,7 +721,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1084
721
|
let nodeType;
|
|
1085
722
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1086
723
|
childNode = childNodes[i];
|
|
1087
|
-
if (childNode.nodeType === 1 /*
|
|
724
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1088
725
|
if (childNode['s-sr']) {
|
|
1089
726
|
// this is a slot fallback node
|
|
1090
727
|
// get the slot name for this slot reference node
|
|
@@ -1096,7 +733,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1096
733
|
nodeType = childNodes[j].nodeType;
|
|
1097
734
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
1098
735
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
1099
|
-
if (nodeType === 1 /*
|
|
736
|
+
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1100
737
|
childNode.hidden = true;
|
|
1101
738
|
break;
|
|
1102
739
|
}
|
|
@@ -1105,8 +742,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1105
742
|
// this is a default fallback slot node
|
|
1106
743
|
// any element or text node (with content)
|
|
1107
744
|
// should hide the default fallback slot node
|
|
1108
|
-
if (nodeType === 1 /*
|
|
1109
|
-
(nodeType === 3 /*
|
|
745
|
+
if (nodeType === 1 /* ElementNode */ ||
|
|
746
|
+
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1110
747
|
childNode.hidden = true;
|
|
1111
748
|
break;
|
|
1112
749
|
}
|
|
@@ -1128,8 +765,8 @@ const relocateSlotContent = (elm) => {
|
|
|
1128
765
|
let relocateNodeData;
|
|
1129
766
|
let j;
|
|
1130
767
|
let i = 0;
|
|
1131
|
-
|
|
1132
|
-
|
|
768
|
+
let childNodes = elm.childNodes;
|
|
769
|
+
let ilen = childNodes.length;
|
|
1133
770
|
for (; i < ilen; i++) {
|
|
1134
771
|
childNode = childNodes[i];
|
|
1135
772
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -1184,13 +821,13 @@ const relocateSlotContent = (elm) => {
|
|
|
1184
821
|
}
|
|
1185
822
|
}
|
|
1186
823
|
}
|
|
1187
|
-
if (childNode.nodeType === 1 /*
|
|
824
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1188
825
|
relocateSlotContent(childNode);
|
|
1189
826
|
}
|
|
1190
827
|
}
|
|
1191
828
|
};
|
|
1192
829
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
1193
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
830
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1194
831
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
1195
832
|
return true;
|
|
1196
833
|
}
|
|
@@ -1210,18 +847,6 @@ const callNodeRefs = (vNode) => {
|
|
|
1210
847
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1211
848
|
}
|
|
1212
849
|
};
|
|
1213
|
-
/**
|
|
1214
|
-
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1215
|
-
*
|
|
1216
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1217
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1218
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1219
|
-
* relocation, and reflecting attributes.
|
|
1220
|
-
*
|
|
1221
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1222
|
-
* the DOM node into which it should be rendered.
|
|
1223
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1224
|
-
*/
|
|
1225
850
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
1226
851
|
const hostElm = hostRef.$hostElement$;
|
|
1227
852
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -1233,12 +858,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1233
858
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1234
859
|
}
|
|
1235
860
|
rootVnode.$tag$ = null;
|
|
1236
|
-
rootVnode.$flags$ |= 4 /*
|
|
861
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1237
862
|
hostRef.$vnode$ = rootVnode;
|
|
1238
863
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
1239
864
|
{
|
|
1240
865
|
contentRef = hostElm['s-cr'];
|
|
1241
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /*
|
|
866
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1242
867
|
// always reset
|
|
1243
868
|
checkSlotFallbackVisibility = false;
|
|
1244
869
|
}
|
|
@@ -1247,7 +872,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1247
872
|
{
|
|
1248
873
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1249
874
|
// the disconnectCallback from working
|
|
1250
|
-
plt.$flags$ |= 1 /*
|
|
875
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1251
876
|
if (checkSlotRelocate) {
|
|
1252
877
|
relocateSlotContent(rootVnode.$elm$);
|
|
1253
878
|
let relocateData;
|
|
@@ -1305,7 +930,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1305
930
|
}
|
|
1306
931
|
else {
|
|
1307
932
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1308
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
933
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1309
934
|
nodeToRelocate.hidden = true;
|
|
1310
935
|
}
|
|
1311
936
|
}
|
|
@@ -1316,11 +941,30 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1316
941
|
}
|
|
1317
942
|
// done moving nodes around
|
|
1318
943
|
// allow the disconnect callback to work again
|
|
1319
|
-
plt.$flags$ &= ~1 /*
|
|
944
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1320
945
|
// always reset
|
|
1321
946
|
relocateNodes.length = 0;
|
|
1322
947
|
}
|
|
1323
948
|
};
|
|
949
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
950
|
+
const createEvent = (ref, name, flags) => {
|
|
951
|
+
const elm = getElement(ref);
|
|
952
|
+
return {
|
|
953
|
+
emit: (detail) => {
|
|
954
|
+
return emitEvent(elm, name, {
|
|
955
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
956
|
+
composed: !!(flags & 2 /* Composed */),
|
|
957
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
958
|
+
detail,
|
|
959
|
+
});
|
|
960
|
+
},
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
const emitEvent = (elm, name, opts) => {
|
|
964
|
+
const ev = plt.ce(name, opts);
|
|
965
|
+
elm.dispatchEvent(ev);
|
|
966
|
+
return ev;
|
|
967
|
+
};
|
|
1324
968
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1325
969
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1326
970
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1328,10 +972,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1328
972
|
};
|
|
1329
973
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1330
974
|
{
|
|
1331
|
-
hostRef.$flags$ |= 16 /*
|
|
975
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1332
976
|
}
|
|
1333
|
-
if (hostRef.$flags$ & 4 /*
|
|
1334
|
-
hostRef.$flags$ |= 512 /*
|
|
977
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
978
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1335
979
|
return;
|
|
1336
980
|
}
|
|
1337
981
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1347,7 +991,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1347
991
|
let promise;
|
|
1348
992
|
if (isInitialLoad) {
|
|
1349
993
|
{
|
|
1350
|
-
hostRef.$flags$ |= 256 /*
|
|
994
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1351
995
|
if (hostRef.$queuedListeners$) {
|
|
1352
996
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1353
997
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1358,17 +1002,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1358
1002
|
}
|
|
1359
1003
|
}
|
|
1360
1004
|
endSchedule();
|
|
1361
|
-
return then(promise, () => updateComponent(hostRef, instance
|
|
1005
|
+
return then(promise, () => updateComponent(hostRef, instance));
|
|
1362
1006
|
};
|
|
1363
1007
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1364
1008
|
// updateComponent
|
|
1365
1009
|
const elm = hostRef.$hostElement$;
|
|
1366
1010
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1367
1011
|
const rc = elm['s-rc'];
|
|
1368
|
-
if (isInitialLoad) {
|
|
1369
|
-
// DOM WRITE!
|
|
1370
|
-
attachStyles(hostRef);
|
|
1371
|
-
}
|
|
1372
1012
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1373
1013
|
{
|
|
1374
1014
|
callRender(hostRef, instance);
|
|
@@ -1390,7 +1030,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1390
1030
|
}
|
|
1391
1031
|
else {
|
|
1392
1032
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1393
|
-
hostRef.$flags$ |= 4 /*
|
|
1033
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1394
1034
|
childrenPromises.length = 0;
|
|
1395
1035
|
}
|
|
1396
1036
|
}
|
|
@@ -1399,10 +1039,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1399
1039
|
try {
|
|
1400
1040
|
instance = instance.render() ;
|
|
1401
1041
|
{
|
|
1402
|
-
hostRef.$flags$ &= ~16 /*
|
|
1042
|
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1403
1043
|
}
|
|
1404
1044
|
{
|
|
1405
|
-
hostRef.$flags$ |= 2 /*
|
|
1045
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1406
1046
|
}
|
|
1407
1047
|
{
|
|
1408
1048
|
{
|
|
@@ -1429,8 +1069,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1429
1069
|
{
|
|
1430
1070
|
safeCall(instance, 'componentDidRender');
|
|
1431
1071
|
}
|
|
1432
|
-
if (!(hostRef.$flags$ & 64 /*
|
|
1433
|
-
hostRef.$flags$ |= 64 /*
|
|
1072
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1073
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1434
1074
|
{
|
|
1435
1075
|
// DOM WRITE!
|
|
1436
1076
|
addHydratedFlag(elm);
|
|
@@ -1462,10 +1102,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1462
1102
|
hostRef.$onRenderResolve$();
|
|
1463
1103
|
hostRef.$onRenderResolve$ = undefined;
|
|
1464
1104
|
}
|
|
1465
|
-
if (hostRef.$flags$ & 512 /*
|
|
1105
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1466
1106
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1467
1107
|
}
|
|
1468
|
-
hostRef.$flags$ &= ~(4 /*
|
|
1108
|
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1469
1109
|
}
|
|
1470
1110
|
// ( •_•)
|
|
1471
1111
|
// ( •_•)>⌐■-■
|
|
@@ -1495,40 +1135,44 @@ const then = (promise, thenFn) => {
|
|
|
1495
1135
|
};
|
|
1496
1136
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1497
1137
|
;
|
|
1138
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
1139
|
+
// ensure this value is of the correct prop type
|
|
1140
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
1141
|
+
if (propType & 4 /* Boolean */) {
|
|
1142
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
1143
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1144
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1145
|
+
}
|
|
1146
|
+
if (propType & 2 /* Number */) {
|
|
1147
|
+
// force it to be a number
|
|
1148
|
+
return parseFloat(propValue);
|
|
1149
|
+
}
|
|
1150
|
+
if (propType & 1 /* String */) {
|
|
1151
|
+
// could have been passed as a number or boolean
|
|
1152
|
+
// but we still want it as a string
|
|
1153
|
+
return String(propValue);
|
|
1154
|
+
}
|
|
1155
|
+
// redundant return here for better minification
|
|
1156
|
+
return propValue;
|
|
1157
|
+
}
|
|
1158
|
+
// not sure exactly what type we want
|
|
1159
|
+
// so no need to change to a different type
|
|
1160
|
+
return propValue;
|
|
1161
|
+
};
|
|
1498
1162
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1499
1163
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1500
1164
|
// check our new property value against our internal value
|
|
1501
1165
|
const hostRef = getHostRef(ref);
|
|
1502
|
-
const elm = hostRef.$hostElement$ ;
|
|
1503
1166
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1504
1167
|
const flags = hostRef.$flags$;
|
|
1505
1168
|
const instance = hostRef.$lazyInstance$ ;
|
|
1506
1169
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1507
|
-
|
|
1508
|
-
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1509
|
-
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1510
|
-
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1170
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
|
1511
1171
|
// gadzooks! the property's value has changed!!
|
|
1512
1172
|
// set our new value!
|
|
1513
1173
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1514
1174
|
if (instance) {
|
|
1515
|
-
|
|
1516
|
-
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1517
|
-
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1518
|
-
if (watchMethods) {
|
|
1519
|
-
// this instance is watching for when this property changed
|
|
1520
|
-
watchMethods.map((watchMethodName) => {
|
|
1521
|
-
try {
|
|
1522
|
-
// fire off each of the watch methods that are watching this property
|
|
1523
|
-
instance[watchMethodName](newVal, oldVal, propName);
|
|
1524
|
-
}
|
|
1525
|
-
catch (e) {
|
|
1526
|
-
consoleError(e, elm);
|
|
1527
|
-
}
|
|
1528
|
-
});
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1175
|
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1532
1176
|
// looks like this value actually changed, so we've got work to do!
|
|
1533
1177
|
// but only if we've already rendered, otherwise just chill out
|
|
1534
1178
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1538,27 +1182,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1538
1182
|
}
|
|
1539
1183
|
}
|
|
1540
1184
|
};
|
|
1541
|
-
/**
|
|
1542
|
-
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1543
|
-
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1544
|
-
* decorators, callbacks for when attributes change, and so on.
|
|
1545
|
-
*
|
|
1546
|
-
* @param Cstr the constructor for a component that we need to process
|
|
1547
|
-
* @param cmpMeta metadata collected previously about the component
|
|
1548
|
-
* @param flags a number used to store a series of bit flags
|
|
1549
|
-
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1550
|
-
*/
|
|
1551
1185
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1552
1186
|
if (cmpMeta.$members$) {
|
|
1553
|
-
if (Cstr.watchers) {
|
|
1554
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1555
|
-
}
|
|
1556
1187
|
// It's better to have a const than two Object.entries()
|
|
1557
1188
|
const members = Object.entries(cmpMeta.$members$);
|
|
1558
1189
|
const prototype = Cstr.prototype;
|
|
1559
1190
|
members.map(([memberName, [memberFlags]]) => {
|
|
1560
|
-
if ((memberFlags & 31 /*
|
|
1561
|
-
((flags & 2 /*
|
|
1191
|
+
if ((memberFlags & 31 /* Prop */ ||
|
|
1192
|
+
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1562
1193
|
// proxyComponent - prop
|
|
1563
1194
|
Object.defineProperty(prototype, memberName, {
|
|
1564
1195
|
get() {
|
|
@@ -1573,8 +1204,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1573
1204
|
enumerable: true,
|
|
1574
1205
|
});
|
|
1575
1206
|
}
|
|
1576
|
-
else if (flags & 1 /*
|
|
1577
|
-
memberFlags & 64 /*
|
|
1207
|
+
else if (flags & 1 /* isElementConstructor */ &&
|
|
1208
|
+
memberFlags & 64 /* Method */) {
|
|
1578
1209
|
// proxyComponent - method
|
|
1579
1210
|
Object.defineProperty(prototype, memberName, {
|
|
1580
1211
|
value(...args) {
|
|
@@ -1584,19 +1215,19 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1584
1215
|
});
|
|
1585
1216
|
}
|
|
1586
1217
|
});
|
|
1587
|
-
if ((flags & 1 /*
|
|
1218
|
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
1588
1219
|
const attrNameToPropName = new Map();
|
|
1589
1220
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1590
1221
|
plt.jmp(() => {
|
|
1591
1222
|
const propName = attrNameToPropName.get(attrName);
|
|
1592
|
-
// In a
|
|
1223
|
+
// In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
|
|
1593
1224
|
// in the case where an attribute was set inline.
|
|
1594
1225
|
// ```html
|
|
1595
1226
|
// <my-component some-attribute="some-value"></my-component>
|
|
1596
1227
|
// ```
|
|
1597
1228
|
//
|
|
1598
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1599
|
-
//
|
|
1229
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then programatically
|
|
1230
|
+
// changes it before it has been upgraded as shown below:
|
|
1600
1231
|
//
|
|
1601
1232
|
// ```html
|
|
1602
1233
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1606,13 +1237,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1606
1237
|
// el = document.querySelector("#test");
|
|
1607
1238
|
// el.someAttribute = "another-value";
|
|
1608
1239
|
// // upgrade component
|
|
1609
|
-
//
|
|
1240
|
+
// cutsomElements.define('my-component', MyComponent);
|
|
1610
1241
|
// </script>
|
|
1611
1242
|
// ```
|
|
1612
1243
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1613
1244
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1614
1245
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1615
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1246
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
|
|
1616
1247
|
//
|
|
1617
1248
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1618
1249
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1626,25 +1257,17 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1626
1257
|
newValue = this[propName];
|
|
1627
1258
|
delete this[propName];
|
|
1628
1259
|
}
|
|
1629
|
-
else if (prototype.hasOwnProperty(propName) &&
|
|
1630
|
-
typeof this[propName] === 'number' &&
|
|
1631
|
-
this[propName] == newValue) {
|
|
1632
|
-
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1633
|
-
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1634
|
-
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
1260
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1638
1261
|
});
|
|
1639
1262
|
};
|
|
1640
1263
|
// create an array of attributes to observe
|
|
1641
1264
|
// and also create a map of html attribute name to js property name
|
|
1642
1265
|
Cstr.observedAttributes = members
|
|
1643
|
-
.filter(([_, m]) => m[0] & 15 /*
|
|
1266
|
+
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1644
1267
|
.map(([propName, m]) => {
|
|
1645
1268
|
const attrName = m[1] || propName;
|
|
1646
1269
|
attrNameToPropName.set(attrName, propName);
|
|
1647
|
-
if (m[0] & 512 /*
|
|
1270
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1648
1271
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1649
1272
|
}
|
|
1650
1273
|
return attrName;
|
|
@@ -1655,10 +1278,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1655
1278
|
};
|
|
1656
1279
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1657
1280
|
// initializeComponent
|
|
1658
|
-
if ((hostRef.$flags$ & 32 /*
|
|
1281
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1659
1282
|
{
|
|
1660
1283
|
// we haven't initialized this element yet
|
|
1661
|
-
hostRef.$flags$ |= 32 /*
|
|
1284
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1662
1285
|
// lazy loaded components
|
|
1663
1286
|
// request the component's implementation to be
|
|
1664
1287
|
// wired up with the host element
|
|
@@ -1670,13 +1293,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1670
1293
|
endLoad();
|
|
1671
1294
|
}
|
|
1672
1295
|
if (!Cstr.isProxied) {
|
|
1673
|
-
|
|
1674
|
-
// let's add the getters/setters to its prototype before
|
|
1675
|
-
// the first time we create an instance of the implementation
|
|
1676
|
-
{
|
|
1677
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1678
|
-
}
|
|
1679
|
-
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1296
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1680
1297
|
Cstr.isProxied = true;
|
|
1681
1298
|
}
|
|
1682
1299
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1684,7 +1301,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1684
1301
|
// but let's keep track of when we start and stop
|
|
1685
1302
|
// so that the getters/setters don't incorrectly step on data
|
|
1686
1303
|
{
|
|
1687
|
-
hostRef.$flags$ |= 8 /*
|
|
1304
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1688
1305
|
}
|
|
1689
1306
|
// construct the lazy-loaded component implementation
|
|
1690
1307
|
// passing the hostRef is very important during
|
|
@@ -1697,30 +1314,17 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1697
1314
|
consoleError(e);
|
|
1698
1315
|
}
|
|
1699
1316
|
{
|
|
1700
|
-
hostRef.$flags$ &= ~8 /*
|
|
1701
|
-
}
|
|
1702
|
-
{
|
|
1703
|
-
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1317
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1704
1318
|
}
|
|
1705
1319
|
endNewInstance();
|
|
1706
1320
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1707
1321
|
}
|
|
1708
|
-
if (Cstr.style) {
|
|
1709
|
-
// this component has styles but we haven't registered them yet
|
|
1710
|
-
let style = Cstr.style;
|
|
1711
|
-
const scopeId = getScopeId(cmpMeta);
|
|
1712
|
-
if (!styles.has(scopeId)) {
|
|
1713
|
-
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1714
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1715
|
-
endRegisterStyles();
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
1322
|
}
|
|
1719
1323
|
// we've successfully created a lazy instance
|
|
1720
1324
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1721
1325
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1722
1326
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1723
|
-
// this is the
|
|
1327
|
+
// this is the intial load and this component it has an ancestor component
|
|
1724
1328
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1725
1329
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1726
1330
|
// this will get fired off when the ancestor component
|
|
@@ -1738,20 +1342,19 @@ const fireConnectedCallback = (instance) => {
|
|
|
1738
1342
|
}
|
|
1739
1343
|
};
|
|
1740
1344
|
const connectedCallback = (elm) => {
|
|
1741
|
-
if ((plt.$flags$ & 1 /*
|
|
1345
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1742
1346
|
const hostRef = getHostRef(elm);
|
|
1743
1347
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1744
1348
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1745
|
-
if (!(hostRef.$flags$ & 1 /*
|
|
1349
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1746
1350
|
// first time this component has connected
|
|
1747
|
-
hostRef.$flags$ |= 1 /*
|
|
1351
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1748
1352
|
{
|
|
1749
1353
|
// initUpdate
|
|
1750
1354
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1751
1355
|
// in here to act as original content anchors as we move nodes around
|
|
1752
1356
|
// host element has been connected to the DOM
|
|
1753
|
-
if ((
|
|
1754
|
-
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1357
|
+
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1755
1358
|
setContentReference(elm);
|
|
1756
1359
|
}
|
|
1757
1360
|
}
|
|
@@ -1774,7 +1377,7 @@ const connectedCallback = (elm) => {
|
|
|
1774
1377
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1775
1378
|
if (cmpMeta.$members$) {
|
|
1776
1379
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1777
|
-
if (memberFlags & 31 /*
|
|
1380
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1778
1381
|
const value = elm[memberName];
|
|
1779
1382
|
delete elm[memberName];
|
|
1780
1383
|
elm[memberName] = value;
|
|
@@ -1808,7 +1411,7 @@ const setContentReference = (elm) => {
|
|
|
1808
1411
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1809
1412
|
};
|
|
1810
1413
|
const disconnectedCallback = (elm) => {
|
|
1811
|
-
if ((plt.$flags$ & 1 /*
|
|
1414
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1812
1415
|
const hostRef = getHostRef(elm);
|
|
1813
1416
|
const instance = hostRef.$lazyInstance$ ;
|
|
1814
1417
|
{
|
|
@@ -1823,7 +1426,6 @@ const disconnectedCallback = (elm) => {
|
|
|
1823
1426
|
}
|
|
1824
1427
|
};
|
|
1825
1428
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1826
|
-
var _a;
|
|
1827
1429
|
const endBootstrap = createTime();
|
|
1828
1430
|
const cmpTags = [];
|
|
1829
1431
|
const exclude = options.exclude || [];
|
|
@@ -1836,70 +1438,60 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1836
1438
|
let isBootstrapping = true;
|
|
1837
1439
|
Object.assign(plt, options);
|
|
1838
1440
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1839
|
-
lazyBundles.map((lazyBundle) => {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1441
|
+
lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
|
|
1442
|
+
const cmpMeta = {
|
|
1443
|
+
$flags$: compactMeta[0],
|
|
1444
|
+
$tagName$: compactMeta[1],
|
|
1445
|
+
$members$: compactMeta[2],
|
|
1446
|
+
$listeners$: compactMeta[3],
|
|
1447
|
+
};
|
|
1448
|
+
{
|
|
1449
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1450
|
+
}
|
|
1451
|
+
{
|
|
1452
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1453
|
+
}
|
|
1454
|
+
{
|
|
1455
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1456
|
+
}
|
|
1457
|
+
const tagName = cmpMeta.$tagName$;
|
|
1458
|
+
const HostElement = class extends HTMLElement {
|
|
1459
|
+
// StencilLazyHost
|
|
1460
|
+
constructor(self) {
|
|
1461
|
+
// @ts-ignore
|
|
1462
|
+
super(self);
|
|
1463
|
+
self = this;
|
|
1464
|
+
registerHost(self, cmpMeta);
|
|
1858
1465
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
// @ts-ignore
|
|
1864
|
-
super(self);
|
|
1865
|
-
self = this;
|
|
1866
|
-
registerHost(self, cmpMeta);
|
|
1867
|
-
}
|
|
1868
|
-
connectedCallback() {
|
|
1869
|
-
if (appLoadFallback) {
|
|
1870
|
-
clearTimeout(appLoadFallback);
|
|
1871
|
-
appLoadFallback = null;
|
|
1872
|
-
}
|
|
1873
|
-
if (isBootstrapping) {
|
|
1874
|
-
// connectedCallback will be processed once all components have been registered
|
|
1875
|
-
deferredConnectedCallbacks.push(this);
|
|
1876
|
-
}
|
|
1877
|
-
else {
|
|
1878
|
-
plt.jmp(() => connectedCallback(this));
|
|
1879
|
-
}
|
|
1466
|
+
connectedCallback() {
|
|
1467
|
+
if (appLoadFallback) {
|
|
1468
|
+
clearTimeout(appLoadFallback);
|
|
1469
|
+
appLoadFallback = null;
|
|
1880
1470
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1471
|
+
if (isBootstrapping) {
|
|
1472
|
+
// connectedCallback will be processed once all components have been registered
|
|
1473
|
+
deferredConnectedCallbacks.push(this);
|
|
1883
1474
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1475
|
+
else {
|
|
1476
|
+
plt.jmp(() => connectedCallback(this));
|
|
1886
1477
|
}
|
|
1887
|
-
};
|
|
1888
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1889
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1890
|
-
cmpTags.push(tagName);
|
|
1891
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1892
1478
|
}
|
|
1893
|
-
|
|
1894
|
-
|
|
1479
|
+
disconnectedCallback() {
|
|
1480
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1481
|
+
}
|
|
1482
|
+
componentOnReady() {
|
|
1483
|
+
return getHostRef(this).$onReadyPromise$;
|
|
1484
|
+
}
|
|
1485
|
+
};
|
|
1486
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1487
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1488
|
+
cmpTags.push(tagName);
|
|
1489
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1490
|
+
}
|
|
1491
|
+
}));
|
|
1895
1492
|
{
|
|
1896
1493
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1897
1494
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1898
|
-
// Apply CSP nonce to the style tag if it exists
|
|
1899
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1900
|
-
if (nonce != null) {
|
|
1901
|
-
visibilityStyle.setAttribute('nonce', nonce);
|
|
1902
|
-
}
|
|
1903
1495
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1904
1496
|
}
|
|
1905
1497
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1916,48 +1508,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1916
1508
|
endBootstrap();
|
|
1917
1509
|
};
|
|
1918
1510
|
const Fragment = (_, children) => children;
|
|
1919
|
-
const
|
|
1920
|
-
if (listeners) {
|
|
1921
|
-
listeners.map(([flags, name, method]) => {
|
|
1922
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
1923
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1924
|
-
const opts = hostListenerOpts(flags);
|
|
1925
|
-
plt.ael(target, name, handler, opts);
|
|
1926
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1927
|
-
});
|
|
1928
|
-
}
|
|
1929
|
-
};
|
|
1930
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1931
|
-
try {
|
|
1932
|
-
{
|
|
1933
|
-
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1934
|
-
// instance is ready, let's call it's member method for this event
|
|
1935
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
1936
|
-
}
|
|
1937
|
-
else {
|
|
1938
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
catch (e) {
|
|
1943
|
-
consoleError(e);
|
|
1944
|
-
}
|
|
1945
|
-
};
|
|
1946
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
1947
|
-
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1948
|
-
return win;
|
|
1949
|
-
return elm;
|
|
1950
|
-
};
|
|
1951
|
-
// prettier-ignore
|
|
1952
|
-
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1953
|
-
/**
|
|
1954
|
-
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1955
|
-
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1956
|
-
* @param nonce The value to be assigned to the platform nonce property.
|
|
1957
|
-
* @returns void
|
|
1958
|
-
*/
|
|
1959
|
-
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1960
|
-
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1511
|
+
const hostRefs = new WeakMap();
|
|
1961
1512
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1962
1513
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1963
1514
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1989,82 +1540,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1989
1540
|
if (module) {
|
|
1990
1541
|
return module[exportName];
|
|
1991
1542
|
}
|
|
1992
|
-
|
|
1993
|
-
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1994
|
-
const processMod = importedModule => {
|
|
1995
|
-
cmpModules.set(bundleId, importedModule);
|
|
1996
|
-
return importedModule[exportName];
|
|
1997
|
-
}
|
|
1998
|
-
switch(bundleId) {
|
|
1999
|
-
|
|
2000
|
-
case 'xpl-avatar_15':
|
|
2001
|
-
return import(
|
|
2002
|
-
/* webpackMode: "lazy" */
|
|
2003
|
-
'./xpl-avatar_15.entry.js').then(processMod, consoleError);
|
|
2004
|
-
case 'xpl-application-shell':
|
|
2005
|
-
return import(
|
|
2006
|
-
/* webpackMode: "lazy" */
|
|
2007
|
-
'./xpl-application-shell.entry.js').then(processMod, consoleError);
|
|
2008
|
-
case 'xpl-button-row':
|
|
2009
|
-
return import(
|
|
2010
|
-
/* webpackMode: "lazy" */
|
|
2011
|
-
'./xpl-button-row.entry.js').then(processMod, consoleError);
|
|
2012
|
-
case 'xpl-choicelist':
|
|
2013
|
-
return import(
|
|
2014
|
-
/* webpackMode: "lazy" */
|
|
2015
|
-
'./xpl-choicelist.entry.js').then(processMod, consoleError);
|
|
2016
|
-
case 'xpl-divider':
|
|
2017
|
-
return import(
|
|
2018
|
-
/* webpackMode: "lazy" */
|
|
2019
|
-
'./xpl-divider.entry.js').then(processMod, consoleError);
|
|
2020
|
-
case 'xpl-grid':
|
|
2021
|
-
return import(
|
|
2022
|
-
/* webpackMode: "lazy" */
|
|
2023
|
-
'./xpl-grid.entry.js').then(processMod, consoleError);
|
|
2024
|
-
case 'xpl-grid-item':
|
|
2025
|
-
return import(
|
|
2026
|
-
/* webpackMode: "lazy" */
|
|
2027
|
-
'./xpl-grid-item.entry.js').then(processMod, consoleError);
|
|
2028
|
-
case 'xpl-input':
|
|
2029
|
-
return import(
|
|
2030
|
-
/* webpackMode: "lazy" */
|
|
2031
|
-
'./xpl-input.entry.js').then(processMod, consoleError);
|
|
2032
|
-
case 'xpl-list':
|
|
2033
|
-
return import(
|
|
2034
|
-
/* webpackMode: "lazy" */
|
|
2035
|
-
'./xpl-list.entry.js').then(processMod, consoleError);
|
|
2036
|
-
case 'xpl-main-nav':
|
|
2037
|
-
return import(
|
|
2038
|
-
/* webpackMode: "lazy" */
|
|
2039
|
-
'./xpl-main-nav.entry.js').then(processMod, consoleError);
|
|
2040
|
-
case 'xpl-pagination':
|
|
2041
|
-
return import(
|
|
2042
|
-
/* webpackMode: "lazy" */
|
|
2043
|
-
'./xpl-pagination.entry.js').then(processMod, consoleError);
|
|
2044
|
-
case 'xpl-select':
|
|
2045
|
-
return import(
|
|
2046
|
-
/* webpackMode: "lazy" */
|
|
2047
|
-
'./xpl-select.entry.js').then(processMod, consoleError);
|
|
2048
|
-
case 'xpl-toggle':
|
|
2049
|
-
return import(
|
|
2050
|
-
/* webpackMode: "lazy" */
|
|
2051
|
-
'./xpl-toggle.entry.js').then(processMod, consoleError);
|
|
2052
|
-
case 'xpl-backdrop':
|
|
2053
|
-
return import(
|
|
2054
|
-
/* webpackMode: "lazy" */
|
|
2055
|
-
'./xpl-backdrop.entry.js').then(processMod, consoleError);
|
|
2056
|
-
case 'xpl-dropdown_2':
|
|
2057
|
-
return import(
|
|
2058
|
-
/* webpackMode: "lazy" */
|
|
2059
|
-
'./xpl-dropdown_2.entry.js').then(processMod, consoleError);
|
|
2060
|
-
case 'xpl-dropdown-group_3':
|
|
2061
|
-
return import(
|
|
2062
|
-
/* webpackMode: "lazy" */
|
|
2063
|
-
'./xpl-dropdown-group_3.entry.js').then(processMod, consoleError);
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
1543
|
return import(
|
|
2067
|
-
/* @vite-ignore */
|
|
2068
1544
|
/* webpackInclude: /\.entry\.js$/ */
|
|
2069
1545
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2070
1546
|
/* webpackMode: "lazy" */
|
|
@@ -2075,35 +1551,13 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2075
1551
|
return importedModule[exportName];
|
|
2076
1552
|
}, consoleError);
|
|
2077
1553
|
};
|
|
2078
|
-
const styles = /*@__PURE__*/ new Map();
|
|
2079
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
2080
|
-
const doc = win.document || { head: {} };
|
|
2081
|
-
const plt = {
|
|
2082
|
-
$flags$: 0,
|
|
2083
|
-
$resourcesUrl$: '',
|
|
2084
|
-
jmp: (h) => h(),
|
|
2085
|
-
raf: (h) => requestAnimationFrame(h),
|
|
2086
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2087
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2088
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2089
|
-
};
|
|
2090
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
2091
|
-
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2092
|
-
try {
|
|
2093
|
-
new CSSStyleSheet();
|
|
2094
|
-
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2095
|
-
}
|
|
2096
|
-
catch (e) { }
|
|
2097
|
-
return false;
|
|
2098
|
-
})()
|
|
2099
|
-
;
|
|
2100
1554
|
const queueDomReads = [];
|
|
2101
1555
|
const queueDomWrites = [];
|
|
2102
1556
|
const queueTask = (queue, write) => (cb) => {
|
|
2103
1557
|
queue.push(cb);
|
|
2104
1558
|
if (!queuePending) {
|
|
2105
1559
|
queuePending = true;
|
|
2106
|
-
if (write && plt.$flags$ & 4 /*
|
|
1560
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2107
1561
|
nextTick(flush);
|
|
2108
1562
|
}
|
|
2109
1563
|
else {
|
|
@@ -2140,6 +1594,4 @@ const flush = () => {
|
|
|
2140
1594
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
2141
1595
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2142
1596
|
|
|
2143
|
-
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r
|
|
2144
|
-
|
|
2145
|
-
//# sourceMappingURL=index-56581b5c.js.map
|
|
1597
|
+
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|