@zanichelli/albe-web-components 6.6.9 → 6.6.10-test
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 +2209 -0
- package/dist/types/components/inputs/z-combobox/index.d.ts +2 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/web-components-library/_commonjsHelpers-8fe71198.js +44 -0
- package/dist/web-components-library/app-globals-0f993ce5.js +3 -0
- package/dist/{esm → web-components-library}/breakpoints-c386984e.js +0 -0
- package/dist/web-components-library/css-shim-b3f2ee8d.js +4 -0
- package/dist/web-components-library/dom-665d6011.js +73 -0
- package/dist/{esm/hammer-c3266b17.js → web-components-library/hammer-782a2043.js} +3 -2
- package/dist/{esm → web-components-library}/icons-85e529a3.js +0 -0
- package/dist/{cjs/index-e3299e0a.js → web-components-library/index-291c96fb.js} +1473 -521
- package/dist/{esm → web-components-library}/index-968a240f.js +0 -0
- package/dist/web-components-library/index.esm.js +9 -1
- package/dist/web-components-library/shadow-css-b18e99d7.js +387 -0
- package/dist/{esm/utils-6cf7efe2.js → web-components-library/utils-b96780be.js} +18 -0
- package/dist/{esm/utils-151f0ab4.js → web-components-library/utils-d783f6be.js} +26 -4
- package/dist/web-components-library/web-components-library.css +1636 -1
- package/dist/web-components-library/web-components-library.esm.js +129 -1
- package/dist/{esm → web-components-library}/z-alert.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-anchor-navigation.entry.js +1 -1
- package/dist/web-components-library/z-app-header.entry.js +129 -0
- package/dist/{esm → web-components-library}/z-app-switcher.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-aria-alert.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-avatar.entry.js +1 -1
- package/dist/web-components-library/z-body.entry.js +14 -0
- package/dist/{esm → web-components-library}/z-button-sort.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-button.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-card.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-carousel.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-chip.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-combobox.entry.js +6 -4
- package/dist/{esm → web-components-library}/z-contextual-menu.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-cover-hero.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-date-picker.entry.js +12 -6
- package/dist/{esm → web-components-library}/z-divider.entry.js +1 -1
- package/dist/web-components-library/z-dragdrop-area.entry.js +33 -0
- package/dist/{esm → web-components-library}/z-file-upload.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-file.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-ghost-loading.entry.js +1 -1
- package/dist/web-components-library/z-heading.entry.js +14 -0
- package/dist/web-components-library/z-icon.entry.js +22 -0
- package/dist/{esm → web-components-library}/z-info-box.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-info-reveal.entry.js +1 -1
- package/dist/web-components-library/z-input-message.entry.js +20 -0
- package/dist/web-components-library/z-input.entry.js +231 -0
- package/dist/{esm → web-components-library}/z-link.entry.js +1 -1
- package/dist/web-components-library/z-list-element.entry.js +173 -0
- package/dist/web-components-library/z-list-group.entry.js +56 -0
- package/dist/web-components-library/z-list.entry.js +36 -0
- package/dist/{esm → web-components-library}/z-logo.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-menu-section.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-menu.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-messages-pocket.entry.js +1 -1
- package/dist/{esm/z-dragdrop-area_3.entry.js → web-components-library/z-modal.entry.js} +2 -43
- package/dist/{esm → web-components-library}/z-myz-card-alert.entry.js +1 -1
- package/dist/web-components-library/z-myz-card-body.entry.js +15 -0
- package/dist/web-components-library/z-myz-card-cover.entry.js +18 -0
- package/dist/{esm → web-components-library}/z-myz-card-dictionary.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-myz-card-footer.entry.js +1 -1
- package/dist/web-components-library/z-myz-card-header.entry.js +36 -0
- package/dist/{esm → web-components-library}/z-myz-card-icon.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-myz-card-info.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-myz-card-list.entry.js +1 -1
- package/dist/web-components-library/z-myz-card.entry.js +42 -0
- package/dist/{esm → web-components-library}/z-myz-list-item.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-myz-list.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-navigation-tab-link.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-navigation-tab.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-navigation-tabs.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-notification.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-offcanvas.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-otp.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-pagination.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-panel-elem.entry.js +1 -1
- package/dist/web-components-library/z-pocket-body.entry.js +23 -0
- package/dist/web-components-library/z-pocket-header.entry.js +36 -0
- package/dist/{esm → web-components-library}/z-pocket-message.entry.js +1 -1
- package/dist/web-components-library/z-pocket.entry.js +68 -0
- package/dist/{esm → web-components-library}/z-popover.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-range-picker.entry.js +3 -3
- package/dist/{esm → web-components-library}/z-searchbar.entry.js +3 -3
- package/dist/{esm → web-components-library}/z-section-title.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-select.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-skip-to-content.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-slideshow.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-stepper-item.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-stepper.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-body.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-cell.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-empty-box.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-expanded-row.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-footer.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-head.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-header-row.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-header.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-table-row.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table-sticky-footer.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-table.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-tag.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-toast-notification-list.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-toast-notification.entry.js +3 -3
- package/dist/{esm → web-components-library}/z-toggle-button.entry.js +1 -1
- package/dist/{esm → web-components-library}/z-toggle-switch.entry.js +2 -2
- package/dist/{esm → web-components-library}/z-tooltip.entry.js +1 -1
- package/dist/{esm/z-body_2.entry.js → web-components-library/z-typography.entry.js} +2 -13
- package/dist/{esm → web-components-library}/z-visually-hidden.entry.js +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +22 -1
- package/react/components.js +25 -3
- package/react/components.js.map +1 -1
- package/src-react/index.ts +1 -0
- package/www/build/_commonjsHelpers-8fe71198.js +44 -0
- package/www/build/app-globals-0f993ce5.js +3 -0
- package/{dist/collection/constants/breakpoints.js → www/build/breakpoints-c386984e.js} +2 -1
- package/www/build/css-shim-b3f2ee8d.js +4 -0
- package/www/build/dom-665d6011.js +73 -0
- package/{dist/cjs/hammer-4f20813e.js → www/build/hammer-782a2043.js} +5 -6
- package/{dist/cjs/icons-9e555ff7.js → www/build/icons-85e529a3.js} +1 -3
- package/{dist/esm/index-a2ca4b97.js → www/build/index-291c96fb.js} +1472 -492
- package/{dist/collection/beans/index.js → www/build/index-968a240f.js} +49 -47
- package/www/build/index.esm.js +9 -1
- package/www/build/shadow-css-b18e99d7.js +387 -0
- package/{dist/collection/utils/utils.js → www/build/utils-b96780be.js} +16 -13
- package/{dist/cjs/utils-8bc9056f.js → www/build/utils-d783f6be.js} +38 -22
- package/www/build/web-components-library.css +1636 -1
- package/www/build/web-components-library.esm.js +129 -1
- package/{dist/cjs/z-alert.cjs.entry.js → www/build/z-alert.entry.js} +4 -8
- package/{dist/cjs/z-anchor-navigation.cjs.entry.js → www/build/z-anchor-navigation.entry.js} +5 -9
- package/www/build/z-app-header.entry.js +129 -0
- package/{dist/cjs/z-app-switcher.cjs.entry.js → www/build/z-app-switcher.entry.js} +7 -11
- package/www/build/z-aria-alert.entry.js +15 -0
- package/{dist/cjs/z-avatar.cjs.entry.js → www/build/z-avatar.entry.js} +10 -14
- package/www/build/z-body.entry.js +14 -0
- package/{dist/cjs/z-button-sort.cjs.entry.js → www/build/z-button-sort.entry.js} +7 -11
- package/{dist/cjs/z-button.cjs.entry.js → www/build/z-button.entry.js} +10 -14
- package/{dist/cjs/z-card.cjs.entry.js → www/build/z-card.entry.js} +17 -21
- package/{dist/cjs/z-carousel.cjs.entry.js → www/build/z-carousel.entry.js} +11 -15
- package/{dist/cjs/z-chip.cjs.entry.js → www/build/z-chip.entry.js} +12 -16
- package/{dist/cjs/z-combobox.cjs.entry.js → www/build/z-combobox.entry.js} +26 -28
- package/{dist/cjs/z-contextual-menu.cjs.entry.js → www/build/z-contextual-menu.entry.js} +7 -11
- package/{dist/cjs/z-cover-hero.cjs.entry.js → www/build/z-cover-hero.entry.js} +12 -16
- package/{dist/cjs/z-date-picker.cjs.entry.js → www/build/z-date-picker.entry.js} +41 -39
- package/{dist/cjs/z-divider.cjs.entry.js → www/build/z-divider.entry.js} +7 -11
- package/www/build/z-dragdrop-area.entry.js +33 -0
- package/{dist/cjs/z-file-upload.cjs.entry.js → www/build/z-file-upload.entry.js} +23 -27
- package/{dist/cjs/z-file.cjs.entry.js → www/build/z-file.entry.js} +9 -13
- package/{dist/cjs/z-ghost-loading.cjs.entry.js → www/build/z-ghost-loading.entry.js} +4 -8
- package/www/build/z-heading.entry.js +14 -0
- package/www/build/z-icon.entry.js +22 -0
- package/{dist/cjs/z-info-box.cjs.entry.js → www/build/z-info-box.entry.js} +5 -9
- package/{dist/cjs/z-info-reveal.cjs.entry.js → www/build/z-info-reveal.entry.js} +7 -11
- package/www/build/z-input-message.entry.js +20 -0
- package/www/build/z-input.entry.js +231 -0
- package/{dist/cjs/z-link.cjs.entry.js → www/build/z-link.entry.js} +8 -12
- package/www/build/z-list-element.entry.js +173 -0
- package/www/build/z-list-group.entry.js +56 -0
- package/www/build/z-list.entry.js +36 -0
- package/{dist/cjs/z-logo.cjs.entry.js → www/build/z-logo.entry.js} +4 -8
- package/{dist/cjs/z-menu-section.cjs.entry.js → www/build/z-menu-section.entry.js} +7 -11
- package/{dist/cjs/z-menu.cjs.entry.js → www/build/z-menu.entry.js} +10 -14
- package/{dist/cjs/z-messages-pocket.cjs.entry.js → www/build/z-messages-pocket.entry.js} +13 -17
- package/www/build/z-modal.entry.js +29 -0
- package/{dist/cjs/z-myz-card-alert.cjs.entry.js → www/build/z-myz-card-alert.entry.js} +8 -12
- package/www/build/z-myz-card-body.entry.js +15 -0
- package/www/build/z-myz-card-cover.entry.js +18 -0
- package/{dist/cjs/z-myz-card-dictionary.cjs.entry.js → www/build/z-myz-card-dictionary.entry.js} +6 -10
- package/{dist/cjs/z-myz-card-footer-sections.cjs.entry.js → www/build/z-myz-card-footer-sections.entry.js} +4 -8
- package/{dist/cjs/z-myz-card-footer.cjs.entry.js → www/build/z-myz-card-footer.entry.js} +8 -12
- package/www/build/z-myz-card-header.entry.js +36 -0
- package/{dist/cjs/z-myz-card-icon.cjs.entry.js → www/build/z-myz-card-icon.entry.js} +4 -8
- package/{dist/cjs/z-myz-card-info.cjs.entry.js → www/build/z-myz-card-info.entry.js} +19 -23
- package/{dist/cjs/z-myz-card-list.cjs.entry.js → www/build/z-myz-card-list.entry.js} +7 -11
- package/www/build/z-myz-card.entry.js +42 -0
- package/{dist/cjs/z-myz-list-item.cjs.entry.js → www/build/z-myz-list-item.entry.js} +9 -13
- package/{dist/cjs/z-myz-list.cjs.entry.js → www/build/z-myz-list.entry.js} +5 -9
- package/{dist/cjs/z-navigation-tab-link.cjs.entry.js → www/build/z-navigation-tab-link.entry.js} +12 -16
- package/{dist/cjs/z-navigation-tab.cjs.entry.js → www/build/z-navigation-tab.entry.js} +12 -16
- package/{dist/cjs/z-navigation-tabs.cjs.entry.js → www/build/z-navigation-tabs.entry.js} +13 -17
- package/{dist/cjs/z-notification.cjs.entry.js → www/build/z-notification.entry.js} +6 -10
- package/{dist/cjs/z-offcanvas.cjs.entry.js → www/build/z-offcanvas.entry.js} +12 -16
- package/{dist/cjs/z-otp.cjs.entry.js → www/build/z-otp.entry.js} +7 -11
- package/{dist/cjs/z-pagination.cjs.entry.js → www/build/z-pagination.entry.js} +19 -23
- package/www/build/z-panel-elem.entry.js +26 -0
- package/www/build/z-pocket-body.entry.js +23 -0
- package/www/build/z-pocket-header.entry.js +36 -0
- package/{dist/cjs/z-pocket-message.cjs.entry.js → www/build/z-pocket-message.entry.js} +4 -8
- package/www/build/z-pocket.entry.js +68 -0
- package/{dist/cjs/z-popover.cjs.entry.js → www/build/z-popover.entry.js} +29 -33
- package/{dist/cjs/z-range-picker.cjs.entry.js → www/build/z-range-picker.entry.js} +28 -32
- package/{dist/cjs/z-searchbar.cjs.entry.js → www/build/z-searchbar.entry.js} +23 -27
- package/{dist/cjs/z-section-title.cjs.entry.js → www/build/z-section-title.entry.js} +7 -11
- package/{dist/cjs/z-select.cjs.entry.js → www/build/z-select.entry.js} +25 -29
- package/{dist/cjs/z-skip-to-content.cjs.entry.js → www/build/z-skip-to-content.entry.js} +10 -14
- package/{dist/cjs/z-slideshow.cjs.entry.js → www/build/z-slideshow.entry.js} +19 -23
- package/{dist/cjs/z-stepper-item.cjs.entry.js → www/build/z-stepper-item.entry.js} +5 -9
- package/{dist/cjs/z-stepper.cjs.entry.js → www/build/z-stepper.entry.js} +4 -8
- package/{dist/cjs/z-table-body.cjs.entry.js → www/build/z-table-body.entry.js} +5 -9
- package/{dist/cjs/z-table-cell.cjs.entry.js → www/build/z-table-cell.entry.js} +9 -13
- package/{dist/cjs/z-table-empty-box.cjs.entry.js → www/build/z-table-empty-box.entry.js} +6 -10
- package/www/build/z-table-expanded-row.entry.js +15 -0
- package/{dist/cjs/z-table-footer.cjs.entry.js → www/build/z-table-footer.entry.js} +5 -9
- package/{dist/cjs/z-table-head.cjs.entry.js → www/build/z-table-head.entry.js} +5 -9
- package/{dist/cjs/z-table-header-row.cjs.entry.js → www/build/z-table-header-row.entry.js} +5 -9
- package/{dist/cjs/z-table-header.cjs.entry.js → www/build/z-table-header.entry.js} +22 -26
- package/{dist/cjs/z-table-row.cjs.entry.js → www/build/z-table-row.entry.js} +12 -16
- package/{dist/cjs/z-table-sticky-footer.cjs.entry.js → www/build/z-table-sticky-footer.entry.js} +4 -8
- package/{dist/cjs/z-table.cjs.entry.js → www/build/z-table.entry.js} +16 -20
- package/{dist/cjs/z-tag.cjs.entry.js → www/build/z-tag.entry.js} +5 -9
- package/{dist/cjs/z-toast-notification-list.cjs.entry.js → www/build/z-toast-notification-list.entry.js} +7 -11
- package/{dist/cjs/z-toast-notification.cjs.entry.js → www/build/z-toast-notification.entry.js} +30 -34
- package/{dist/cjs/z-toggle-button.cjs.entry.js → www/build/z-toggle-button.entry.js} +6 -10
- package/{dist/cjs/z-toggle-switch.cjs.entry.js → www/build/z-toggle-switch.entry.js} +12 -16
- package/{dist/cjs/z-tooltip.cjs.entry.js → www/build/z-tooltip.entry.js} +6 -10
- package/{dist/cjs/z-body_2.cjs.entry.js → www/build/z-typography.entry.js} +5 -21
- package/{dist/cjs/z-visually-hidden.cjs.entry.js → www/build/z-visually-hidden.entry.js} +4 -8
- package/www/index.html +10 -1
- package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
- package/dist/cjs/breakpoints-88c4fd6c.js +0 -7
- package/dist/cjs/index-fa110f37.js +0 -311
- package/dist/cjs/index.cjs.js +0 -295
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/utils-600bad93.js +0 -100
- package/dist/cjs/web-components-library.cjs.js +0 -19
- package/dist/cjs/z-app-header_2.cjs.entry.js +0 -153
- package/dist/cjs/z-aria-alert.cjs.entry.js +0 -19
- package/dist/cjs/z-dragdrop-area_3.cjs.entry.js +0 -76
- package/dist/cjs/z-input_2.cjs.entry.js +0 -253
- package/dist/cjs/z-list_3.cjs.entry.js +0 -261
- package/dist/cjs/z-myz-card_4.cjs.entry.js +0 -108
- package/dist/cjs/z-panel-elem.cjs.entry.js +0 -30
- package/dist/cjs/z-pocket_3.cjs.entry.js +0 -125
- package/dist/cjs/z-table-expanded-row.cjs.entry.js +0 -19
- package/dist/collection/collection-manifest.json +0 -100
- package/dist/collection/components/buttons/z-button/index.js +0 -241
- package/dist/collection/components/buttons/z-button/styles.css +0 -149
- package/dist/collection/components/buttons/z-button-sort/index.js +0 -220
- package/dist/collection/components/buttons/z-button-sort/styles.css +0 -101
- package/dist/collection/components/buttons/z-chip/index.js +0 -133
- package/dist/collection/components/buttons/z-chip/styles.css +0 -131
- package/dist/collection/components/buttons/z-toggle-button/index.js +0 -126
- package/dist/collection/components/buttons/z-toggle-button/styles.css +0 -62
- package/dist/collection/components/buttons/z-toggle-switch/index.js +0 -144
- package/dist/collection/components/buttons/z-toggle-switch/styles.css +0 -104
- package/dist/collection/components/date-picker/styles.css +0 -565
- package/dist/collection/components/date-picker/utils.js +0 -76
- package/dist/collection/components/date-picker/z-date-picker/index.js +0 -295
- package/dist/collection/components/date-picker/z-range-picker/index.js +0 -499
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js +0 -53
- package/dist/collection/components/file-upload/z-dragdrop-area/styles.css +0 -51
- package/dist/collection/components/file-upload/z-file/index.js +0 -131
- package/dist/collection/components/file-upload/z-file/styles.css +0 -23
- package/dist/collection/components/file-upload/z-file-upload/index.js +0 -363
- package/dist/collection/components/file-upload/z-file-upload/styles.css +0 -84
- package/dist/collection/components/icons/icons.js +0 -747
- package/dist/collection/components/icons/z-icon/index.js +0 -114
- package/dist/collection/components/icons/z-icon/styles.css +0 -14
- package/dist/collection/components/index.js +0 -8
- package/dist/collection/components/indicators/z-stepper/index.js +0 -21
- package/dist/collection/components/indicators/z-stepper/styles.css +0 -19
- package/dist/collection/components/indicators/z-stepper-item/index.js +0 -93
- package/dist/collection/components/indicators/z-stepper-item/styles.css +0 -114
- package/dist/collection/components/inputs/z-combobox/index.js +0 -525
- package/dist/collection/components/inputs/z-combobox/styles.css +0 -142
- package/dist/collection/components/inputs/z-input/index.js +0 -731
- package/dist/collection/components/inputs/z-input/styles.css +0 -327
- package/dist/collection/components/inputs/z-input-message/index.js +0 -68
- package/dist/collection/components/inputs/z-input-message/styles.css +0 -33
- package/dist/collection/components/inputs/z-searchbar/index.js +0 -516
- package/dist/collection/components/inputs/z-searchbar/styles.css +0 -211
- package/dist/collection/components/inputs/z-select/index.js +0 -633
- package/dist/collection/components/inputs/z-select/styles.css +0 -88
- package/dist/collection/components/list/z-list/index.js +0 -91
- package/dist/collection/components/list/z-list/styles.css +0 -6
- package/dist/collection/components/list/z-list-element/index.js +0 -508
- package/dist/collection/components/list/z-list-element/styles.css +0 -121
- package/dist/collection/components/list/z-list-group/index.js +0 -175
- package/dist/collection/components/list/z-list-group/styles.css +0 -21
- package/dist/collection/components/list/z-toast-notification-list/index.js +0 -105
- package/dist/collection/components/list/z-toast-notification-list/styles.css +0 -100
- package/dist/collection/components/logo/z-logo/index.js +0 -131
- package/dist/collection/components/logo/z-logo/styles.css +0 -29
- package/dist/collection/components/modal/z-modal/index.js +0 -156
- package/dist/collection/components/modal/z-modal/styles.css +0 -179
- package/dist/collection/components/navigation/tabs/navigation-tab.css +0 -136
- package/dist/collection/components/navigation/tabs/z-navigation-tab/index.js +0 -242
- package/dist/collection/components/navigation/tabs/z-navigation-tab-link/index.js +0 -264
- package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +0 -200
- package/dist/collection/components/navigation/tabs/z-navigation-tabs/styles.css +0 -104
- package/dist/collection/components/navigation/z-app-header/index.js +0 -306
- package/dist/collection/components/navigation/z-app-header/styles.css +0 -420
- package/dist/collection/components/navigation/z-app-switcher/index.js +0 -79
- package/dist/collection/components/navigation/z-app-switcher/styles.css +0 -23
- package/dist/collection/components/navigation/z-link/index.js +0 -317
- package/dist/collection/components/navigation/z-link/styles.css +0 -167
- package/dist/collection/components/navigation/z-menu/index.js +0 -225
- package/dist/collection/components/navigation/z-menu/styles.css +0 -146
- package/dist/collection/components/navigation/z-menu-section/index.js +0 -116
- package/dist/collection/components/navigation/z-menu-section/styles.css +0 -91
- package/dist/collection/components/notification/z-info-box/index.js +0 -85
- package/dist/collection/components/notification/z-info-box/styles.css +0 -23
- package/dist/collection/components/notification/z-notification/index.js +0 -195
- package/dist/collection/components/notification/z-notification/styles.css +0 -114
- package/dist/collection/components/notification/z-toast-notification/index.js +0 -399
- package/dist/collection/components/notification/z-toast-notification/styles.css +0 -254
- package/dist/collection/components/notification/z-tooltip/index.js +0 -133
- package/dist/collection/components/notification/z-tooltip/styles.css +0 -16
- package/dist/collection/components/panel/z-panel-elem/index.js +0 -193
- package/dist/collection/components/panel/z-panel-elem/styles.css +0 -39
- package/dist/collection/components/typography/z-body/index.js +0 -68
- package/dist/collection/components/typography/z-heading/index.js +0 -68
- package/dist/collection/components/typography/z-typography/index.js +0 -91
- package/dist/collection/components/typography/z-typography/styles.css +0 -65
- package/dist/collection/components/z-anchor-navigation/index.js +0 -95
- package/dist/collection/components/z-anchor-navigation/styles.css +0 -129
- package/dist/collection/components/z-aria-alert/index.js +0 -39
- package/dist/collection/components/z-avatar/index.js +0 -142
- package/dist/collection/components/z-avatar/styles.css +0 -32
- package/dist/collection/components/z-card/index.js +0 -177
- package/dist/collection/components/z-card/styles.css +0 -206
- package/dist/collection/components/z-carousel/index.js +0 -300
- package/dist/collection/components/z-carousel/styles.css +0 -129
- package/dist/collection/components/z-contextual-menu/index.js +0 -126
- package/dist/collection/components/z-contextual-menu/styles.css +0 -60
- package/dist/collection/components/z-cover-hero/index.js +0 -103
- package/dist/collection/components/z-cover-hero/styles.css +0 -78
- package/dist/collection/components/z-divider/index.js +0 -95
- package/dist/collection/components/z-divider/styles.css +0 -37
- package/dist/collection/components/z-ghost-loading/index.js +0 -18
- package/dist/collection/components/z-ghost-loading/styles.css +0 -34
- package/dist/collection/components/z-info-reveal/index.js +0 -147
- package/dist/collection/components/z-info-reveal/styles.css +0 -103
- package/dist/collection/components/z-offcanvas/index.js +0 -162
- package/dist/collection/components/z-offcanvas/styles.css +0 -191
- package/dist/collection/components/z-pagination/index.js +0 -435
- package/dist/collection/components/z-pagination/styles.css +0 -199
- package/dist/collection/components/z-popover/index.js +0 -512
- package/dist/collection/components/z-popover/styles.css +0 -147
- package/dist/collection/components/z-section-title/index.js +0 -88
- package/dist/collection/components/z-section-title/styles.css +0 -44
- package/dist/collection/components/z-skip-to-content/index.js +0 -139
- package/dist/collection/components/z-skip-to-content/styles.css +0 -80
- package/dist/collection/components/z-table/z-table/index.js +0 -352
- package/dist/collection/components/z-table/z-table/styles.css +0 -115
- package/dist/collection/components/z-table/z-table-body/index.js +0 -23
- package/dist/collection/components/z-table/z-table-body/styles.css +0 -9
- package/dist/collection/components/z-table/z-table-cell/index.js +0 -86
- package/dist/collection/components/z-table/z-table-cell/styles.css +0 -58
- package/dist/collection/components/z-table/z-table-empty-box/index.js +0 -72
- package/dist/collection/components/z-table/z-table-empty-box/styles.css +0 -38
- package/dist/collection/components/z-table/z-table-expanded-row/index.js +0 -39
- package/dist/collection/components/z-table/z-table-expanded-row/styles.css +0 -9
- package/dist/collection/components/z-table/z-table-footer/index.js +0 -22
- package/dist/collection/components/z-table/z-table-footer/styles.css +0 -5
- package/dist/collection/components/z-table/z-table-head/index.js +0 -22
- package/dist/collection/components/z-table/z-table-head/styles.css +0 -5
- package/dist/collection/components/z-table/z-table-header/index.js +0 -238
- package/dist/collection/components/z-table/z-table-header/styles.css +0 -71
- package/dist/collection/components/z-table/z-table-header-row/index.js +0 -41
- package/dist/collection/components/z-table/z-table-header-row/styles.css +0 -13
- package/dist/collection/components/z-table/z-table-row/index.js +0 -92
- package/dist/collection/components/z-table/z-table-row/styles.css +0 -45
- package/dist/collection/components/z-table/z-table-sticky-footer/index.js +0 -21
- package/dist/collection/components/z-table/z-table-sticky-footer/styles.css +0 -11
- package/dist/collection/components/z-tag/index.js +0 -65
- package/dist/collection/components/z-tag/styles.css +0 -46
- package/dist/collection/components/z-visually-hidden/index.js +0 -18
- package/dist/collection/components/z-visually-hidden/styles.css +0 -12
- package/dist/collection/constants/icons.js +0 -6
- package/dist/collection/index.js +0 -7
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +0 -129
- package/dist/collection/snowflakes/myz/card/z-myz-card/styles.css +0 -44
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +0 -151
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/styles.css +0 -62
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +0 -22
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/styles.css +0 -13
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +0 -93
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/styles.css +0 -11
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +0 -177
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/styles.css +0 -72
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +0 -207
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/styles.css +0 -182
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +0 -22
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/styles.css +0 -20
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +0 -109
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/styles.css +0 -47
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +0 -81
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/styles.css +0 -69
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +0 -199
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/styles.css +0 -93
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +0 -60
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/styles.css +0 -41
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +0 -78
- package/dist/collection/snowflakes/myz/list/z-myz-list/styles.css +0 -4
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +0 -192
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/styles.css +0 -47
- package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/index.js +0 -120
- package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/styles.css +0 -102
- package/dist/collection/snowflakes/myz/pocket/z-pocket/index.js +0 -191
- package/dist/collection/snowflakes/myz/pocket/z-pocket/styles.css +0 -44
- package/dist/collection/snowflakes/myz/pocket/z-pocket-body/index.js +0 -84
- package/dist/collection/snowflakes/myz/pocket/z-pocket-body/styles.css +0 -41
- package/dist/collection/snowflakes/myz/pocket/z-pocket-header/index.js +0 -93
- package/dist/collection/snowflakes/myz/pocket/z-pocket-header/styles.css +0 -27
- package/dist/collection/snowflakes/myz/pocket/z-pocket-message/index.js +0 -22
- package/dist/collection/snowflakes/myz/pocket/z-pocket-message/styles.css +0 -44
- package/dist/collection/snowflakes/myz/z-alert/index.js +0 -47
- package/dist/collection/snowflakes/myz/z-alert/styles.css +0 -28
- package/dist/collection/snowflakes/myz/z-otp/index.js +0 -120
- package/dist/collection/snowflakes/myz/z-otp/styles.css +0 -47
- package/dist/collection/snowflakes/myz/z-slideshow/index.js +0 -180
- package/dist/collection/snowflakes/myz/z-slideshow/styles.css +0 -127
- package/dist/collection/utils/storybook-utils.js +0 -51
- package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
- package/dist/esm/index.js +0 -9
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/web-components-library.js +0 -17
- package/dist/esm/z-app-header_2.entry.js +0 -148
- package/dist/esm/z-input_2.entry.js +0 -248
- package/dist/esm/z-list_3.entry.js +0 -255
- package/dist/esm/z-myz-card_4.entry.js +0 -101
- package/dist/esm/z-pocket_3.entry.js +0 -119
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/web-components-library/p-009c9f67.entry.js +0 -1
- package/dist/web-components-library/p-01f001fd.entry.js +0 -1
- package/dist/web-components-library/p-05ced71c.entry.js +0 -1
- package/dist/web-components-library/p-074ea569.entry.js +0 -1
- package/dist/web-components-library/p-07e18572.entry.js +0 -1
- package/dist/web-components-library/p-0843b0e7.entry.js +0 -1
- package/dist/web-components-library/p-0fa4b50b.entry.js +0 -1
- package/dist/web-components-library/p-112455b1.js +0 -1
- package/dist/web-components-library/p-1d66b265.entry.js +0 -1
- package/dist/web-components-library/p-214b6cee.entry.js +0 -1
- package/dist/web-components-library/p-26033729.entry.js +0 -1
- package/dist/web-components-library/p-26f834e5.entry.js +0 -1
- package/dist/web-components-library/p-2acd6a51.entry.js +0 -1
- package/dist/web-components-library/p-2d1b6c3c.entry.js +0 -1
- package/dist/web-components-library/p-2efedcf4.entry.js +0 -1
- package/dist/web-components-library/p-32509af7.entry.js +0 -1
- package/dist/web-components-library/p-33352f9e.entry.js +0 -1
- package/dist/web-components-library/p-344e7ae7.entry.js +0 -1
- package/dist/web-components-library/p-34c26207.entry.js +0 -1
- package/dist/web-components-library/p-37e050bd.entry.js +0 -1
- package/dist/web-components-library/p-38a3cf3b.entry.js +0 -1
- package/dist/web-components-library/p-3a468aa9.entry.js +0 -1
- package/dist/web-components-library/p-3be171d0.entry.js +0 -1
- package/dist/web-components-library/p-3eb60c95.entry.js +0 -1
- package/dist/web-components-library/p-3f55dce6.entry.js +0 -1
- package/dist/web-components-library/p-4423b00c.entry.js +0 -1
- package/dist/web-components-library/p-475ca461.entry.js +0 -1
- package/dist/web-components-library/p-51e308ca.entry.js +0 -1
- package/dist/web-components-library/p-53065788.entry.js +0 -1
- package/dist/web-components-library/p-540c7d73.entry.js +0 -1
- package/dist/web-components-library/p-5624a127.entry.js +0 -1
- package/dist/web-components-library/p-56d2b76d.entry.js +0 -1
- package/dist/web-components-library/p-59cfee8d.entry.js +0 -1
- package/dist/web-components-library/p-5c62387a.entry.js +0 -1
- package/dist/web-components-library/p-5dd9a2c6.entry.js +0 -1
- package/dist/web-components-library/p-61424b8a.entry.js +0 -1
- package/dist/web-components-library/p-6289c4bd.entry.js +0 -1
- package/dist/web-components-library/p-6b1a5309.entry.js +0 -1
- package/dist/web-components-library/p-6c163539.entry.js +0 -1
- package/dist/web-components-library/p-735bdfa3.entry.js +0 -1
- package/dist/web-components-library/p-73c91de3.entry.js +0 -1
- package/dist/web-components-library/p-7b3b99ee.entry.js +0 -1
- package/dist/web-components-library/p-7ea553e9.entry.js +0 -1
- package/dist/web-components-library/p-810bd730.entry.js +0 -1
- package/dist/web-components-library/p-8b15b30c.entry.js +0 -1
- package/dist/web-components-library/p-8c105bd1.entry.js +0 -1
- package/dist/web-components-library/p-8ebe4adf.js +0 -1
- package/dist/web-components-library/p-91a74348.entry.js +0 -1
- package/dist/web-components-library/p-93142fac.entry.js +0 -1
- package/dist/web-components-library/p-95b8f109.entry.js +0 -1
- package/dist/web-components-library/p-9c28b8fc.entry.js +0 -1
- package/dist/web-components-library/p-9c338aeb.entry.js +0 -1
- package/dist/web-components-library/p-9d03a7d6.entry.js +0 -1
- package/dist/web-components-library/p-9d57a84c.entry.js +0 -1
- package/dist/web-components-library/p-9f543b6a.entry.js +0 -1
- package/dist/web-components-library/p-a05ce0a6.entry.js +0 -1
- package/dist/web-components-library/p-a0e2715e.entry.js +0 -1
- package/dist/web-components-library/p-a23e9115.js +0 -1
- package/dist/web-components-library/p-a6c0f149.entry.js +0 -1
- package/dist/web-components-library/p-a79d1412.entry.js +0 -1
- package/dist/web-components-library/p-a82ea410.entry.js +0 -1
- package/dist/web-components-library/p-ae6197f4.entry.js +0 -1
- package/dist/web-components-library/p-ae79573a.entry.js +0 -1
- package/dist/web-components-library/p-af4d1987.entry.js +0 -1
- package/dist/web-components-library/p-b33f5e6a.entry.js +0 -1
- package/dist/web-components-library/p-b3c29822.js +0 -1
- package/dist/web-components-library/p-b6f36170.entry.js +0 -16
- package/dist/web-components-library/p-bb0fe7bc.entry.js +0 -1
- package/dist/web-components-library/p-bdefe224.entry.js +0 -1
- package/dist/web-components-library/p-beba3e67.entry.js +0 -1
- package/dist/web-components-library/p-c4417a91.entry.js +0 -1
- package/dist/web-components-library/p-ce83ce18.entry.js +0 -1
- package/dist/web-components-library/p-d17ebc2f.js +0 -2
- package/dist/web-components-library/p-d2127d84.entry.js +0 -1
- package/dist/web-components-library/p-d69e14fb.js +0 -1
- package/dist/web-components-library/p-de55c171.entry.js +0 -1
- package/dist/web-components-library/p-e40b16fa.entry.js +0 -1
- package/dist/web-components-library/p-e43e61ac.js +0 -7
- package/dist/web-components-library/p-eaa4eba8.entry.js +0 -1
- package/dist/web-components-library/p-ede9fbf5.entry.js +0 -1
- package/dist/web-components-library/p-f0653e72.entry.js +0 -1
- package/dist/web-components-library/p-f158d205.entry.js +0 -1
- package/dist/web-components-library/p-f425f188.js +0 -1
- package/dist/web-components-library/p-f54f63e1.entry.js +0 -1
- package/dist/web-components-library/p-f95cc914.entry.js +0 -1
- package/www/build/p-009c9f67.entry.js +0 -1
- package/www/build/p-01f001fd.entry.js +0 -1
- package/www/build/p-05ced71c.entry.js +0 -1
- package/www/build/p-074ea569.entry.js +0 -1
- package/www/build/p-07e18572.entry.js +0 -1
- package/www/build/p-0843b0e7.entry.js +0 -1
- package/www/build/p-0fa4b50b.entry.js +0 -1
- package/www/build/p-112455b1.js +0 -1
- package/www/build/p-1d66b265.entry.js +0 -1
- package/www/build/p-214b6cee.entry.js +0 -1
- package/www/build/p-26033729.entry.js +0 -1
- package/www/build/p-26f834e5.entry.js +0 -1
- package/www/build/p-275801c6.css +0 -1
- package/www/build/p-2acd6a51.entry.js +0 -1
- package/www/build/p-2d1b6c3c.entry.js +0 -1
- package/www/build/p-2efedcf4.entry.js +0 -1
- package/www/build/p-32509af7.entry.js +0 -1
- package/www/build/p-33352f9e.entry.js +0 -1
- package/www/build/p-344e7ae7.entry.js +0 -1
- package/www/build/p-34c26207.entry.js +0 -1
- package/www/build/p-35ae6f4d.js +0 -1
- package/www/build/p-37e050bd.entry.js +0 -1
- package/www/build/p-38a3cf3b.entry.js +0 -1
- package/www/build/p-3a468aa9.entry.js +0 -1
- package/www/build/p-3be171d0.entry.js +0 -1
- package/www/build/p-3eb60c95.entry.js +0 -1
- package/www/build/p-3f55dce6.entry.js +0 -1
- package/www/build/p-4423b00c.entry.js +0 -1
- package/www/build/p-475ca461.entry.js +0 -1
- package/www/build/p-51e308ca.entry.js +0 -1
- package/www/build/p-53065788.entry.js +0 -1
- package/www/build/p-540c7d73.entry.js +0 -1
- package/www/build/p-5624a127.entry.js +0 -1
- package/www/build/p-56d2b76d.entry.js +0 -1
- package/www/build/p-59cfee8d.entry.js +0 -1
- package/www/build/p-5c62387a.entry.js +0 -1
- package/www/build/p-5dd9a2c6.entry.js +0 -1
- package/www/build/p-61424b8a.entry.js +0 -1
- package/www/build/p-6289c4bd.entry.js +0 -1
- package/www/build/p-6b1a5309.entry.js +0 -1
- package/www/build/p-6c163539.entry.js +0 -1
- package/www/build/p-735bdfa3.entry.js +0 -1
- package/www/build/p-73c91de3.entry.js +0 -1
- package/www/build/p-7b3b99ee.entry.js +0 -1
- package/www/build/p-7ea553e9.entry.js +0 -1
- package/www/build/p-810bd730.entry.js +0 -1
- package/www/build/p-8b15b30c.entry.js +0 -1
- package/www/build/p-8c105bd1.entry.js +0 -1
- package/www/build/p-8ebe4adf.js +0 -1
- package/www/build/p-91a74348.entry.js +0 -1
- package/www/build/p-93142fac.entry.js +0 -1
- package/www/build/p-95b8f109.entry.js +0 -1
- package/www/build/p-9c28b8fc.entry.js +0 -1
- package/www/build/p-9c338aeb.entry.js +0 -1
- package/www/build/p-9d03a7d6.entry.js +0 -1
- package/www/build/p-9d57a84c.entry.js +0 -1
- package/www/build/p-9f543b6a.entry.js +0 -1
- package/www/build/p-a05ce0a6.entry.js +0 -1
- package/www/build/p-a0e2715e.entry.js +0 -1
- package/www/build/p-a23e9115.js +0 -1
- package/www/build/p-a6c0f149.entry.js +0 -1
- package/www/build/p-a79d1412.entry.js +0 -1
- package/www/build/p-a82ea410.entry.js +0 -1
- package/www/build/p-ae6197f4.entry.js +0 -1
- package/www/build/p-ae79573a.entry.js +0 -1
- package/www/build/p-af4d1987.entry.js +0 -1
- package/www/build/p-b33f5e6a.entry.js +0 -1
- package/www/build/p-b3c29822.js +0 -1
- package/www/build/p-b6f36170.entry.js +0 -16
- package/www/build/p-bb0fe7bc.entry.js +0 -1
- package/www/build/p-bdefe224.entry.js +0 -1
- package/www/build/p-beba3e67.entry.js +0 -1
- package/www/build/p-c4417a91.entry.js +0 -1
- package/www/build/p-ce83ce18.entry.js +0 -1
- package/www/build/p-d17ebc2f.js +0 -2
- package/www/build/p-d2127d84.entry.js +0 -1
- package/www/build/p-d69e14fb.js +0 -1
- package/www/build/p-de55c171.entry.js +0 -1
- package/www/build/p-e40b16fa.entry.js +0 -1
- package/www/build/p-e43e61ac.js +0 -7
- package/www/build/p-eaa4eba8.entry.js +0 -1
- package/www/build/p-ede9fbf5.entry.js +0 -1
- package/www/build/p-f0653e72.entry.js +0 -1
- package/www/build/p-f158d205.entry.js +0 -1
- package/www/build/p-f425f188.js +0 -1
- package/www/build/p-f54f63e1.entry.js +0 -1
- package/www/build/p-f95cc914.entry.js +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const NAMESPACE = 'web-components-library';
|
|
2
|
+
const BUILD = /* web-components-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: true, connectedCallback: false, constructableCSS: false, cssAnnotations: true, cssVarShim: false, devTools: true, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: true, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
|
+
const Env = /* web-components-library */ {};
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -11,25 +13,120 @@ const NAMESPACE = 'web-components-library';
|
|
|
11
13
|
let scopeId;
|
|
12
14
|
let contentRef;
|
|
13
15
|
let hostTagName;
|
|
16
|
+
let customError;
|
|
17
|
+
let i = 0;
|
|
14
18
|
let useNativeShadowDom = false;
|
|
15
19
|
let checkSlotFallbackVisibility = false;
|
|
16
20
|
let checkSlotRelocate = false;
|
|
17
21
|
let isSvgMode = false;
|
|
22
|
+
let renderingRef = null;
|
|
23
|
+
let queueCongestion = 0;
|
|
18
24
|
let queuePending = false;
|
|
25
|
+
const Build = {
|
|
26
|
+
isDev: BUILD.isDev ? true : false,
|
|
27
|
+
isBrowser: true,
|
|
28
|
+
isServer: false,
|
|
29
|
+
isTesting: BUILD.isTesting ? true : false,
|
|
30
|
+
};
|
|
31
|
+
const Context = {};
|
|
32
|
+
const getAssetPath = (path) => {
|
|
33
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
34
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
35
|
+
};
|
|
36
|
+
const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
|
|
19
37
|
const createTime = (fnName, tagName = '') => {
|
|
20
|
-
{
|
|
38
|
+
if (BUILD.profile && performance.mark) {
|
|
39
|
+
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
40
|
+
// Start
|
|
41
|
+
performance.mark(key);
|
|
42
|
+
// End
|
|
43
|
+
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
21
46
|
return () => {
|
|
22
47
|
return;
|
|
23
48
|
};
|
|
24
49
|
}
|
|
25
50
|
};
|
|
26
51
|
const uniqueTime = (key, measureText) => {
|
|
27
|
-
{
|
|
52
|
+
if (BUILD.profile && performance.mark) {
|
|
53
|
+
if (performance.getEntriesByName(key).length === 0) {
|
|
54
|
+
performance.mark(key);
|
|
55
|
+
}
|
|
56
|
+
return () => {
|
|
57
|
+
if (performance.getEntriesByName(measureText).length === 0) {
|
|
58
|
+
performance.measure(measureText, key);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
28
63
|
return () => {
|
|
29
64
|
return;
|
|
30
65
|
};
|
|
31
66
|
}
|
|
32
67
|
};
|
|
68
|
+
const inspect = (ref) => {
|
|
69
|
+
const hostRef = getHostRef(ref);
|
|
70
|
+
if (!hostRef) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const flags = hostRef.$flags$;
|
|
74
|
+
const hostElement = hostRef.$hostElement$;
|
|
75
|
+
return {
|
|
76
|
+
renderCount: hostRef.$renderCount$,
|
|
77
|
+
flags: {
|
|
78
|
+
hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
|
|
79
|
+
hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
|
|
80
|
+
isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
|
|
81
|
+
isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
|
|
82
|
+
isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
|
|
83
|
+
hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
|
|
84
|
+
hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
|
|
85
|
+
isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
|
|
86
|
+
isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
|
|
87
|
+
needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
|
|
88
|
+
},
|
|
89
|
+
instanceValues: hostRef.$instanceValues$,
|
|
90
|
+
ancestorComponent: hostRef.$ancestorComponent$,
|
|
91
|
+
hostElement,
|
|
92
|
+
lazyInstance: hostRef.$lazyInstance$,
|
|
93
|
+
vnode: hostRef.$vnode$,
|
|
94
|
+
modeName: hostRef.$modeName$,
|
|
95
|
+
onReadyPromise: hostRef.$onReadyPromise$,
|
|
96
|
+
onReadyResolve: hostRef.$onReadyResolve$,
|
|
97
|
+
onInstancePromise: hostRef.$onInstancePromise$,
|
|
98
|
+
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
99
|
+
onRenderResolve: hostRef.$onRenderResolve$,
|
|
100
|
+
queuedListeners: hostRef.$queuedListeners$,
|
|
101
|
+
rmListeners: hostRef.$rmListeners$,
|
|
102
|
+
['s-id']: hostElement['s-id'],
|
|
103
|
+
['s-cr']: hostElement['s-cr'],
|
|
104
|
+
['s-lr']: hostElement['s-lr'],
|
|
105
|
+
['s-p']: hostElement['s-p'],
|
|
106
|
+
['s-rc']: hostElement['s-rc'],
|
|
107
|
+
['s-sc']: hostElement['s-sc'],
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const installDevTools = () => {
|
|
111
|
+
if (BUILD.devTools) {
|
|
112
|
+
const stencil = (win.stencil = win.stencil || {});
|
|
113
|
+
const originalInspect = stencil.inspect;
|
|
114
|
+
stencil.inspect = (ref) => {
|
|
115
|
+
let result = inspect(ref);
|
|
116
|
+
if (!result && typeof originalInspect === 'function') {
|
|
117
|
+
result = originalInspect(ref);
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const CONTENT_REF_ID = 'r';
|
|
124
|
+
const ORG_LOCATION_ID = 'o';
|
|
125
|
+
const SLOT_NODE_ID = 's';
|
|
126
|
+
const TEXT_NODE_ID = 't';
|
|
127
|
+
const HYDRATE_ID = 's-id';
|
|
128
|
+
const HYDRATED_STYLE_ID = 'sty-id';
|
|
129
|
+
const HYDRATE_CHILD_ID = 'c-id';
|
|
33
130
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
34
131
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
35
132
|
/**
|
|
@@ -79,6 +176,11 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
79
176
|
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
80
177
|
child = String(child);
|
|
81
178
|
}
|
|
179
|
+
else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
|
|
180
|
+
consoleDevError(`vNode passed as children has unexpected type.
|
|
181
|
+
Make sure it's using the correct h() function.
|
|
182
|
+
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
183
|
+
}
|
|
82
184
|
if (simple && lastSimple) {
|
|
83
185
|
// If the previous child was simple (string), we merge both
|
|
84
186
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -93,14 +195,17 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
93
195
|
};
|
|
94
196
|
walk(children);
|
|
95
197
|
if (vnodeData) {
|
|
198
|
+
if (BUILD.isDev && nodeName === 'input') {
|
|
199
|
+
validateInputProperties(vnodeData);
|
|
200
|
+
}
|
|
96
201
|
// normalize class / classname attributes
|
|
97
|
-
if (vnodeData.key) {
|
|
202
|
+
if (BUILD.vdomKey && vnodeData.key) {
|
|
98
203
|
key = vnodeData.key;
|
|
99
204
|
}
|
|
100
|
-
if (vnodeData.name) {
|
|
205
|
+
if (BUILD.slotRelocation && vnodeData.name) {
|
|
101
206
|
slotName = vnodeData.name;
|
|
102
207
|
}
|
|
103
|
-
{
|
|
208
|
+
if (BUILD.vdomClass) {
|
|
104
209
|
const classData = vnodeData.className || vnodeData.class;
|
|
105
210
|
if (classData) {
|
|
106
211
|
vnodeData.class =
|
|
@@ -112,15 +217,24 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
112
217
|
}
|
|
113
218
|
}
|
|
114
219
|
}
|
|
220
|
+
if (BUILD.isDev && vNodeChildren.some(isHost)) {
|
|
221
|
+
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
222
|
+
- You are NOT using hostData() and <Host> in the same component.
|
|
223
|
+
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
224
|
+
}
|
|
225
|
+
if (BUILD.vdomFunctional && typeof nodeName === 'function') {
|
|
226
|
+
// nodeName is a functional component
|
|
227
|
+
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
228
|
+
}
|
|
115
229
|
const vnode = newVNode(nodeName, null);
|
|
116
230
|
vnode.$attrs$ = vnodeData;
|
|
117
231
|
if (vNodeChildren.length > 0) {
|
|
118
232
|
vnode.$children$ = vNodeChildren;
|
|
119
233
|
}
|
|
120
|
-
{
|
|
234
|
+
if (BUILD.vdomKey) {
|
|
121
235
|
vnode.$key$ = key;
|
|
122
236
|
}
|
|
123
|
-
{
|
|
237
|
+
if (BUILD.slotRelocation) {
|
|
124
238
|
vnode.$name$ = slotName;
|
|
125
239
|
}
|
|
126
240
|
return vnode;
|
|
@@ -133,19 +247,277 @@ const newVNode = (tag, text) => {
|
|
|
133
247
|
$elm$: null,
|
|
134
248
|
$children$: null,
|
|
135
249
|
};
|
|
136
|
-
{
|
|
250
|
+
if (BUILD.vdomAttribute) {
|
|
137
251
|
vnode.$attrs$ = null;
|
|
138
252
|
}
|
|
139
|
-
{
|
|
253
|
+
if (BUILD.vdomKey) {
|
|
140
254
|
vnode.$key$ = null;
|
|
141
255
|
}
|
|
142
|
-
{
|
|
256
|
+
if (BUILD.slotRelocation) {
|
|
143
257
|
vnode.$name$ = null;
|
|
144
258
|
}
|
|
145
259
|
return vnode;
|
|
146
260
|
};
|
|
147
261
|
const Host = {};
|
|
148
262
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
263
|
+
const vdomFnUtils = {
|
|
264
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
265
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
266
|
+
};
|
|
267
|
+
const convertToPublic = (node) => ({
|
|
268
|
+
vattrs: node.$attrs$,
|
|
269
|
+
vchildren: node.$children$,
|
|
270
|
+
vkey: node.$key$,
|
|
271
|
+
vname: node.$name$,
|
|
272
|
+
vtag: node.$tag$,
|
|
273
|
+
vtext: node.$text$,
|
|
274
|
+
});
|
|
275
|
+
const convertToPrivate = (node) => {
|
|
276
|
+
if (typeof node.vtag === 'function') {
|
|
277
|
+
const vnodeData = Object.assign({}, node.vattrs);
|
|
278
|
+
if (node.vkey) {
|
|
279
|
+
vnodeData.key = node.vkey;
|
|
280
|
+
}
|
|
281
|
+
if (node.vname) {
|
|
282
|
+
vnodeData.name = node.vname;
|
|
283
|
+
}
|
|
284
|
+
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
285
|
+
}
|
|
286
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
287
|
+
vnode.$attrs$ = node.vattrs;
|
|
288
|
+
vnode.$children$ = node.vchildren;
|
|
289
|
+
vnode.$key$ = node.vkey;
|
|
290
|
+
vnode.$name$ = node.vname;
|
|
291
|
+
return vnode;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Validates the ordering of attributes on an input element
|
|
295
|
+
* @param inputElm the element to validate
|
|
296
|
+
*/
|
|
297
|
+
const validateInputProperties = (inputElm) => {
|
|
298
|
+
const props = Object.keys(inputElm);
|
|
299
|
+
const value = props.indexOf('value');
|
|
300
|
+
if (value === -1) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const typeIndex = props.indexOf('type');
|
|
304
|
+
const minIndex = props.indexOf('min');
|
|
305
|
+
const maxIndex = props.indexOf('max');
|
|
306
|
+
const stepIndex = props.indexOf('step');
|
|
307
|
+
if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
|
|
308
|
+
consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
312
|
+
const endHydrate = createTime('hydrateClient', tagName);
|
|
313
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
314
|
+
const childRenderNodes = [];
|
|
315
|
+
const slotNodes = [];
|
|
316
|
+
const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
|
|
317
|
+
const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
|
318
|
+
if (!plt.$orgLocNodes$) {
|
|
319
|
+
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
|
320
|
+
}
|
|
321
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
322
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
323
|
+
clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
|
|
324
|
+
childRenderNodes.map((c) => {
|
|
325
|
+
const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
|
326
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
327
|
+
const node = c.$elm$;
|
|
328
|
+
if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
|
|
329
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
330
|
+
}
|
|
331
|
+
if (!shadowRoot) {
|
|
332
|
+
node['s-hn'] = tagName;
|
|
333
|
+
if (orgLocationNode) {
|
|
334
|
+
node['s-ol'] = orgLocationNode;
|
|
335
|
+
node['s-ol']['s-nr'] = node;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
339
|
+
});
|
|
340
|
+
if (BUILD.shadowDom && shadowRoot) {
|
|
341
|
+
shadowRootNodes.map((shadowRootNode) => {
|
|
342
|
+
if (shadowRootNode) {
|
|
343
|
+
shadowRoot.appendChild(shadowRootNode);
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
endHydrate();
|
|
348
|
+
};
|
|
349
|
+
const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
|
|
350
|
+
let childNodeType;
|
|
351
|
+
let childIdSplt;
|
|
352
|
+
let childVNode;
|
|
353
|
+
let i;
|
|
354
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
355
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
356
|
+
if (childNodeType) {
|
|
357
|
+
// got the node data from the element's attribute
|
|
358
|
+
// `${hostId}.${nodeId}.${depth}.${index}`
|
|
359
|
+
childIdSplt = childNodeType.split('.');
|
|
360
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
|
|
361
|
+
childVNode = {
|
|
362
|
+
$flags$: 0,
|
|
363
|
+
$hostId$: childIdSplt[0],
|
|
364
|
+
$nodeId$: childIdSplt[1],
|
|
365
|
+
$depth$: childIdSplt[2],
|
|
366
|
+
$index$: childIdSplt[3],
|
|
367
|
+
$tag$: node.tagName.toLowerCase(),
|
|
368
|
+
$elm$: node,
|
|
369
|
+
$attrs$: null,
|
|
370
|
+
$children$: null,
|
|
371
|
+
$key$: null,
|
|
372
|
+
$name$: null,
|
|
373
|
+
$text$: null,
|
|
374
|
+
};
|
|
375
|
+
childRenderNodes.push(childVNode);
|
|
376
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
377
|
+
// this is a new child vnode
|
|
378
|
+
// so ensure its parent vnode has the vchildren array
|
|
379
|
+
if (!parentVNode.$children$) {
|
|
380
|
+
parentVNode.$children$ = [];
|
|
381
|
+
}
|
|
382
|
+
// add our child vnode to a specific index of the vnode's children
|
|
383
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
384
|
+
// this is now the new parent vnode for all the next child checks
|
|
385
|
+
parentVNode = childVNode;
|
|
386
|
+
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
387
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// recursively drill down, end to start so we can remove nodes
|
|
392
|
+
for (i = node.childNodes.length - 1; i >= 0; i--) {
|
|
393
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
|
|
394
|
+
}
|
|
395
|
+
if (node.shadowRoot) {
|
|
396
|
+
// keep drilling down through the shadow root nodes
|
|
397
|
+
for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
|
|
398
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
403
|
+
// `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
|
|
404
|
+
childIdSplt = node.nodeValue.split('.');
|
|
405
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
|
|
406
|
+
// comment node for either the host id or a 0 host id
|
|
407
|
+
childNodeType = childIdSplt[0];
|
|
408
|
+
childVNode = {
|
|
409
|
+
$flags$: 0,
|
|
410
|
+
$hostId$: childIdSplt[1],
|
|
411
|
+
$nodeId$: childIdSplt[2],
|
|
412
|
+
$depth$: childIdSplt[3],
|
|
413
|
+
$index$: childIdSplt[4],
|
|
414
|
+
$elm$: node,
|
|
415
|
+
$attrs$: null,
|
|
416
|
+
$children$: null,
|
|
417
|
+
$key$: null,
|
|
418
|
+
$name$: null,
|
|
419
|
+
$tag$: null,
|
|
420
|
+
$text$: null,
|
|
421
|
+
};
|
|
422
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
423
|
+
childVNode.$elm$ = node.nextSibling;
|
|
424
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
425
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
426
|
+
childRenderNodes.push(childVNode);
|
|
427
|
+
// remove the text comment since it's no longer needed
|
|
428
|
+
node.remove();
|
|
429
|
+
if (!parentVNode.$children$) {
|
|
430
|
+
parentVNode.$children$ = [];
|
|
431
|
+
}
|
|
432
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
433
|
+
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
434
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
else if (childVNode.$hostId$ === hostId) {
|
|
439
|
+
// this comment node is specifcally for this host id
|
|
440
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
441
|
+
// `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
|
|
442
|
+
childVNode.$tag$ = 'slot';
|
|
443
|
+
if (childIdSplt[5]) {
|
|
444
|
+
node['s-sn'] = childVNode.$name$ = childIdSplt[5];
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
node['s-sn'] = '';
|
|
448
|
+
}
|
|
449
|
+
node['s-sr'] = true;
|
|
450
|
+
if (BUILD.shadowDom && shadowRootNodes) {
|
|
451
|
+
// browser support shadowRoot and this is a shadow dom component
|
|
452
|
+
// create an actual slot element
|
|
453
|
+
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
454
|
+
if (childVNode.$name$) {
|
|
455
|
+
// add the slot name attribute
|
|
456
|
+
childVNode.$elm$.setAttribute('name', childVNode.$name$);
|
|
457
|
+
}
|
|
458
|
+
// insert the new slot element before the slot comment
|
|
459
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
460
|
+
// remove the slot comment since it's not needed for shadow
|
|
461
|
+
node.remove();
|
|
462
|
+
if (childVNode.$depth$ === '0') {
|
|
463
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
slotNodes.push(childVNode);
|
|
467
|
+
if (!parentVNode.$children$) {
|
|
468
|
+
parentVNode.$children$ = [];
|
|
469
|
+
}
|
|
470
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
471
|
+
}
|
|
472
|
+
else if (childNodeType === CONTENT_REF_ID) {
|
|
473
|
+
// `${CONTENT_REF_ID}.${hostId}`;
|
|
474
|
+
if (BUILD.shadowDom && shadowRootNodes) {
|
|
475
|
+
// remove the content ref comment since it's not needed for shadow
|
|
476
|
+
node.remove();
|
|
477
|
+
}
|
|
478
|
+
else if (BUILD.slotRelocation) {
|
|
479
|
+
hostElm['s-cr'] = node;
|
|
480
|
+
node['s-cn'] = true;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
else if (parentVNode && parentVNode.$tag$ === 'style') {
|
|
487
|
+
const vnode = newVNode(null, node.textContent);
|
|
488
|
+
vnode.$elm$ = node;
|
|
489
|
+
vnode.$index$ = '0';
|
|
490
|
+
parentVNode.$children$ = [vnode];
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
const initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
494
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
495
|
+
let i = 0;
|
|
496
|
+
for (; i < node.childNodes.length; i++) {
|
|
497
|
+
initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
|
|
498
|
+
}
|
|
499
|
+
if (node.shadowRoot) {
|
|
500
|
+
for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
|
|
501
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
506
|
+
const childIdSplt = node.nodeValue.split('.');
|
|
507
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
508
|
+
orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
|
|
509
|
+
node.nodeValue = '';
|
|
510
|
+
// useful to know if the original location is
|
|
511
|
+
// the root light-dom of a shadow dom component
|
|
512
|
+
node['s-en'] = childIdSplt[3];
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
// Private
|
|
517
|
+
const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
|
|
518
|
+
// Public
|
|
519
|
+
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
520
|
+
const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
149
521
|
/**
|
|
150
522
|
* Parse a new property value for a given property type.
|
|
151
523
|
*
|
|
@@ -172,16 +544,16 @@ const isHost = (node) => node && node.$tag$ === Host;
|
|
|
172
544
|
const parsePropertyValue = (propValue, propType) => {
|
|
173
545
|
// ensure this value is of the correct prop type
|
|
174
546
|
if (propValue != null && !isComplexType(propValue)) {
|
|
175
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
547
|
+
if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
176
548
|
// per the HTML spec, any string value means it is a boolean true value
|
|
177
549
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
178
550
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
179
551
|
}
|
|
180
|
-
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
552
|
+
if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
181
553
|
// force it to be a number
|
|
182
554
|
return parseFloat(propValue);
|
|
183
555
|
}
|
|
184
|
-
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
556
|
+
if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {
|
|
185
557
|
// could have been passed as a number or boolean
|
|
186
558
|
// but we still want it as a string
|
|
187
559
|
return String(propValue);
|
|
@@ -193,11 +565,14 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
193
565
|
// so no need to change to a different type
|
|
194
566
|
return propValue;
|
|
195
567
|
};
|
|
196
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
568
|
+
const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
|
|
197
569
|
const createEvent = (ref, name, flags) => {
|
|
198
570
|
const elm = getElement(ref);
|
|
199
571
|
return {
|
|
200
572
|
emit: (detail) => {
|
|
573
|
+
if (BUILD.isDev && !elm.isConnected) {
|
|
574
|
+
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
575
|
+
}
|
|
201
576
|
return emitEvent(elm, name, {
|
|
202
577
|
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
203
578
|
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
@@ -237,8 +612,11 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
237
612
|
styles.set(scopeId, style);
|
|
238
613
|
};
|
|
239
614
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
240
|
-
let scopeId = getScopeId(cmpMeta);
|
|
615
|
+
let scopeId = getScopeId(cmpMeta, mode);
|
|
241
616
|
const style = styles.get(scopeId);
|
|
617
|
+
if (!BUILD.attachStyles) {
|
|
618
|
+
return scopeId;
|
|
619
|
+
}
|
|
242
620
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
243
621
|
// so the fallback is to always use the document for the root node in those cases
|
|
244
622
|
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -251,11 +629,31 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
251
629
|
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
252
630
|
}
|
|
253
631
|
if (!appliedStyles.has(scopeId)) {
|
|
254
|
-
|
|
255
|
-
|
|
632
|
+
if (BUILD.hydrateClientSide &&
|
|
633
|
+
styleContainerNode.host &&
|
|
634
|
+
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
635
|
+
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
636
|
+
styleElm.innerHTML = style;
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
640
|
+
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* CMP_FLAGS.needsScopedEncapsulation */));
|
|
641
|
+
const newScopeId = styleElm['s-sc'];
|
|
642
|
+
if (newScopeId) {
|
|
643
|
+
scopeId = newScopeId;
|
|
644
|
+
// we don't want to add this styleID to the appliedStyles Set
|
|
645
|
+
// since the cssVarShim might need to apply several different
|
|
646
|
+
// stylesheets for the same component
|
|
647
|
+
appliedStyles = null;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
256
651
|
styleElm = doc.createElement('style');
|
|
257
652
|
styleElm.innerHTML = style;
|
|
258
653
|
}
|
|
654
|
+
if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
|
|
655
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
|
|
656
|
+
}
|
|
259
657
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
260
658
|
}
|
|
261
659
|
if (appliedStyles) {
|
|
@@ -263,7 +661,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
263
661
|
}
|
|
264
662
|
}
|
|
265
663
|
}
|
|
266
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
664
|
+
else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
267
665
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
268
666
|
}
|
|
269
667
|
}
|
|
@@ -274,8 +672,8 @@ const attachStyles = (hostRef) => {
|
|
|
274
672
|
const elm = hostRef.$hostElement$;
|
|
275
673
|
const flags = cmpMeta.$flags$;
|
|
276
674
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
277
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
278
|
-
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
675
|
+
const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
|
|
676
|
+
if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
279
677
|
// only required when we're NOT using native shadow dom (slot)
|
|
280
678
|
// or this browser doesn't support native shadow dom
|
|
281
679
|
// and this host element was NOT created with SSR
|
|
@@ -285,13 +683,14 @@ const attachStyles = (hostRef) => {
|
|
|
285
683
|
// DOM WRITE!!
|
|
286
684
|
elm['s-sc'] = scopeId;
|
|
287
685
|
elm.classList.add(scopeId + '-h');
|
|
288
|
-
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
686
|
+
if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
289
687
|
elm.classList.add(scopeId + '-s');
|
|
290
688
|
}
|
|
291
689
|
}
|
|
292
690
|
endAttachStyles();
|
|
293
691
|
};
|
|
294
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
692
|
+
const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
|
|
693
|
+
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
295
694
|
/**
|
|
296
695
|
* Production setAccessor() function based on Preact by
|
|
297
696
|
* Jason Miller (@developit)
|
|
@@ -304,19 +703,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
304
703
|
if (oldValue !== newValue) {
|
|
305
704
|
let isProp = isMemberInElement(elm, memberName);
|
|
306
705
|
let ln = memberName.toLowerCase();
|
|
307
|
-
if (memberName === 'class') {
|
|
706
|
+
if (BUILD.vdomClass && memberName === 'class') {
|
|
308
707
|
const classList = elm.classList;
|
|
309
708
|
const oldClasses = parseClassList(oldValue);
|
|
310
709
|
const newClasses = parseClassList(newValue);
|
|
311
710
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
312
711
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
313
712
|
}
|
|
314
|
-
else if (memberName === 'style') {
|
|
713
|
+
else if (BUILD.vdomStyle && memberName === 'style') {
|
|
315
714
|
// update style attribute, css properties and values
|
|
316
|
-
{
|
|
715
|
+
if (BUILD.updatable) {
|
|
317
716
|
for (const prop in oldValue) {
|
|
318
717
|
if (!newValue || newValue[prop] == null) {
|
|
319
|
-
if (prop.includes('-')) {
|
|
718
|
+
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
320
719
|
elm.style.removeProperty(prop);
|
|
321
720
|
}
|
|
322
721
|
else {
|
|
@@ -327,7 +726,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
327
726
|
}
|
|
328
727
|
for (const prop in newValue) {
|
|
329
728
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
330
|
-
if (prop.includes('-')) {
|
|
729
|
+
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
331
730
|
elm.style.setProperty(prop, newValue[prop]);
|
|
332
731
|
}
|
|
333
732
|
else {
|
|
@@ -336,15 +735,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
336
735
|
}
|
|
337
736
|
}
|
|
338
737
|
}
|
|
339
|
-
else if (memberName === 'key')
|
|
738
|
+
else if (BUILD.vdomKey && memberName === 'key')
|
|
340
739
|
;
|
|
341
|
-
else if (memberName === 'ref') {
|
|
740
|
+
else if (BUILD.vdomRef && memberName === 'ref') {
|
|
342
741
|
// minifier will clean this up
|
|
343
742
|
if (newValue) {
|
|
344
743
|
newValue(elm);
|
|
345
744
|
}
|
|
346
745
|
}
|
|
347
|
-
else if (
|
|
746
|
+
else if (BUILD.vdomListener &&
|
|
747
|
+
(BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
|
|
348
748
|
memberName[0] === 'o' &&
|
|
349
749
|
memberName[1] === 'n') {
|
|
350
750
|
// Event Handlers
|
|
@@ -383,7 +783,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
383
783
|
plt.ael(elm, memberName, newValue, false);
|
|
384
784
|
}
|
|
385
785
|
}
|
|
386
|
-
else {
|
|
786
|
+
else if (BUILD.vdomPropOrAttr) {
|
|
387
787
|
// Set property if it exists and it's not a SVG
|
|
388
788
|
const isComplex = isComplexType(newValue);
|
|
389
789
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
@@ -412,7 +812,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
412
812
|
* - if the newValue is null/undefined or 'false'.
|
|
413
813
|
*/
|
|
414
814
|
let xlink = false;
|
|
415
|
-
{
|
|
815
|
+
if (BUILD.vdomXlink) {
|
|
416
816
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
417
817
|
memberName = ln;
|
|
418
818
|
xlink = true;
|
|
@@ -420,7 +820,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
420
820
|
}
|
|
421
821
|
if (newValue == null || newValue === false) {
|
|
422
822
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
423
|
-
if (xlink) {
|
|
823
|
+
if (BUILD.vdomXlink && xlink) {
|
|
424
824
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
425
825
|
}
|
|
426
826
|
else {
|
|
@@ -430,7 +830,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
430
830
|
}
|
|
431
831
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
432
832
|
newValue = newValue === true ? '' : newValue;
|
|
433
|
-
if (xlink) {
|
|
833
|
+
if (BUILD.vdomXlink && xlink) {
|
|
434
834
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
435
835
|
}
|
|
436
836
|
else {
|
|
@@ -451,7 +851,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
451
851
|
: newVnode.$elm$;
|
|
452
852
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
453
853
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
454
|
-
{
|
|
854
|
+
if (BUILD.updatable) {
|
|
455
855
|
// remove attributes no longer present on the vnode by setting them to undefined
|
|
456
856
|
for (memberName in oldVnodeAttrs) {
|
|
457
857
|
if (!(memberName in newVnodeAttrs)) {
|
|
@@ -481,7 +881,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
481
881
|
let elm;
|
|
482
882
|
let childNode;
|
|
483
883
|
let oldVNode;
|
|
484
|
-
if (!useNativeShadowDom) {
|
|
884
|
+
if (BUILD.slotRelocation && !useNativeShadowDom) {
|
|
485
885
|
// remember for later we need to check to relocate nodes
|
|
486
886
|
checkSlotRelocate = true;
|
|
487
887
|
if (newVNode.$tag$ === 'slot') {
|
|
@@ -496,32 +896,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
496
896
|
1 /* VNODE_FLAGS.isSlotReference */;
|
|
497
897
|
}
|
|
498
898
|
}
|
|
499
|
-
if (newVNode.$
|
|
899
|
+
if (BUILD.isDev && newVNode.$elm$) {
|
|
900
|
+
consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
|
|
901
|
+
}
|
|
902
|
+
if (BUILD.vdomText && newVNode.$text$ !== null) {
|
|
500
903
|
// create text node
|
|
501
904
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
502
905
|
}
|
|
503
|
-
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
906
|
+
else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
504
907
|
// create a slot reference node
|
|
505
908
|
elm = newVNode.$elm$ =
|
|
506
|
-
doc.createTextNode('');
|
|
909
|
+
BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
|
|
507
910
|
}
|
|
508
911
|
else {
|
|
509
|
-
if (!isSvgMode) {
|
|
912
|
+
if (BUILD.svg && !isSvgMode) {
|
|
510
913
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
511
914
|
}
|
|
512
915
|
// create element
|
|
513
|
-
elm = newVNode.$elm$ = (
|
|
916
|
+
elm = newVNode.$elm$ = (BUILD.svg
|
|
917
|
+
? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
514
918
|
? 'slot-fb'
|
|
515
919
|
: newVNode.$tag$)
|
|
516
|
-
|
|
517
|
-
|
|
920
|
+
: doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
921
|
+
? 'slot-fb'
|
|
922
|
+
: newVNode.$tag$));
|
|
923
|
+
if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
518
924
|
isSvgMode = false;
|
|
519
925
|
}
|
|
520
926
|
// add css classes, attrs, props, listeners, etc.
|
|
521
|
-
{
|
|
927
|
+
if (BUILD.vdomAttribute) {
|
|
522
928
|
updateElement(null, newVNode, isSvgMode);
|
|
523
929
|
}
|
|
524
|
-
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
930
|
+
if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
525
931
|
// if there is a scopeId and this is the initial render
|
|
526
932
|
// then let's add the scopeId as a css class
|
|
527
933
|
elm.classList.add((elm['s-si'] = scopeId));
|
|
@@ -537,7 +943,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
537
943
|
}
|
|
538
944
|
}
|
|
539
945
|
}
|
|
540
|
-
{
|
|
946
|
+
if (BUILD.svg) {
|
|
541
947
|
if (newVNode.$tag$ === 'svg') {
|
|
542
948
|
// Only reset the SVG context when we're exiting <svg> element
|
|
543
949
|
isSvgMode = false;
|
|
@@ -548,7 +954,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
548
954
|
}
|
|
549
955
|
}
|
|
550
956
|
}
|
|
551
|
-
{
|
|
957
|
+
if (BUILD.slotRelocation) {
|
|
552
958
|
elm['s-hn'] = hostTagName;
|
|
553
959
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
554
960
|
// remember the content reference comment
|
|
@@ -593,9 +999,9 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
593
999
|
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
594
1000
|
};
|
|
595
1001
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
596
|
-
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
1002
|
+
let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
597
1003
|
let childNode;
|
|
598
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1004
|
+
if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
599
1005
|
containerElm = containerElm.shadowRoot;
|
|
600
1006
|
}
|
|
601
1007
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -603,7 +1009,7 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
603
1009
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
604
1010
|
if (childNode) {
|
|
605
1011
|
vnodes[startIdx].$elm$ = childNode;
|
|
606
|
-
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
1012
|
+
containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
|
|
607
1013
|
}
|
|
608
1014
|
}
|
|
609
1015
|
}
|
|
@@ -613,7 +1019,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
613
1019
|
if ((vnode = vnodes[startIdx])) {
|
|
614
1020
|
elm = vnode.$elm$;
|
|
615
1021
|
callNodeRefs(vnode);
|
|
616
|
-
{
|
|
1022
|
+
if (BUILD.slotRelocation) {
|
|
617
1023
|
// we're removing this element
|
|
618
1024
|
// so it's possible we need to show slot fallback content now
|
|
619
1025
|
checkSlotFallbackVisibility = true;
|
|
@@ -759,7 +1165,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
759
1165
|
//
|
|
760
1166
|
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
761
1167
|
// and move the DOM element for `oldStartVnode`.
|
|
762
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1168
|
+
if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
763
1169
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
764
1170
|
}
|
|
765
1171
|
patch(oldStartVnode, newEndVnode);
|
|
@@ -800,7 +1206,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
800
1206
|
// (which will handle updating any changed attributes, reconciling their
|
|
801
1207
|
// children etc) but we also need to move the DOM node to which
|
|
802
1208
|
// `oldEndVnode` corresponds.
|
|
803
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1209
|
+
if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
804
1210
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
805
1211
|
}
|
|
806
1212
|
patch(oldEndVnode, newStartVnode);
|
|
@@ -823,7 +1229,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
823
1229
|
// children which have the same key as the first node in the new
|
|
824
1230
|
// children.
|
|
825
1231
|
idxInOld = -1;
|
|
826
|
-
{
|
|
1232
|
+
if (BUILD.vdomKey) {
|
|
827
1233
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
828
1234
|
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
829
1235
|
idxInOld = i;
|
|
@@ -831,7 +1237,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
831
1237
|
}
|
|
832
1238
|
}
|
|
833
1239
|
}
|
|
834
|
-
if (idxInOld >= 0) {
|
|
1240
|
+
if (BUILD.vdomKey && idxInOld >= 0) {
|
|
835
1241
|
// We found a node in the old children which matches up with the first
|
|
836
1242
|
// node in the new children! So let's deal with that
|
|
837
1243
|
elmToMove = oldCh[idxInOld];
|
|
@@ -858,9 +1264,12 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
858
1264
|
}
|
|
859
1265
|
if (node) {
|
|
860
1266
|
// if we created a new node then handle inserting it to the DOM
|
|
861
|
-
{
|
|
1267
|
+
if (BUILD.slotRelocation) {
|
|
862
1268
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
863
1269
|
}
|
|
1270
|
+
else {
|
|
1271
|
+
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
1272
|
+
}
|
|
864
1273
|
}
|
|
865
1274
|
}
|
|
866
1275
|
}
|
|
@@ -868,7 +1277,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
868
1277
|
// we have some more new nodes to add which don't match up with old nodes
|
|
869
1278
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
870
1279
|
}
|
|
871
|
-
else if (newStartIdx > newEndIdx) {
|
|
1280
|
+
else if (BUILD.updatable && newStartIdx > newEndIdx) {
|
|
872
1281
|
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
873
1282
|
// in the new array, so lets remove them (which entails cleaning up the
|
|
874
1283
|
// relevant DOM nodes)
|
|
@@ -896,13 +1305,14 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
896
1305
|
// compare if two vnode to see if they're "technically" the same
|
|
897
1306
|
// need to have the same element tag, and same key to be the same
|
|
898
1307
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
899
|
-
if (leftVNode.$tag$ === 'slot') {
|
|
1308
|
+
if (BUILD.slotRelocation && leftVNode.$tag$ === 'slot') {
|
|
900
1309
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
901
1310
|
}
|
|
902
1311
|
// this will be set if components in the build have `key` attrs set on them
|
|
903
|
-
{
|
|
1312
|
+
if (BUILD.vdomKey) {
|
|
904
1313
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
905
1314
|
}
|
|
1315
|
+
return true;
|
|
906
1316
|
}
|
|
907
1317
|
return false;
|
|
908
1318
|
};
|
|
@@ -929,14 +1339,14 @@ const patch = (oldVNode, newVNode) => {
|
|
|
929
1339
|
const tag = newVNode.$tag$;
|
|
930
1340
|
const text = newVNode.$text$;
|
|
931
1341
|
let defaultHolder;
|
|
932
|
-
if (text === null) {
|
|
933
|
-
{
|
|
1342
|
+
if (!BUILD.vdomText || text === null) {
|
|
1343
|
+
if (BUILD.svg) {
|
|
934
1344
|
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
935
1345
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
936
1346
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
937
1347
|
}
|
|
938
|
-
{
|
|
939
|
-
if (tag === 'slot')
|
|
1348
|
+
if (BUILD.vdomAttribute || BUILD.reflect) {
|
|
1349
|
+
if (BUILD.slot && tag === 'slot')
|
|
940
1350
|
;
|
|
941
1351
|
else {
|
|
942
1352
|
// either this is the first render of an element OR it's an update
|
|
@@ -945,33 +1355,33 @@ const patch = (oldVNode, newVNode) => {
|
|
|
945
1355
|
updateElement(oldVNode, newVNode, isSvgMode);
|
|
946
1356
|
}
|
|
947
1357
|
}
|
|
948
|
-
if (oldChildren !== null && newChildren !== null) {
|
|
1358
|
+
if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
|
|
949
1359
|
// looks like there's child vnodes for both the old and new vnodes
|
|
950
1360
|
// so we need to call `updateChildren` to reconcile them
|
|
951
1361
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
952
1362
|
}
|
|
953
1363
|
else if (newChildren !== null) {
|
|
954
1364
|
// no old child vnodes, but there are new child vnodes to add
|
|
955
|
-
if (oldVNode.$text$ !== null) {
|
|
1365
|
+
if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
|
|
956
1366
|
// the old vnode was text, so be sure to clear it out
|
|
957
1367
|
elm.textContent = '';
|
|
958
1368
|
}
|
|
959
1369
|
// add the new vnode children
|
|
960
1370
|
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
961
1371
|
}
|
|
962
|
-
else if (oldChildren !== null) {
|
|
1372
|
+
else if (BUILD.updatable && oldChildren !== null) {
|
|
963
1373
|
// no new child vnodes, but there are old child vnodes to remove
|
|
964
1374
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
965
1375
|
}
|
|
966
|
-
if (isSvgMode && tag === 'svg') {
|
|
1376
|
+
if (BUILD.svg && isSvgMode && tag === 'svg') {
|
|
967
1377
|
isSvgMode = false;
|
|
968
1378
|
}
|
|
969
1379
|
}
|
|
970
|
-
else if ((defaultHolder = elm['s-cr'])) {
|
|
1380
|
+
else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
|
|
971
1381
|
// this element has slotted content
|
|
972
1382
|
defaultHolder.parentNode.textContent = text;
|
|
973
1383
|
}
|
|
974
|
-
else if (oldVNode.$text$ !== text) {
|
|
1384
|
+
else if (BUILD.vdomText && oldVNode.$text$ !== text) {
|
|
975
1385
|
// update the text content for the text only vnode
|
|
976
1386
|
// and also only if the text is different than before
|
|
977
1387
|
elm.data = text;
|
|
@@ -1109,7 +1519,7 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
|
1109
1519
|
return slotNameAttr === '';
|
|
1110
1520
|
};
|
|
1111
1521
|
const callNodeRefs = (vNode) => {
|
|
1112
|
-
{
|
|
1522
|
+
if (BUILD.vdomRef) {
|
|
1113
1523
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1114
1524
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1115
1525
|
}
|
|
@@ -1120,26 +1530,41 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1120
1530
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1121
1531
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1122
1532
|
hostTagName = hostElm.tagName;
|
|
1123
|
-
|
|
1533
|
+
// <Host> runtime check
|
|
1534
|
+
if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1535
|
+
throw new Error(`The <Host> must be the single root component.
|
|
1536
|
+
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1537
|
+
|
|
1538
|
+
The render() function should look like this instead:
|
|
1539
|
+
|
|
1540
|
+
render() {
|
|
1541
|
+
// Do not return an array
|
|
1542
|
+
return (
|
|
1543
|
+
<Host>{content}</Host>
|
|
1544
|
+
);
|
|
1545
|
+
}
|
|
1546
|
+
`);
|
|
1547
|
+
}
|
|
1548
|
+
if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1124
1549
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1125
1550
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1126
1551
|
}
|
|
1127
1552
|
rootVnode.$tag$ = null;
|
|
1128
1553
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1129
1554
|
hostRef.$vnode$ = rootVnode;
|
|
1130
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
1131
|
-
{
|
|
1555
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
|
|
1556
|
+
if (BUILD.scoped || BUILD.shadowDom) {
|
|
1132
1557
|
scopeId = hostElm['s-sc'];
|
|
1133
1558
|
}
|
|
1134
|
-
{
|
|
1559
|
+
if (BUILD.slotRelocation) {
|
|
1135
1560
|
contentRef = hostElm['s-cr'];
|
|
1136
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1561
|
+
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1137
1562
|
// always reset
|
|
1138
1563
|
checkSlotFallbackVisibility = false;
|
|
1139
1564
|
}
|
|
1140
1565
|
// synchronous patch
|
|
1141
1566
|
patch(oldVNode, rootVnode);
|
|
1142
|
-
{
|
|
1567
|
+
if (BUILD.slotRelocation) {
|
|
1143
1568
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1144
1569
|
// the disconnectCallback from working
|
|
1145
1570
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
@@ -1159,7 +1584,9 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1159
1584
|
// add a reference node marking this node's original location
|
|
1160
1585
|
// keep a reference to this node for later lookups
|
|
1161
1586
|
orgLocationNode =
|
|
1162
|
-
|
|
1587
|
+
BUILD.isDebug || BUILD.hydrateServerSide
|
|
1588
|
+
? originalLocationDebugNode(nodeToRelocate)
|
|
1589
|
+
: doc.createTextNode('');
|
|
1163
1590
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1164
1591
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1165
1592
|
}
|
|
@@ -1216,16 +1643,23 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1216
1643
|
relocateNodes.length = 0;
|
|
1217
1644
|
}
|
|
1218
1645
|
};
|
|
1646
|
+
// slot comment debug nodes only created with the `--debug` flag
|
|
1647
|
+
// otherwise these nodes are text nodes w/out content
|
|
1648
|
+
const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
|
|
1649
|
+
const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
|
|
1650
|
+
(nodeToRelocate.localName
|
|
1651
|
+
? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
|
|
1652
|
+
: `[${nodeToRelocate.textContent}]`));
|
|
1219
1653
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1220
|
-
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1654
|
+
if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1221
1655
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
1222
1656
|
}
|
|
1223
1657
|
};
|
|
1224
1658
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1225
|
-
{
|
|
1659
|
+
if (BUILD.taskQueue && BUILD.updatable) {
|
|
1226
1660
|
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1227
1661
|
}
|
|
1228
|
-
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1662
|
+
if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1229
1663
|
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1230
1664
|
return;
|
|
1231
1665
|
}
|
|
@@ -1234,30 +1668,34 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
1234
1668
|
// has already fired off its lifecycle update then
|
|
1235
1669
|
// fire off the initial update
|
|
1236
1670
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1237
|
-
return writeTask(dispatch) ;
|
|
1671
|
+
return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1238
1672
|
};
|
|
1239
1673
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1674
|
+
const elm = hostRef.$hostElement$;
|
|
1240
1675
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1241
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1676
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1242
1677
|
let promise;
|
|
1243
1678
|
if (isInitialLoad) {
|
|
1244
|
-
{
|
|
1679
|
+
if (BUILD.lazyLoad && BUILD.hostListener) {
|
|
1245
1680
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1246
1681
|
if (hostRef.$queuedListeners$) {
|
|
1247
1682
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1248
1683
|
hostRef.$queuedListeners$ = null;
|
|
1249
1684
|
}
|
|
1250
1685
|
}
|
|
1251
|
-
|
|
1686
|
+
emitLifecycleEvent(elm, 'componentWillLoad');
|
|
1687
|
+
if (BUILD.cmpWillLoad) {
|
|
1252
1688
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1253
1689
|
}
|
|
1254
1690
|
}
|
|
1255
1691
|
else {
|
|
1256
|
-
|
|
1692
|
+
emitLifecycleEvent(elm, 'componentWillUpdate');
|
|
1693
|
+
if (BUILD.cmpWillUpdate) {
|
|
1257
1694
|
promise = safeCall(instance, 'componentWillUpdate');
|
|
1258
1695
|
}
|
|
1259
1696
|
}
|
|
1260
|
-
|
|
1697
|
+
emitLifecycleEvent(elm, 'componentWillRender');
|
|
1698
|
+
if (BUILD.cmpWillRender) {
|
|
1261
1699
|
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1262
1700
|
}
|
|
1263
1701
|
endSchedule();
|
|
@@ -1268,15 +1706,46 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1268
1706
|
const elm = hostRef.$hostElement$;
|
|
1269
1707
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1270
1708
|
const rc = elm['s-rc'];
|
|
1271
|
-
if (isInitialLoad) {
|
|
1709
|
+
if (BUILD.style && isInitialLoad) {
|
|
1272
1710
|
// DOM WRITE!
|
|
1273
1711
|
attachStyles(hostRef);
|
|
1274
1712
|
}
|
|
1275
1713
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1276
|
-
{
|
|
1277
|
-
|
|
1714
|
+
if (BUILD.isDev) {
|
|
1715
|
+
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1716
|
+
}
|
|
1717
|
+
if (BUILD.hydrateServerSide) {
|
|
1718
|
+
await callRender(hostRef, instance, elm);
|
|
1719
|
+
}
|
|
1720
|
+
else {
|
|
1721
|
+
callRender(hostRef, instance, elm);
|
|
1722
|
+
}
|
|
1723
|
+
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
1724
|
+
plt.$cssShim$.updateHost(elm);
|
|
1278
1725
|
}
|
|
1279
|
-
if (
|
|
1726
|
+
if (BUILD.isDev) {
|
|
1727
|
+
hostRef.$renderCount$++;
|
|
1728
|
+
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1729
|
+
}
|
|
1730
|
+
if (BUILD.hydrateServerSide) {
|
|
1731
|
+
try {
|
|
1732
|
+
// manually connected child components during server-side hydrate
|
|
1733
|
+
serverSideConnected(elm);
|
|
1734
|
+
if (isInitialLoad) {
|
|
1735
|
+
// using only during server-side hydrate
|
|
1736
|
+
if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1737
|
+
elm['s-en'] = '';
|
|
1738
|
+
}
|
|
1739
|
+
else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
1740
|
+
elm['s-en'] = 'c';
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
catch (e) {
|
|
1745
|
+
consoleError(e, elm);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
if (BUILD.asyncLoading && rc) {
|
|
1280
1749
|
// ok, so turns out there are some child host elements
|
|
1281
1750
|
// waiting on this parent element to load
|
|
1282
1751
|
// let's fire off all update callbacks waiting
|
|
@@ -1285,7 +1754,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1285
1754
|
}
|
|
1286
1755
|
endRender();
|
|
1287
1756
|
endUpdate();
|
|
1288
|
-
{
|
|
1757
|
+
if (BUILD.asyncLoading) {
|
|
1289
1758
|
const childrenPromises = elm['s-p'];
|
|
1290
1759
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1291
1760
|
if (childrenPromises.length === 0) {
|
|
@@ -1297,70 +1766,117 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1297
1766
|
childrenPromises.length = 0;
|
|
1298
1767
|
}
|
|
1299
1768
|
}
|
|
1769
|
+
else {
|
|
1770
|
+
postUpdateComponent(hostRef);
|
|
1771
|
+
}
|
|
1300
1772
|
};
|
|
1301
1773
|
const callRender = (hostRef, instance, elm) => {
|
|
1774
|
+
// in order for bundlers to correctly treeshake the BUILD object
|
|
1775
|
+
// we need to ensure BUILD is not deoptimized within a try/catch
|
|
1776
|
+
// https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
|
|
1777
|
+
const allRenderFn = BUILD.allRenderFn ? true : false;
|
|
1778
|
+
const lazyLoad = BUILD.lazyLoad ? true : false;
|
|
1779
|
+
const taskQueue = BUILD.taskQueue ? true : false;
|
|
1780
|
+
const updatable = BUILD.updatable ? true : false;
|
|
1302
1781
|
try {
|
|
1303
|
-
|
|
1304
|
-
|
|
1782
|
+
renderingRef = instance;
|
|
1783
|
+
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
1784
|
+
if (updatable && taskQueue) {
|
|
1305
1785
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1306
1786
|
}
|
|
1307
|
-
{
|
|
1787
|
+
if (updatable || lazyLoad) {
|
|
1308
1788
|
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1309
1789
|
}
|
|
1310
|
-
{
|
|
1311
|
-
{
|
|
1790
|
+
if (BUILD.hasRenderFn || BUILD.reflect) {
|
|
1791
|
+
if (BUILD.vdomRender || BUILD.reflect) {
|
|
1312
1792
|
// looks like we've got child nodes to render into this host element
|
|
1313
1793
|
// or we need to update the css class/attrs on the host element
|
|
1314
1794
|
// DOM WRITE!
|
|
1315
|
-
{
|
|
1795
|
+
if (BUILD.hydrateServerSide) {
|
|
1796
|
+
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
|
|
1797
|
+
}
|
|
1798
|
+
else {
|
|
1316
1799
|
renderVdom(hostRef, instance);
|
|
1317
1800
|
}
|
|
1318
1801
|
}
|
|
1802
|
+
else {
|
|
1803
|
+
elm.textContent = instance;
|
|
1804
|
+
}
|
|
1319
1805
|
}
|
|
1320
1806
|
}
|
|
1321
1807
|
catch (e) {
|
|
1322
1808
|
consoleError(e, hostRef.$hostElement$);
|
|
1323
1809
|
}
|
|
1810
|
+
renderingRef = null;
|
|
1324
1811
|
return null;
|
|
1325
1812
|
};
|
|
1813
|
+
const getRenderingRef = () => renderingRef;
|
|
1326
1814
|
const postUpdateComponent = (hostRef) => {
|
|
1327
1815
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1328
1816
|
const elm = hostRef.$hostElement$;
|
|
1329
1817
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1330
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1818
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1331
1819
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1332
|
-
{
|
|
1820
|
+
if (BUILD.cmpDidRender) {
|
|
1821
|
+
if (BUILD.isDev) {
|
|
1822
|
+
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1823
|
+
}
|
|
1333
1824
|
safeCall(instance, 'componentDidRender');
|
|
1825
|
+
if (BUILD.isDev) {
|
|
1826
|
+
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1827
|
+
}
|
|
1334
1828
|
}
|
|
1829
|
+
emitLifecycleEvent(elm, 'componentDidRender');
|
|
1335
1830
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1336
1831
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1337
|
-
{
|
|
1832
|
+
if (BUILD.asyncLoading && BUILD.cssAnnotations) {
|
|
1338
1833
|
// DOM WRITE!
|
|
1339
1834
|
addHydratedFlag(elm);
|
|
1340
1835
|
}
|
|
1341
|
-
{
|
|
1836
|
+
if (BUILD.cmpDidLoad) {
|
|
1837
|
+
if (BUILD.isDev) {
|
|
1838
|
+
hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1839
|
+
}
|
|
1342
1840
|
safeCall(instance, 'componentDidLoad');
|
|
1841
|
+
if (BUILD.isDev) {
|
|
1842
|
+
hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1843
|
+
}
|
|
1343
1844
|
}
|
|
1845
|
+
emitLifecycleEvent(elm, 'componentDidLoad');
|
|
1344
1846
|
endPostUpdate();
|
|
1345
|
-
{
|
|
1847
|
+
if (BUILD.asyncLoading) {
|
|
1346
1848
|
hostRef.$onReadyResolve$(elm);
|
|
1347
1849
|
if (!ancestorComponent) {
|
|
1348
|
-
appDidLoad();
|
|
1850
|
+
appDidLoad(tagName);
|
|
1349
1851
|
}
|
|
1350
1852
|
}
|
|
1351
1853
|
}
|
|
1352
1854
|
else {
|
|
1353
|
-
{
|
|
1855
|
+
if (BUILD.cmpDidUpdate) {
|
|
1856
|
+
// we've already loaded this component
|
|
1857
|
+
// fire off the user's componentDidUpdate method (if one was provided)
|
|
1858
|
+
// componentDidUpdate runs AFTER render() has been called
|
|
1859
|
+
// and all child components have finished updating
|
|
1860
|
+
if (BUILD.isDev) {
|
|
1861
|
+
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1862
|
+
}
|
|
1354
1863
|
safeCall(instance, 'componentDidUpdate');
|
|
1864
|
+
if (BUILD.isDev) {
|
|
1865
|
+
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1866
|
+
}
|
|
1355
1867
|
}
|
|
1868
|
+
emitLifecycleEvent(elm, 'componentDidUpdate');
|
|
1356
1869
|
endPostUpdate();
|
|
1357
1870
|
}
|
|
1358
|
-
{
|
|
1871
|
+
if (BUILD.hotModuleReplacement) {
|
|
1872
|
+
elm['s-hmr-load'] && elm['s-hmr-load']();
|
|
1873
|
+
}
|
|
1874
|
+
if (BUILD.method && BUILD.lazyLoad) {
|
|
1359
1875
|
hostRef.$onInstanceResolve$(elm);
|
|
1360
1876
|
}
|
|
1361
1877
|
// load events fire from bottom to top
|
|
1362
1878
|
// the deepest elements load first then bubbles up
|
|
1363
|
-
{
|
|
1879
|
+
if (BUILD.asyncLoading) {
|
|
1364
1880
|
if (hostRef.$onRenderResolve$) {
|
|
1365
1881
|
hostRef.$onRenderResolve$();
|
|
1366
1882
|
hostRef.$onRenderResolve$ = undefined;
|
|
@@ -1374,13 +1890,32 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1374
1890
|
// ( •_•)>⌐■-■
|
|
1375
1891
|
// (⌐■_■)
|
|
1376
1892
|
};
|
|
1893
|
+
const forceUpdate = (ref) => {
|
|
1894
|
+
if (BUILD.updatable) {
|
|
1895
|
+
const hostRef = getHostRef(ref);
|
|
1896
|
+
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1897
|
+
if (isConnected &&
|
|
1898
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1899
|
+
scheduleUpdate(hostRef, false);
|
|
1900
|
+
}
|
|
1901
|
+
// Returns "true" when the forced update was successfully scheduled
|
|
1902
|
+
return isConnected;
|
|
1903
|
+
}
|
|
1904
|
+
return false;
|
|
1905
|
+
};
|
|
1377
1906
|
const appDidLoad = (who) => {
|
|
1378
1907
|
// on appload
|
|
1379
1908
|
// we have finish the first big initial render
|
|
1380
|
-
{
|
|
1909
|
+
if (BUILD.cssAnnotations) {
|
|
1381
1910
|
addHydratedFlag(doc.documentElement);
|
|
1382
1911
|
}
|
|
1912
|
+
if (BUILD.asyncQueue) {
|
|
1913
|
+
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
1914
|
+
}
|
|
1383
1915
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1916
|
+
if (BUILD.profile && performance.measure) {
|
|
1917
|
+
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
|
|
1918
|
+
}
|
|
1384
1919
|
};
|
|
1385
1920
|
const safeCall = (instance, method, arg) => {
|
|
1386
1921
|
if (instance && instance[method]) {
|
|
@@ -1396,27 +1931,61 @@ const safeCall = (instance, method, arg) => {
|
|
|
1396
1931
|
const then = (promise, thenFn) => {
|
|
1397
1932
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1398
1933
|
};
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1934
|
+
const emitLifecycleEvent = (elm, lifecycleName) => {
|
|
1935
|
+
if (BUILD.lifecycleDOMEvents) {
|
|
1936
|
+
emitEvent(elm, 'stencil_' + lifecycleName, {
|
|
1937
|
+
bubbles: true,
|
|
1938
|
+
composed: true,
|
|
1939
|
+
detail: {
|
|
1940
|
+
namespace: NAMESPACE,
|
|
1941
|
+
},
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
const addHydratedFlag = (elm) => BUILD.hydratedClass
|
|
1946
|
+
? elm.classList.add('hydrated')
|
|
1947
|
+
: BUILD.hydratedAttribute
|
|
1948
|
+
? elm.setAttribute('hydrated', '')
|
|
1949
|
+
: undefined;
|
|
1950
|
+
const serverSideConnected = (elm) => {
|
|
1951
|
+
const children = elm.children;
|
|
1952
|
+
if (children != null) {
|
|
1953
|
+
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
1954
|
+
const childElm = children[i];
|
|
1955
|
+
if (typeof childElm.connectedCallback === 'function') {
|
|
1956
|
+
childElm.connectedCallback();
|
|
1957
|
+
}
|
|
1958
|
+
serverSideConnected(childElm);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1401
1962
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1402
1963
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1403
1964
|
// check our new property value against our internal value
|
|
1404
1965
|
const hostRef = getHostRef(ref);
|
|
1405
|
-
const elm = hostRef.$hostElement$ ;
|
|
1966
|
+
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
1406
1967
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1407
1968
|
const flags = hostRef.$flags$;
|
|
1408
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1969
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1409
1970
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1410
1971
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1411
1972
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1412
1973
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1413
|
-
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1974
|
+
if ((!BUILD.lazyLoad || !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1414
1975
|
// gadzooks! the property's value has changed!!
|
|
1415
1976
|
// set our new value!
|
|
1416
1977
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1417
|
-
if (
|
|
1978
|
+
if (BUILD.isDev) {
|
|
1979
|
+
if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
|
|
1980
|
+
consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
1981
|
+
}
|
|
1982
|
+
else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
|
|
1983
|
+
consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
if (!BUILD.lazyLoad || instance) {
|
|
1418
1987
|
// get an array of method names of watch functions to call
|
|
1419
|
-
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1988
|
+
if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1420
1989
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1421
1990
|
if (watchMethods) {
|
|
1422
1991
|
// this instance is watching for when this property changed
|
|
@@ -1431,7 +2000,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1431
2000
|
});
|
|
1432
2001
|
}
|
|
1433
2002
|
}
|
|
1434
|
-
if (
|
|
2003
|
+
if (BUILD.updatable &&
|
|
2004
|
+
(flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2005
|
+
if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2006
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
1435
2010
|
// looks like this value actually changed, so we've got work to do!
|
|
1436
2011
|
// but only if we've already rendered, otherwise just chill out
|
|
1437
2012
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1452,16 +2027,17 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1452
2027
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1453
2028
|
*/
|
|
1454
2029
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1455
|
-
if (cmpMeta.$members$) {
|
|
1456
|
-
if (Cstr.watchers) {
|
|
2030
|
+
if (BUILD.member && cmpMeta.$members$) {
|
|
2031
|
+
if (BUILD.watchCallback && Cstr.watchers) {
|
|
1457
2032
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1458
2033
|
}
|
|
1459
2034
|
// It's better to have a const than two Object.entries()
|
|
1460
2035
|
const members = Object.entries(cmpMeta.$members$);
|
|
1461
2036
|
const prototype = Cstr.prototype;
|
|
1462
2037
|
members.map(([memberName, [memberFlags]]) => {
|
|
1463
|
-
if ((
|
|
1464
|
-
|
|
2038
|
+
if ((BUILD.prop || BUILD.state) &&
|
|
2039
|
+
(memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
2040
|
+
((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1465
2041
|
// proxyComponent - prop
|
|
1466
2042
|
Object.defineProperty(prototype, memberName, {
|
|
1467
2043
|
get() {
|
|
@@ -1469,6 +2045,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1469
2045
|
return getValue(this, memberName);
|
|
1470
2046
|
},
|
|
1471
2047
|
set(newValue) {
|
|
2048
|
+
// only during dev time
|
|
2049
|
+
if (BUILD.isDev) {
|
|
2050
|
+
const ref = getHostRef(this);
|
|
2051
|
+
if (
|
|
2052
|
+
// we are proxying the instance (not element)
|
|
2053
|
+
(flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
|
|
2054
|
+
// the element is not constructing
|
|
2055
|
+
(ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
|
|
2056
|
+
// the member is a prop
|
|
2057
|
+
(memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
|
|
2058
|
+
// the member is not mutable
|
|
2059
|
+
(memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
|
|
2060
|
+
consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
1472
2063
|
// proxyComponent, set value
|
|
1473
2064
|
setValue(this, memberName, newValue, cmpMeta);
|
|
1474
2065
|
},
|
|
@@ -1476,7 +2067,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1476
2067
|
enumerable: true,
|
|
1477
2068
|
});
|
|
1478
2069
|
}
|
|
1479
|
-
else if (
|
|
2070
|
+
else if (BUILD.lazyLoad &&
|
|
2071
|
+
BUILD.method &&
|
|
2072
|
+
flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1480
2073
|
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1481
2074
|
// proxyComponent - method
|
|
1482
2075
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -1487,7 +2080,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1487
2080
|
});
|
|
1488
2081
|
}
|
|
1489
2082
|
});
|
|
1490
|
-
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
2083
|
+
if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1491
2084
|
const attrNameToPropName = new Map();
|
|
1492
2085
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1493
2086
|
plt.jmp(() => {
|
|
@@ -1547,7 +2140,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1547
2140
|
.map(([propName, m]) => {
|
|
1548
2141
|
const attrName = m[1] || propName;
|
|
1549
2142
|
attrNameToPropName.set(attrName, propName);
|
|
1550
|
-
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
2143
|
+
if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1551
2144
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1552
2145
|
}
|
|
1553
2146
|
return attrName;
|
|
@@ -1558,25 +2151,29 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1558
2151
|
};
|
|
1559
2152
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1560
2153
|
// initializeComponent
|
|
1561
|
-
if ((
|
|
1562
|
-
{
|
|
2154
|
+
if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&
|
|
2155
|
+
(hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
2156
|
+
if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
1563
2157
|
// we haven't initialized this element yet
|
|
1564
2158
|
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1565
2159
|
// lazy loaded components
|
|
1566
2160
|
// request the component's implementation to be
|
|
1567
2161
|
// wired up with the host element
|
|
1568
|
-
Cstr = loadModule(cmpMeta);
|
|
2162
|
+
Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
1569
2163
|
if (Cstr.then) {
|
|
1570
2164
|
// Await creates a micro-task avoid if possible
|
|
1571
|
-
const endLoad = uniqueTime();
|
|
2165
|
+
const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
|
|
1572
2166
|
Cstr = await Cstr;
|
|
1573
2167
|
endLoad();
|
|
1574
2168
|
}
|
|
1575
|
-
if (!Cstr
|
|
2169
|
+
if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
|
|
2170
|
+
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2171
|
+
}
|
|
2172
|
+
if (BUILD.member && !Cstr.isProxied) {
|
|
1576
2173
|
// we've never proxied this Constructor before
|
|
1577
2174
|
// let's add the getters/setters to its prototype before
|
|
1578
2175
|
// the first time we create an instance of the implementation
|
|
1579
|
-
{
|
|
2176
|
+
if (BUILD.watchCallback) {
|
|
1580
2177
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1581
2178
|
}
|
|
1582
2179
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
@@ -1586,7 +2183,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1586
2183
|
// ok, time to construct the instance
|
|
1587
2184
|
// but let's keep track of when we start and stop
|
|
1588
2185
|
// so that the getters/setters don't incorrectly step on data
|
|
1589
|
-
{
|
|
2186
|
+
if (BUILD.member) {
|
|
1590
2187
|
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1591
2188
|
}
|
|
1592
2189
|
// construct the lazy-loaded component implementation
|
|
@@ -1599,20 +2196,42 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1599
2196
|
catch (e) {
|
|
1600
2197
|
consoleError(e);
|
|
1601
2198
|
}
|
|
1602
|
-
{
|
|
2199
|
+
if (BUILD.member) {
|
|
1603
2200
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1604
2201
|
}
|
|
1605
|
-
{
|
|
2202
|
+
if (BUILD.watchCallback) {
|
|
1606
2203
|
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1607
2204
|
}
|
|
1608
2205
|
endNewInstance();
|
|
2206
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2207
|
+
}
|
|
2208
|
+
else {
|
|
2209
|
+
// sync constructor component
|
|
2210
|
+
Cstr = elm.constructor;
|
|
2211
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
2212
|
+
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
2213
|
+
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
|
2214
|
+
// Stencil has completed instantiating the component.
|
|
2215
|
+
customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
|
|
1609
2216
|
}
|
|
1610
|
-
if (Cstr.style) {
|
|
2217
|
+
if (BUILD.style && Cstr.style) {
|
|
1611
2218
|
// this component has styles but we haven't registered them yet
|
|
1612
2219
|
let style = Cstr.style;
|
|
1613
|
-
|
|
2220
|
+
if (BUILD.mode && typeof style !== 'string') {
|
|
2221
|
+
style = style[(hostRef.$modeName$ = computeMode(elm))];
|
|
2222
|
+
if (BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2223
|
+
elm.setAttribute('s-mode', hostRef.$modeName$);
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
1614
2227
|
if (!styles.has(scopeId)) {
|
|
1615
2228
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
2229
|
+
if (!BUILD.hydrateServerSide &&
|
|
2230
|
+
BUILD.shadowDom &&
|
|
2231
|
+
BUILD.shadowDomShim &&
|
|
2232
|
+
cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2233
|
+
style = await import('./shadow-css-b18e99d7.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
2234
|
+
}
|
|
1616
2235
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1617
2236
|
endRegisterStyles();
|
|
1618
2237
|
}
|
|
@@ -1621,7 +2240,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1621
2240
|
// we've successfully created a lazy instance
|
|
1622
2241
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1623
2242
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1624
|
-
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
2243
|
+
if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
|
|
1625
2244
|
// this is the initial load and this component it has an ancestor component
|
|
1626
2245
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1627
2246
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
@@ -1634,31 +2253,59 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1634
2253
|
schedule();
|
|
1635
2254
|
}
|
|
1636
2255
|
};
|
|
2256
|
+
const fireConnectedCallback = (instance) => {
|
|
2257
|
+
if (BUILD.lazyLoad && BUILD.connectedCallback) {
|
|
2258
|
+
safeCall(instance, 'connectedCallback');
|
|
2259
|
+
}
|
|
2260
|
+
};
|
|
1637
2261
|
const connectedCallback = (elm) => {
|
|
1638
2262
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1639
2263
|
const hostRef = getHostRef(elm);
|
|
1640
2264
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1641
2265
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
2266
|
+
if (BUILD.hostListenerTargetParent) {
|
|
2267
|
+
// only run if we have listeners being attached to a parent
|
|
2268
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2269
|
+
}
|
|
1642
2270
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1643
2271
|
// first time this component has connected
|
|
1644
2272
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1645
|
-
|
|
2273
|
+
let hostId;
|
|
2274
|
+
if (BUILD.hydrateClientSide) {
|
|
2275
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2276
|
+
if (hostId) {
|
|
2277
|
+
if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2278
|
+
const scopeId = BUILD.mode
|
|
2279
|
+
? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
|
|
2280
|
+
: addStyle(elm.shadowRoot, cmpMeta);
|
|
2281
|
+
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
|
2282
|
+
}
|
|
2283
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
if (BUILD.slotRelocation && !hostId) {
|
|
1646
2287
|
// initUpdate
|
|
1647
2288
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1648
2289
|
// in here to act as original content anchors as we move nodes around
|
|
1649
2290
|
// host element has been connected to the DOM
|
|
1650
|
-
if (
|
|
2291
|
+
if (BUILD.hydrateServerSide ||
|
|
2292
|
+
((BUILD.slot || BUILD.shadowDom) &&
|
|
2293
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1651
2294
|
setContentReference(elm);
|
|
1652
2295
|
}
|
|
1653
2296
|
}
|
|
1654
|
-
{
|
|
2297
|
+
if (BUILD.asyncLoading) {
|
|
1655
2298
|
// find the first ancestor component (if there is one) and register
|
|
1656
2299
|
// this component as one of the actively loading child components for its ancestor
|
|
1657
2300
|
let ancestorComponent = elm;
|
|
1658
2301
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
1659
2302
|
// climb up the ancestors looking for the first
|
|
1660
2303
|
// component that hasn't finished its lifecycle update yet
|
|
1661
|
-
if (
|
|
2304
|
+
if ((BUILD.hydrateClientSide &&
|
|
2305
|
+
ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
2306
|
+
ancestorComponent.hasAttribute('s-id') &&
|
|
2307
|
+
ancestorComponent['s-p']) ||
|
|
2308
|
+
ancestorComponent['s-p']) {
|
|
1662
2309
|
// we found this components first ancestor component
|
|
1663
2310
|
// keep a reference to this component's ancestor component
|
|
1664
2311
|
attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
|
|
@@ -1668,7 +2315,7 @@ const connectedCallback = (elm) => {
|
|
|
1668
2315
|
}
|
|
1669
2316
|
// Lazy properties
|
|
1670
2317
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1671
|
-
if (cmpMeta.$members$) {
|
|
2318
|
+
if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
1672
2319
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1673
2320
|
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1674
2321
|
const value = elm[memberName];
|
|
@@ -1677,7 +2324,14 @@ const connectedCallback = (elm) => {
|
|
|
1677
2324
|
}
|
|
1678
2325
|
});
|
|
1679
2326
|
}
|
|
1680
|
-
{
|
|
2327
|
+
if (BUILD.initializeNextTick) {
|
|
2328
|
+
// connectedCallback, taskQueue, initialLoad
|
|
2329
|
+
// angular sets attribute AFTER connectCallback
|
|
2330
|
+
// https://github.com/angular/angular/issues/18909
|
|
2331
|
+
// https://github.com/angular/angular/issues/19940
|
|
2332
|
+
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2333
|
+
}
|
|
2334
|
+
else {
|
|
1681
2335
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1682
2336
|
}
|
|
1683
2337
|
}
|
|
@@ -1685,7 +2339,9 @@ const connectedCallback = (elm) => {
|
|
|
1685
2339
|
// not the first time this has connected
|
|
1686
2340
|
// reattach any event listeners to the host
|
|
1687
2341
|
// since they would have been removed when disconnected
|
|
1688
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
2342
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
2343
|
+
// fire off connectedCallback() on component instance
|
|
2344
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1689
2345
|
}
|
|
1690
2346
|
endConnected();
|
|
1691
2347
|
}
|
|
@@ -1697,27 +2353,316 @@ const setContentReference = (elm) => {
|
|
|
1697
2353
|
// let's pick out the inner content for slot projection
|
|
1698
2354
|
// create a node to represent where the original
|
|
1699
2355
|
// content was first placed, which is useful later on
|
|
1700
|
-
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
2356
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
|
|
1701
2357
|
contentRefElm['s-cn'] = true;
|
|
1702
2358
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1703
2359
|
};
|
|
1704
2360
|
const disconnectedCallback = (elm) => {
|
|
1705
2361
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1706
2362
|
const hostRef = getHostRef(elm);
|
|
1707
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1708
|
-
{
|
|
2363
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2364
|
+
if (BUILD.hostListener) {
|
|
1709
2365
|
if (hostRef.$rmListeners$) {
|
|
1710
2366
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1711
2367
|
hostRef.$rmListeners$ = undefined;
|
|
1712
2368
|
}
|
|
1713
2369
|
}
|
|
1714
|
-
|
|
2370
|
+
// clear CSS var-shim tracking
|
|
2371
|
+
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
2372
|
+
plt.$cssShim$.removeHost(elm);
|
|
2373
|
+
}
|
|
2374
|
+
if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
|
|
1715
2375
|
safeCall(instance, 'disconnectedCallback');
|
|
1716
2376
|
}
|
|
2377
|
+
if (BUILD.cmpDidUnload) {
|
|
2378
|
+
safeCall(instance, 'componentDidUnload');
|
|
2379
|
+
}
|
|
1717
2380
|
}
|
|
1718
2381
|
};
|
|
2382
|
+
const defineCustomElement = (Cstr, compactMeta) => {
|
|
2383
|
+
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
2384
|
+
};
|
|
2385
|
+
const proxyCustomElement = (Cstr, compactMeta) => {
|
|
2386
|
+
const cmpMeta = {
|
|
2387
|
+
$flags$: compactMeta[0],
|
|
2388
|
+
$tagName$: compactMeta[1],
|
|
2389
|
+
};
|
|
2390
|
+
if (BUILD.member) {
|
|
2391
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
2392
|
+
}
|
|
2393
|
+
if (BUILD.hostListener) {
|
|
2394
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
2395
|
+
}
|
|
2396
|
+
if (BUILD.watchCallback) {
|
|
2397
|
+
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2398
|
+
}
|
|
2399
|
+
if (BUILD.reflect) {
|
|
2400
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
2401
|
+
}
|
|
2402
|
+
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2403
|
+
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2404
|
+
}
|
|
2405
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
2406
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
2407
|
+
Object.assign(Cstr.prototype, {
|
|
2408
|
+
__registerHost() {
|
|
2409
|
+
registerHost(this, cmpMeta);
|
|
2410
|
+
},
|
|
2411
|
+
connectedCallback() {
|
|
2412
|
+
connectedCallback(this);
|
|
2413
|
+
if (BUILD.connectedCallback && originalConnectedCallback) {
|
|
2414
|
+
originalConnectedCallback.call(this);
|
|
2415
|
+
}
|
|
2416
|
+
},
|
|
2417
|
+
disconnectedCallback() {
|
|
2418
|
+
disconnectedCallback(this);
|
|
2419
|
+
if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
|
|
2420
|
+
originalDisconnectedCallback.call(this);
|
|
2421
|
+
}
|
|
2422
|
+
},
|
|
2423
|
+
__attachShadow() {
|
|
2424
|
+
if (supportsShadow) {
|
|
2425
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2426
|
+
this.attachShadow({
|
|
2427
|
+
mode: 'open',
|
|
2428
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
else {
|
|
2432
|
+
this.attachShadow({ mode: 'open' });
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
else {
|
|
2436
|
+
this.shadowRoot = this;
|
|
2437
|
+
}
|
|
2438
|
+
},
|
|
2439
|
+
});
|
|
2440
|
+
Cstr.is = cmpMeta.$tagName$;
|
|
2441
|
+
return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
|
|
2442
|
+
};
|
|
2443
|
+
const forceModeUpdate = (elm) => {
|
|
2444
|
+
if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
|
|
2445
|
+
const mode = computeMode(elm);
|
|
2446
|
+
const hostRef = getHostRef(elm);
|
|
2447
|
+
if (hostRef.$modeName$ !== mode) {
|
|
2448
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2449
|
+
const oldScopeId = elm['s-sc'];
|
|
2450
|
+
const scopeId = getScopeId(cmpMeta, mode);
|
|
2451
|
+
const style = elm.constructor.style[mode];
|
|
2452
|
+
const flags = cmpMeta.$flags$;
|
|
2453
|
+
if (style) {
|
|
2454
|
+
if (!styles.has(scopeId)) {
|
|
2455
|
+
registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
2456
|
+
}
|
|
2457
|
+
hostRef.$modeName$ = mode;
|
|
2458
|
+
elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
|
|
2459
|
+
attachStyles(hostRef);
|
|
2460
|
+
forceUpdate(elm);
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
const patchCloneNode = (HostElementPrototype) => {
|
|
2466
|
+
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2467
|
+
HostElementPrototype.cloneNode = function (deep) {
|
|
2468
|
+
const srcNode = this;
|
|
2469
|
+
const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2470
|
+
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2471
|
+
if (BUILD.slot && !isShadowDom && deep) {
|
|
2472
|
+
let i = 0;
|
|
2473
|
+
let slotted, nonStencilNode;
|
|
2474
|
+
const stencilPrivates = [
|
|
2475
|
+
's-id',
|
|
2476
|
+
's-cr',
|
|
2477
|
+
's-lr',
|
|
2478
|
+
's-rc',
|
|
2479
|
+
's-sc',
|
|
2480
|
+
's-p',
|
|
2481
|
+
's-cn',
|
|
2482
|
+
's-sr',
|
|
2483
|
+
's-sn',
|
|
2484
|
+
's-hn',
|
|
2485
|
+
's-ol',
|
|
2486
|
+
's-nr',
|
|
2487
|
+
's-si',
|
|
2488
|
+
];
|
|
2489
|
+
for (; i < srcNode.childNodes.length; i++) {
|
|
2490
|
+
slotted = srcNode.childNodes[i]['s-nr'];
|
|
2491
|
+
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
|
|
2492
|
+
if (slotted) {
|
|
2493
|
+
if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2494
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2495
|
+
}
|
|
2496
|
+
else {
|
|
2497
|
+
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
if (nonStencilNode) {
|
|
2501
|
+
clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
return clonedNode;
|
|
2506
|
+
};
|
|
2507
|
+
};
|
|
2508
|
+
const patchSlotAppendChild = (HostElementPrototype) => {
|
|
2509
|
+
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2510
|
+
HostElementPrototype.appendChild = function (newChild) {
|
|
2511
|
+
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
|
2512
|
+
const slotNode = getHostSlotNode(this.childNodes, slotName);
|
|
2513
|
+
if (slotNode) {
|
|
2514
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2515
|
+
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2516
|
+
return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
|
|
2517
|
+
}
|
|
2518
|
+
return this.__appendChild(newChild);
|
|
2519
|
+
};
|
|
2520
|
+
};
|
|
2521
|
+
/**
|
|
2522
|
+
* Patches the text content of an unnamed slotted node inside a scoped component
|
|
2523
|
+
* @param hostElementPrototype the `Element` to be patched
|
|
2524
|
+
* @param cmpMeta component runtime metadata used to determine if the component should be patched or not
|
|
2525
|
+
*/
|
|
2526
|
+
const patchTextContent = (hostElementPrototype, cmpMeta) => {
|
|
2527
|
+
if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
2528
|
+
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
|
|
2529
|
+
Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
|
|
2530
|
+
Object.defineProperty(hostElementPrototype, 'textContent', {
|
|
2531
|
+
get() {
|
|
2532
|
+
var _a;
|
|
2533
|
+
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2534
|
+
// the empty string
|
|
2535
|
+
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2536
|
+
// when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
|
|
2537
|
+
// nodes were reordered during the vdom render. first try to get the text content from the sibling.
|
|
2538
|
+
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
2539
|
+
return slotNode.nextSibling.textContent;
|
|
2540
|
+
}
|
|
2541
|
+
else if (slotNode) {
|
|
2542
|
+
return slotNode.textContent;
|
|
2543
|
+
}
|
|
2544
|
+
else {
|
|
2545
|
+
// fallback to the original implementation
|
|
2546
|
+
return this.__textContent;
|
|
2547
|
+
}
|
|
2548
|
+
},
|
|
2549
|
+
set(value) {
|
|
2550
|
+
var _a;
|
|
2551
|
+
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
2552
|
+
// the empty string
|
|
2553
|
+
const slotNode = getHostSlotNode(this.childNodes, '');
|
|
2554
|
+
// when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
|
|
2555
|
+
// depending on how nodes were reordered during the vdom render. first try to set the text content on the
|
|
2556
|
+
// sibling.
|
|
2557
|
+
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
2558
|
+
slotNode.nextSibling.textContent = value;
|
|
2559
|
+
}
|
|
2560
|
+
else if (slotNode) {
|
|
2561
|
+
slotNode.textContent = value;
|
|
2562
|
+
}
|
|
2563
|
+
else {
|
|
2564
|
+
// we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
|
|
2565
|
+
// loaded, we could have missed it. check for a content reference element on the scoped component and insert
|
|
2566
|
+
// it there
|
|
2567
|
+
this.__textContent = value;
|
|
2568
|
+
const contentRefElm = this['s-cr'];
|
|
2569
|
+
if (contentRefElm) {
|
|
2570
|
+
this.insertBefore(contentRefElm, this.firstChild);
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2578
|
+
class FakeNodeList extends Array {
|
|
2579
|
+
item(n) {
|
|
2580
|
+
return this[n];
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2584
|
+
const childNodesFn = elm.__lookupGetter__('childNodes');
|
|
2585
|
+
Object.defineProperty(elm, 'children', {
|
|
2586
|
+
get() {
|
|
2587
|
+
return this.childNodes.map((n) => n.nodeType === 1);
|
|
2588
|
+
},
|
|
2589
|
+
});
|
|
2590
|
+
Object.defineProperty(elm, 'childElementCount', {
|
|
2591
|
+
get() {
|
|
2592
|
+
return elm.children.length;
|
|
2593
|
+
},
|
|
2594
|
+
});
|
|
2595
|
+
Object.defineProperty(elm, 'childNodes', {
|
|
2596
|
+
get() {
|
|
2597
|
+
const childNodes = childNodesFn.call(this);
|
|
2598
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
|
|
2599
|
+
getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
|
|
2600
|
+
const result = new FakeNodeList();
|
|
2601
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
2602
|
+
const slot = childNodes[i]['s-nr'];
|
|
2603
|
+
if (slot) {
|
|
2604
|
+
result.push(slot);
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
return result;
|
|
2608
|
+
}
|
|
2609
|
+
return FakeNodeList.from(childNodes);
|
|
2610
|
+
},
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
|
|
2615
|
+
/**
|
|
2616
|
+
* Recursively searches a series of child nodes for a slot with the provided name.
|
|
2617
|
+
* @param childNodes the nodes to search for a slot with a specific name.
|
|
2618
|
+
* @param slotName the name of the slot to match on.
|
|
2619
|
+
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
|
2620
|
+
*/
|
|
2621
|
+
const getHostSlotNode = (childNodes, slotName) => {
|
|
2622
|
+
let i = 0;
|
|
2623
|
+
let childNode;
|
|
2624
|
+
for (; i < childNodes.length; i++) {
|
|
2625
|
+
childNode = childNodes[i];
|
|
2626
|
+
if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
|
|
2627
|
+
return childNode;
|
|
2628
|
+
}
|
|
2629
|
+
childNode = getHostSlotNode(childNode.childNodes, slotName);
|
|
2630
|
+
if (childNode) {
|
|
2631
|
+
return childNode;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
return null;
|
|
2635
|
+
};
|
|
2636
|
+
const getHostSlotChildNodes = (n, slotName) => {
|
|
2637
|
+
const childNodes = [n];
|
|
2638
|
+
while ((n = n.nextSibling) && n['s-sn'] === slotName) {
|
|
2639
|
+
childNodes.push(n);
|
|
2640
|
+
}
|
|
2641
|
+
return childNodes;
|
|
2642
|
+
};
|
|
2643
|
+
const hmrStart = (elm, cmpMeta, hmrVersionId) => {
|
|
2644
|
+
// ¯\_(ツ)_/¯
|
|
2645
|
+
const hostRef = getHostRef(elm);
|
|
2646
|
+
// reset state flags to only have been connected
|
|
2647
|
+
hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
|
|
2648
|
+
// TODO
|
|
2649
|
+
// detatch any event listeners that may have been added
|
|
2650
|
+
// because we're not passing an exact event name it'll
|
|
2651
|
+
// remove all of this element's event, which is good
|
|
2652
|
+
// create a callback for when this component finishes hmr
|
|
2653
|
+
elm['s-hmr-load'] = () => {
|
|
2654
|
+
// finished hmr for this element
|
|
2655
|
+
delete elm['s-hmr-load'];
|
|
2656
|
+
};
|
|
2657
|
+
// re-initialize the component
|
|
2658
|
+
initializeComponent(elm, hostRef, cmpMeta, hmrVersionId);
|
|
2659
|
+
};
|
|
1719
2660
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1720
|
-
|
|
2661
|
+
if (BUILD.profile && performance.mark) {
|
|
2662
|
+
performance.mark('st:app:start');
|
|
2663
|
+
}
|
|
2664
|
+
installDevTools();
|
|
2665
|
+
const endBootstrap = createTime('bootstrapLazy');
|
|
1721
2666
|
const cmpTags = [];
|
|
1722
2667
|
const exclude = options.exclude || [];
|
|
1723
2668
|
const customElements = win.customElements;
|
|
@@ -1725,10 +2670,27 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1725
2670
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1726
2671
|
const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
|
1727
2672
|
const deferredConnectedCallbacks = [];
|
|
2673
|
+
const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1728
2674
|
let appLoadFallback;
|
|
1729
2675
|
let isBootstrapping = true;
|
|
2676
|
+
let i = 0;
|
|
1730
2677
|
Object.assign(plt, options);
|
|
1731
2678
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
2679
|
+
if (BUILD.asyncQueue) {
|
|
2680
|
+
if (options.syncQueue) {
|
|
2681
|
+
plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
if (BUILD.hydrateClientSide) {
|
|
2685
|
+
// If the app is already hydrated there is not point to disable the
|
|
2686
|
+
// async queue. This will improve the first input delay
|
|
2687
|
+
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
2688
|
+
}
|
|
2689
|
+
if (BUILD.hydrateClientSide && BUILD.shadowDom) {
|
|
2690
|
+
for (; i < styles.length; i++) {
|
|
2691
|
+
registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
1732
2694
|
lazyBundles.map((lazyBundle) => {
|
|
1733
2695
|
lazyBundle[1].map((compactMeta) => {
|
|
1734
2696
|
const cmpMeta = {
|
|
@@ -1737,19 +2699,24 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1737
2699
|
$members$: compactMeta[2],
|
|
1738
2700
|
$listeners$: compactMeta[3],
|
|
1739
2701
|
};
|
|
1740
|
-
{
|
|
2702
|
+
if (BUILD.member) {
|
|
1741
2703
|
cmpMeta.$members$ = compactMeta[2];
|
|
1742
2704
|
}
|
|
1743
|
-
{
|
|
2705
|
+
if (BUILD.hostListener) {
|
|
1744
2706
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1745
2707
|
}
|
|
1746
|
-
{
|
|
2708
|
+
if (BUILD.reflect) {
|
|
1747
2709
|
cmpMeta.$attrsToReflect$ = [];
|
|
1748
2710
|
}
|
|
1749
|
-
{
|
|
2711
|
+
if (BUILD.watchCallback) {
|
|
1750
2712
|
cmpMeta.$watchers$ = {};
|
|
1751
2713
|
}
|
|
1752
|
-
|
|
2714
|
+
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2715
|
+
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
2716
|
+
}
|
|
2717
|
+
const tagName = BUILD.transformTagName && options.transformTagName
|
|
2718
|
+
? options.transformTagName(cmpMeta.$tagName$)
|
|
2719
|
+
: cmpMeta.$tagName$;
|
|
1753
2720
|
const HostElement = class extends HTMLElement {
|
|
1754
2721
|
// StencilLazyHost
|
|
1755
2722
|
constructor(self) {
|
|
@@ -1757,16 +2724,28 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1757
2724
|
super(self);
|
|
1758
2725
|
self = this;
|
|
1759
2726
|
registerHost(self, cmpMeta);
|
|
1760
|
-
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2727
|
+
if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1761
2728
|
// this component is using shadow dom
|
|
1762
2729
|
// and this browser supports shadow dom
|
|
1763
2730
|
// add the read-only property "shadowRoot" to the host element
|
|
1764
2731
|
// adding the shadow root build conditionals to minimize runtime
|
|
1765
|
-
{
|
|
1766
|
-
{
|
|
2732
|
+
if (supportsShadow) {
|
|
2733
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2734
|
+
self.attachShadow({
|
|
2735
|
+
mode: 'open',
|
|
2736
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
else {
|
|
1767
2740
|
self.attachShadow({ mode: 'open' });
|
|
1768
2741
|
}
|
|
1769
2742
|
}
|
|
2743
|
+
else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
|
|
2744
|
+
self.shadowRoot = self;
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
if (BUILD.slotChildNodesFix) {
|
|
2748
|
+
patchChildSlotNodes(self, cmpMeta);
|
|
1770
2749
|
}
|
|
1771
2750
|
}
|
|
1772
2751
|
connectedCallback() {
|
|
@@ -1789,6 +2768,20 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1789
2768
|
return getHostRef(this).$onReadyPromise$;
|
|
1790
2769
|
}
|
|
1791
2770
|
};
|
|
2771
|
+
if (BUILD.cloneNodeFix) {
|
|
2772
|
+
patchCloneNode(HostElement.prototype);
|
|
2773
|
+
}
|
|
2774
|
+
if (BUILD.appendChildSlotFix) {
|
|
2775
|
+
patchSlotAppendChild(HostElement.prototype);
|
|
2776
|
+
}
|
|
2777
|
+
if (BUILD.hotModuleReplacement) {
|
|
2778
|
+
HostElement.prototype['s-hmr'] = function (hmrVersionId) {
|
|
2779
|
+
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
if (BUILD.scopedSlotTextContentFix) {
|
|
2783
|
+
patchTextContent(HostElement.prototype, cmpMeta);
|
|
2784
|
+
}
|
|
1792
2785
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1793
2786
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1794
2787
|
cmpTags.push(tagName);
|
|
@@ -1796,7 +2789,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1796
2789
|
}
|
|
1797
2790
|
});
|
|
1798
2791
|
});
|
|
1799
|
-
{
|
|
2792
|
+
if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
|
|
1800
2793
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1801
2794
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1802
2795
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
@@ -1807,17 +2800,89 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1807
2800
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
1808
2801
|
}
|
|
1809
2802
|
else {
|
|
1810
|
-
{
|
|
2803
|
+
if (BUILD.profile) {
|
|
2804
|
+
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
|
|
2805
|
+
}
|
|
2806
|
+
else {
|
|
1811
2807
|
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
|
|
1812
2808
|
}
|
|
1813
2809
|
}
|
|
1814
2810
|
// Fallback appLoad event
|
|
1815
2811
|
endBootstrap();
|
|
1816
2812
|
};
|
|
2813
|
+
const getConnect = (_ref, tagName) => {
|
|
2814
|
+
const componentOnReady = () => {
|
|
2815
|
+
let elm = doc.querySelector(tagName);
|
|
2816
|
+
if (!elm) {
|
|
2817
|
+
elm = doc.createElement(tagName);
|
|
2818
|
+
doc.body.appendChild(elm);
|
|
2819
|
+
}
|
|
2820
|
+
return typeof elm.componentOnReady === 'function' ? elm.componentOnReady() : Promise.resolve(elm);
|
|
2821
|
+
};
|
|
2822
|
+
const create = (...args) => {
|
|
2823
|
+
return componentOnReady().then((el) => el.create(...args));
|
|
2824
|
+
};
|
|
2825
|
+
return {
|
|
2826
|
+
create,
|
|
2827
|
+
componentOnReady,
|
|
2828
|
+
};
|
|
2829
|
+
};
|
|
2830
|
+
const getContext = (_elm, context) => {
|
|
2831
|
+
if (context in Context) {
|
|
2832
|
+
return Context[context];
|
|
2833
|
+
}
|
|
2834
|
+
else if (context === 'window') {
|
|
2835
|
+
return win;
|
|
2836
|
+
}
|
|
2837
|
+
else if (context === 'document') {
|
|
2838
|
+
return doc;
|
|
2839
|
+
}
|
|
2840
|
+
else if (context === 'isServer' || context === 'isPrerender') {
|
|
2841
|
+
return BUILD.hydrateServerSide ? true : false;
|
|
2842
|
+
}
|
|
2843
|
+
else if (context === 'isClient') {
|
|
2844
|
+
return BUILD.hydrateServerSide ? false : true;
|
|
2845
|
+
}
|
|
2846
|
+
else if (context === 'resourcesUrl' || context === 'publicPath') {
|
|
2847
|
+
return getAssetPath('.');
|
|
2848
|
+
}
|
|
2849
|
+
else if (context === 'queue') {
|
|
2850
|
+
return {
|
|
2851
|
+
write: writeTask,
|
|
2852
|
+
read: readTask,
|
|
2853
|
+
tick: {
|
|
2854
|
+
then(cb) {
|
|
2855
|
+
return nextTick(cb);
|
|
2856
|
+
},
|
|
2857
|
+
},
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2860
|
+
return undefined;
|
|
2861
|
+
};
|
|
2862
|
+
const Fragment = (_, children) => children;
|
|
1817
2863
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1818
|
-
if (listeners) {
|
|
2864
|
+
if (BUILD.hostListener && listeners) {
|
|
2865
|
+
// this is called immediately within the element's constructor
|
|
2866
|
+
// initialize our event listeners on the host element
|
|
2867
|
+
// we do this now so that we can listen to events that may
|
|
2868
|
+
// have fired even before the instance is ready
|
|
2869
|
+
if (BUILD.hostListenerTargetParent) {
|
|
2870
|
+
// this component may have event listeners that should be attached to the parent
|
|
2871
|
+
if (attachParentListeners) {
|
|
2872
|
+
// this is being ran from within the connectedCallback
|
|
2873
|
+
// which is important so that we know the host element actually has a parent element
|
|
2874
|
+
// filter out the listeners to only have the ones that ARE being attached to the parent
|
|
2875
|
+
listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
|
|
2876
|
+
}
|
|
2877
|
+
else {
|
|
2878
|
+
// this is being ran from within the component constructor
|
|
2879
|
+
// everything BUT the parent element listeners should be attached at this time
|
|
2880
|
+
// filter out the listeners that are NOT being attached to the parent
|
|
2881
|
+
listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
1819
2884
|
listeners.map(([flags, name, method]) => {
|
|
1820
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2885
|
+
const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
1821
2886
|
const handler = hostListenerProxy(hostRef, method);
|
|
1822
2887
|
const opts = hostListenerOpts(flags);
|
|
1823
2888
|
plt.ael(target, name, handler, opts);
|
|
@@ -1827,7 +2892,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
|
|
|
1827
2892
|
};
|
|
1828
2893
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1829
2894
|
try {
|
|
1830
|
-
{
|
|
2895
|
+
if (BUILD.lazyLoad) {
|
|
1831
2896
|
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1832
2897
|
// instance is ready, let's call it's member method for this event
|
|
1833
2898
|
hostRef.$lazyInstance$[methodName](ev);
|
|
@@ -1836,22 +2901,172 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1836
2901
|
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1837
2902
|
}
|
|
1838
2903
|
}
|
|
2904
|
+
else {
|
|
2905
|
+
hostRef.$hostElement$[methodName](ev);
|
|
2906
|
+
}
|
|
1839
2907
|
}
|
|
1840
2908
|
catch (e) {
|
|
1841
2909
|
consoleError(e);
|
|
1842
2910
|
}
|
|
1843
2911
|
};
|
|
1844
2912
|
const getHostListenerTarget = (elm, flags) => {
|
|
1845
|
-
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
2913
|
+
if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1846
2914
|
return doc;
|
|
1847
|
-
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
2915
|
+
if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1848
2916
|
return win;
|
|
1849
|
-
if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
2917
|
+
if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
1850
2918
|
return doc.body;
|
|
2919
|
+
if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
|
|
2920
|
+
return elm.parentElement;
|
|
1851
2921
|
return elm;
|
|
1852
2922
|
};
|
|
1853
2923
|
// prettier-ignore
|
|
1854
|
-
const hostListenerOpts = (flags) =>
|
|
2924
|
+
const hostListenerOpts = (flags) => supportsListenerOptions
|
|
2925
|
+
? ({
|
|
2926
|
+
passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
|
|
2927
|
+
capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
|
|
2928
|
+
})
|
|
2929
|
+
: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
2930
|
+
const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
2931
|
+
const insertVdomAnnotations = (doc, staticComponents) => {
|
|
2932
|
+
if (doc != null) {
|
|
2933
|
+
const docData = {
|
|
2934
|
+
hostIds: 0,
|
|
2935
|
+
rootLevelIds: 0,
|
|
2936
|
+
staticComponents: new Set(staticComponents),
|
|
2937
|
+
};
|
|
2938
|
+
const orgLocationNodes = [];
|
|
2939
|
+
parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
|
|
2940
|
+
orgLocationNodes.forEach((orgLocationNode) => {
|
|
2941
|
+
if (orgLocationNode != null) {
|
|
2942
|
+
const nodeRef = orgLocationNode['s-nr'];
|
|
2943
|
+
let hostId = nodeRef['s-host-id'];
|
|
2944
|
+
let nodeId = nodeRef['s-node-id'];
|
|
2945
|
+
let childId = `${hostId}.${nodeId}`;
|
|
2946
|
+
if (hostId == null) {
|
|
2947
|
+
hostId = 0;
|
|
2948
|
+
docData.rootLevelIds++;
|
|
2949
|
+
nodeId = docData.rootLevelIds;
|
|
2950
|
+
childId = `${hostId}.${nodeId}`;
|
|
2951
|
+
if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
2952
|
+
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
2953
|
+
}
|
|
2954
|
+
else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
2955
|
+
if (hostId === 0) {
|
|
2956
|
+
const textContent = nodeRef.nodeValue.trim();
|
|
2957
|
+
if (textContent === '') {
|
|
2958
|
+
// useless whitespace node at the document root
|
|
2959
|
+
orgLocationNode.remove();
|
|
2960
|
+
return;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
const commentBeforeTextNode = doc.createComment(childId);
|
|
2964
|
+
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
2965
|
+
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
2969
|
+
const orgLocationParentNode = orgLocationNode.parentElement;
|
|
2970
|
+
if (orgLocationParentNode) {
|
|
2971
|
+
if (orgLocationParentNode['s-en'] === '') {
|
|
2972
|
+
// ending with a "." means that the parent element
|
|
2973
|
+
// of this node's original location is a SHADOW dom element
|
|
2974
|
+
// and this node is apart of the root level light dom
|
|
2975
|
+
orgLocationNodeId += `.`;
|
|
2976
|
+
}
|
|
2977
|
+
else if (orgLocationParentNode['s-en'] === 'c') {
|
|
2978
|
+
// ending with a ".c" means that the parent element
|
|
2979
|
+
// of this node's original location is a SCOPED element
|
|
2980
|
+
// and this node is apart of the root level light dom
|
|
2981
|
+
orgLocationNodeId += `.c`;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
orgLocationNode.nodeValue = orgLocationNodeId;
|
|
2985
|
+
}
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
};
|
|
2989
|
+
const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
|
|
2990
|
+
if (node == null) {
|
|
2991
|
+
return;
|
|
2992
|
+
}
|
|
2993
|
+
if (node['s-nr'] != null) {
|
|
2994
|
+
orgLocationNodes.push(node);
|
|
2995
|
+
}
|
|
2996
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
2997
|
+
node.childNodes.forEach((childNode) => {
|
|
2998
|
+
const hostRef = getHostRef(childNode);
|
|
2999
|
+
if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
|
|
3000
|
+
const cmpData = {
|
|
3001
|
+
nodeIds: 0,
|
|
3002
|
+
};
|
|
3003
|
+
insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
|
|
3004
|
+
}
|
|
3005
|
+
parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
|
|
3006
|
+
});
|
|
3007
|
+
}
|
|
3008
|
+
};
|
|
3009
|
+
const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
3010
|
+
if (vnode != null) {
|
|
3011
|
+
const hostId = ++docData.hostIds;
|
|
3012
|
+
hostElm.setAttribute(HYDRATE_ID, hostId);
|
|
3013
|
+
if (hostElm['s-cr'] != null) {
|
|
3014
|
+
hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
|
|
3015
|
+
}
|
|
3016
|
+
if (vnode.$children$ != null) {
|
|
3017
|
+
const depth = 0;
|
|
3018
|
+
vnode.$children$.forEach((vnodeChild, index) => {
|
|
3019
|
+
insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {
|
|
3023
|
+
const parent = hostElm.parentElement;
|
|
3024
|
+
if (parent && parent.childNodes) {
|
|
3025
|
+
const parentChildNodes = Array.from(parent.childNodes);
|
|
3026
|
+
const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
|
|
3027
|
+
if (comment) {
|
|
3028
|
+
const index = parentChildNodes.indexOf(hostElm) - 1;
|
|
3029
|
+
vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
};
|
|
3035
|
+
const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
|
|
3036
|
+
const childElm = vnodeChild.$elm$;
|
|
3037
|
+
if (childElm == null) {
|
|
3038
|
+
return;
|
|
3039
|
+
}
|
|
3040
|
+
const nodeId = cmpData.nodeIds++;
|
|
3041
|
+
const childId = `${hostId}.${nodeId}.${depth}.${index}`;
|
|
3042
|
+
childElm['s-host-id'] = hostId;
|
|
3043
|
+
childElm['s-node-id'] = nodeId;
|
|
3044
|
+
if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
3045
|
+
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3046
|
+
}
|
|
3047
|
+
else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
3048
|
+
const parentNode = childElm.parentNode;
|
|
3049
|
+
const nodeName = parentNode.nodeName;
|
|
3050
|
+
if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
|
|
3051
|
+
const textNodeId = `${TEXT_NODE_ID}.${childId}`;
|
|
3052
|
+
const commentBeforeTextNode = doc.createComment(textNodeId);
|
|
3053
|
+
parentNode.insertBefore(commentBeforeTextNode, childElm);
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
3057
|
+
if (childElm['s-sr']) {
|
|
3058
|
+
const slotName = childElm['s-sn'] || '';
|
|
3059
|
+
const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
|
|
3060
|
+
childElm.nodeValue = slotNodeId;
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
if (vnodeChild.$children$ != null) {
|
|
3064
|
+
const childDepth = depth + 1;
|
|
3065
|
+
vnodeChild.$children$.forEach((vnode, index) => {
|
|
3066
|
+
insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
|
|
3067
|
+
});
|
|
3068
|
+
}
|
|
3069
|
+
};
|
|
1855
3070
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1856
3071
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1857
3072
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1862,361 +3077,65 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1862
3077
|
$cmpMeta$: cmpMeta,
|
|
1863
3078
|
$instanceValues$: new Map(),
|
|
1864
3079
|
};
|
|
1865
|
-
{
|
|
3080
|
+
if (BUILD.isDev) {
|
|
3081
|
+
hostRef.$renderCount$ = 0;
|
|
3082
|
+
}
|
|
3083
|
+
if (BUILD.method && BUILD.lazyLoad) {
|
|
1866
3084
|
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
1867
3085
|
}
|
|
1868
|
-
{
|
|
3086
|
+
if (BUILD.asyncLoading) {
|
|
1869
3087
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1870
3088
|
elm['s-p'] = [];
|
|
1871
3089
|
elm['s-rc'] = [];
|
|
1872
3090
|
}
|
|
1873
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
3091
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
1874
3092
|
return hostRefs.set(elm, hostRef);
|
|
1875
3093
|
};
|
|
1876
3094
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1877
|
-
const consoleError = (e, el) => (
|
|
3095
|
+
const consoleError = (e, el) => (customError || console.error)(e, el);
|
|
3096
|
+
const STENCIL_DEV_MODE = BUILD.isTesting
|
|
3097
|
+
? ['STENCIL:'] // E2E testing
|
|
3098
|
+
: [
|
|
3099
|
+
'%cstencil',
|
|
3100
|
+
'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
|
|
3101
|
+
];
|
|
3102
|
+
const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
3103
|
+
const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
3104
|
+
const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
3105
|
+
const setErrorHandler = (handler) => (customError = handler);
|
|
1878
3106
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
1879
3107
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
1880
3108
|
// loadModuleImport
|
|
1881
3109
|
const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
1882
3110
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1883
|
-
|
|
3111
|
+
if (BUILD.isDev && typeof bundleId !== 'string') {
|
|
3112
|
+
consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
|
|
3113
|
+
return undefined;
|
|
3114
|
+
}
|
|
3115
|
+
const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
1884
3116
|
if (module) {
|
|
1885
3117
|
return module[exportName];
|
|
1886
3118
|
}
|
|
1887
|
-
|
|
1888
|
-
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1889
|
-
const processMod = importedModule => {
|
|
1890
|
-
cmpModules.set(bundleId, importedModule);
|
|
1891
|
-
return importedModule[exportName];
|
|
1892
|
-
}
|
|
1893
|
-
switch(bundleId) {
|
|
1894
|
-
|
|
1895
|
-
case 'z-app-header_2':
|
|
1896
|
-
return import(
|
|
1897
|
-
/* webpackMode: "lazy" */
|
|
1898
|
-
'./z-app-header_2.entry.js').then(processMod, consoleError);
|
|
1899
|
-
case 'z-anchor-navigation':
|
|
1900
|
-
return import(
|
|
1901
|
-
/* webpackMode: "lazy" */
|
|
1902
|
-
'./z-anchor-navigation.entry.js').then(processMod, consoleError);
|
|
1903
|
-
case 'z-app-switcher':
|
|
1904
|
-
return import(
|
|
1905
|
-
/* webpackMode: "lazy" */
|
|
1906
|
-
'./z-app-switcher.entry.js').then(processMod, consoleError);
|
|
1907
|
-
case 'z-aria-alert':
|
|
1908
|
-
return import(
|
|
1909
|
-
/* webpackMode: "lazy" */
|
|
1910
|
-
'./z-aria-alert.entry.js').then(processMod, consoleError);
|
|
1911
|
-
case 'z-avatar':
|
|
1912
|
-
return import(
|
|
1913
|
-
/* webpackMode: "lazy" */
|
|
1914
|
-
'./z-avatar.entry.js').then(processMod, consoleError);
|
|
1915
|
-
case 'z-button-sort':
|
|
1916
|
-
return import(
|
|
1917
|
-
/* webpackMode: "lazy" */
|
|
1918
|
-
'./z-button-sort.entry.js').then(processMod, consoleError);
|
|
1919
|
-
case 'z-card':
|
|
1920
|
-
return import(
|
|
1921
|
-
/* webpackMode: "lazy" */
|
|
1922
|
-
'./z-card.entry.js').then(processMod, consoleError);
|
|
1923
|
-
case 'z-carousel':
|
|
1924
|
-
return import(
|
|
1925
|
-
/* webpackMode: "lazy" */
|
|
1926
|
-
'./z-carousel.entry.js').then(processMod, consoleError);
|
|
1927
|
-
case 'z-combobox':
|
|
1928
|
-
return import(
|
|
1929
|
-
/* webpackMode: "lazy" */
|
|
1930
|
-
'./z-combobox.entry.js').then(processMod, consoleError);
|
|
1931
|
-
case 'z-contextual-menu':
|
|
1932
|
-
return import(
|
|
1933
|
-
/* webpackMode: "lazy" */
|
|
1934
|
-
'./z-contextual-menu.entry.js').then(processMod, consoleError);
|
|
1935
|
-
case 'z-cover-hero':
|
|
1936
|
-
return import(
|
|
1937
|
-
/* webpackMode: "lazy" */
|
|
1938
|
-
'./z-cover-hero.entry.js').then(processMod, consoleError);
|
|
1939
|
-
case 'z-date-picker':
|
|
1940
|
-
return import(
|
|
1941
|
-
/* webpackMode: "lazy" */
|
|
1942
|
-
'./z-date-picker.entry.js').then(processMod, consoleError);
|
|
1943
|
-
case 'z-file':
|
|
1944
|
-
return import(
|
|
1945
|
-
/* webpackMode: "lazy" */
|
|
1946
|
-
'./z-file.entry.js').then(processMod, consoleError);
|
|
1947
|
-
case 'z-file-upload':
|
|
1948
|
-
return import(
|
|
1949
|
-
/* webpackMode: "lazy" */
|
|
1950
|
-
'./z-file-upload.entry.js').then(processMod, consoleError);
|
|
1951
|
-
case 'z-info-box':
|
|
1952
|
-
return import(
|
|
1953
|
-
/* webpackMode: "lazy" */
|
|
1954
|
-
'./z-info-box.entry.js').then(processMod, consoleError);
|
|
1955
|
-
case 'z-info-reveal':
|
|
1956
|
-
return import(
|
|
1957
|
-
/* webpackMode: "lazy" */
|
|
1958
|
-
'./z-info-reveal.entry.js').then(processMod, consoleError);
|
|
1959
|
-
case 'z-logo':
|
|
1960
|
-
return import(
|
|
1961
|
-
/* webpackMode: "lazy" */
|
|
1962
|
-
'./z-logo.entry.js').then(processMod, consoleError);
|
|
1963
|
-
case 'z-menu':
|
|
1964
|
-
return import(
|
|
1965
|
-
/* webpackMode: "lazy" */
|
|
1966
|
-
'./z-menu.entry.js').then(processMod, consoleError);
|
|
1967
|
-
case 'z-menu-section':
|
|
1968
|
-
return import(
|
|
1969
|
-
/* webpackMode: "lazy" */
|
|
1970
|
-
'./z-menu-section.entry.js').then(processMod, consoleError);
|
|
1971
|
-
case 'z-messages-pocket':
|
|
1972
|
-
return import(
|
|
1973
|
-
/* webpackMode: "lazy" */
|
|
1974
|
-
'./z-messages-pocket.entry.js').then(processMod, consoleError);
|
|
1975
|
-
case 'z-myz-card-alert':
|
|
1976
|
-
return import(
|
|
1977
|
-
/* webpackMode: "lazy" */
|
|
1978
|
-
'./z-myz-card-alert.entry.js').then(processMod, consoleError);
|
|
1979
|
-
case 'z-myz-card-dictionary':
|
|
1980
|
-
return import(
|
|
1981
|
-
/* webpackMode: "lazy" */
|
|
1982
|
-
'./z-myz-card-dictionary.entry.js').then(processMod, consoleError);
|
|
1983
|
-
case 'z-myz-card-footer':
|
|
1984
|
-
return import(
|
|
1985
|
-
/* webpackMode: "lazy" */
|
|
1986
|
-
'./z-myz-card-footer.entry.js').then(processMod, consoleError);
|
|
1987
|
-
case 'z-myz-card-footer-sections':
|
|
1988
|
-
return import(
|
|
1989
|
-
/* webpackMode: "lazy" */
|
|
1990
|
-
'./z-myz-card-footer-sections.entry.js').then(processMod, consoleError);
|
|
1991
|
-
case 'z-myz-card-icon':
|
|
1992
|
-
return import(
|
|
1993
|
-
/* webpackMode: "lazy" */
|
|
1994
|
-
'./z-myz-card-icon.entry.js').then(processMod, consoleError);
|
|
1995
|
-
case 'z-myz-card-info':
|
|
1996
|
-
return import(
|
|
1997
|
-
/* webpackMode: "lazy" */
|
|
1998
|
-
'./z-myz-card-info.entry.js').then(processMod, consoleError);
|
|
1999
|
-
case 'z-myz-card-list':
|
|
2000
|
-
return import(
|
|
2001
|
-
/* webpackMode: "lazy" */
|
|
2002
|
-
'./z-myz-card-list.entry.js').then(processMod, consoleError);
|
|
2003
|
-
case 'z-myz-list':
|
|
2004
|
-
return import(
|
|
2005
|
-
/* webpackMode: "lazy" */
|
|
2006
|
-
'./z-myz-list.entry.js').then(processMod, consoleError);
|
|
2007
|
-
case 'z-navigation-tab':
|
|
2008
|
-
return import(
|
|
2009
|
-
/* webpackMode: "lazy" */
|
|
2010
|
-
'./z-navigation-tab.entry.js').then(processMod, consoleError);
|
|
2011
|
-
case 'z-navigation-tab-link':
|
|
2012
|
-
return import(
|
|
2013
|
-
/* webpackMode: "lazy" */
|
|
2014
|
-
'./z-navigation-tab-link.entry.js').then(processMod, consoleError);
|
|
2015
|
-
case 'z-navigation-tabs':
|
|
2016
|
-
return import(
|
|
2017
|
-
/* webpackMode: "lazy" */
|
|
2018
|
-
'./z-navigation-tabs.entry.js').then(processMod, consoleError);
|
|
2019
|
-
case 'z-notification':
|
|
2020
|
-
return import(
|
|
2021
|
-
/* webpackMode: "lazy" */
|
|
2022
|
-
'./z-notification.entry.js').then(processMod, consoleError);
|
|
2023
|
-
case 'z-offcanvas':
|
|
2024
|
-
return import(
|
|
2025
|
-
/* webpackMode: "lazy" */
|
|
2026
|
-
'./z-offcanvas.entry.js').then(processMod, consoleError);
|
|
2027
|
-
case 'z-otp':
|
|
2028
|
-
return import(
|
|
2029
|
-
/* webpackMode: "lazy" */
|
|
2030
|
-
'./z-otp.entry.js').then(processMod, consoleError);
|
|
2031
|
-
case 'z-pagination':
|
|
2032
|
-
return import(
|
|
2033
|
-
/* webpackMode: "lazy" */
|
|
2034
|
-
'./z-pagination.entry.js').then(processMod, consoleError);
|
|
2035
|
-
case 'z-panel-elem':
|
|
2036
|
-
return import(
|
|
2037
|
-
/* webpackMode: "lazy" */
|
|
2038
|
-
'./z-panel-elem.entry.js').then(processMod, consoleError);
|
|
2039
|
-
case 'z-pocket-message':
|
|
2040
|
-
return import(
|
|
2041
|
-
/* webpackMode: "lazy" */
|
|
2042
|
-
'./z-pocket-message.entry.js').then(processMod, consoleError);
|
|
2043
|
-
case 'z-range-picker':
|
|
2044
|
-
return import(
|
|
2045
|
-
/* webpackMode: "lazy" */
|
|
2046
|
-
'./z-range-picker.entry.js').then(processMod, consoleError);
|
|
2047
|
-
case 'z-searchbar':
|
|
2048
|
-
return import(
|
|
2049
|
-
/* webpackMode: "lazy" */
|
|
2050
|
-
'./z-searchbar.entry.js').then(processMod, consoleError);
|
|
2051
|
-
case 'z-section-title':
|
|
2052
|
-
return import(
|
|
2053
|
-
/* webpackMode: "lazy" */
|
|
2054
|
-
'./z-section-title.entry.js').then(processMod, consoleError);
|
|
2055
|
-
case 'z-select':
|
|
2056
|
-
return import(
|
|
2057
|
-
/* webpackMode: "lazy" */
|
|
2058
|
-
'./z-select.entry.js').then(processMod, consoleError);
|
|
2059
|
-
case 'z-skip-to-content':
|
|
2060
|
-
return import(
|
|
2061
|
-
/* webpackMode: "lazy" */
|
|
2062
|
-
'./z-skip-to-content.entry.js').then(processMod, consoleError);
|
|
2063
|
-
case 'z-slideshow':
|
|
2064
|
-
return import(
|
|
2065
|
-
/* webpackMode: "lazy" */
|
|
2066
|
-
'./z-slideshow.entry.js').then(processMod, consoleError);
|
|
2067
|
-
case 'z-stepper':
|
|
2068
|
-
return import(
|
|
2069
|
-
/* webpackMode: "lazy" */
|
|
2070
|
-
'./z-stepper.entry.js').then(processMod, consoleError);
|
|
2071
|
-
case 'z-stepper-item':
|
|
2072
|
-
return import(
|
|
2073
|
-
/* webpackMode: "lazy" */
|
|
2074
|
-
'./z-stepper-item.entry.js').then(processMod, consoleError);
|
|
2075
|
-
case 'z-table':
|
|
2076
|
-
return import(
|
|
2077
|
-
/* webpackMode: "lazy" */
|
|
2078
|
-
'./z-table.entry.js').then(processMod, consoleError);
|
|
2079
|
-
case 'z-table-body':
|
|
2080
|
-
return import(
|
|
2081
|
-
/* webpackMode: "lazy" */
|
|
2082
|
-
'./z-table-body.entry.js').then(processMod, consoleError);
|
|
2083
|
-
case 'z-table-expanded-row':
|
|
2084
|
-
return import(
|
|
2085
|
-
/* webpackMode: "lazy" */
|
|
2086
|
-
'./z-table-expanded-row.entry.js').then(processMod, consoleError);
|
|
2087
|
-
case 'z-table-footer':
|
|
2088
|
-
return import(
|
|
2089
|
-
/* webpackMode: "lazy" */
|
|
2090
|
-
'./z-table-footer.entry.js').then(processMod, consoleError);
|
|
2091
|
-
case 'z-table-head':
|
|
2092
|
-
return import(
|
|
2093
|
-
/* webpackMode: "lazy" */
|
|
2094
|
-
'./z-table-head.entry.js').then(processMod, consoleError);
|
|
2095
|
-
case 'z-table-header-row':
|
|
2096
|
-
return import(
|
|
2097
|
-
/* webpackMode: "lazy" */
|
|
2098
|
-
'./z-table-header-row.entry.js').then(processMod, consoleError);
|
|
2099
|
-
case 'z-table-row':
|
|
2100
|
-
return import(
|
|
2101
|
-
/* webpackMode: "lazy" */
|
|
2102
|
-
'./z-table-row.entry.js').then(processMod, consoleError);
|
|
2103
|
-
case 'z-table-sticky-footer':
|
|
2104
|
-
return import(
|
|
2105
|
-
/* webpackMode: "lazy" */
|
|
2106
|
-
'./z-table-sticky-footer.entry.js').then(processMod, consoleError);
|
|
2107
|
-
case 'z-tag':
|
|
2108
|
-
return import(
|
|
2109
|
-
/* webpackMode: "lazy" */
|
|
2110
|
-
'./z-tag.entry.js').then(processMod, consoleError);
|
|
2111
|
-
case 'z-toast-notification':
|
|
2112
|
-
return import(
|
|
2113
|
-
/* webpackMode: "lazy" */
|
|
2114
|
-
'./z-toast-notification.entry.js').then(processMod, consoleError);
|
|
2115
|
-
case 'z-toast-notification-list':
|
|
2116
|
-
return import(
|
|
2117
|
-
/* webpackMode: "lazy" */
|
|
2118
|
-
'./z-toast-notification-list.entry.js').then(processMod, consoleError);
|
|
2119
|
-
case 'z-toggle-button':
|
|
2120
|
-
return import(
|
|
2121
|
-
/* webpackMode: "lazy" */
|
|
2122
|
-
'./z-toggle-button.entry.js').then(processMod, consoleError);
|
|
2123
|
-
case 'z-toggle-switch':
|
|
2124
|
-
return import(
|
|
2125
|
-
/* webpackMode: "lazy" */
|
|
2126
|
-
'./z-toggle-switch.entry.js').then(processMod, consoleError);
|
|
2127
|
-
case 'z-tooltip':
|
|
2128
|
-
return import(
|
|
2129
|
-
/* webpackMode: "lazy" */
|
|
2130
|
-
'./z-tooltip.entry.js').then(processMod, consoleError);
|
|
2131
|
-
case 'z-visually-hidden':
|
|
2132
|
-
return import(
|
|
2133
|
-
/* webpackMode: "lazy" */
|
|
2134
|
-
'./z-visually-hidden.entry.js').then(processMod, consoleError);
|
|
2135
|
-
case 'z-alert':
|
|
2136
|
-
return import(
|
|
2137
|
-
/* webpackMode: "lazy" */
|
|
2138
|
-
'./z-alert.entry.js').then(processMod, consoleError);
|
|
2139
|
-
case 'z-chip':
|
|
2140
|
-
return import(
|
|
2141
|
-
/* webpackMode: "lazy" */
|
|
2142
|
-
'./z-chip.entry.js').then(processMod, consoleError);
|
|
2143
|
-
case 'z-dragdrop-area_3':
|
|
2144
|
-
return import(
|
|
2145
|
-
/* webpackMode: "lazy" */
|
|
2146
|
-
'./z-dragdrop-area_3.entry.js').then(processMod, consoleError);
|
|
2147
|
-
case 'z-ghost-loading':
|
|
2148
|
-
return import(
|
|
2149
|
-
/* webpackMode: "lazy" */
|
|
2150
|
-
'./z-ghost-loading.entry.js').then(processMod, consoleError);
|
|
2151
|
-
case 'z-myz-card_4':
|
|
2152
|
-
return import(
|
|
2153
|
-
/* webpackMode: "lazy" */
|
|
2154
|
-
'./z-myz-card_4.entry.js').then(processMod, consoleError);
|
|
2155
|
-
case 'z-pocket_3':
|
|
2156
|
-
return import(
|
|
2157
|
-
/* webpackMode: "lazy" */
|
|
2158
|
-
'./z-pocket_3.entry.js').then(processMod, consoleError);
|
|
2159
|
-
case 'z-table-cell':
|
|
2160
|
-
return import(
|
|
2161
|
-
/* webpackMode: "lazy" */
|
|
2162
|
-
'./z-table-cell.entry.js').then(processMod, consoleError);
|
|
2163
|
-
case 'z-table-empty-box':
|
|
2164
|
-
return import(
|
|
2165
|
-
/* webpackMode: "lazy" */
|
|
2166
|
-
'./z-table-empty-box.entry.js').then(processMod, consoleError);
|
|
2167
|
-
case 'z-table-header':
|
|
2168
|
-
return import(
|
|
2169
|
-
/* webpackMode: "lazy" */
|
|
2170
|
-
'./z-table-header.entry.js').then(processMod, consoleError);
|
|
2171
|
-
case 'z-myz-list-item':
|
|
2172
|
-
return import(
|
|
2173
|
-
/* webpackMode: "lazy" */
|
|
2174
|
-
'./z-myz-list-item.entry.js').then(processMod, consoleError);
|
|
2175
|
-
case 'z-link':
|
|
2176
|
-
return import(
|
|
2177
|
-
/* webpackMode: "lazy" */
|
|
2178
|
-
'./z-link.entry.js').then(processMod, consoleError);
|
|
2179
|
-
case 'z-list_3':
|
|
2180
|
-
return import(
|
|
2181
|
-
/* webpackMode: "lazy" */
|
|
2182
|
-
'./z-list_3.entry.js').then(processMod, consoleError);
|
|
2183
|
-
case 'z-body_2':
|
|
2184
|
-
return import(
|
|
2185
|
-
/* webpackMode: "lazy" */
|
|
2186
|
-
'./z-body_2.entry.js').then(processMod, consoleError);
|
|
2187
|
-
case 'z-input_2':
|
|
2188
|
-
return import(
|
|
2189
|
-
/* webpackMode: "lazy" */
|
|
2190
|
-
'./z-input_2.entry.js').then(processMod, consoleError);
|
|
2191
|
-
case 'z-popover':
|
|
2192
|
-
return import(
|
|
2193
|
-
/* webpackMode: "lazy" */
|
|
2194
|
-
'./z-popover.entry.js').then(processMod, consoleError);
|
|
2195
|
-
case 'z-divider':
|
|
2196
|
-
return import(
|
|
2197
|
-
/* webpackMode: "lazy" */
|
|
2198
|
-
'./z-divider.entry.js').then(processMod, consoleError);
|
|
2199
|
-
case 'z-button':
|
|
2200
|
-
return import(
|
|
2201
|
-
/* webpackMode: "lazy" */
|
|
2202
|
-
'./z-button.entry.js').then(processMod, consoleError);
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
3119
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
2205
3120
|
return import(
|
|
2206
3121
|
/* @vite-ignore */
|
|
2207
3122
|
/* webpackInclude: /\.entry\.js$/ */
|
|
2208
3123
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2209
3124
|
/* webpackMode: "lazy" */
|
|
2210
|
-
`./${bundleId}.entry.js${''}`).then((importedModule) => {
|
|
2211
|
-
{
|
|
3125
|
+
`./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
|
|
3126
|
+
if (!BUILD.hotModuleReplacement) {
|
|
2212
3127
|
cmpModules.set(bundleId, importedModule);
|
|
2213
3128
|
}
|
|
2214
3129
|
return importedModule[exportName];
|
|
2215
3130
|
}, consoleError);
|
|
2216
3131
|
};
|
|
2217
3132
|
const styles = /*@__PURE__*/ new Map();
|
|
3133
|
+
const modeResolutionChain = [];
|
|
2218
3134
|
const win = typeof window !== 'undefined' ? window : {};
|
|
3135
|
+
const CSS = BUILD.cssVarShim ? win.CSS : null;
|
|
2219
3136
|
const doc = win.document || { head: {} };
|
|
3137
|
+
const H = (win.HTMLElement || class {
|
|
3138
|
+
});
|
|
2220
3139
|
const plt = {
|
|
2221
3140
|
$flags$: 0,
|
|
2222
3141
|
$resourcesUrl$: '',
|
|
@@ -2226,8 +3145,27 @@ const plt = {
|
|
|
2226
3145
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2227
3146
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2228
3147
|
};
|
|
3148
|
+
const setPlatformHelpers = (helpers) => {
|
|
3149
|
+
Object.assign(plt, helpers);
|
|
3150
|
+
};
|
|
3151
|
+
const supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom
|
|
3152
|
+
? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
3153
|
+
: true;
|
|
3154
|
+
const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
3155
|
+
let supportsListenerOptions = false;
|
|
3156
|
+
try {
|
|
3157
|
+
doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
|
|
3158
|
+
get() {
|
|
3159
|
+
supportsListenerOptions = true;
|
|
3160
|
+
},
|
|
3161
|
+
}));
|
|
3162
|
+
}
|
|
3163
|
+
catch (e) { }
|
|
3164
|
+
return supportsListenerOptions;
|
|
3165
|
+
})();
|
|
2229
3166
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
2230
|
-
const supportsConstructableStylesheets =
|
|
3167
|
+
const supportsConstructableStylesheets = BUILD.constructableCSS
|
|
3168
|
+
? /*@__PURE__*/ (() => {
|
|
2231
3169
|
try {
|
|
2232
3170
|
new CSSStyleSheet();
|
|
2233
3171
|
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
@@ -2235,9 +3173,10 @@ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
|
2235
3173
|
catch (e) { }
|
|
2236
3174
|
return false;
|
|
2237
3175
|
})()
|
|
2238
|
-
;
|
|
3176
|
+
: false;
|
|
2239
3177
|
const queueDomReads = [];
|
|
2240
3178
|
const queueDomWrites = [];
|
|
3179
|
+
const queueDomWritesLow = [];
|
|
2241
3180
|
const queueTask = (queue, write) => (cb) => {
|
|
2242
3181
|
queue.push(cb);
|
|
2243
3182
|
if (!queuePending) {
|
|
@@ -2261,13 +3200,53 @@ const consume = (queue) => {
|
|
|
2261
3200
|
}
|
|
2262
3201
|
queue.length = 0;
|
|
2263
3202
|
};
|
|
3203
|
+
const consumeTimeout = (queue, timeout) => {
|
|
3204
|
+
let i = 0;
|
|
3205
|
+
let ts = 0;
|
|
3206
|
+
while (i < queue.length && (ts = performance.now()) < timeout) {
|
|
3207
|
+
try {
|
|
3208
|
+
queue[i++](ts);
|
|
3209
|
+
}
|
|
3210
|
+
catch (e) {
|
|
3211
|
+
consoleError(e);
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
if (i === queue.length) {
|
|
3215
|
+
queue.length = 0;
|
|
3216
|
+
}
|
|
3217
|
+
else if (i !== 0) {
|
|
3218
|
+
queue.splice(0, i);
|
|
3219
|
+
}
|
|
3220
|
+
};
|
|
2264
3221
|
const flush = () => {
|
|
3222
|
+
if (BUILD.asyncQueue) {
|
|
3223
|
+
queueCongestion++;
|
|
3224
|
+
}
|
|
2265
3225
|
// always force a bunch of medium callbacks to run, but still have
|
|
2266
3226
|
// a throttle on how many can run in a certain time
|
|
2267
3227
|
// DOM READS!!!
|
|
2268
3228
|
consume(queueDomReads);
|
|
2269
3229
|
// DOM WRITES!!!
|
|
2270
|
-
{
|
|
3230
|
+
if (BUILD.asyncQueue) {
|
|
3231
|
+
const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
|
|
3232
|
+
? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
|
|
3233
|
+
: Infinity;
|
|
3234
|
+
consumeTimeout(queueDomWrites, timeout);
|
|
3235
|
+
consumeTimeout(queueDomWritesLow, timeout);
|
|
3236
|
+
if (queueDomWrites.length > 0) {
|
|
3237
|
+
queueDomWritesLow.push(...queueDomWrites);
|
|
3238
|
+
queueDomWrites.length = 0;
|
|
3239
|
+
}
|
|
3240
|
+
if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
|
|
3241
|
+
// still more to do yet, but we've run out of time
|
|
3242
|
+
// let's let this thing cool off and try again in the next tick
|
|
3243
|
+
plt.raf(flush);
|
|
3244
|
+
}
|
|
3245
|
+
else {
|
|
3246
|
+
queueCongestion = 0;
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
else {
|
|
2271
3250
|
consume(queueDomWrites);
|
|
2272
3251
|
if ((queuePending = queueDomReads.length > 0)) {
|
|
2273
3252
|
// still more to do yet, but we've run out of time
|
|
@@ -2277,6 +3256,7 @@ const flush = () => {
|
|
|
2277
3256
|
}
|
|
2278
3257
|
};
|
|
2279
3258
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
3259
|
+
const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
|
|
2280
3260
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2281
3261
|
|
|
2282
|
-
export {
|
|
3262
|
+
export { BUILD as B, CSS as C, H, NAMESPACE as N, promiseResolve as a, bootstrapLazy as b, consoleDevInfo as c, doc as d, Host as e, createEvent as f, getElement as g, h, plt as p, registerInstance as r, win as w };
|