@zanichelli/albe-web-components 6.6.8 → 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 +2 -0
- package/dist/types/components/inputs/z-combobox/index.d.ts +2 -0
- package/dist/types/components/z-cover-hero/index.d.ts +2 -1
- 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/web-components-library/z-cover-hero.entry.js +36 -0
- 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/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/www/build/z-cover-hero.entry.js +36 -0
- 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-cover-hero.cjs.entry.js +0 -40
- 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 -102
- package/dist/collection/components/z-cover-hero/styles.css +0 -77
- 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-cover-hero.entry.js +0 -36
- 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-67d6cfcb.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-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-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-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-4b159cbd.css +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-67d6cfcb.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-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-c85c7cb2.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,26 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _interopNamespace(e) {
|
|
4
|
-
if (e && e.__esModule) return e;
|
|
5
|
-
var n = Object.create(null);
|
|
6
|
-
if (e) {
|
|
7
|
-
Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default') {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return e[k];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n['default'] = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
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 */ {};
|
|
24
4
|
|
|
25
5
|
/**
|
|
26
6
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -33,25 +13,120 @@ const NAMESPACE = 'web-components-library';
|
|
|
33
13
|
let scopeId;
|
|
34
14
|
let contentRef;
|
|
35
15
|
let hostTagName;
|
|
16
|
+
let customError;
|
|
17
|
+
let i = 0;
|
|
36
18
|
let useNativeShadowDom = false;
|
|
37
19
|
let checkSlotFallbackVisibility = false;
|
|
38
20
|
let checkSlotRelocate = false;
|
|
39
21
|
let isSvgMode = false;
|
|
22
|
+
let renderingRef = null;
|
|
23
|
+
let queueCongestion = 0;
|
|
40
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);
|
|
41
37
|
const createTime = (fnName, tagName = '') => {
|
|
42
|
-
{
|
|
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 {
|
|
43
46
|
return () => {
|
|
44
47
|
return;
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
51
|
const uniqueTime = (key, measureText) => {
|
|
49
|
-
{
|
|
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 {
|
|
50
63
|
return () => {
|
|
51
64
|
return;
|
|
52
65
|
};
|
|
53
66
|
}
|
|
54
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';
|
|
55
130
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
56
131
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
57
132
|
/**
|
|
@@ -101,6 +176,11 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
101
176
|
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
102
177
|
child = String(child);
|
|
103
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
|
+
}
|
|
104
184
|
if (simple && lastSimple) {
|
|
105
185
|
// If the previous child was simple (string), we merge both
|
|
106
186
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -115,14 +195,17 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
115
195
|
};
|
|
116
196
|
walk(children);
|
|
117
197
|
if (vnodeData) {
|
|
198
|
+
if (BUILD.isDev && nodeName === 'input') {
|
|
199
|
+
validateInputProperties(vnodeData);
|
|
200
|
+
}
|
|
118
201
|
// normalize class / classname attributes
|
|
119
|
-
if (vnodeData.key) {
|
|
202
|
+
if (BUILD.vdomKey && vnodeData.key) {
|
|
120
203
|
key = vnodeData.key;
|
|
121
204
|
}
|
|
122
|
-
if (vnodeData.name) {
|
|
205
|
+
if (BUILD.slotRelocation && vnodeData.name) {
|
|
123
206
|
slotName = vnodeData.name;
|
|
124
207
|
}
|
|
125
|
-
{
|
|
208
|
+
if (BUILD.vdomClass) {
|
|
126
209
|
const classData = vnodeData.className || vnodeData.class;
|
|
127
210
|
if (classData) {
|
|
128
211
|
vnodeData.class =
|
|
@@ -134,15 +217,24 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
134
217
|
}
|
|
135
218
|
}
|
|
136
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
|
+
}
|
|
137
229
|
const vnode = newVNode(nodeName, null);
|
|
138
230
|
vnode.$attrs$ = vnodeData;
|
|
139
231
|
if (vNodeChildren.length > 0) {
|
|
140
232
|
vnode.$children$ = vNodeChildren;
|
|
141
233
|
}
|
|
142
|
-
{
|
|
234
|
+
if (BUILD.vdomKey) {
|
|
143
235
|
vnode.$key$ = key;
|
|
144
236
|
}
|
|
145
|
-
{
|
|
237
|
+
if (BUILD.slotRelocation) {
|
|
146
238
|
vnode.$name$ = slotName;
|
|
147
239
|
}
|
|
148
240
|
return vnode;
|
|
@@ -155,19 +247,277 @@ const newVNode = (tag, text) => {
|
|
|
155
247
|
$elm$: null,
|
|
156
248
|
$children$: null,
|
|
157
249
|
};
|
|
158
|
-
{
|
|
250
|
+
if (BUILD.vdomAttribute) {
|
|
159
251
|
vnode.$attrs$ = null;
|
|
160
252
|
}
|
|
161
|
-
{
|
|
253
|
+
if (BUILD.vdomKey) {
|
|
162
254
|
vnode.$key$ = null;
|
|
163
255
|
}
|
|
164
|
-
{
|
|
256
|
+
if (BUILD.slotRelocation) {
|
|
165
257
|
vnode.$name$ = null;
|
|
166
258
|
}
|
|
167
259
|
return vnode;
|
|
168
260
|
};
|
|
169
261
|
const Host = {};
|
|
170
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$;
|
|
171
521
|
/**
|
|
172
522
|
* Parse a new property value for a given property type.
|
|
173
523
|
*
|
|
@@ -194,16 +544,16 @@ const isHost = (node) => node && node.$tag$ === Host;
|
|
|
194
544
|
const parsePropertyValue = (propValue, propType) => {
|
|
195
545
|
// ensure this value is of the correct prop type
|
|
196
546
|
if (propValue != null && !isComplexType(propValue)) {
|
|
197
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
547
|
+
if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
198
548
|
// per the HTML spec, any string value means it is a boolean true value
|
|
199
549
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
200
550
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
201
551
|
}
|
|
202
|
-
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
552
|
+
if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
203
553
|
// force it to be a number
|
|
204
554
|
return parseFloat(propValue);
|
|
205
555
|
}
|
|
206
|
-
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
556
|
+
if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {
|
|
207
557
|
// could have been passed as a number or boolean
|
|
208
558
|
// but we still want it as a string
|
|
209
559
|
return String(propValue);
|
|
@@ -215,11 +565,14 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
215
565
|
// so no need to change to a different type
|
|
216
566
|
return propValue;
|
|
217
567
|
};
|
|
218
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
568
|
+
const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
|
|
219
569
|
const createEvent = (ref, name, flags) => {
|
|
220
570
|
const elm = getElement(ref);
|
|
221
571
|
return {
|
|
222
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
|
+
}
|
|
223
576
|
return emitEvent(elm, name, {
|
|
224
577
|
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
225
578
|
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
@@ -259,8 +612,11 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
259
612
|
styles.set(scopeId, style);
|
|
260
613
|
};
|
|
261
614
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
262
|
-
let scopeId = getScopeId(cmpMeta);
|
|
615
|
+
let scopeId = getScopeId(cmpMeta, mode);
|
|
263
616
|
const style = styles.get(scopeId);
|
|
617
|
+
if (!BUILD.attachStyles) {
|
|
618
|
+
return scopeId;
|
|
619
|
+
}
|
|
264
620
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
265
621
|
// so the fallback is to always use the document for the root node in those cases
|
|
266
622
|
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -273,11 +629,31 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
273
629
|
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
274
630
|
}
|
|
275
631
|
if (!appliedStyles.has(scopeId)) {
|
|
276
|
-
|
|
277
|
-
|
|
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 {
|
|
278
651
|
styleElm = doc.createElement('style');
|
|
279
652
|
styleElm.innerHTML = style;
|
|
280
653
|
}
|
|
654
|
+
if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
|
|
655
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
|
|
656
|
+
}
|
|
281
657
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
282
658
|
}
|
|
283
659
|
if (appliedStyles) {
|
|
@@ -285,7 +661,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
285
661
|
}
|
|
286
662
|
}
|
|
287
663
|
}
|
|
288
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
664
|
+
else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
289
665
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
290
666
|
}
|
|
291
667
|
}
|
|
@@ -296,8 +672,8 @@ const attachStyles = (hostRef) => {
|
|
|
296
672
|
const elm = hostRef.$hostElement$;
|
|
297
673
|
const flags = cmpMeta.$flags$;
|
|
298
674
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
299
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
300
|
-
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 */) {
|
|
301
677
|
// only required when we're NOT using native shadow dom (slot)
|
|
302
678
|
// or this browser doesn't support native shadow dom
|
|
303
679
|
// and this host element was NOT created with SSR
|
|
@@ -307,13 +683,14 @@ const attachStyles = (hostRef) => {
|
|
|
307
683
|
// DOM WRITE!!
|
|
308
684
|
elm['s-sc'] = scopeId;
|
|
309
685
|
elm.classList.add(scopeId + '-h');
|
|
310
|
-
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
686
|
+
if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
311
687
|
elm.classList.add(scopeId + '-s');
|
|
312
688
|
}
|
|
313
689
|
}
|
|
314
690
|
endAttachStyles();
|
|
315
691
|
};
|
|
316
|
-
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{');
|
|
317
694
|
/**
|
|
318
695
|
* Production setAccessor() function based on Preact by
|
|
319
696
|
* Jason Miller (@developit)
|
|
@@ -326,19 +703,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
326
703
|
if (oldValue !== newValue) {
|
|
327
704
|
let isProp = isMemberInElement(elm, memberName);
|
|
328
705
|
let ln = memberName.toLowerCase();
|
|
329
|
-
if (memberName === 'class') {
|
|
706
|
+
if (BUILD.vdomClass && memberName === 'class') {
|
|
330
707
|
const classList = elm.classList;
|
|
331
708
|
const oldClasses = parseClassList(oldValue);
|
|
332
709
|
const newClasses = parseClassList(newValue);
|
|
333
710
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
334
711
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
335
712
|
}
|
|
336
|
-
else if (memberName === 'style') {
|
|
713
|
+
else if (BUILD.vdomStyle && memberName === 'style') {
|
|
337
714
|
// update style attribute, css properties and values
|
|
338
|
-
{
|
|
715
|
+
if (BUILD.updatable) {
|
|
339
716
|
for (const prop in oldValue) {
|
|
340
717
|
if (!newValue || newValue[prop] == null) {
|
|
341
|
-
if (prop.includes('-')) {
|
|
718
|
+
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
342
719
|
elm.style.removeProperty(prop);
|
|
343
720
|
}
|
|
344
721
|
else {
|
|
@@ -349,7 +726,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
349
726
|
}
|
|
350
727
|
for (const prop in newValue) {
|
|
351
728
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
352
|
-
if (prop.includes('-')) {
|
|
729
|
+
if (!BUILD.hydrateServerSide && prop.includes('-')) {
|
|
353
730
|
elm.style.setProperty(prop, newValue[prop]);
|
|
354
731
|
}
|
|
355
732
|
else {
|
|
@@ -358,15 +735,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
358
735
|
}
|
|
359
736
|
}
|
|
360
737
|
}
|
|
361
|
-
else if (memberName === 'key')
|
|
738
|
+
else if (BUILD.vdomKey && memberName === 'key')
|
|
362
739
|
;
|
|
363
|
-
else if (memberName === 'ref') {
|
|
740
|
+
else if (BUILD.vdomRef && memberName === 'ref') {
|
|
364
741
|
// minifier will clean this up
|
|
365
742
|
if (newValue) {
|
|
366
743
|
newValue(elm);
|
|
367
744
|
}
|
|
368
745
|
}
|
|
369
|
-
else if (
|
|
746
|
+
else if (BUILD.vdomListener &&
|
|
747
|
+
(BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
|
|
370
748
|
memberName[0] === 'o' &&
|
|
371
749
|
memberName[1] === 'n') {
|
|
372
750
|
// Event Handlers
|
|
@@ -405,7 +783,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
405
783
|
plt.ael(elm, memberName, newValue, false);
|
|
406
784
|
}
|
|
407
785
|
}
|
|
408
|
-
else {
|
|
786
|
+
else if (BUILD.vdomPropOrAttr) {
|
|
409
787
|
// Set property if it exists and it's not a SVG
|
|
410
788
|
const isComplex = isComplexType(newValue);
|
|
411
789
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
@@ -434,7 +812,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
434
812
|
* - if the newValue is null/undefined or 'false'.
|
|
435
813
|
*/
|
|
436
814
|
let xlink = false;
|
|
437
|
-
{
|
|
815
|
+
if (BUILD.vdomXlink) {
|
|
438
816
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
439
817
|
memberName = ln;
|
|
440
818
|
xlink = true;
|
|
@@ -442,7 +820,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
442
820
|
}
|
|
443
821
|
if (newValue == null || newValue === false) {
|
|
444
822
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
445
|
-
if (xlink) {
|
|
823
|
+
if (BUILD.vdomXlink && xlink) {
|
|
446
824
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
447
825
|
}
|
|
448
826
|
else {
|
|
@@ -452,7 +830,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
452
830
|
}
|
|
453
831
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
454
832
|
newValue = newValue === true ? '' : newValue;
|
|
455
|
-
if (xlink) {
|
|
833
|
+
if (BUILD.vdomXlink && xlink) {
|
|
456
834
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
457
835
|
}
|
|
458
836
|
else {
|
|
@@ -473,7 +851,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
473
851
|
: newVnode.$elm$;
|
|
474
852
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
475
853
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
476
|
-
{
|
|
854
|
+
if (BUILD.updatable) {
|
|
477
855
|
// remove attributes no longer present on the vnode by setting them to undefined
|
|
478
856
|
for (memberName in oldVnodeAttrs) {
|
|
479
857
|
if (!(memberName in newVnodeAttrs)) {
|
|
@@ -503,7 +881,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
503
881
|
let elm;
|
|
504
882
|
let childNode;
|
|
505
883
|
let oldVNode;
|
|
506
|
-
if (!useNativeShadowDom) {
|
|
884
|
+
if (BUILD.slotRelocation && !useNativeShadowDom) {
|
|
507
885
|
// remember for later we need to check to relocate nodes
|
|
508
886
|
checkSlotRelocate = true;
|
|
509
887
|
if (newVNode.$tag$ === 'slot') {
|
|
@@ -518,32 +896,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
518
896
|
1 /* VNODE_FLAGS.isSlotReference */;
|
|
519
897
|
}
|
|
520
898
|
}
|
|
521
|
-
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) {
|
|
522
903
|
// create text node
|
|
523
904
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
524
905
|
}
|
|
525
|
-
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
906
|
+
else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
526
907
|
// create a slot reference node
|
|
527
908
|
elm = newVNode.$elm$ =
|
|
528
|
-
doc.createTextNode('');
|
|
909
|
+
BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
|
|
529
910
|
}
|
|
530
911
|
else {
|
|
531
|
-
if (!isSvgMode) {
|
|
912
|
+
if (BUILD.svg && !isSvgMode) {
|
|
532
913
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
533
914
|
}
|
|
534
915
|
// create element
|
|
535
|
-
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 */
|
|
536
918
|
? 'slot-fb'
|
|
537
919
|
: newVNode.$tag$)
|
|
538
|
-
|
|
539
|
-
|
|
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') {
|
|
540
924
|
isSvgMode = false;
|
|
541
925
|
}
|
|
542
926
|
// add css classes, attrs, props, listeners, etc.
|
|
543
|
-
{
|
|
927
|
+
if (BUILD.vdomAttribute) {
|
|
544
928
|
updateElement(null, newVNode, isSvgMode);
|
|
545
929
|
}
|
|
546
|
-
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
930
|
+
if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
547
931
|
// if there is a scopeId and this is the initial render
|
|
548
932
|
// then let's add the scopeId as a css class
|
|
549
933
|
elm.classList.add((elm['s-si'] = scopeId));
|
|
@@ -559,7 +943,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
559
943
|
}
|
|
560
944
|
}
|
|
561
945
|
}
|
|
562
|
-
{
|
|
946
|
+
if (BUILD.svg) {
|
|
563
947
|
if (newVNode.$tag$ === 'svg') {
|
|
564
948
|
// Only reset the SVG context when we're exiting <svg> element
|
|
565
949
|
isSvgMode = false;
|
|
@@ -570,7 +954,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
570
954
|
}
|
|
571
955
|
}
|
|
572
956
|
}
|
|
573
|
-
{
|
|
957
|
+
if (BUILD.slotRelocation) {
|
|
574
958
|
elm['s-hn'] = hostTagName;
|
|
575
959
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
576
960
|
// remember the content reference comment
|
|
@@ -615,9 +999,9 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
615
999
|
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
616
1000
|
};
|
|
617
1001
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
618
|
-
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
1002
|
+
let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
619
1003
|
let childNode;
|
|
620
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1004
|
+
if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
621
1005
|
containerElm = containerElm.shadowRoot;
|
|
622
1006
|
}
|
|
623
1007
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -625,7 +1009,7 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
625
1009
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
626
1010
|
if (childNode) {
|
|
627
1011
|
vnodes[startIdx].$elm$ = childNode;
|
|
628
|
-
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
1012
|
+
containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
|
|
629
1013
|
}
|
|
630
1014
|
}
|
|
631
1015
|
}
|
|
@@ -635,7 +1019,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
635
1019
|
if ((vnode = vnodes[startIdx])) {
|
|
636
1020
|
elm = vnode.$elm$;
|
|
637
1021
|
callNodeRefs(vnode);
|
|
638
|
-
{
|
|
1022
|
+
if (BUILD.slotRelocation) {
|
|
639
1023
|
// we're removing this element
|
|
640
1024
|
// so it's possible we need to show slot fallback content now
|
|
641
1025
|
checkSlotFallbackVisibility = true;
|
|
@@ -781,7 +1165,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
781
1165
|
//
|
|
782
1166
|
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
783
1167
|
// and move the DOM element for `oldStartVnode`.
|
|
784
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1168
|
+
if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
785
1169
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
786
1170
|
}
|
|
787
1171
|
patch(oldStartVnode, newEndVnode);
|
|
@@ -822,7 +1206,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
822
1206
|
// (which will handle updating any changed attributes, reconciling their
|
|
823
1207
|
// children etc) but we also need to move the DOM node to which
|
|
824
1208
|
// `oldEndVnode` corresponds.
|
|
825
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1209
|
+
if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
826
1210
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
827
1211
|
}
|
|
828
1212
|
patch(oldEndVnode, newStartVnode);
|
|
@@ -845,7 +1229,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
845
1229
|
// children which have the same key as the first node in the new
|
|
846
1230
|
// children.
|
|
847
1231
|
idxInOld = -1;
|
|
848
|
-
{
|
|
1232
|
+
if (BUILD.vdomKey) {
|
|
849
1233
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
850
1234
|
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
851
1235
|
idxInOld = i;
|
|
@@ -853,7 +1237,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
853
1237
|
}
|
|
854
1238
|
}
|
|
855
1239
|
}
|
|
856
|
-
if (idxInOld >= 0) {
|
|
1240
|
+
if (BUILD.vdomKey && idxInOld >= 0) {
|
|
857
1241
|
// We found a node in the old children which matches up with the first
|
|
858
1242
|
// node in the new children! So let's deal with that
|
|
859
1243
|
elmToMove = oldCh[idxInOld];
|
|
@@ -880,9 +1264,12 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
880
1264
|
}
|
|
881
1265
|
if (node) {
|
|
882
1266
|
// if we created a new node then handle inserting it to the DOM
|
|
883
|
-
{
|
|
1267
|
+
if (BUILD.slotRelocation) {
|
|
884
1268
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
885
1269
|
}
|
|
1270
|
+
else {
|
|
1271
|
+
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
1272
|
+
}
|
|
886
1273
|
}
|
|
887
1274
|
}
|
|
888
1275
|
}
|
|
@@ -890,7 +1277,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
890
1277
|
// we have some more new nodes to add which don't match up with old nodes
|
|
891
1278
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
892
1279
|
}
|
|
893
|
-
else if (newStartIdx > newEndIdx) {
|
|
1280
|
+
else if (BUILD.updatable && newStartIdx > newEndIdx) {
|
|
894
1281
|
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
895
1282
|
// in the new array, so lets remove them (which entails cleaning up the
|
|
896
1283
|
// relevant DOM nodes)
|
|
@@ -918,13 +1305,14 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
918
1305
|
// compare if two vnode to see if they're "technically" the same
|
|
919
1306
|
// need to have the same element tag, and same key to be the same
|
|
920
1307
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
921
|
-
if (leftVNode.$tag$ === 'slot') {
|
|
1308
|
+
if (BUILD.slotRelocation && leftVNode.$tag$ === 'slot') {
|
|
922
1309
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
923
1310
|
}
|
|
924
1311
|
// this will be set if components in the build have `key` attrs set on them
|
|
925
|
-
{
|
|
1312
|
+
if (BUILD.vdomKey) {
|
|
926
1313
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
927
1314
|
}
|
|
1315
|
+
return true;
|
|
928
1316
|
}
|
|
929
1317
|
return false;
|
|
930
1318
|
};
|
|
@@ -951,14 +1339,14 @@ const patch = (oldVNode, newVNode) => {
|
|
|
951
1339
|
const tag = newVNode.$tag$;
|
|
952
1340
|
const text = newVNode.$text$;
|
|
953
1341
|
let defaultHolder;
|
|
954
|
-
if (text === null) {
|
|
955
|
-
{
|
|
1342
|
+
if (!BUILD.vdomText || text === null) {
|
|
1343
|
+
if (BUILD.svg) {
|
|
956
1344
|
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
957
1345
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
958
1346
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
959
1347
|
}
|
|
960
|
-
{
|
|
961
|
-
if (tag === 'slot')
|
|
1348
|
+
if (BUILD.vdomAttribute || BUILD.reflect) {
|
|
1349
|
+
if (BUILD.slot && tag === 'slot')
|
|
962
1350
|
;
|
|
963
1351
|
else {
|
|
964
1352
|
// either this is the first render of an element OR it's an update
|
|
@@ -967,33 +1355,33 @@ const patch = (oldVNode, newVNode) => {
|
|
|
967
1355
|
updateElement(oldVNode, newVNode, isSvgMode);
|
|
968
1356
|
}
|
|
969
1357
|
}
|
|
970
|
-
if (oldChildren !== null && newChildren !== null) {
|
|
1358
|
+
if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
|
|
971
1359
|
// looks like there's child vnodes for both the old and new vnodes
|
|
972
1360
|
// so we need to call `updateChildren` to reconcile them
|
|
973
1361
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
974
1362
|
}
|
|
975
1363
|
else if (newChildren !== null) {
|
|
976
1364
|
// no old child vnodes, but there are new child vnodes to add
|
|
977
|
-
if (oldVNode.$text$ !== null) {
|
|
1365
|
+
if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
|
|
978
1366
|
// the old vnode was text, so be sure to clear it out
|
|
979
1367
|
elm.textContent = '';
|
|
980
1368
|
}
|
|
981
1369
|
// add the new vnode children
|
|
982
1370
|
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
983
1371
|
}
|
|
984
|
-
else if (oldChildren !== null) {
|
|
1372
|
+
else if (BUILD.updatable && oldChildren !== null) {
|
|
985
1373
|
// no new child vnodes, but there are old child vnodes to remove
|
|
986
1374
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
987
1375
|
}
|
|
988
|
-
if (isSvgMode && tag === 'svg') {
|
|
1376
|
+
if (BUILD.svg && isSvgMode && tag === 'svg') {
|
|
989
1377
|
isSvgMode = false;
|
|
990
1378
|
}
|
|
991
1379
|
}
|
|
992
|
-
else if ((defaultHolder = elm['s-cr'])) {
|
|
1380
|
+
else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
|
|
993
1381
|
// this element has slotted content
|
|
994
1382
|
defaultHolder.parentNode.textContent = text;
|
|
995
1383
|
}
|
|
996
|
-
else if (oldVNode.$text$ !== text) {
|
|
1384
|
+
else if (BUILD.vdomText && oldVNode.$text$ !== text) {
|
|
997
1385
|
// update the text content for the text only vnode
|
|
998
1386
|
// and also only if the text is different than before
|
|
999
1387
|
elm.data = text;
|
|
@@ -1131,7 +1519,7 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
|
1131
1519
|
return slotNameAttr === '';
|
|
1132
1520
|
};
|
|
1133
1521
|
const callNodeRefs = (vNode) => {
|
|
1134
|
-
{
|
|
1522
|
+
if (BUILD.vdomRef) {
|
|
1135
1523
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1136
1524
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1137
1525
|
}
|
|
@@ -1142,26 +1530,41 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1142
1530
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1143
1531
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1144
1532
|
hostTagName = hostElm.tagName;
|
|
1145
|
-
|
|
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$) {
|
|
1146
1549
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1147
1550
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1148
1551
|
}
|
|
1149
1552
|
rootVnode.$tag$ = null;
|
|
1150
1553
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1151
1554
|
hostRef.$vnode$ = rootVnode;
|
|
1152
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
1153
|
-
{
|
|
1555
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
|
|
1556
|
+
if (BUILD.scoped || BUILD.shadowDom) {
|
|
1154
1557
|
scopeId = hostElm['s-sc'];
|
|
1155
1558
|
}
|
|
1156
|
-
{
|
|
1559
|
+
if (BUILD.slotRelocation) {
|
|
1157
1560
|
contentRef = hostElm['s-cr'];
|
|
1158
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1561
|
+
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1159
1562
|
// always reset
|
|
1160
1563
|
checkSlotFallbackVisibility = false;
|
|
1161
1564
|
}
|
|
1162
1565
|
// synchronous patch
|
|
1163
1566
|
patch(oldVNode, rootVnode);
|
|
1164
|
-
{
|
|
1567
|
+
if (BUILD.slotRelocation) {
|
|
1165
1568
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1166
1569
|
// the disconnectCallback from working
|
|
1167
1570
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
@@ -1181,7 +1584,9 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1181
1584
|
// add a reference node marking this node's original location
|
|
1182
1585
|
// keep a reference to this node for later lookups
|
|
1183
1586
|
orgLocationNode =
|
|
1184
|
-
|
|
1587
|
+
BUILD.isDebug || BUILD.hydrateServerSide
|
|
1588
|
+
? originalLocationDebugNode(nodeToRelocate)
|
|
1589
|
+
: doc.createTextNode('');
|
|
1185
1590
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1186
1591
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1187
1592
|
}
|
|
@@ -1238,16 +1643,23 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1238
1643
|
relocateNodes.length = 0;
|
|
1239
1644
|
}
|
|
1240
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}]`));
|
|
1241
1653
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1242
|
-
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1654
|
+
if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1243
1655
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
1244
1656
|
}
|
|
1245
1657
|
};
|
|
1246
1658
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1247
|
-
{
|
|
1659
|
+
if (BUILD.taskQueue && BUILD.updatable) {
|
|
1248
1660
|
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1249
1661
|
}
|
|
1250
|
-
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1662
|
+
if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1251
1663
|
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1252
1664
|
return;
|
|
1253
1665
|
}
|
|
@@ -1256,30 +1668,34 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
1256
1668
|
// has already fired off its lifecycle update then
|
|
1257
1669
|
// fire off the initial update
|
|
1258
1670
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1259
|
-
return writeTask(dispatch) ;
|
|
1671
|
+
return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1260
1672
|
};
|
|
1261
1673
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1674
|
+
const elm = hostRef.$hostElement$;
|
|
1262
1675
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1263
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1676
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1264
1677
|
let promise;
|
|
1265
1678
|
if (isInitialLoad) {
|
|
1266
|
-
{
|
|
1679
|
+
if (BUILD.lazyLoad && BUILD.hostListener) {
|
|
1267
1680
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1268
1681
|
if (hostRef.$queuedListeners$) {
|
|
1269
1682
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1270
1683
|
hostRef.$queuedListeners$ = null;
|
|
1271
1684
|
}
|
|
1272
1685
|
}
|
|
1273
|
-
|
|
1686
|
+
emitLifecycleEvent(elm, 'componentWillLoad');
|
|
1687
|
+
if (BUILD.cmpWillLoad) {
|
|
1274
1688
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1275
1689
|
}
|
|
1276
1690
|
}
|
|
1277
1691
|
else {
|
|
1278
|
-
|
|
1692
|
+
emitLifecycleEvent(elm, 'componentWillUpdate');
|
|
1693
|
+
if (BUILD.cmpWillUpdate) {
|
|
1279
1694
|
promise = safeCall(instance, 'componentWillUpdate');
|
|
1280
1695
|
}
|
|
1281
1696
|
}
|
|
1282
|
-
|
|
1697
|
+
emitLifecycleEvent(elm, 'componentWillRender');
|
|
1698
|
+
if (BUILD.cmpWillRender) {
|
|
1283
1699
|
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1284
1700
|
}
|
|
1285
1701
|
endSchedule();
|
|
@@ -1290,15 +1706,46 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1290
1706
|
const elm = hostRef.$hostElement$;
|
|
1291
1707
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1292
1708
|
const rc = elm['s-rc'];
|
|
1293
|
-
if (isInitialLoad) {
|
|
1709
|
+
if (BUILD.style && isInitialLoad) {
|
|
1294
1710
|
// DOM WRITE!
|
|
1295
1711
|
attachStyles(hostRef);
|
|
1296
1712
|
}
|
|
1297
1713
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1298
|
-
{
|
|
1299
|
-
|
|
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);
|
|
1725
|
+
}
|
|
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
|
+
}
|
|
1300
1747
|
}
|
|
1301
|
-
if (rc) {
|
|
1748
|
+
if (BUILD.asyncLoading && rc) {
|
|
1302
1749
|
// ok, so turns out there are some child host elements
|
|
1303
1750
|
// waiting on this parent element to load
|
|
1304
1751
|
// let's fire off all update callbacks waiting
|
|
@@ -1307,7 +1754,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1307
1754
|
}
|
|
1308
1755
|
endRender();
|
|
1309
1756
|
endUpdate();
|
|
1310
|
-
{
|
|
1757
|
+
if (BUILD.asyncLoading) {
|
|
1311
1758
|
const childrenPromises = elm['s-p'];
|
|
1312
1759
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1313
1760
|
if (childrenPromises.length === 0) {
|
|
@@ -1319,70 +1766,117 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1319
1766
|
childrenPromises.length = 0;
|
|
1320
1767
|
}
|
|
1321
1768
|
}
|
|
1769
|
+
else {
|
|
1770
|
+
postUpdateComponent(hostRef);
|
|
1771
|
+
}
|
|
1322
1772
|
};
|
|
1323
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;
|
|
1324
1781
|
try {
|
|
1325
|
-
|
|
1326
|
-
|
|
1782
|
+
renderingRef = instance;
|
|
1783
|
+
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
1784
|
+
if (updatable && taskQueue) {
|
|
1327
1785
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1328
1786
|
}
|
|
1329
|
-
{
|
|
1787
|
+
if (updatable || lazyLoad) {
|
|
1330
1788
|
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1331
1789
|
}
|
|
1332
|
-
{
|
|
1333
|
-
{
|
|
1790
|
+
if (BUILD.hasRenderFn || BUILD.reflect) {
|
|
1791
|
+
if (BUILD.vdomRender || BUILD.reflect) {
|
|
1334
1792
|
// looks like we've got child nodes to render into this host element
|
|
1335
1793
|
// or we need to update the css class/attrs on the host element
|
|
1336
1794
|
// DOM WRITE!
|
|
1337
|
-
{
|
|
1795
|
+
if (BUILD.hydrateServerSide) {
|
|
1796
|
+
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
|
|
1797
|
+
}
|
|
1798
|
+
else {
|
|
1338
1799
|
renderVdom(hostRef, instance);
|
|
1339
1800
|
}
|
|
1340
1801
|
}
|
|
1802
|
+
else {
|
|
1803
|
+
elm.textContent = instance;
|
|
1804
|
+
}
|
|
1341
1805
|
}
|
|
1342
1806
|
}
|
|
1343
1807
|
catch (e) {
|
|
1344
1808
|
consoleError(e, hostRef.$hostElement$);
|
|
1345
1809
|
}
|
|
1810
|
+
renderingRef = null;
|
|
1346
1811
|
return null;
|
|
1347
1812
|
};
|
|
1813
|
+
const getRenderingRef = () => renderingRef;
|
|
1348
1814
|
const postUpdateComponent = (hostRef) => {
|
|
1349
1815
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1350
1816
|
const elm = hostRef.$hostElement$;
|
|
1351
1817
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1352
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1818
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1353
1819
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1354
|
-
{
|
|
1820
|
+
if (BUILD.cmpDidRender) {
|
|
1821
|
+
if (BUILD.isDev) {
|
|
1822
|
+
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
1823
|
+
}
|
|
1355
1824
|
safeCall(instance, 'componentDidRender');
|
|
1825
|
+
if (BUILD.isDev) {
|
|
1826
|
+
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1827
|
+
}
|
|
1356
1828
|
}
|
|
1829
|
+
emitLifecycleEvent(elm, 'componentDidRender');
|
|
1357
1830
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1358
1831
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1359
|
-
{
|
|
1832
|
+
if (BUILD.asyncLoading && BUILD.cssAnnotations) {
|
|
1360
1833
|
// DOM WRITE!
|
|
1361
1834
|
addHydratedFlag(elm);
|
|
1362
1835
|
}
|
|
1363
|
-
{
|
|
1836
|
+
if (BUILD.cmpDidLoad) {
|
|
1837
|
+
if (BUILD.isDev) {
|
|
1838
|
+
hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1839
|
+
}
|
|
1364
1840
|
safeCall(instance, 'componentDidLoad');
|
|
1841
|
+
if (BUILD.isDev) {
|
|
1842
|
+
hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
1843
|
+
}
|
|
1365
1844
|
}
|
|
1845
|
+
emitLifecycleEvent(elm, 'componentDidLoad');
|
|
1366
1846
|
endPostUpdate();
|
|
1367
|
-
{
|
|
1847
|
+
if (BUILD.asyncLoading) {
|
|
1368
1848
|
hostRef.$onReadyResolve$(elm);
|
|
1369
1849
|
if (!ancestorComponent) {
|
|
1370
|
-
appDidLoad();
|
|
1850
|
+
appDidLoad(tagName);
|
|
1371
1851
|
}
|
|
1372
1852
|
}
|
|
1373
1853
|
}
|
|
1374
1854
|
else {
|
|
1375
|
-
{
|
|
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
|
+
}
|
|
1376
1863
|
safeCall(instance, 'componentDidUpdate');
|
|
1864
|
+
if (BUILD.isDev) {
|
|
1865
|
+
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
1866
|
+
}
|
|
1377
1867
|
}
|
|
1868
|
+
emitLifecycleEvent(elm, 'componentDidUpdate');
|
|
1378
1869
|
endPostUpdate();
|
|
1379
1870
|
}
|
|
1380
|
-
{
|
|
1871
|
+
if (BUILD.hotModuleReplacement) {
|
|
1872
|
+
elm['s-hmr-load'] && elm['s-hmr-load']();
|
|
1873
|
+
}
|
|
1874
|
+
if (BUILD.method && BUILD.lazyLoad) {
|
|
1381
1875
|
hostRef.$onInstanceResolve$(elm);
|
|
1382
1876
|
}
|
|
1383
1877
|
// load events fire from bottom to top
|
|
1384
1878
|
// the deepest elements load first then bubbles up
|
|
1385
|
-
{
|
|
1879
|
+
if (BUILD.asyncLoading) {
|
|
1386
1880
|
if (hostRef.$onRenderResolve$) {
|
|
1387
1881
|
hostRef.$onRenderResolve$();
|
|
1388
1882
|
hostRef.$onRenderResolve$ = undefined;
|
|
@@ -1396,13 +1890,32 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1396
1890
|
// ( •_•)>⌐■-■
|
|
1397
1891
|
// (⌐■_■)
|
|
1398
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
|
+
};
|
|
1399
1906
|
const appDidLoad = (who) => {
|
|
1400
1907
|
// on appload
|
|
1401
1908
|
// we have finish the first big initial render
|
|
1402
|
-
{
|
|
1909
|
+
if (BUILD.cssAnnotations) {
|
|
1403
1910
|
addHydratedFlag(doc.documentElement);
|
|
1404
1911
|
}
|
|
1912
|
+
if (BUILD.asyncQueue) {
|
|
1913
|
+
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
1914
|
+
}
|
|
1405
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
|
+
}
|
|
1406
1919
|
};
|
|
1407
1920
|
const safeCall = (instance, method, arg) => {
|
|
1408
1921
|
if (instance && instance[method]) {
|
|
@@ -1418,27 +1931,61 @@ const safeCall = (instance, method, arg) => {
|
|
|
1418
1931
|
const then = (promise, thenFn) => {
|
|
1419
1932
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1420
1933
|
};
|
|
1421
|
-
const
|
|
1422
|
-
|
|
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
|
+
};
|
|
1423
1962
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1424
1963
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1425
1964
|
// check our new property value against our internal value
|
|
1426
1965
|
const hostRef = getHostRef(ref);
|
|
1427
|
-
const elm = hostRef.$hostElement$ ;
|
|
1966
|
+
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
1428
1967
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1429
1968
|
const flags = hostRef.$flags$;
|
|
1430
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1969
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1431
1970
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1432
1971
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1433
1972
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1434
1973
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1435
|
-
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1974
|
+
if ((!BUILD.lazyLoad || !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1436
1975
|
// gadzooks! the property's value has changed!!
|
|
1437
1976
|
// set our new value!
|
|
1438
1977
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1439
|
-
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) {
|
|
1440
1987
|
// get an array of method names of watch functions to call
|
|
1441
|
-
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1988
|
+
if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1442
1989
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1443
1990
|
if (watchMethods) {
|
|
1444
1991
|
// this instance is watching for when this property changed
|
|
@@ -1453,7 +2000,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1453
2000
|
});
|
|
1454
2001
|
}
|
|
1455
2002
|
}
|
|
1456
|
-
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
|
+
}
|
|
1457
2010
|
// looks like this value actually changed, so we've got work to do!
|
|
1458
2011
|
// but only if we've already rendered, otherwise just chill out
|
|
1459
2012
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1474,16 +2027,17 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1474
2027
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1475
2028
|
*/
|
|
1476
2029
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1477
|
-
if (cmpMeta.$members$) {
|
|
1478
|
-
if (Cstr.watchers) {
|
|
2030
|
+
if (BUILD.member && cmpMeta.$members$) {
|
|
2031
|
+
if (BUILD.watchCallback && Cstr.watchers) {
|
|
1479
2032
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1480
2033
|
}
|
|
1481
2034
|
// It's better to have a const than two Object.entries()
|
|
1482
2035
|
const members = Object.entries(cmpMeta.$members$);
|
|
1483
2036
|
const prototype = Cstr.prototype;
|
|
1484
2037
|
members.map(([memberName, [memberFlags]]) => {
|
|
1485
|
-
if ((
|
|
1486
|
-
|
|
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 */))) {
|
|
1487
2041
|
// proxyComponent - prop
|
|
1488
2042
|
Object.defineProperty(prototype, memberName, {
|
|
1489
2043
|
get() {
|
|
@@ -1491,6 +2045,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1491
2045
|
return getValue(this, memberName);
|
|
1492
2046
|
},
|
|
1493
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
|
+
}
|
|
1494
2063
|
// proxyComponent, set value
|
|
1495
2064
|
setValue(this, memberName, newValue, cmpMeta);
|
|
1496
2065
|
},
|
|
@@ -1498,7 +2067,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1498
2067
|
enumerable: true,
|
|
1499
2068
|
});
|
|
1500
2069
|
}
|
|
1501
|
-
else if (
|
|
2070
|
+
else if (BUILD.lazyLoad &&
|
|
2071
|
+
BUILD.method &&
|
|
2072
|
+
flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1502
2073
|
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1503
2074
|
// proxyComponent - method
|
|
1504
2075
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -1509,7 +2080,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1509
2080
|
});
|
|
1510
2081
|
}
|
|
1511
2082
|
});
|
|
1512
|
-
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
2083
|
+
if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1513
2084
|
const attrNameToPropName = new Map();
|
|
1514
2085
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1515
2086
|
plt.jmp(() => {
|
|
@@ -1569,7 +2140,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1569
2140
|
.map(([propName, m]) => {
|
|
1570
2141
|
const attrName = m[1] || propName;
|
|
1571
2142
|
attrNameToPropName.set(attrName, propName);
|
|
1572
|
-
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
2143
|
+
if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1573
2144
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1574
2145
|
}
|
|
1575
2146
|
return attrName;
|
|
@@ -1580,25 +2151,29 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1580
2151
|
};
|
|
1581
2152
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1582
2153
|
// initializeComponent
|
|
1583
|
-
if ((
|
|
1584
|
-
{
|
|
2154
|
+
if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&
|
|
2155
|
+
(hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
2156
|
+
if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
|
|
1585
2157
|
// we haven't initialized this element yet
|
|
1586
2158
|
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1587
2159
|
// lazy loaded components
|
|
1588
2160
|
// request the component's implementation to be
|
|
1589
2161
|
// wired up with the host element
|
|
1590
|
-
Cstr = loadModule(cmpMeta);
|
|
2162
|
+
Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
1591
2163
|
if (Cstr.then) {
|
|
1592
2164
|
// Await creates a micro-task avoid if possible
|
|
1593
|
-
const endLoad = uniqueTime();
|
|
2165
|
+
const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
|
|
1594
2166
|
Cstr = await Cstr;
|
|
1595
2167
|
endLoad();
|
|
1596
2168
|
}
|
|
1597
|
-
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) {
|
|
1598
2173
|
// we've never proxied this Constructor before
|
|
1599
2174
|
// let's add the getters/setters to its prototype before
|
|
1600
2175
|
// the first time we create an instance of the implementation
|
|
1601
|
-
{
|
|
2176
|
+
if (BUILD.watchCallback) {
|
|
1602
2177
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1603
2178
|
}
|
|
1604
2179
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
@@ -1608,7 +2183,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1608
2183
|
// ok, time to construct the instance
|
|
1609
2184
|
// but let's keep track of when we start and stop
|
|
1610
2185
|
// so that the getters/setters don't incorrectly step on data
|
|
1611
|
-
{
|
|
2186
|
+
if (BUILD.member) {
|
|
1612
2187
|
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1613
2188
|
}
|
|
1614
2189
|
// construct the lazy-loaded component implementation
|
|
@@ -1621,20 +2196,42 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1621
2196
|
catch (e) {
|
|
1622
2197
|
consoleError(e);
|
|
1623
2198
|
}
|
|
1624
|
-
{
|
|
2199
|
+
if (BUILD.member) {
|
|
1625
2200
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1626
2201
|
}
|
|
1627
|
-
{
|
|
2202
|
+
if (BUILD.watchCallback) {
|
|
1628
2203
|
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1629
2204
|
}
|
|
1630
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 */));
|
|
1631
2216
|
}
|
|
1632
|
-
if (Cstr.style) {
|
|
2217
|
+
if (BUILD.style && Cstr.style) {
|
|
1633
2218
|
// this component has styles but we haven't registered them yet
|
|
1634
2219
|
let style = Cstr.style;
|
|
1635
|
-
|
|
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$);
|
|
1636
2227
|
if (!styles.has(scopeId)) {
|
|
1637
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
|
+
}
|
|
1638
2235
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1639
2236
|
endRegisterStyles();
|
|
1640
2237
|
}
|
|
@@ -1643,7 +2240,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1643
2240
|
// we've successfully created a lazy instance
|
|
1644
2241
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1645
2242
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1646
|
-
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
2243
|
+
if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
|
|
1647
2244
|
// this is the initial load and this component it has an ancestor component
|
|
1648
2245
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1649
2246
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
@@ -1656,31 +2253,59 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1656
2253
|
schedule();
|
|
1657
2254
|
}
|
|
1658
2255
|
};
|
|
2256
|
+
const fireConnectedCallback = (instance) => {
|
|
2257
|
+
if (BUILD.lazyLoad && BUILD.connectedCallback) {
|
|
2258
|
+
safeCall(instance, 'connectedCallback');
|
|
2259
|
+
}
|
|
2260
|
+
};
|
|
1659
2261
|
const connectedCallback = (elm) => {
|
|
1660
2262
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1661
2263
|
const hostRef = getHostRef(elm);
|
|
1662
2264
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1663
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
|
+
}
|
|
1664
2270
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1665
2271
|
// first time this component has connected
|
|
1666
2272
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1667
|
-
|
|
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) {
|
|
1668
2287
|
// initUpdate
|
|
1669
2288
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1670
2289
|
// in here to act as original content anchors as we move nodes around
|
|
1671
2290
|
// host element has been connected to the DOM
|
|
1672
|
-
if (
|
|
2291
|
+
if (BUILD.hydrateServerSide ||
|
|
2292
|
+
((BUILD.slot || BUILD.shadowDom) &&
|
|
2293
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1673
2294
|
setContentReference(elm);
|
|
1674
2295
|
}
|
|
1675
2296
|
}
|
|
1676
|
-
{
|
|
2297
|
+
if (BUILD.asyncLoading) {
|
|
1677
2298
|
// find the first ancestor component (if there is one) and register
|
|
1678
2299
|
// this component as one of the actively loading child components for its ancestor
|
|
1679
2300
|
let ancestorComponent = elm;
|
|
1680
2301
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
1681
2302
|
// climb up the ancestors looking for the first
|
|
1682
2303
|
// component that hasn't finished its lifecycle update yet
|
|
1683
|
-
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']) {
|
|
1684
2309
|
// we found this components first ancestor component
|
|
1685
2310
|
// keep a reference to this component's ancestor component
|
|
1686
2311
|
attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
|
|
@@ -1690,7 +2315,7 @@ const connectedCallback = (elm) => {
|
|
|
1690
2315
|
}
|
|
1691
2316
|
// Lazy properties
|
|
1692
2317
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1693
|
-
if (cmpMeta.$members$) {
|
|
2318
|
+
if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
1694
2319
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1695
2320
|
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1696
2321
|
const value = elm[memberName];
|
|
@@ -1699,7 +2324,14 @@ const connectedCallback = (elm) => {
|
|
|
1699
2324
|
}
|
|
1700
2325
|
});
|
|
1701
2326
|
}
|
|
1702
|
-
{
|
|
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 {
|
|
1703
2335
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1704
2336
|
}
|
|
1705
2337
|
}
|
|
@@ -1707,7 +2339,9 @@ const connectedCallback = (elm) => {
|
|
|
1707
2339
|
// not the first time this has connected
|
|
1708
2340
|
// reattach any event listeners to the host
|
|
1709
2341
|
// since they would have been removed when disconnected
|
|
1710
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
2342
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
2343
|
+
// fire off connectedCallback() on component instance
|
|
2344
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1711
2345
|
}
|
|
1712
2346
|
endConnected();
|
|
1713
2347
|
}
|
|
@@ -1719,27 +2353,316 @@ const setContentReference = (elm) => {
|
|
|
1719
2353
|
// let's pick out the inner content for slot projection
|
|
1720
2354
|
// create a node to represent where the original
|
|
1721
2355
|
// content was first placed, which is useful later on
|
|
1722
|
-
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
2356
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
|
|
1723
2357
|
contentRefElm['s-cn'] = true;
|
|
1724
2358
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1725
2359
|
};
|
|
1726
2360
|
const disconnectedCallback = (elm) => {
|
|
1727
2361
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1728
2362
|
const hostRef = getHostRef(elm);
|
|
1729
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1730
|
-
{
|
|
2363
|
+
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2364
|
+
if (BUILD.hostListener) {
|
|
1731
2365
|
if (hostRef.$rmListeners$) {
|
|
1732
2366
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1733
2367
|
hostRef.$rmListeners$ = undefined;
|
|
1734
2368
|
}
|
|
1735
2369
|
}
|
|
1736
|
-
|
|
2370
|
+
// clear CSS var-shim tracking
|
|
2371
|
+
if (BUILD.cssVarShim && plt.$cssShim$) {
|
|
2372
|
+
plt.$cssShim$.removeHost(elm);
|
|
2373
|
+
}
|
|
2374
|
+
if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
|
|
1737
2375
|
safeCall(instance, 'disconnectedCallback');
|
|
1738
2376
|
}
|
|
2377
|
+
if (BUILD.cmpDidUnload) {
|
|
2378
|
+
safeCall(instance, 'componentDidUnload');
|
|
2379
|
+
}
|
|
1739
2380
|
}
|
|
1740
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
|
+
};
|
|
1741
2660
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1742
|
-
|
|
2661
|
+
if (BUILD.profile && performance.mark) {
|
|
2662
|
+
performance.mark('st:app:start');
|
|
2663
|
+
}
|
|
2664
|
+
installDevTools();
|
|
2665
|
+
const endBootstrap = createTime('bootstrapLazy');
|
|
1743
2666
|
const cmpTags = [];
|
|
1744
2667
|
const exclude = options.exclude || [];
|
|
1745
2668
|
const customElements = win.customElements;
|
|
@@ -1747,10 +2670,27 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1747
2670
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1748
2671
|
const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
|
1749
2672
|
const deferredConnectedCallbacks = [];
|
|
2673
|
+
const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1750
2674
|
let appLoadFallback;
|
|
1751
2675
|
let isBootstrapping = true;
|
|
2676
|
+
let i = 0;
|
|
1752
2677
|
Object.assign(plt, options);
|
|
1753
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
|
+
}
|
|
1754
2694
|
lazyBundles.map((lazyBundle) => {
|
|
1755
2695
|
lazyBundle[1].map((compactMeta) => {
|
|
1756
2696
|
const cmpMeta = {
|
|
@@ -1759,19 +2699,24 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1759
2699
|
$members$: compactMeta[2],
|
|
1760
2700
|
$listeners$: compactMeta[3],
|
|
1761
2701
|
};
|
|
1762
|
-
{
|
|
2702
|
+
if (BUILD.member) {
|
|
1763
2703
|
cmpMeta.$members$ = compactMeta[2];
|
|
1764
2704
|
}
|
|
1765
|
-
{
|
|
2705
|
+
if (BUILD.hostListener) {
|
|
1766
2706
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1767
2707
|
}
|
|
1768
|
-
{
|
|
2708
|
+
if (BUILD.reflect) {
|
|
1769
2709
|
cmpMeta.$attrsToReflect$ = [];
|
|
1770
2710
|
}
|
|
1771
|
-
{
|
|
2711
|
+
if (BUILD.watchCallback) {
|
|
1772
2712
|
cmpMeta.$watchers$ = {};
|
|
1773
2713
|
}
|
|
1774
|
-
|
|
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$;
|
|
1775
2720
|
const HostElement = class extends HTMLElement {
|
|
1776
2721
|
// StencilLazyHost
|
|
1777
2722
|
constructor(self) {
|
|
@@ -1779,16 +2724,28 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1779
2724
|
super(self);
|
|
1780
2725
|
self = this;
|
|
1781
2726
|
registerHost(self, cmpMeta);
|
|
1782
|
-
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2727
|
+
if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1783
2728
|
// this component is using shadow dom
|
|
1784
2729
|
// and this browser supports shadow dom
|
|
1785
2730
|
// add the read-only property "shadowRoot" to the host element
|
|
1786
2731
|
// adding the shadow root build conditionals to minimize runtime
|
|
1787
|
-
{
|
|
1788
|
-
{
|
|
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 {
|
|
1789
2740
|
self.attachShadow({ mode: 'open' });
|
|
1790
2741
|
}
|
|
1791
2742
|
}
|
|
2743
|
+
else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
|
|
2744
|
+
self.shadowRoot = self;
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
if (BUILD.slotChildNodesFix) {
|
|
2748
|
+
patchChildSlotNodes(self, cmpMeta);
|
|
1792
2749
|
}
|
|
1793
2750
|
}
|
|
1794
2751
|
connectedCallback() {
|
|
@@ -1811,6 +2768,20 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1811
2768
|
return getHostRef(this).$onReadyPromise$;
|
|
1812
2769
|
}
|
|
1813
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
|
+
}
|
|
1814
2785
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1815
2786
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1816
2787
|
cmpTags.push(tagName);
|
|
@@ -1818,7 +2789,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1818
2789
|
}
|
|
1819
2790
|
});
|
|
1820
2791
|
});
|
|
1821
|
-
{
|
|
2792
|
+
if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
|
|
1822
2793
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1823
2794
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1824
2795
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
@@ -1829,17 +2800,89 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1829
2800
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
1830
2801
|
}
|
|
1831
2802
|
else {
|
|
1832
|
-
{
|
|
2803
|
+
if (BUILD.profile) {
|
|
2804
|
+
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
|
|
2805
|
+
}
|
|
2806
|
+
else {
|
|
1833
2807
|
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
|
|
1834
2808
|
}
|
|
1835
2809
|
}
|
|
1836
2810
|
// Fallback appLoad event
|
|
1837
2811
|
endBootstrap();
|
|
1838
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;
|
|
1839
2863
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1840
|
-
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
|
+
}
|
|
1841
2884
|
listeners.map(([flags, name, method]) => {
|
|
1842
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2885
|
+
const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
1843
2886
|
const handler = hostListenerProxy(hostRef, method);
|
|
1844
2887
|
const opts = hostListenerOpts(flags);
|
|
1845
2888
|
plt.ael(target, name, handler, opts);
|
|
@@ -1849,7 +2892,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
|
|
|
1849
2892
|
};
|
|
1850
2893
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1851
2894
|
try {
|
|
1852
|
-
{
|
|
2895
|
+
if (BUILD.lazyLoad) {
|
|
1853
2896
|
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1854
2897
|
// instance is ready, let's call it's member method for this event
|
|
1855
2898
|
hostRef.$lazyInstance$[methodName](ev);
|
|
@@ -1858,22 +2901,172 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1858
2901
|
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1859
2902
|
}
|
|
1860
2903
|
}
|
|
2904
|
+
else {
|
|
2905
|
+
hostRef.$hostElement$[methodName](ev);
|
|
2906
|
+
}
|
|
1861
2907
|
}
|
|
1862
2908
|
catch (e) {
|
|
1863
2909
|
consoleError(e);
|
|
1864
2910
|
}
|
|
1865
2911
|
};
|
|
1866
2912
|
const getHostListenerTarget = (elm, flags) => {
|
|
1867
|
-
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
2913
|
+
if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1868
2914
|
return doc;
|
|
1869
|
-
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
2915
|
+
if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1870
2916
|
return win;
|
|
1871
|
-
if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
2917
|
+
if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
1872
2918
|
return doc.body;
|
|
2919
|
+
if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
|
|
2920
|
+
return elm.parentElement;
|
|
1873
2921
|
return elm;
|
|
1874
2922
|
};
|
|
1875
2923
|
// prettier-ignore
|
|
1876
|
-
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
|
+
};
|
|
1877
3070
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1878
3071
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1879
3072
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1884,361 +3077,65 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1884
3077
|
$cmpMeta$: cmpMeta,
|
|
1885
3078
|
$instanceValues$: new Map(),
|
|
1886
3079
|
};
|
|
1887
|
-
{
|
|
3080
|
+
if (BUILD.isDev) {
|
|
3081
|
+
hostRef.$renderCount$ = 0;
|
|
3082
|
+
}
|
|
3083
|
+
if (BUILD.method && BUILD.lazyLoad) {
|
|
1888
3084
|
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
1889
3085
|
}
|
|
1890
|
-
{
|
|
3086
|
+
if (BUILD.asyncLoading) {
|
|
1891
3087
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1892
3088
|
elm['s-p'] = [];
|
|
1893
3089
|
elm['s-rc'] = [];
|
|
1894
3090
|
}
|
|
1895
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
3091
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
1896
3092
|
return hostRefs.set(elm, hostRef);
|
|
1897
3093
|
};
|
|
1898
3094
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1899
|
-
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);
|
|
1900
3106
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
1901
3107
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
1902
3108
|
// loadModuleImport
|
|
1903
3109
|
const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
1904
3110
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1905
|
-
|
|
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;
|
|
1906
3116
|
if (module) {
|
|
1907
3117
|
return module[exportName];
|
|
1908
3118
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
const processMod = importedModule => {
|
|
1912
|
-
cmpModules.set(bundleId, importedModule);
|
|
1913
|
-
return importedModule[exportName];
|
|
1914
|
-
}
|
|
1915
|
-
switch(bundleId) {
|
|
1916
|
-
|
|
1917
|
-
case 'z-app-header_2.cjs':
|
|
1918
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1919
|
-
/* webpackMode: "lazy" */
|
|
1920
|
-
'./z-app-header_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1921
|
-
case 'z-anchor-navigation.cjs':
|
|
1922
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1923
|
-
/* webpackMode: "lazy" */
|
|
1924
|
-
'./z-anchor-navigation.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1925
|
-
case 'z-app-switcher.cjs':
|
|
1926
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1927
|
-
/* webpackMode: "lazy" */
|
|
1928
|
-
'./z-app-switcher.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1929
|
-
case 'z-aria-alert.cjs':
|
|
1930
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1931
|
-
/* webpackMode: "lazy" */
|
|
1932
|
-
'./z-aria-alert.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1933
|
-
case 'z-avatar.cjs':
|
|
1934
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1935
|
-
/* webpackMode: "lazy" */
|
|
1936
|
-
'./z-avatar.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1937
|
-
case 'z-button-sort.cjs':
|
|
1938
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1939
|
-
/* webpackMode: "lazy" */
|
|
1940
|
-
'./z-button-sort.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1941
|
-
case 'z-card.cjs':
|
|
1942
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1943
|
-
/* webpackMode: "lazy" */
|
|
1944
|
-
'./z-card.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1945
|
-
case 'z-carousel.cjs':
|
|
1946
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1947
|
-
/* webpackMode: "lazy" */
|
|
1948
|
-
'./z-carousel.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1949
|
-
case 'z-combobox.cjs':
|
|
1950
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1951
|
-
/* webpackMode: "lazy" */
|
|
1952
|
-
'./z-combobox.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1953
|
-
case 'z-contextual-menu.cjs':
|
|
1954
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1955
|
-
/* webpackMode: "lazy" */
|
|
1956
|
-
'./z-contextual-menu.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1957
|
-
case 'z-cover-hero.cjs':
|
|
1958
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1959
|
-
/* webpackMode: "lazy" */
|
|
1960
|
-
'./z-cover-hero.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1961
|
-
case 'z-date-picker.cjs':
|
|
1962
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1963
|
-
/* webpackMode: "lazy" */
|
|
1964
|
-
'./z-date-picker.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1965
|
-
case 'z-file.cjs':
|
|
1966
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1967
|
-
/* webpackMode: "lazy" */
|
|
1968
|
-
'./z-file.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1969
|
-
case 'z-file-upload.cjs':
|
|
1970
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1971
|
-
/* webpackMode: "lazy" */
|
|
1972
|
-
'./z-file-upload.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1973
|
-
case 'z-info-box.cjs':
|
|
1974
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1975
|
-
/* webpackMode: "lazy" */
|
|
1976
|
-
'./z-info-box.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1977
|
-
case 'z-info-reveal.cjs':
|
|
1978
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1979
|
-
/* webpackMode: "lazy" */
|
|
1980
|
-
'./z-info-reveal.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1981
|
-
case 'z-logo.cjs':
|
|
1982
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1983
|
-
/* webpackMode: "lazy" */
|
|
1984
|
-
'./z-logo.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1985
|
-
case 'z-menu.cjs':
|
|
1986
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1987
|
-
/* webpackMode: "lazy" */
|
|
1988
|
-
'./z-menu.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1989
|
-
case 'z-menu-section.cjs':
|
|
1990
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1991
|
-
/* webpackMode: "lazy" */
|
|
1992
|
-
'./z-menu-section.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1993
|
-
case 'z-messages-pocket.cjs':
|
|
1994
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1995
|
-
/* webpackMode: "lazy" */
|
|
1996
|
-
'./z-messages-pocket.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1997
|
-
case 'z-myz-card-alert.cjs':
|
|
1998
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1999
|
-
/* webpackMode: "lazy" */
|
|
2000
|
-
'./z-myz-card-alert.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2001
|
-
case 'z-myz-card-dictionary.cjs':
|
|
2002
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2003
|
-
/* webpackMode: "lazy" */
|
|
2004
|
-
'./z-myz-card-dictionary.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2005
|
-
case 'z-myz-card-footer.cjs':
|
|
2006
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2007
|
-
/* webpackMode: "lazy" */
|
|
2008
|
-
'./z-myz-card-footer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2009
|
-
case 'z-myz-card-footer-sections.cjs':
|
|
2010
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2011
|
-
/* webpackMode: "lazy" */
|
|
2012
|
-
'./z-myz-card-footer-sections.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2013
|
-
case 'z-myz-card-icon.cjs':
|
|
2014
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2015
|
-
/* webpackMode: "lazy" */
|
|
2016
|
-
'./z-myz-card-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2017
|
-
case 'z-myz-card-info.cjs':
|
|
2018
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2019
|
-
/* webpackMode: "lazy" */
|
|
2020
|
-
'./z-myz-card-info.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2021
|
-
case 'z-myz-card-list.cjs':
|
|
2022
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2023
|
-
/* webpackMode: "lazy" */
|
|
2024
|
-
'./z-myz-card-list.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2025
|
-
case 'z-myz-list.cjs':
|
|
2026
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2027
|
-
/* webpackMode: "lazy" */
|
|
2028
|
-
'./z-myz-list.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2029
|
-
case 'z-navigation-tab.cjs':
|
|
2030
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2031
|
-
/* webpackMode: "lazy" */
|
|
2032
|
-
'./z-navigation-tab.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2033
|
-
case 'z-navigation-tab-link.cjs':
|
|
2034
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2035
|
-
/* webpackMode: "lazy" */
|
|
2036
|
-
'./z-navigation-tab-link.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2037
|
-
case 'z-navigation-tabs.cjs':
|
|
2038
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2039
|
-
/* webpackMode: "lazy" */
|
|
2040
|
-
'./z-navigation-tabs.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2041
|
-
case 'z-notification.cjs':
|
|
2042
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2043
|
-
/* webpackMode: "lazy" */
|
|
2044
|
-
'./z-notification.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2045
|
-
case 'z-offcanvas.cjs':
|
|
2046
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2047
|
-
/* webpackMode: "lazy" */
|
|
2048
|
-
'./z-offcanvas.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2049
|
-
case 'z-otp.cjs':
|
|
2050
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2051
|
-
/* webpackMode: "lazy" */
|
|
2052
|
-
'./z-otp.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2053
|
-
case 'z-pagination.cjs':
|
|
2054
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2055
|
-
/* webpackMode: "lazy" */
|
|
2056
|
-
'./z-pagination.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2057
|
-
case 'z-panel-elem.cjs':
|
|
2058
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2059
|
-
/* webpackMode: "lazy" */
|
|
2060
|
-
'./z-panel-elem.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2061
|
-
case 'z-pocket-message.cjs':
|
|
2062
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2063
|
-
/* webpackMode: "lazy" */
|
|
2064
|
-
'./z-pocket-message.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2065
|
-
case 'z-range-picker.cjs':
|
|
2066
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2067
|
-
/* webpackMode: "lazy" */
|
|
2068
|
-
'./z-range-picker.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2069
|
-
case 'z-searchbar.cjs':
|
|
2070
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2071
|
-
/* webpackMode: "lazy" */
|
|
2072
|
-
'./z-searchbar.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2073
|
-
case 'z-section-title.cjs':
|
|
2074
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2075
|
-
/* webpackMode: "lazy" */
|
|
2076
|
-
'./z-section-title.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2077
|
-
case 'z-select.cjs':
|
|
2078
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2079
|
-
/* webpackMode: "lazy" */
|
|
2080
|
-
'./z-select.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2081
|
-
case 'z-skip-to-content.cjs':
|
|
2082
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2083
|
-
/* webpackMode: "lazy" */
|
|
2084
|
-
'./z-skip-to-content.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2085
|
-
case 'z-slideshow.cjs':
|
|
2086
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2087
|
-
/* webpackMode: "lazy" */
|
|
2088
|
-
'./z-slideshow.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2089
|
-
case 'z-stepper.cjs':
|
|
2090
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2091
|
-
/* webpackMode: "lazy" */
|
|
2092
|
-
'./z-stepper.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2093
|
-
case 'z-stepper-item.cjs':
|
|
2094
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2095
|
-
/* webpackMode: "lazy" */
|
|
2096
|
-
'./z-stepper-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2097
|
-
case 'z-table.cjs':
|
|
2098
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2099
|
-
/* webpackMode: "lazy" */
|
|
2100
|
-
'./z-table.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2101
|
-
case 'z-table-body.cjs':
|
|
2102
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2103
|
-
/* webpackMode: "lazy" */
|
|
2104
|
-
'./z-table-body.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2105
|
-
case 'z-table-expanded-row.cjs':
|
|
2106
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2107
|
-
/* webpackMode: "lazy" */
|
|
2108
|
-
'./z-table-expanded-row.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2109
|
-
case 'z-table-footer.cjs':
|
|
2110
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2111
|
-
/* webpackMode: "lazy" */
|
|
2112
|
-
'./z-table-footer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2113
|
-
case 'z-table-head.cjs':
|
|
2114
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2115
|
-
/* webpackMode: "lazy" */
|
|
2116
|
-
'./z-table-head.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2117
|
-
case 'z-table-header-row.cjs':
|
|
2118
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2119
|
-
/* webpackMode: "lazy" */
|
|
2120
|
-
'./z-table-header-row.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2121
|
-
case 'z-table-row.cjs':
|
|
2122
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2123
|
-
/* webpackMode: "lazy" */
|
|
2124
|
-
'./z-table-row.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2125
|
-
case 'z-table-sticky-footer.cjs':
|
|
2126
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2127
|
-
/* webpackMode: "lazy" */
|
|
2128
|
-
'./z-table-sticky-footer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2129
|
-
case 'z-tag.cjs':
|
|
2130
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2131
|
-
/* webpackMode: "lazy" */
|
|
2132
|
-
'./z-tag.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2133
|
-
case 'z-toast-notification.cjs':
|
|
2134
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2135
|
-
/* webpackMode: "lazy" */
|
|
2136
|
-
'./z-toast-notification.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2137
|
-
case 'z-toast-notification-list.cjs':
|
|
2138
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2139
|
-
/* webpackMode: "lazy" */
|
|
2140
|
-
'./z-toast-notification-list.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2141
|
-
case 'z-toggle-button.cjs':
|
|
2142
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2143
|
-
/* webpackMode: "lazy" */
|
|
2144
|
-
'./z-toggle-button.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2145
|
-
case 'z-toggle-switch.cjs':
|
|
2146
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2147
|
-
/* webpackMode: "lazy" */
|
|
2148
|
-
'./z-toggle-switch.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2149
|
-
case 'z-tooltip.cjs':
|
|
2150
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2151
|
-
/* webpackMode: "lazy" */
|
|
2152
|
-
'./z-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2153
|
-
case 'z-visually-hidden.cjs':
|
|
2154
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2155
|
-
/* webpackMode: "lazy" */
|
|
2156
|
-
'./z-visually-hidden.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2157
|
-
case 'z-alert.cjs':
|
|
2158
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2159
|
-
/* webpackMode: "lazy" */
|
|
2160
|
-
'./z-alert.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2161
|
-
case 'z-chip.cjs':
|
|
2162
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2163
|
-
/* webpackMode: "lazy" */
|
|
2164
|
-
'./z-chip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2165
|
-
case 'z-dragdrop-area_3.cjs':
|
|
2166
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2167
|
-
/* webpackMode: "lazy" */
|
|
2168
|
-
'./z-dragdrop-area_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2169
|
-
case 'z-ghost-loading.cjs':
|
|
2170
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2171
|
-
/* webpackMode: "lazy" */
|
|
2172
|
-
'./z-ghost-loading.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2173
|
-
case 'z-myz-card_4.cjs':
|
|
2174
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2175
|
-
/* webpackMode: "lazy" */
|
|
2176
|
-
'./z-myz-card_4.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2177
|
-
case 'z-pocket_3.cjs':
|
|
2178
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2179
|
-
/* webpackMode: "lazy" */
|
|
2180
|
-
'./z-pocket_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2181
|
-
case 'z-table-cell.cjs':
|
|
2182
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2183
|
-
/* webpackMode: "lazy" */
|
|
2184
|
-
'./z-table-cell.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2185
|
-
case 'z-table-empty-box.cjs':
|
|
2186
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2187
|
-
/* webpackMode: "lazy" */
|
|
2188
|
-
'./z-table-empty-box.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2189
|
-
case 'z-table-header.cjs':
|
|
2190
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2191
|
-
/* webpackMode: "lazy" */
|
|
2192
|
-
'./z-table-header.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2193
|
-
case 'z-myz-list-item.cjs':
|
|
2194
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2195
|
-
/* webpackMode: "lazy" */
|
|
2196
|
-
'./z-myz-list-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2197
|
-
case 'z-link.cjs':
|
|
2198
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2199
|
-
/* webpackMode: "lazy" */
|
|
2200
|
-
'./z-link.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2201
|
-
case 'z-list_3.cjs':
|
|
2202
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2203
|
-
/* webpackMode: "lazy" */
|
|
2204
|
-
'./z-list_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2205
|
-
case 'z-body_2.cjs':
|
|
2206
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2207
|
-
/* webpackMode: "lazy" */
|
|
2208
|
-
'./z-body_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2209
|
-
case 'z-input_2.cjs':
|
|
2210
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2211
|
-
/* webpackMode: "lazy" */
|
|
2212
|
-
'./z-input_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2213
|
-
case 'z-popover.cjs':
|
|
2214
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2215
|
-
/* webpackMode: "lazy" */
|
|
2216
|
-
'./z-popover.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2217
|
-
case 'z-divider.cjs':
|
|
2218
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2219
|
-
/* webpackMode: "lazy" */
|
|
2220
|
-
'./z-divider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2221
|
-
case 'z-button.cjs':
|
|
2222
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2223
|
-
/* webpackMode: "lazy" */
|
|
2224
|
-
'./z-button.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
3119
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
3120
|
+
return import(
|
|
2228
3121
|
/* @vite-ignore */
|
|
2229
3122
|
/* webpackInclude: /\.entry\.js$/ */
|
|
2230
3123
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2231
3124
|
/* webpackMode: "lazy" */
|
|
2232
|
-
`./${bundleId}.entry.js${''}`)
|
|
2233
|
-
{
|
|
3125
|
+
`./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
|
|
3126
|
+
if (!BUILD.hotModuleReplacement) {
|
|
2234
3127
|
cmpModules.set(bundleId, importedModule);
|
|
2235
3128
|
}
|
|
2236
3129
|
return importedModule[exportName];
|
|
2237
3130
|
}, consoleError);
|
|
2238
3131
|
};
|
|
2239
3132
|
const styles = /*@__PURE__*/ new Map();
|
|
3133
|
+
const modeResolutionChain = [];
|
|
2240
3134
|
const win = typeof window !== 'undefined' ? window : {};
|
|
3135
|
+
const CSS = BUILD.cssVarShim ? win.CSS : null;
|
|
2241
3136
|
const doc = win.document || { head: {} };
|
|
3137
|
+
const H = (win.HTMLElement || class {
|
|
3138
|
+
});
|
|
2242
3139
|
const plt = {
|
|
2243
3140
|
$flags$: 0,
|
|
2244
3141
|
$resourcesUrl$: '',
|
|
@@ -2248,8 +3145,27 @@ const plt = {
|
|
|
2248
3145
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2249
3146
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2250
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
|
+
})();
|
|
2251
3166
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
2252
|
-
const supportsConstructableStylesheets =
|
|
3167
|
+
const supportsConstructableStylesheets = BUILD.constructableCSS
|
|
3168
|
+
? /*@__PURE__*/ (() => {
|
|
2253
3169
|
try {
|
|
2254
3170
|
new CSSStyleSheet();
|
|
2255
3171
|
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
@@ -2257,9 +3173,10 @@ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
|
2257
3173
|
catch (e) { }
|
|
2258
3174
|
return false;
|
|
2259
3175
|
})()
|
|
2260
|
-
;
|
|
3176
|
+
: false;
|
|
2261
3177
|
const queueDomReads = [];
|
|
2262
3178
|
const queueDomWrites = [];
|
|
3179
|
+
const queueDomWritesLow = [];
|
|
2263
3180
|
const queueTask = (queue, write) => (cb) => {
|
|
2264
3181
|
queue.push(cb);
|
|
2265
3182
|
if (!queuePending) {
|
|
@@ -2283,13 +3200,53 @@ const consume = (queue) => {
|
|
|
2283
3200
|
}
|
|
2284
3201
|
queue.length = 0;
|
|
2285
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
|
+
};
|
|
2286
3221
|
const flush = () => {
|
|
3222
|
+
if (BUILD.asyncQueue) {
|
|
3223
|
+
queueCongestion++;
|
|
3224
|
+
}
|
|
2287
3225
|
// always force a bunch of medium callbacks to run, but still have
|
|
2288
3226
|
// a throttle on how many can run in a certain time
|
|
2289
3227
|
// DOM READS!!!
|
|
2290
3228
|
consume(queueDomReads);
|
|
2291
3229
|
// DOM WRITES!!!
|
|
2292
|
-
{
|
|
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 {
|
|
2293
3250
|
consume(queueDomWrites);
|
|
2294
3251
|
if ((queuePending = queueDomReads.length > 0)) {
|
|
2295
3252
|
// still more to do yet, but we've run out of time
|
|
@@ -2299,12 +3256,7 @@ const flush = () => {
|
|
|
2299
3256
|
}
|
|
2300
3257
|
};
|
|
2301
3258
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
3259
|
+
const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
|
|
2302
3260
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2303
3261
|
|
|
2304
|
-
|
|
2305
|
-
exports.bootstrapLazy = bootstrapLazy;
|
|
2306
|
-
exports.createEvent = createEvent;
|
|
2307
|
-
exports.getElement = getElement;
|
|
2308
|
-
exports.h = h;
|
|
2309
|
-
exports.promiseResolve = promiseResolve;
|
|
2310
|
-
exports.registerInstance = registerInstance;
|
|
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 };
|