@paperless/core 0.1.0-alpha.3 → 0.1.0-alpha.300
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 +3061 -0
- package/README.md +27 -2
- package/dist/assets/i18n/page-size-select.i18n.en.json +4 -0
- package/dist/assets/i18n/page-size-select.i18n.nl.json +4 -0
- package/dist/assets/i18n/table-footer.i18n.en.json +3 -0
- package/dist/assets/i18n/table-footer.i18n.nl.json +3 -0
- package/dist/assets/i18n/table-header.i18n.en.json +6 -0
- package/dist/assets/i18n/table-header.i18n.nl.json +6 -0
- package/dist/assets/i18n/table.i18n.en.json +13 -0
- package/dist/assets/i18n/table.i18n.nl.json +13 -0
- package/dist/assets/icons/camera.svg +10 -0
- package/dist/assets/icons/checklist.svg +17 -0
- package/dist/assets/icons/filter.svg +6 -13
- package/dist/assets/icons/folder.svg +19 -0
- package/dist/assets/icons/integration.svg +17 -0
- package/dist/assets/icons/menu.svg +25 -0
- package/dist/assets/icons/more.svg +18 -0
- package/dist/assets/icons/reload.svg +10 -0
- package/dist/assets/icons/signout.svg +23 -0
- package/dist/assets/icons/switch.svg +20 -0
- package/dist/assets/icons/task.svg +17 -0
- package/dist/assets/icons/template.svg +17 -0
- package/dist/assets/illustrations/e-mail.svg +1 -0
- package/dist/assets/illustrations/empty-state-overview.svg +65 -0
- package/dist/assets/illustrations/empty-state-search.svg +88 -0
- package/dist/assets/images/avatar/company-default.svg +12 -0
- package/dist/assets/images/avatar/user-default.svg +12 -0
- package/dist/assets/images/helper/helper-hover.svg +15 -0
- package/dist/assets/images/helper/helper.svg +15 -0
- package/dist/build/index.esm.js +1 -0
- package/dist/build/p-0688d548.entry.js +1 -0
- package/dist/build/p-07f28695.entry.js +1 -0
- package/dist/build/p-09ea2a1a.js +1 -0
- package/dist/build/p-12f5c483.entry.js +1 -0
- package/dist/build/p-1a4dea17.entry.js +1 -0
- package/dist/build/p-2df7dcab.entry.js +1 -0
- package/dist/build/p-2e47afc7.entry.js +1 -0
- package/dist/build/p-3946e0a3.entry.js +1 -0
- package/dist/build/p-4e650fe4.js +1 -0
- package/dist/build/p-529ccaf7.entry.js +1 -0
- package/dist/build/p-603f7eeb.entry.js +1 -0
- package/dist/build/p-62d49606.entry.js +1 -0
- package/dist/build/p-66ca8871.entry.js +1 -0
- package/dist/build/p-681ed79b.entry.js +1 -0
- package/dist/build/p-6c60fd3d.js +1 -0
- package/dist/build/p-6cc16633.entry.js +1 -0
- package/dist/build/p-7df6230f.entry.js +1 -0
- package/dist/build/p-855a9700.entry.js +1 -0
- package/dist/build/p-86db301b.entry.js +1 -0
- package/dist/build/p-8a6728d5.js +1 -0
- package/dist/build/p-9001f4e3.entry.js +1 -0
- package/dist/build/p-91d032b2.entry.js +1 -0
- package/dist/build/p-9315c1e2.entry.js +1 -0
- package/dist/build/p-98e3dcd7.entry.js +1 -0
- package/dist/build/p-ac5a17c4.entry.js +1 -0
- package/dist/build/p-b4af4b21.entry.js +1 -0
- package/dist/build/p-b6cad89e.entry.js +1 -0
- package/dist/build/p-b72559e4.entry.js +1 -0
- package/dist/build/p-b8a237be.entry.js +1 -0
- package/dist/build/p-b8dd503c.entry.js +1 -0
- package/dist/build/p-c1f6925e.entry.js +1 -0
- package/dist/build/p-c9f2fa8f.js +2 -0
- package/dist/build/p-d0e70650.entry.js +1 -0
- package/dist/build/p-d2cf5ab2.entry.js +1 -0
- package/dist/build/p-d896ab0d.entry.js +1 -0
- package/dist/build/p-dbb409ab.entry.js +1 -0
- package/dist/build/p-ddd388f6.entry.js +1 -0
- package/dist/build/p-f1867cb5.entry.js +1 -0
- package/dist/build/p-f499f696.entry.js +1 -0
- package/dist/build/p-f86fcdf4.js +1 -0
- package/dist/build/p-fa3216a5.entry.js +1 -0
- package/dist/build/p-fbb44fc1.entry.js +1 -0
- package/dist/build/paperless.css +1 -81
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/child-of-e472f812.js +9 -0
- package/dist/cjs/constants-a4459ec9.js +7 -0
- package/dist/cjs/{index-a2da05ae.js → index-195002a8.js} +729 -254
- package/dist/cjs/index.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/localization-9e2ac7f3.js +60 -0
- package/dist/cjs/object-get-by-path-6dc21ed5.js +12 -0
- package/dist/cjs/p-accordion.cjs.entry.js +34 -0
- package/dist/cjs/p-avatar-group.cjs.entry.js +20 -0
- package/dist/cjs/p-avatar.cjs.entry.js +43 -0
- package/dist/cjs/p-backdrop.cjs.entry.js +30 -0
- package/dist/cjs/p-button_3.cjs.entry.js +326 -94
- package/dist/cjs/p-card-body.cjs.entry.js +20 -0
- package/dist/cjs/p-card-container.cjs.entry.js +21 -0
- package/dist/cjs/p-card-header.cjs.entry.js +22 -0
- package/dist/cjs/p-content-slider.cjs.entry.js +210 -0
- package/dist/cjs/p-counter.cjs.entry.js +21 -0
- package/dist/cjs/p-divider.cjs.entry.js +22 -0
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +49 -0
- package/dist/cjs/p-drawer.cjs.entry.js +62 -0
- package/dist/cjs/p-dropdown_3.cjs.entry.js +177 -0
- package/dist/cjs/p-helper_2.cjs.entry.js +139 -0
- package/dist/cjs/{p-illustration.cjs.entry.js → p-illustration_6.cjs.entry.js} +1304 -5
- package/dist/cjs/p-info-panel.cjs.entry.js +27 -0
- package/dist/cjs/p-input-group_4.cjs.entry.js +125 -0
- package/dist/cjs/p-layout.cjs.entry.js +20 -0
- package/dist/cjs/p-modal-body_4.cjs.entry.js +77 -0
- package/dist/cjs/p-modal.cjs.entry.js +58 -0
- package/dist/cjs/p-navbar.cjs.entry.js +28 -0
- package/dist/cjs/p-navigation-item.cjs.entry.js +24 -0
- package/dist/cjs/p-page-size-select_3.cjs.entry.js +222 -0
- package/dist/cjs/p-profile.cjs.entry.js +43 -0
- package/dist/cjs/p-select.cjs.entry.js +183 -0
- package/dist/cjs/p-slider-indicator.cjs.entry.js +20 -0
- package/dist/cjs/p-status.cjs.entry.js +49 -0
- package/dist/cjs/p-stepper-item_2.cjs.entry.js +38 -0
- package/dist/cjs/p-stepper.cjs.entry.js +43 -0
- package/dist/cjs/p-tab-group.cjs.entry.js +19 -0
- package/dist/cjs/p-tab-item.cjs.entry.js +20 -0
- package/dist/cjs/p-table-column.cjs.entry.js +26 -0
- package/dist/cjs/p-table.cjs.entry.js +341 -0
- package/dist/cjs/p-toast-container.cjs.entry.js +20 -0
- package/dist/cjs/p-toast.cjs.entry.js +33 -0
- package/dist/cjs/paperless.cjs.js +3 -3
- package/dist/{esm/p-tooltip.entry.js → cjs/popper-d7a0f999.js} +62 -130
- package/dist/collection/assets/icons/camera.svg +10 -0
- package/dist/collection/assets/icons/checklist.svg +17 -0
- package/dist/collection/assets/icons/filter.svg +6 -13
- package/dist/collection/assets/icons/folder.svg +19 -0
- package/dist/collection/assets/icons/integration.svg +17 -0
- package/dist/collection/assets/icons/menu.svg +25 -0
- package/dist/collection/assets/icons/more.svg +18 -0
- package/dist/collection/assets/icons/reload.svg +10 -0
- package/dist/collection/assets/icons/signout.svg +23 -0
- package/dist/collection/assets/icons/switch.svg +20 -0
- package/dist/collection/assets/icons/task.svg +17 -0
- package/dist/collection/assets/icons/template.svg +17 -0
- package/dist/collection/assets/illustrations/e-mail.svg +1 -0
- package/dist/collection/assets/illustrations/empty-state-overview.svg +65 -0
- package/dist/collection/assets/illustrations/empty-state-search.svg +88 -0
- package/dist/collection/assets/images/avatar/company-default.svg +12 -0
- package/dist/collection/assets/images/avatar/user-default.svg +12 -0
- package/dist/collection/assets/images/helper/helper-hover.svg +15 -0
- package/dist/collection/assets/images/helper/helper.svg +15 -0
- package/dist/collection/collection-manifest.json +55 -3
- package/dist/collection/components/atoms/avatar/avatar.component.css +1 -0
- package/dist/collection/components/atoms/avatar/avatar.component.js +125 -0
- package/dist/collection/components/atoms/avatar-group/avatar-group.component.css +1 -0
- package/dist/collection/components/atoms/avatar-group/avatar-group.component.js +41 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.js +119 -0
- package/dist/collection/components/atoms/button/button.component.css +1 -47
- package/dist/collection/components/atoms/button/button.component.js +308 -227
- package/dist/collection/components/atoms/card-body/card-body.component.css +1 -0
- package/dist/collection/components/atoms/card-body/card-body.component.js +42 -0
- package/dist/collection/components/atoms/card-container/card-container.component.css +1 -0
- package/dist/collection/components/atoms/card-container/card-container.component.js +62 -0
- package/dist/collection/components/atoms/card-header/card-header.component.css +1 -0
- package/dist/collection/components/atoms/card-header/card-header.component.js +61 -0
- package/dist/collection/components/atoms/counter/counter.component.css +1 -0
- package/dist/collection/components/atoms/counter/counter.component.js +62 -0
- package/dist/collection/components/atoms/divider/divider.component.css +1 -0
- package/dist/collection/components/atoms/divider/divider.component.js +21 -0
- package/dist/collection/components/atoms/drawer-body/drawer-body.component.css +1 -0
- package/dist/collection/components/atoms/drawer-body/drawer-body.component.js +43 -0
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -0
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.js +47 -0
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -0
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +65 -0
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -0
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +42 -0
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -0
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +85 -0
- package/dist/collection/components/atoms/helper/helper.component.css +1 -0
- package/dist/collection/components/atoms/helper/helper.component.js +48 -0
- package/dist/collection/components/atoms/icon/icon.component.css +1 -0
- package/dist/collection/components/atoms/icon/icon.component.js +138 -96
- package/dist/collection/components/atoms/illustration/illustration.component.js +26 -28
- package/dist/collection/components/atoms/info-panel/info-panel.component.css +1 -0
- package/dist/collection/components/atoms/info-panel/info-panel.component.js +102 -0
- package/dist/collection/components/atoms/label/label.component.css +1 -0
- package/dist/collection/components/atoms/label/label.component.js +170 -0
- package/dist/collection/components/atoms/layout/layout.component.css +1 -0
- package/dist/collection/components/atoms/layout/layout.component.js +43 -0
- package/dist/collection/components/atoms/loader/loader.component.css +1 -26
- package/dist/collection/components/atoms/loader/loader.component.js +114 -115
- package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -0
- package/dist/collection/components/atoms/modal-body/modal-body.component.js +62 -0
- package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -0
- package/dist/collection/components/atoms/modal-container/modal-container.component.js +74 -0
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -0
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.js +18 -0
- package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -0
- package/dist/collection/components/atoms/modal-header/modal-header.component.js +65 -0
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -0
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +43 -0
- package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -0
- package/dist/collection/components/atoms/segment-container/segment-container.component.js +17 -0
- package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -0
- package/dist/collection/components/atoms/segment-item/segment-item.component.js +118 -0
- package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -0
- package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js +43 -0
- package/dist/collection/components/atoms/status/status.component.css +1 -0
- package/dist/collection/components/atoms/status/status.component.js +137 -0
- package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -0
- package/dist/collection/components/atoms/stepper-item/stepper-item.component.js +100 -0
- package/dist/collection/components/atoms/stepper-line/stepper-line.component.css +1 -0
- package/dist/collection/components/atoms/stepper-line/stepper-line.component.js +62 -0
- package/dist/collection/components/atoms/tab-group/tab-group.component.css +1 -0
- package/dist/collection/components/atoms/tab-group/tab-group.component.js +18 -0
- package/dist/collection/components/atoms/tab-item/tab-item.component.css +1 -0
- package/dist/collection/components/atoms/tab-item/tab-item.component.js +43 -0
- package/dist/collection/components/atoms/table-container/table-container.component.css +1 -0
- package/dist/collection/components/atoms/table-container/table-container.component.js +18 -0
- package/dist/collection/components/atoms/toast-container/toast-container.component.css +1 -0
- package/dist/collection/components/atoms/toast-container/toast-container.component.js +43 -0
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -34
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +252 -122
- package/dist/collection/components/helpers/table-column/table-column.component.js +150 -0
- package/dist/collection/components/molecules/accordion/accordion.component.css +1 -0
- package/dist/collection/components/molecules/accordion/accordion.component.js +127 -0
- package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -0
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +316 -0
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -0
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +334 -0
- package/dist/collection/components/molecules/input-group/input-group.component.css +1 -0
- package/dist/collection/components/molecules/input-group/input-group.component.js +334 -0
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.css +1 -0
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +120 -0
- package/dist/collection/components/molecules/page-size-select/constants.js +2 -0
- package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +204 -0
- package/dist/collection/components/molecules/pagination/pagination.component.css +1 -0
- package/dist/collection/components/molecules/pagination/pagination.component.js +266 -0
- package/dist/collection/components/molecules/profile/profile.component.css +1 -0
- package/dist/collection/components/molecules/profile/profile.component.js +89 -0
- package/dist/collection/components/molecules/select/select.component.css +1 -0
- package/dist/collection/components/molecules/select/select.component.js +570 -0
- package/dist/collection/components/molecules/stepper/stepper.component.css +1 -0
- package/dist/collection/components/molecules/stepper/stepper.component.js +84 -0
- package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -0
- package/dist/collection/components/molecules/table-cell/table-cell.component.js +262 -0
- package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -0
- package/dist/collection/components/molecules/table-footer/table-footer.component.js +275 -0
- package/dist/collection/components/molecules/table-header/table-header.component.css +1 -0
- package/dist/collection/components/molecules/table-header/table-header.component.js +380 -0
- package/dist/collection/components/molecules/table-row/table-row.component.css +1 -0
- package/dist/collection/components/molecules/table-row/table-row.component.js +64 -0
- package/dist/collection/components/molecules/toast/toast.component.css +1 -0
- package/dist/collection/components/molecules/toast/toast.component.js +196 -0
- package/dist/collection/components/organisms/drawer/drawer.component.css +1 -0
- package/dist/collection/components/organisms/drawer/drawer.component.js +214 -0
- package/dist/collection/components/organisms/modal/modal.component.js +239 -0
- package/dist/collection/components/organisms/navbar/navbar.component.css +1 -0
- package/dist/collection/components/organisms/navbar/navbar.component.js +89 -0
- package/dist/collection/components/organisms/table/table.component.css +1 -0
- package/dist/collection/components/organisms/table/table.component.js +1164 -0
- package/dist/collection/index.js +2 -1
- package/dist/collection/tailwind/animation.js +87 -0
- package/dist/collection/tailwind/backdrop-blur.js +3 -0
- package/dist/collection/tailwind/border-radius.js +8 -6
- package/dist/collection/tailwind/height.js +3 -0
- package/dist/collection/tailwind/screens.js +8 -0
- package/dist/collection/tailwind/shadows.js +11 -5
- package/dist/collection/tailwind/spacing.js +10 -0
- package/dist/collection/tailwind/typography.js +21 -0
- package/dist/collection/tailwind/width.js +18 -0
- package/dist/collection/tailwind/z-index.js +17 -0
- package/dist/collection/tailwind.config.js +28 -14
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/table.js +1 -0
- package/dist/collection/types/tailwind.js +1 -0
- package/dist/collection/utils/child-of.js +5 -0
- package/dist/collection/utils/icons.js +22 -0
- package/dist/collection/utils/illustrations.js +6 -0
- package/dist/collection/utils/index.js +6 -0
- package/dist/collection/utils/localization.js +55 -0
- package/dist/collection/utils/object-get-by-path.js +8 -0
- package/dist/collection/utils/transformers.js +4 -0
- package/dist/components/backdrop.component.js +45 -0
- package/dist/components/button.component.js +98 -0
- package/dist/components/counter.component.js +35 -0
- package/dist/components/divider.component.js +33 -0
- package/dist/components/drawer-body.component.js +33 -0
- package/dist/components/drawer-container.component.js +32 -0
- package/dist/components/drawer-header.component.js +52 -0
- package/dist/components/dropdown-menu-container.component.js +32 -0
- package/dist/components/dropdown-menu-item.component.js +43 -0
- package/dist/components/dropdown.component.js +178 -0
- package/dist/components/helper.component.js +39 -0
- package/dist/components/icon.component.js +259 -23
- package/dist/{esm/p-illustration.entry.js → components/illustration.component.js} +183 -10
- package/dist/components/index.d.ts +57 -5
- package/dist/components/index.js +62 -0
- package/dist/components/input-group.component.js +113 -0
- package/dist/components/label.component.js +52 -0
- package/dist/components/loader.component.js +12 -15
- package/dist/components/localization.js +57 -0
- package/dist/components/modal-body.component.js +35 -0
- package/dist/components/modal-container.component.js +47 -0
- package/dist/components/modal-footer.component.js +36 -0
- package/dist/components/modal-header.component.js +52 -0
- package/dist/components/p-accordion.d.ts +11 -0
- package/dist/components/p-accordion.js +65 -0
- package/dist/components/p-avatar-group.d.ts +11 -0
- package/dist/components/p-avatar-group.js +35 -0
- package/dist/components/p-avatar.d.ts +11 -0
- package/dist/components/p-avatar.js +62 -0
- package/dist/components/p-backdrop.d.ts +11 -0
- package/dist/components/p-backdrop.js +6 -0
- package/dist/components/p-button.js +1 -93
- package/dist/components/p-card-body.d.ts +11 -0
- package/dist/components/p-card-body.js +35 -0
- package/dist/components/p-card-container.d.ts +11 -0
- package/dist/components/p-card-container.js +38 -0
- package/dist/components/p-card-header.d.ts +11 -0
- package/dist/components/p-card-header.js +44 -0
- package/dist/components/p-content-slider.d.ts +11 -0
- package/dist/components/p-content-slider.js +239 -0
- package/dist/components/p-counter.d.ts +11 -0
- package/dist/components/p-counter.js +6 -0
- package/dist/components/p-divider.d.ts +11 -0
- package/dist/components/p-divider.js +6 -0
- package/dist/components/p-drawer-body.d.ts +11 -0
- package/dist/components/p-drawer-body.js +6 -0
- package/dist/components/p-drawer-container.d.ts +11 -0
- package/dist/components/p-drawer-container.js +6 -0
- package/dist/components/p-drawer-header.d.ts +11 -0
- package/dist/components/p-drawer-header.js +6 -0
- package/dist/components/p-drawer.d.ts +11 -0
- package/dist/components/p-drawer.js +126 -0
- package/dist/components/p-dropdown-menu-container.d.ts +11 -0
- package/dist/components/p-dropdown-menu-container.js +6 -0
- package/dist/components/p-dropdown-menu-item.d.ts +11 -0
- package/dist/components/p-dropdown-menu-item.js +6 -0
- package/dist/components/p-dropdown.d.ts +11 -0
- package/dist/components/p-dropdown.js +6 -0
- package/dist/components/p-helper.d.ts +11 -0
- package/dist/components/p-helper.js +6 -0
- package/dist/components/p-illustration.js +1 -1436
- package/dist/components/p-info-panel.d.ts +11 -0
- package/dist/components/p-info-panel.js +52 -0
- package/dist/components/p-input-group.d.ts +11 -0
- package/dist/components/p-input-group.js +6 -0
- package/dist/components/p-label.d.ts +11 -0
- package/dist/components/p-label.js +6 -0
- package/dist/components/p-layout.d.ts +11 -0
- package/dist/components/p-layout.js +36 -0
- package/dist/components/p-modal-body.d.ts +11 -0
- package/dist/components/p-modal-body.js +6 -0
- package/dist/components/p-modal-container.d.ts +11 -0
- package/dist/components/p-modal-container.js +6 -0
- package/dist/components/p-modal-footer.d.ts +11 -0
- package/dist/components/p-modal-footer.js +6 -0
- package/dist/components/p-modal-header.d.ts +11 -0
- package/dist/components/p-modal-header.js +6 -0
- package/dist/components/p-modal.d.ts +11 -0
- package/dist/components/p-modal.js +136 -0
- package/dist/components/p-navbar.d.ts +11 -0
- package/dist/components/p-navbar.js +70 -0
- package/dist/components/p-navigation-item.d.ts +11 -0
- package/dist/components/p-navigation-item.js +56 -0
- package/dist/components/p-page-size-select.d.ts +11 -0
- package/dist/components/p-page-size-select.js +6 -0
- package/dist/components/p-pagination-item.d.ts +11 -0
- package/dist/components/p-pagination-item.js +6 -0
- package/dist/components/p-pagination.d.ts +11 -0
- package/dist/components/p-pagination.js +6 -0
- package/dist/components/p-profile.d.ts +11 -0
- package/dist/components/p-profile.js +79 -0
- package/dist/components/p-segment-container.d.ts +11 -0
- package/dist/components/p-segment-container.js +6 -0
- package/dist/components/p-segment-item.d.ts +11 -0
- package/dist/components/p-segment-item.js +6 -0
- package/dist/components/p-select.d.ts +11 -0
- package/dist/components/p-select.js +265 -0
- package/dist/components/p-slider-indicator.d.ts +11 -0
- package/dist/components/p-slider-indicator.js +6 -0
- package/dist/components/p-status.d.ts +11 -0
- package/dist/components/p-status.js +73 -0
- package/dist/components/p-stepper-item.d.ts +11 -0
- package/dist/components/p-stepper-item.js +6 -0
- package/dist/components/p-stepper-line.d.ts +11 -0
- package/dist/components/p-stepper-line.js +6 -0
- package/dist/components/p-stepper.d.ts +11 -0
- package/dist/components/p-stepper.js +78 -0
- package/dist/components/p-tab-group.d.ts +11 -0
- package/dist/components/p-tab-group.js +39 -0
- package/dist/components/p-tab-item.d.ts +11 -0
- package/dist/components/p-tab-item.js +36 -0
- package/dist/components/p-table-cell.d.ts +11 -0
- package/dist/components/p-table-cell.js +6 -0
- package/dist/components/p-table-column.d.ts +11 -0
- package/dist/components/p-table-column.js +46 -0
- package/dist/components/p-table-container.d.ts +11 -0
- package/dist/components/p-table-container.js +6 -0
- package/dist/components/p-table-footer.d.ts +11 -0
- package/dist/components/p-table-footer.js +6 -0
- package/dist/components/p-table-header.d.ts +11 -0
- package/dist/components/p-table-header.js +6 -0
- package/dist/components/p-table-row.d.ts +11 -0
- package/dist/components/p-table-row.js +6 -0
- package/dist/components/p-table.d.ts +11 -0
- package/dist/components/p-table.js +521 -0
- package/dist/components/p-toast-container.d.ts +11 -0
- package/dist/components/p-toast-container.js +36 -0
- package/dist/components/p-toast.d.ts +11 -0
- package/dist/components/p-toast.js +73 -0
- package/dist/components/p-tooltip.js +1 -1886
- package/dist/components/page-size-select.component.js +105 -0
- package/dist/components/pagination-item.component.js +33 -0
- package/dist/components/pagination.component.js +194 -0
- package/dist/{cjs/p-tooltip.cjs.entry.js → components/popper.js} +61 -135
- package/dist/components/segment-container.component.js +29 -0
- package/dist/components/segment-item.component.js +51 -0
- package/dist/components/slider-indicator.component.js +33 -0
- package/dist/components/stepper-item.component.js +45 -0
- package/dist/components/stepper-line.component.js +35 -0
- package/dist/components/table-cell.component.js +143 -0
- package/dist/components/table-container.component.js +30 -0
- package/dist/components/table-footer.component.js +127 -0
- package/dist/components/table-header.component.js +1048 -0
- package/dist/components/table-row.component.js +43 -0
- package/dist/components/tooltip.component.js +143 -0
- package/dist/esm/child-of-90a8c4b5.js +7 -0
- package/dist/esm/constants-826f9460.js +4 -0
- package/dist/esm/{index-d08bfe75.js → index-8170b4fb.js} +729 -254
- package/dist/esm/index.js +9 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/localization-901dc2d3.js +57 -0
- package/dist/esm/object-get-by-path-d6427a61.js +10 -0
- package/dist/esm/p-accordion.entry.js +30 -0
- package/dist/esm/p-avatar-group.entry.js +16 -0
- package/dist/esm/p-avatar.entry.js +39 -0
- package/dist/esm/p-backdrop.entry.js +26 -0
- package/dist/esm/p-button_3.entry.js +326 -94
- package/dist/esm/p-card-body.entry.js +16 -0
- package/dist/esm/p-card-container.entry.js +17 -0
- package/dist/esm/p-card-header.entry.js +18 -0
- package/dist/esm/p-content-slider.entry.js +206 -0
- package/dist/esm/p-counter.entry.js +17 -0
- package/dist/esm/p-divider.entry.js +18 -0
- package/dist/esm/p-drawer-body_3.entry.js +43 -0
- package/dist/esm/p-drawer.entry.js +58 -0
- package/dist/esm/p-dropdown_3.entry.js +171 -0
- package/dist/esm/p-helper_2.entry.js +134 -0
- package/dist/esm/p-illustration_6.entry.js +2716 -0
- package/dist/esm/p-info-panel.entry.js +23 -0
- package/dist/esm/p-input-group_4.entry.js +118 -0
- package/dist/esm/p-layout.entry.js +16 -0
- package/dist/esm/p-modal-body_4.entry.js +70 -0
- package/dist/esm/p-modal.entry.js +54 -0
- package/dist/esm/p-navbar.entry.js +24 -0
- package/dist/esm/p-navigation-item.entry.js +20 -0
- package/dist/esm/p-page-size-select_3.entry.js +216 -0
- package/dist/esm/p-profile.entry.js +39 -0
- package/dist/esm/p-select.entry.js +179 -0
- package/dist/esm/p-slider-indicator.entry.js +16 -0
- package/dist/esm/p-status.entry.js +45 -0
- package/dist/esm/p-stepper-item_2.entry.js +33 -0
- package/dist/esm/p-stepper.entry.js +39 -0
- package/dist/esm/p-tab-group.entry.js +15 -0
- package/dist/esm/p-tab-item.entry.js +16 -0
- package/dist/esm/p-table-column.entry.js +22 -0
- package/dist/esm/p-table.entry.js +337 -0
- package/dist/esm/p-toast-container.entry.js +16 -0
- package/dist/esm/p-toast.entry.js +29 -0
- package/dist/esm/paperless.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/popper-42db9fbd.js +1799 -0
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -0
- package/dist/paperless/p-0688d548.entry.js +1 -0
- package/dist/paperless/p-07f28695.entry.js +1 -0
- package/dist/paperless/p-09ea2a1a.js +1 -0
- package/dist/paperless/p-12f5c483.entry.js +1 -0
- package/dist/paperless/p-1a4dea17.entry.js +1 -0
- package/dist/paperless/p-2df7dcab.entry.js +1 -0
- package/dist/paperless/p-2e47afc7.entry.js +1 -0
- package/dist/paperless/p-3946e0a3.entry.js +1 -0
- package/dist/paperless/p-4e650fe4.js +1 -0
- package/dist/paperless/p-529ccaf7.entry.js +1 -0
- package/dist/paperless/p-603f7eeb.entry.js +1 -0
- package/dist/paperless/p-62d49606.entry.js +1 -0
- package/dist/paperless/p-66ca8871.entry.js +1 -0
- package/dist/paperless/p-681ed79b.entry.js +1 -0
- package/dist/paperless/p-6c60fd3d.js +1 -0
- package/dist/paperless/p-6cc16633.entry.js +1 -0
- package/dist/paperless/p-7df6230f.entry.js +1 -0
- package/dist/paperless/p-855a9700.entry.js +1 -0
- package/dist/paperless/p-86db301b.entry.js +1 -0
- package/dist/paperless/p-8a6728d5.js +1 -0
- package/dist/paperless/p-9001f4e3.entry.js +1 -0
- package/dist/paperless/p-91d032b2.entry.js +1 -0
- package/dist/paperless/p-9315c1e2.entry.js +1 -0
- package/dist/paperless/p-98e3dcd7.entry.js +1 -0
- package/dist/paperless/p-ac5a17c4.entry.js +1 -0
- package/dist/paperless/p-b4af4b21.entry.js +1 -0
- package/dist/paperless/p-b6cad89e.entry.js +1 -0
- package/dist/paperless/p-b72559e4.entry.js +1 -0
- package/dist/paperless/p-b8a237be.entry.js +1 -0
- package/dist/paperless/p-b8dd503c.entry.js +1 -0
- package/dist/paperless/p-c1f6925e.entry.js +1 -0
- package/dist/paperless/p-c9f2fa8f.js +2 -0
- package/dist/paperless/p-d0e70650.entry.js +1 -0
- package/dist/paperless/p-d2cf5ab2.entry.js +1 -0
- package/dist/paperless/p-d896ab0d.entry.js +1 -0
- package/dist/paperless/p-dbb409ab.entry.js +1 -0
- package/dist/paperless/p-ddd388f6.entry.js +1 -0
- package/dist/paperless/p-f1867cb5.entry.js +1 -0
- package/dist/paperless/p-f499f696.entry.js +1 -0
- package/dist/paperless/p-f86fcdf4.js +1 -0
- package/dist/paperless/p-fa3216a5.entry.js +1 -0
- package/dist/paperless/p-fbb44fc1.entry.js +1 -0
- package/dist/paperless/paperless.css +589 -26643
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/style/_fonts.scss +70 -0
- package/dist/style/_reset.scss +31 -0
- package/dist/style/_tailwind.scss +3 -0
- package/dist/style/_typograhpy.scss +29 -0
- package/dist/style/_variables.scss +2 -0
- package/dist/style/form/_checkbox.scss +62 -0
- package/dist/style/form/_input.scss +22 -0
- package/dist/style/form/_mixins.scss +107 -0
- package/dist/style/form/_radio.scss +58 -0
- package/dist/style/form/_textarea.scss +18 -0
- package/dist/style/form/index.scss +4 -0
- package/dist/style/paperless.scss +10 -0
- package/dist/sw.js +2 -260
- package/dist/sw.js.map +1 -0
- package/dist/tailwind/animation.js +87 -0
- package/dist/tailwind/backdrop-blur.js +3 -0
- package/dist/tailwind/border-radius.js +10 -0
- package/dist/tailwind/colors.js +52 -0
- package/dist/tailwind/height.js +3 -0
- package/dist/tailwind/rotate.js +8 -0
- package/dist/tailwind/scale.js +3 -0
- package/dist/tailwind/screens.js +8 -0
- package/dist/tailwind/shadows.js +13 -0
- package/dist/tailwind/spacing.js +10 -0
- package/dist/tailwind/typography.js +21 -0
- package/dist/tailwind/width.js +18 -0
- package/dist/tailwind/z-index.js +17 -0
- package/dist/tailwind.config.js +28 -14
- package/dist/types/components/atoms/avatar/avatar.component.d.ts +23 -0
- package/dist/types/components/atoms/avatar-group/avatar-group.component.d.ts +7 -0
- package/dist/types/components/atoms/backdrop/backdrop.component.d.ts +25 -0
- package/dist/types/components/atoms/button/button.component.d.ts +20 -3
- package/dist/types/components/atoms/card-body/card-body.component.d.ts +7 -0
- package/dist/types/components/atoms/card-container/card-container.component.d.ts +11 -0
- package/dist/types/components/atoms/card-header/card-header.component.d.ts +11 -0
- package/dist/types/components/atoms/counter/counter.component.d.ts +11 -0
- package/dist/types/components/atoms/divider/divider.component.d.ts +7 -0
- package/dist/types/components/atoms/drawer-body/drawer-body.component.d.ts +7 -0
- package/dist/types/components/atoms/drawer-container/drawer-container.component.d.ts +7 -0
- package/dist/types/components/atoms/drawer-header/drawer-header.component.d.ts +12 -0
- package/dist/types/components/atoms/dropdown-menu-container/dropdown-menu-container.component.d.ts +7 -0
- package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +16 -0
- package/dist/types/components/atoms/helper/helper.component.d.ts +8 -0
- package/dist/types/components/atoms/icon/icon.component.d.ts +3 -3
- package/dist/types/components/atoms/info-panel/info-panel.component.d.ts +24 -0
- package/dist/types/components/atoms/label/label.component.d.ts +33 -0
- package/dist/types/components/atoms/layout/layout.component.d.ts +7 -0
- package/dist/types/components/atoms/loader/loader.component.d.ts +1 -1
- package/dist/types/components/atoms/modal-body/modal-body.component.d.ts +11 -0
- package/dist/types/components/atoms/modal-container/modal-container.component.d.ts +11 -0
- package/dist/types/components/atoms/modal-footer/modal-footer.component.d.ts +3 -0
- package/dist/types/components/atoms/modal-header/modal-header.component.d.ts +12 -0
- package/dist/types/components/atoms/pagination-item/pagination-item.component.d.ts +7 -0
- package/dist/types/components/atoms/segment-container/segment-container.component.d.ts +3 -0
- package/dist/types/components/atoms/segment-item/segment-item.component.d.ts +22 -0
- package/dist/types/components/atoms/slider-indicator/slider-indicator.component.d.ts +7 -0
- package/dist/types/components/atoms/status/status.component.d.ts +23 -0
- package/dist/types/components/atoms/stepper-item/stepper-item.component.d.ts +19 -0
- package/dist/types/components/atoms/stepper-line/stepper-line.component.d.ts +11 -0
- package/dist/types/components/atoms/tab-group/tab-group.component.d.ts +3 -0
- package/dist/types/components/atoms/tab-item/tab-item.component.d.ts +7 -0
- package/dist/types/components/atoms/table-container/table-container.component.d.ts +3 -0
- package/dist/types/components/atoms/toast-container/toast-container.component.d.ts +7 -0
- package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +30 -9
- package/dist/types/components/helpers/table-column/table-column.component.d.ts +34 -0
- package/dist/types/components/molecules/accordion/accordion.component.d.ts +25 -0
- package/dist/types/components/molecules/content-slider/content-slider.component.d.ts +53 -0
- package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +61 -0
- package/dist/types/components/molecules/input-group/input-group.component.d.ts +67 -0
- package/dist/types/components/molecules/navigation-item/navigation-item.component.d.ts +24 -0
- package/dist/types/components/molecules/page-size-select/constants.d.ts +2 -0
- package/dist/types/components/molecules/page-size-select/page-size-select.component.d.ts +50 -0
- package/dist/types/components/molecules/pagination/pagination.component.d.ts +35 -0
- package/dist/types/components/molecules/profile/profile.component.d.ts +20 -0
- package/dist/types/components/molecules/select/select.component.d.ts +115 -0
- package/dist/types/components/molecules/stepper/stepper.component.d.ts +18 -0
- package/dist/types/components/molecules/table-cell/table-cell.component.d.ts +42 -0
- package/dist/types/components/molecules/table-footer/table-footer.component.d.ts +63 -0
- package/dist/types/components/molecules/table-header/table-header.component.d.ts +87 -0
- package/dist/types/components/molecules/table-row/table-row.component.d.ts +11 -0
- package/dist/types/components/molecules/toast/toast.component.d.ts +39 -0
- package/dist/types/components/organisms/drawer/drawer.component.d.ts +48 -0
- package/dist/types/components/organisms/modal/modal.component.d.ts +54 -0
- package/dist/types/components/organisms/navbar/navbar.component.d.ts +14 -0
- package/dist/types/components/organisms/table/table.component.d.ts +214 -0
- package/dist/types/components.d.ts +2801 -114
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/table.d.ts +27 -0
- package/dist/types/types/tailwind.d.ts +2 -0
- package/dist/types/utils/child-of.d.ts +1 -0
- package/dist/types/utils/icons.d.ts +11 -0
- package/dist/types/utils/illustrations.d.ts +3 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/localization.d.ts +2 -0
- package/dist/types/utils/object-get-by-path.d.ts +1 -0
- package/dist/types/utils/transformers.d.ts +2 -0
- package/dist/workbox-5b279812.js +2 -0
- package/dist/workbox-5b279812.js.map +1 -0
- package/loader/package.json +1 -0
- package/package.json +64 -61
- package/dist/build/p-4144f8a0.entry.js +0 -1
- package/dist/build/p-8538576c.entry.js +0 -1
- package/dist/build/p-f04c4de0.entry.js +0 -1
- package/dist/build/p-f33e1285.js +0 -2
- package/dist/collection/tailwind/grid.js +0 -6
- package/dist/collection/utils/utils.js +0 -3
- package/dist/paperless/p-4144f8a0.entry.js +0 -1
- package/dist/paperless/p-8538576c.entry.js +0 -1
- package/dist/paperless/p-f04c4de0.entry.js +0 -1
- package/dist/paperless/p-f33e1285.js +0 -2
- package/dist/types/utils/utils.d.ts +0 -1
|
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'paperless';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
+
* Simon Friis Vindum (@paldepind)
|
|
28
|
+
* Licensed under the MIT License
|
|
29
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
+
*
|
|
31
|
+
* Modified for Stencil's renderer and slot projection
|
|
32
|
+
*/
|
|
25
33
|
let scopeId;
|
|
26
34
|
let contentRef;
|
|
27
35
|
let hostTagName;
|
|
@@ -30,57 +38,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
30
38
|
let checkSlotRelocate = false;
|
|
31
39
|
let isSvgMode = false;
|
|
32
40
|
let queuePending = false;
|
|
33
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
34
|
-
const doc = win.document || { head: {} };
|
|
35
|
-
const plt = {
|
|
36
|
-
$flags$: 0,
|
|
37
|
-
$resourcesUrl$: '',
|
|
38
|
-
jmp: (h) => h(),
|
|
39
|
-
raf: (h) => requestAnimationFrame(h),
|
|
40
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
41
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
42
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
43
|
-
};
|
|
44
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
45
|
-
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
46
|
-
try {
|
|
47
|
-
new CSSStyleSheet();
|
|
48
|
-
return typeof new CSSStyleSheet().replace === 'function';
|
|
49
|
-
}
|
|
50
|
-
catch (e) { }
|
|
51
|
-
return false;
|
|
52
|
-
})()
|
|
53
|
-
;
|
|
54
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
55
|
-
if (listeners) {
|
|
56
|
-
listeners.map(([flags, name, method]) => {
|
|
57
|
-
const target = elm;
|
|
58
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
59
|
-
const opts = hostListenerOpts(flags);
|
|
60
|
-
plt.ael(target, name, handler, opts);
|
|
61
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
66
|
-
try {
|
|
67
|
-
{
|
|
68
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
69
|
-
// instance is ready, let's call it's member method for this event
|
|
70
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
consoleError(e);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
// prettier-ignore
|
|
82
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
83
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
84
41
|
const createTime = (fnName, tagName = '') => {
|
|
85
42
|
{
|
|
86
43
|
return () => {
|
|
@@ -95,71 +52,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
95
52
|
};
|
|
96
53
|
}
|
|
97
54
|
};
|
|
98
|
-
const
|
|
99
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
100
|
-
let style = styles.get(scopeId);
|
|
101
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
102
|
-
style = (style || new CSSStyleSheet());
|
|
103
|
-
style.replace(cssText);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
style = cssText;
|
|
107
|
-
}
|
|
108
|
-
styles.set(scopeId, style);
|
|
109
|
-
};
|
|
110
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
111
|
-
let scopeId = getScopeId(cmpMeta);
|
|
112
|
-
const style = styles.get(scopeId);
|
|
113
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
114
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
115
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
116
|
-
if (style) {
|
|
117
|
-
if (typeof style === 'string') {
|
|
118
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
119
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
120
|
-
let styleElm;
|
|
121
|
-
if (!appliedStyles) {
|
|
122
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
123
|
-
}
|
|
124
|
-
if (!appliedStyles.has(scopeId)) {
|
|
125
|
-
{
|
|
126
|
-
{
|
|
127
|
-
styleElm = doc.createElement('style');
|
|
128
|
-
styleElm.innerHTML = style;
|
|
129
|
-
}
|
|
130
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
131
|
-
}
|
|
132
|
-
if (appliedStyles) {
|
|
133
|
-
appliedStyles.add(scopeId);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
138
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return scopeId;
|
|
142
|
-
};
|
|
143
|
-
const attachStyles = (hostRef) => {
|
|
144
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
145
|
-
const elm = hostRef.$hostElement$;
|
|
146
|
-
const flags = cmpMeta.$flags$;
|
|
147
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
148
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
149
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
150
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
151
|
-
// or this browser doesn't support native shadow dom
|
|
152
|
-
// and this host element was NOT created with SSR
|
|
153
|
-
// let's pick out the inner content for slot projection
|
|
154
|
-
// create a node to represent where the original
|
|
155
|
-
// content was first placed, which is useful later on
|
|
156
|
-
// DOM WRITE!!
|
|
157
|
-
elm['s-sc'] = scopeId;
|
|
158
|
-
elm.classList.add(scopeId + '-h');
|
|
159
|
-
}
|
|
160
|
-
endAttachStyles();
|
|
161
|
-
};
|
|
162
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
55
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
163
56
|
/**
|
|
164
57
|
* Default style mode id
|
|
165
58
|
*/
|
|
@@ -292,6 +185,149 @@ const convertToPrivate = (node) => {
|
|
|
292
185
|
vnode.$name$ = node.vname;
|
|
293
186
|
return vnode;
|
|
294
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* Parse a new property value for a given property type.
|
|
190
|
+
*
|
|
191
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
192
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
193
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
194
|
+
* 2. the type stored from `propType`.
|
|
195
|
+
*
|
|
196
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
197
|
+
*
|
|
198
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
199
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
200
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
201
|
+
* ```tsx
|
|
202
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* HTML prop values on the other hand, will always a string
|
|
206
|
+
*
|
|
207
|
+
* @param propValue the new value to coerce to some type
|
|
208
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
209
|
+
* @returns the parsed/coerced value
|
|
210
|
+
*/
|
|
211
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
212
|
+
// ensure this value is of the correct prop type
|
|
213
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
214
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
215
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
216
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
217
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
218
|
+
}
|
|
219
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
220
|
+
// force it to be a number
|
|
221
|
+
return parseFloat(propValue);
|
|
222
|
+
}
|
|
223
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
224
|
+
// could have been passed as a number or boolean
|
|
225
|
+
// but we still want it as a string
|
|
226
|
+
return String(propValue);
|
|
227
|
+
}
|
|
228
|
+
// redundant return here for better minification
|
|
229
|
+
return propValue;
|
|
230
|
+
}
|
|
231
|
+
// not sure exactly what type we want
|
|
232
|
+
// so no need to change to a different type
|
|
233
|
+
return propValue;
|
|
234
|
+
};
|
|
235
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
236
|
+
const createEvent = (ref, name, flags) => {
|
|
237
|
+
const elm = getElement(ref);
|
|
238
|
+
return {
|
|
239
|
+
emit: (detail) => {
|
|
240
|
+
return emitEvent(elm, name, {
|
|
241
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
242
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
243
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
244
|
+
detail,
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
251
|
+
* @param elm the target of the Event
|
|
252
|
+
* @param name the name to give the custom Event
|
|
253
|
+
* @param opts options for configuring a custom Event
|
|
254
|
+
* @returns the custom Event
|
|
255
|
+
*/
|
|
256
|
+
const emitEvent = (elm, name, opts) => {
|
|
257
|
+
const ev = plt.ce(name, opts);
|
|
258
|
+
elm.dispatchEvent(ev);
|
|
259
|
+
return ev;
|
|
260
|
+
};
|
|
261
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
262
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
263
|
+
let style = styles.get(scopeId);
|
|
264
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
265
|
+
style = (style || new CSSStyleSheet());
|
|
266
|
+
if (typeof style === 'string') {
|
|
267
|
+
style = cssText;
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
style.replaceSync(cssText);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
style = cssText;
|
|
275
|
+
}
|
|
276
|
+
styles.set(scopeId, style);
|
|
277
|
+
};
|
|
278
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
279
|
+
let scopeId = getScopeId(cmpMeta);
|
|
280
|
+
const style = styles.get(scopeId);
|
|
281
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
282
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
283
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
284
|
+
if (style) {
|
|
285
|
+
if (typeof style === 'string') {
|
|
286
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
287
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
288
|
+
let styleElm;
|
|
289
|
+
if (!appliedStyles) {
|
|
290
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
291
|
+
}
|
|
292
|
+
if (!appliedStyles.has(scopeId)) {
|
|
293
|
+
{
|
|
294
|
+
{
|
|
295
|
+
styleElm = doc.createElement('style');
|
|
296
|
+
styleElm.innerHTML = style;
|
|
297
|
+
}
|
|
298
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
299
|
+
}
|
|
300
|
+
if (appliedStyles) {
|
|
301
|
+
appliedStyles.add(scopeId);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
306
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return scopeId;
|
|
310
|
+
};
|
|
311
|
+
const attachStyles = (hostRef) => {
|
|
312
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
313
|
+
const elm = hostRef.$hostElement$;
|
|
314
|
+
const flags = cmpMeta.$flags$;
|
|
315
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
316
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
317
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
318
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
319
|
+
// or this browser doesn't support native shadow dom
|
|
320
|
+
// and this host element was NOT created with SSR
|
|
321
|
+
// let's pick out the inner content for slot projection
|
|
322
|
+
// create a node to represent where the original
|
|
323
|
+
// content was first placed, which is useful later on
|
|
324
|
+
// DOM WRITE!!
|
|
325
|
+
elm['s-sc'] = scopeId;
|
|
326
|
+
elm.classList.add(scopeId + '-h');
|
|
327
|
+
}
|
|
328
|
+
endAttachStyles();
|
|
329
|
+
};
|
|
330
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
295
331
|
/**
|
|
296
332
|
* Production setAccessor() function based on Preact by
|
|
297
333
|
* Jason Miller (@developit)
|
|
@@ -303,7 +339,7 @@ const convertToPrivate = (node) => {
|
|
|
303
339
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
304
340
|
if (oldValue !== newValue) {
|
|
305
341
|
let isProp = isMemberInElement(elm, memberName);
|
|
306
|
-
memberName.toLowerCase();
|
|
342
|
+
let ln = memberName.toLowerCase();
|
|
307
343
|
if (memberName === 'class') {
|
|
308
344
|
const classList = elm.classList;
|
|
309
345
|
const oldClasses = parseClassList(oldValue);
|
|
@@ -311,12 +347,76 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
311
347
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
312
348
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
313
349
|
}
|
|
350
|
+
else if (memberName === 'style') {
|
|
351
|
+
// update style attribute, css properties and values
|
|
352
|
+
{
|
|
353
|
+
for (const prop in oldValue) {
|
|
354
|
+
if (!newValue || newValue[prop] == null) {
|
|
355
|
+
if (prop.includes('-')) {
|
|
356
|
+
elm.style.removeProperty(prop);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
elm.style[prop] = '';
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
for (const prop in newValue) {
|
|
365
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
366
|
+
if (prop.includes('-')) {
|
|
367
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
elm.style[prop] = newValue[prop];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
314
375
|
else if (memberName === 'ref') {
|
|
315
376
|
// minifier will clean this up
|
|
316
377
|
if (newValue) {
|
|
317
378
|
newValue(elm);
|
|
318
379
|
}
|
|
319
380
|
}
|
|
381
|
+
else if ((!isProp ) &&
|
|
382
|
+
memberName[0] === 'o' &&
|
|
383
|
+
memberName[1] === 'n') {
|
|
384
|
+
// Event Handlers
|
|
385
|
+
// so if the member name starts with "on" and the 3rd characters is
|
|
386
|
+
// a capital letter, and it's not already a member on the element,
|
|
387
|
+
// then we're assuming it's an event listener
|
|
388
|
+
if (memberName[2] === '-') {
|
|
389
|
+
// on- prefixed events
|
|
390
|
+
// allows to be explicit about the dom event to listen without any magic
|
|
391
|
+
// under the hood:
|
|
392
|
+
// <my-cmp on-click> // listens for "click"
|
|
393
|
+
// <my-cmp on-Click> // listens for "Click"
|
|
394
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
395
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
396
|
+
memberName = memberName.slice(3);
|
|
397
|
+
}
|
|
398
|
+
else if (isMemberInElement(win, ln)) {
|
|
399
|
+
// standard event
|
|
400
|
+
// the JSX attribute could have been "onMouseOver" and the
|
|
401
|
+
// member name "onmouseover" is on the window's prototype
|
|
402
|
+
// so let's add the listener "mouseover", which is all lowercased
|
|
403
|
+
memberName = ln.slice(2);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
// custom event
|
|
407
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
|
408
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
|
409
|
+
// and add the listener "myCustomEvent"
|
|
410
|
+
// except for the first character, we keep the event name case
|
|
411
|
+
memberName = ln[2] + memberName.slice(3);
|
|
412
|
+
}
|
|
413
|
+
if (oldValue) {
|
|
414
|
+
plt.rel(elm, memberName, oldValue, false);
|
|
415
|
+
}
|
|
416
|
+
if (newValue) {
|
|
417
|
+
plt.ael(elm, memberName, newValue, false);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
320
420
|
else {
|
|
321
421
|
// Set property if it exists and it's not a SVG
|
|
322
422
|
const isComplex = isComplexType(newValue);
|
|
@@ -345,7 +445,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
345
445
|
}
|
|
346
446
|
}
|
|
347
447
|
}
|
|
348
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
448
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
349
449
|
newValue = newValue === true ? '' : newValue;
|
|
350
450
|
{
|
|
351
451
|
elm.setAttribute(memberName, newValue);
|
|
@@ -360,7 +460,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
360
460
|
// if the element passed in is a shadow root, which is a document fragment
|
|
361
461
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
362
462
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
363
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
463
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
364
464
|
? newVnode.$elm$.host
|
|
365
465
|
: newVnode.$elm$;
|
|
366
466
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -378,6 +478,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
378
478
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
379
479
|
}
|
|
380
480
|
};
|
|
481
|
+
/**
|
|
482
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
483
|
+
*
|
|
484
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
485
|
+
* @param newParentVNode the parent VNode from the current render
|
|
486
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
487
|
+
* children, for which we will create a new DOM node
|
|
488
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
489
|
+
* @returns the newly created node
|
|
490
|
+
*/
|
|
381
491
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
382
492
|
// tslint:disable-next-line: prefer-const
|
|
383
493
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -395,23 +505,23 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
395
505
|
}
|
|
396
506
|
newVNode.$flags$ |= newVNode.$children$
|
|
397
507
|
? // slot element has fallback content
|
|
398
|
-
2 /* isSlotFallback */
|
|
508
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
399
509
|
: // slot element does not have fallback content
|
|
400
|
-
1 /* isSlotReference */;
|
|
510
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
401
511
|
}
|
|
402
512
|
}
|
|
403
513
|
if (newVNode.$text$ !== null) {
|
|
404
514
|
// create text node
|
|
405
515
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
406
516
|
}
|
|
407
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
517
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
408
518
|
// create a slot reference node
|
|
409
519
|
elm = newVNode.$elm$ =
|
|
410
520
|
doc.createTextNode('');
|
|
411
521
|
}
|
|
412
522
|
else {
|
|
413
523
|
// create element
|
|
414
|
-
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
|
|
524
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
415
525
|
? 'slot-fb'
|
|
416
526
|
: newVNode.$tag$));
|
|
417
527
|
// add css classes, attrs, props, listeners, etc.
|
|
@@ -437,7 +547,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
437
547
|
}
|
|
438
548
|
{
|
|
439
549
|
elm['s-hn'] = hostTagName;
|
|
440
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
550
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
441
551
|
// remember the content reference comment
|
|
442
552
|
elm['s-sr'] = true;
|
|
443
553
|
// remember the content reference comment
|
|
@@ -456,7 +566,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
456
566
|
return elm;
|
|
457
567
|
};
|
|
458
568
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
459
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
569
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
460
570
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
461
571
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
462
572
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -477,7 +587,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
477
587
|
putBackInOriginalLocation(childNode, recursive);
|
|
478
588
|
}
|
|
479
589
|
}
|
|
480
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
590
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
481
591
|
};
|
|
482
592
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
483
593
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
@@ -519,6 +629,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
519
629
|
}
|
|
520
630
|
}
|
|
521
631
|
};
|
|
632
|
+
/**
|
|
633
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
634
|
+
* traversing the two collections of children, identifying nodes that are
|
|
635
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
636
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
637
|
+
*
|
|
638
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
639
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
640
|
+
* 'windows' by storing start and end indices and references to the
|
|
641
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
642
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
643
|
+
* no children left to update by doing the following:
|
|
644
|
+
*
|
|
645
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
646
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
647
|
+
* only with a window bounded by the highlighted elements:
|
|
648
|
+
*
|
|
649
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
650
|
+
* ^^^^^^ ^^^^^^
|
|
651
|
+
*
|
|
652
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
653
|
+
* across the windows. This will basically detect elements which haven't
|
|
654
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
655
|
+
* VNode elements (represented as HTML):
|
|
656
|
+
*
|
|
657
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
658
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
659
|
+
*
|
|
660
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
661
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
662
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
663
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
664
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
665
|
+
*
|
|
666
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
667
|
+
* window corresponds to the element at the end of the other window. This is
|
|
668
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
669
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
670
|
+
* children nodes themselves have not changed but merely moved in the
|
|
671
|
+
* following example:
|
|
672
|
+
*
|
|
673
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
674
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
675
|
+
*
|
|
676
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
677
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
678
|
+
* DOM.
|
|
679
|
+
*
|
|
680
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
681
|
+
* nodes in the old children which have the same key as the first element in
|
|
682
|
+
* our window on the new children. If we find such a node we handle calling
|
|
683
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
684
|
+
* what we find.
|
|
685
|
+
*
|
|
686
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
687
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
688
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
689
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
690
|
+
* children has collapsed we still have more nodes on the new children that
|
|
691
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
692
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
693
|
+
* sure the corresponding DOM nodes are removed.
|
|
694
|
+
*
|
|
695
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
696
|
+
* @param oldCh the old children of the parent node
|
|
697
|
+
* @param newVNode the new VNode which will replace the parent
|
|
698
|
+
* @param newCh the new children of the parent node
|
|
699
|
+
*/
|
|
522
700
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
523
701
|
let oldStartIdx = 0;
|
|
524
702
|
let newStartIdx = 0;
|
|
@@ -531,7 +709,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
531
709
|
let node;
|
|
532
710
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
533
711
|
if (oldStartVnode == null) {
|
|
534
|
-
//
|
|
712
|
+
// VNode might have been moved left
|
|
535
713
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
536
714
|
}
|
|
537
715
|
else if (oldEndVnode == null) {
|
|
@@ -544,42 +722,102 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
544
722
|
newEndVnode = newCh[--newEndIdx];
|
|
545
723
|
}
|
|
546
724
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
725
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
726
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
727
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
728
|
+
// since things are matched up in order.
|
|
547
729
|
patch(oldStartVnode, newStartVnode);
|
|
548
730
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
549
731
|
newStartVnode = newCh[++newStartIdx];
|
|
550
732
|
}
|
|
551
733
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
734
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
735
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
736
|
+
// need to move any DOM Nodes.
|
|
552
737
|
patch(oldEndVnode, newEndVnode);
|
|
553
738
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
554
739
|
newEndVnode = newCh[--newEndIdx];
|
|
555
740
|
}
|
|
556
741
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
557
|
-
// Vnode moved right
|
|
742
|
+
// case: "Vnode moved right"
|
|
743
|
+
//
|
|
744
|
+
// We've found that the last node in our window on the new children is
|
|
745
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
746
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
747
|
+
// nodes:
|
|
748
|
+
//
|
|
749
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
750
|
+
// ^^^^^^^^^^^
|
|
751
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
752
|
+
// ^^^^^^^^^^^^^
|
|
753
|
+
//
|
|
754
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
755
|
+
// and move the DOM element for `oldStartVnode`.
|
|
558
756
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
559
757
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
560
758
|
}
|
|
561
759
|
patch(oldStartVnode, newEndVnode);
|
|
760
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
761
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
762
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
763
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
764
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
765
|
+
//
|
|
766
|
+
// <old-start-node />
|
|
767
|
+
// <some-intervening-node />
|
|
768
|
+
// <old-end-node />
|
|
769
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
770
|
+
// <next-sibling />
|
|
771
|
+
//
|
|
772
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
773
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
774
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
775
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
776
|
+
// append it to the children of the parent element.
|
|
562
777
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
563
778
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
564
779
|
newEndVnode = newCh[--newEndIdx];
|
|
565
780
|
}
|
|
566
781
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
567
|
-
// Vnode moved left
|
|
782
|
+
// case: "Vnode moved left"
|
|
783
|
+
//
|
|
784
|
+
// We've found that the first node in our window on the new children is
|
|
785
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
786
|
+
// Visually, this is the layout of these two nodes:
|
|
787
|
+
//
|
|
788
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
789
|
+
// ^^^^^^^^^^^^^
|
|
790
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
791
|
+
// ^^^^^^^^^^^
|
|
792
|
+
//
|
|
793
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
794
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
795
|
+
// children etc) but we also need to move the DOM node to which
|
|
796
|
+
// `oldEndVnode` corresponds.
|
|
568
797
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
569
798
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
570
799
|
}
|
|
571
800
|
patch(oldEndVnode, newStartVnode);
|
|
801
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
802
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
803
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
804
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
805
|
+
// future.
|
|
572
806
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
573
807
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
574
808
|
newStartVnode = newCh[++newStartIdx];
|
|
575
809
|
}
|
|
576
810
|
else {
|
|
577
811
|
{
|
|
578
|
-
//
|
|
812
|
+
// We either didn't find an element in the old children that matches
|
|
813
|
+
// the key of the first new child OR the build is not using `key`
|
|
814
|
+
// attributes at all. In either case we need to create a new element
|
|
815
|
+
// for the new node.
|
|
579
816
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
580
817
|
newStartVnode = newCh[++newStartIdx];
|
|
581
818
|
}
|
|
582
819
|
if (node) {
|
|
820
|
+
// if we created a new node then handle inserting it to the DOM
|
|
583
821
|
{
|
|
584
822
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
585
823
|
}
|
|
@@ -587,18 +825,39 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
587
825
|
}
|
|
588
826
|
}
|
|
589
827
|
if (oldStartIdx > oldEndIdx) {
|
|
828
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
590
829
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
591
830
|
}
|
|
592
831
|
else if (newStartIdx > newEndIdx) {
|
|
832
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
833
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
834
|
+
// relevant DOM nodes)
|
|
593
835
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
594
836
|
}
|
|
595
837
|
};
|
|
596
|
-
|
|
838
|
+
/**
|
|
839
|
+
* Compare two VNodes to determine if they are the same
|
|
840
|
+
*
|
|
841
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
842
|
+
* information set on the two VNodes and can be misleading under certain
|
|
843
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
844
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
845
|
+
* checking that they have the same tag.
|
|
846
|
+
*
|
|
847
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
848
|
+
* changing order within a `children` array or something along those lines then
|
|
849
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
850
|
+
*
|
|
851
|
+
* @param leftVNode the first VNode to check
|
|
852
|
+
* @param rightVNode the second VNode to check
|
|
853
|
+
* @returns whether they're equal or not
|
|
854
|
+
*/
|
|
855
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
597
856
|
// compare if two vnode to see if they're "technically" the same
|
|
598
857
|
// need to have the same element tag, and same key to be the same
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
858
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
859
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
860
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
602
861
|
}
|
|
603
862
|
return true;
|
|
604
863
|
}
|
|
@@ -612,6 +871,14 @@ const referenceNode = (node) => {
|
|
|
612
871
|
return (node && node['s-ol']) || node;
|
|
613
872
|
};
|
|
614
873
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
874
|
+
/**
|
|
875
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
876
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
877
|
+
* children of the two nodes (if any).
|
|
878
|
+
*
|
|
879
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
880
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
881
|
+
*/
|
|
615
882
|
const patch = (oldVNode, newVNode) => {
|
|
616
883
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
617
884
|
const oldChildren = oldVNode.$children$;
|
|
@@ -620,7 +887,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
620
887
|
const text = newVNode.$text$;
|
|
621
888
|
let defaultHolder;
|
|
622
889
|
if (text === null) {
|
|
623
|
-
// element node
|
|
624
890
|
{
|
|
625
891
|
if (tag === 'slot')
|
|
626
892
|
;
|
|
@@ -633,6 +899,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
633
899
|
}
|
|
634
900
|
if (oldChildren !== null && newChildren !== null) {
|
|
635
901
|
// looks like there's child vnodes for both the old and new vnodes
|
|
902
|
+
// so we need to call `updateChildren` to reconcile them
|
|
636
903
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
637
904
|
}
|
|
638
905
|
else if (newChildren !== null) {
|
|
@@ -670,7 +937,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
670
937
|
let nodeType;
|
|
671
938
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
672
939
|
childNode = childNodes[i];
|
|
673
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
940
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
674
941
|
if (childNode['s-sr']) {
|
|
675
942
|
// this is a slot fallback node
|
|
676
943
|
// get the slot name for this slot reference node
|
|
@@ -682,7 +949,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
682
949
|
nodeType = childNodes[j].nodeType;
|
|
683
950
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
684
951
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
685
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
952
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
686
953
|
childNode.hidden = true;
|
|
687
954
|
break;
|
|
688
955
|
}
|
|
@@ -691,8 +958,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
691
958
|
// this is a default fallback slot node
|
|
692
959
|
// any element or text node (with content)
|
|
693
960
|
// should hide the default fallback slot node
|
|
694
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
695
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
961
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
962
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
696
963
|
childNode.hidden = true;
|
|
697
964
|
break;
|
|
698
965
|
}
|
|
@@ -770,13 +1037,13 @@ const relocateSlotContent = (elm) => {
|
|
|
770
1037
|
}
|
|
771
1038
|
}
|
|
772
1039
|
}
|
|
773
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1040
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
774
1041
|
relocateSlotContent(childNode);
|
|
775
1042
|
}
|
|
776
1043
|
}
|
|
777
1044
|
};
|
|
778
1045
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
779
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1046
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
780
1047
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
781
1048
|
return true;
|
|
782
1049
|
}
|
|
@@ -802,8 +1069,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
802
1069
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
803
1070
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
804
1071
|
hostTagName = hostElm.tagName;
|
|
1072
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1073
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1074
|
+
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1075
|
+
}
|
|
805
1076
|
rootVnode.$tag$ = null;
|
|
806
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1077
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
807
1078
|
hostRef.$vnode$ = rootVnode;
|
|
808
1079
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
809
1080
|
{
|
|
@@ -811,7 +1082,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
811
1082
|
}
|
|
812
1083
|
{
|
|
813
1084
|
contentRef = hostElm['s-cr'];
|
|
814
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1085
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
815
1086
|
// always reset
|
|
816
1087
|
checkSlotFallbackVisibility = false;
|
|
817
1088
|
}
|
|
@@ -820,7 +1091,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
820
1091
|
{
|
|
821
1092
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
822
1093
|
// the disconnectCallback from working
|
|
823
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1094
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
824
1095
|
if (checkSlotRelocate) {
|
|
825
1096
|
relocateSlotContent(rootVnode.$elm$);
|
|
826
1097
|
let relocateData;
|
|
@@ -878,7 +1149,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
878
1149
|
}
|
|
879
1150
|
else {
|
|
880
1151
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
881
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1152
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
882
1153
|
nodeToRelocate.hidden = true;
|
|
883
1154
|
}
|
|
884
1155
|
}
|
|
@@ -889,37 +1160,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
889
1160
|
}
|
|
890
1161
|
// done moving nodes around
|
|
891
1162
|
// allow the disconnect callback to work again
|
|
892
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1163
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
893
1164
|
// always reset
|
|
894
1165
|
relocateNodes.length = 0;
|
|
895
1166
|
}
|
|
896
1167
|
};
|
|
897
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
898
|
-
const createEvent = (ref, name, flags) => {
|
|
899
|
-
const elm = getElement(ref);
|
|
900
|
-
return {
|
|
901
|
-
emit: (detail) => {
|
|
902
|
-
return emitEvent(elm, name, {
|
|
903
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
904
|
-
composed: !!(flags & 2 /* Composed */),
|
|
905
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
906
|
-
detail,
|
|
907
|
-
});
|
|
908
|
-
},
|
|
909
|
-
};
|
|
910
|
-
};
|
|
911
|
-
/**
|
|
912
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
913
|
-
* @param elm the target of the Event
|
|
914
|
-
* @param name the name to give the custom Event
|
|
915
|
-
* @param opts options for configuring a custom Event
|
|
916
|
-
* @returns the custom Event
|
|
917
|
-
*/
|
|
918
|
-
const emitEvent = (elm, name, opts) => {
|
|
919
|
-
const ev = plt.ce(name, opts);
|
|
920
|
-
elm.dispatchEvent(ev);
|
|
921
|
-
return ev;
|
|
922
|
-
};
|
|
923
1168
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
924
1169
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
925
1170
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -927,10 +1172,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
927
1172
|
};
|
|
928
1173
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
929
1174
|
{
|
|
930
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1175
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
931
1176
|
}
|
|
932
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
933
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1177
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1178
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
934
1179
|
return;
|
|
935
1180
|
}
|
|
936
1181
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -946,12 +1191,15 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
946
1191
|
let promise;
|
|
947
1192
|
if (isInitialLoad) {
|
|
948
1193
|
{
|
|
949
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1194
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
950
1195
|
if (hostRef.$queuedListeners$) {
|
|
951
1196
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
952
1197
|
hostRef.$queuedListeners$ = null;
|
|
953
1198
|
}
|
|
954
1199
|
}
|
|
1200
|
+
{
|
|
1201
|
+
promise = safeCall(instance, 'componentWillLoad');
|
|
1202
|
+
}
|
|
955
1203
|
}
|
|
956
1204
|
{
|
|
957
1205
|
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
@@ -989,7 +1237,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
989
1237
|
}
|
|
990
1238
|
else {
|
|
991
1239
|
Promise.all(childrenPromises).then(postUpdate);
|
|
992
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1240
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
993
1241
|
childrenPromises.length = 0;
|
|
994
1242
|
}
|
|
995
1243
|
}
|
|
@@ -998,10 +1246,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
998
1246
|
try {
|
|
999
1247
|
instance = instance.render() ;
|
|
1000
1248
|
{
|
|
1001
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1249
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1002
1250
|
}
|
|
1003
1251
|
{
|
|
1004
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1252
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1005
1253
|
}
|
|
1006
1254
|
{
|
|
1007
1255
|
{
|
|
@@ -1023,13 +1271,20 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1023
1271
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1024
1272
|
const elm = hostRef.$hostElement$;
|
|
1025
1273
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1274
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1026
1275
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1027
|
-
|
|
1028
|
-
|
|
1276
|
+
{
|
|
1277
|
+
safeCall(instance, 'componentDidRender');
|
|
1278
|
+
}
|
|
1279
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1280
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1029
1281
|
{
|
|
1030
1282
|
// DOM WRITE!
|
|
1031
1283
|
addHydratedFlag(elm);
|
|
1032
1284
|
}
|
|
1285
|
+
{
|
|
1286
|
+
safeCall(instance, 'componentDidLoad');
|
|
1287
|
+
}
|
|
1033
1288
|
endPostUpdate();
|
|
1034
1289
|
{
|
|
1035
1290
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -1039,6 +1294,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1039
1294
|
}
|
|
1040
1295
|
}
|
|
1041
1296
|
else {
|
|
1297
|
+
{
|
|
1298
|
+
safeCall(instance, 'componentDidUpdate');
|
|
1299
|
+
}
|
|
1042
1300
|
endPostUpdate();
|
|
1043
1301
|
}
|
|
1044
1302
|
// load events fire from bottom to top
|
|
@@ -1048,10 +1306,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1048
1306
|
hostRef.$onRenderResolve$();
|
|
1049
1307
|
hostRef.$onRenderResolve$ = undefined;
|
|
1050
1308
|
}
|
|
1051
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1309
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1052
1310
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1053
1311
|
}
|
|
1054
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1312
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1055
1313
|
}
|
|
1056
1314
|
// ( •_•)
|
|
1057
1315
|
// ( •_•)>⌐■-■
|
|
@@ -1081,57 +1339,11 @@ const then = (promise, thenFn) => {
|
|
|
1081
1339
|
};
|
|
1082
1340
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1083
1341
|
;
|
|
1084
|
-
/**
|
|
1085
|
-
* Parse a new property value for a given property type.
|
|
1086
|
-
*
|
|
1087
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
1088
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
1089
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
1090
|
-
* 2. the type stored from `propType`.
|
|
1091
|
-
*
|
|
1092
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1093
|
-
*
|
|
1094
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1095
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1096
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1097
|
-
* ```tsx
|
|
1098
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
1099
|
-
* ```
|
|
1100
|
-
*
|
|
1101
|
-
* HTML prop values on the other hand, will always a string
|
|
1102
|
-
*
|
|
1103
|
-
* @param propValue the new value to coerce to some type
|
|
1104
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
1105
|
-
* @returns the parsed/coerced value
|
|
1106
|
-
*/
|
|
1107
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1108
|
-
// ensure this value is of the correct prop type
|
|
1109
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1110
|
-
if (propType & 4 /* Boolean */) {
|
|
1111
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1112
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1113
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1114
|
-
}
|
|
1115
|
-
if (propType & 2 /* Number */) {
|
|
1116
|
-
// force it to be a number
|
|
1117
|
-
return parseFloat(propValue);
|
|
1118
|
-
}
|
|
1119
|
-
if (propType & 1 /* String */) {
|
|
1120
|
-
// could have been passed as a number or boolean
|
|
1121
|
-
// but we still want it as a string
|
|
1122
|
-
return String(propValue);
|
|
1123
|
-
}
|
|
1124
|
-
// redundant return here for better minification
|
|
1125
|
-
return propValue;
|
|
1126
|
-
}
|
|
1127
|
-
// not sure exactly what type we want
|
|
1128
|
-
// so no need to change to a different type
|
|
1129
|
-
return propValue;
|
|
1130
|
-
};
|
|
1131
1342
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1132
1343
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1133
1344
|
// check our new property value against our internal value
|
|
1134
1345
|
const hostRef = getHostRef(ref);
|
|
1346
|
+
const elm = hostRef.$hostElement$ ;
|
|
1135
1347
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1136
1348
|
const flags = hostRef.$flags$;
|
|
1137
1349
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -1139,12 +1351,28 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1139
1351
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1140
1352
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1141
1353
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1142
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1354
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1143
1355
|
// gadzooks! the property's value has changed!!
|
|
1144
1356
|
// set our new value!
|
|
1145
1357
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1146
1358
|
if (instance) {
|
|
1147
|
-
|
|
1359
|
+
// get an array of method names of watch functions to call
|
|
1360
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1361
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1362
|
+
if (watchMethods) {
|
|
1363
|
+
// this instance is watching for when this property changed
|
|
1364
|
+
watchMethods.map((watchMethodName) => {
|
|
1365
|
+
try {
|
|
1366
|
+
// fire off each of the watch methods that are watching this property
|
|
1367
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1368
|
+
}
|
|
1369
|
+
catch (e) {
|
|
1370
|
+
consoleError(e, elm);
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1148
1376
|
if (instance.componentShouldUpdate) {
|
|
1149
1377
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1150
1378
|
return;
|
|
@@ -1159,14 +1387,27 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1159
1387
|
}
|
|
1160
1388
|
}
|
|
1161
1389
|
};
|
|
1390
|
+
/**
|
|
1391
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1392
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1393
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1394
|
+
*
|
|
1395
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1396
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1397
|
+
* @param flags a number used to store a series of bit flags
|
|
1398
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1399
|
+
*/
|
|
1162
1400
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1163
1401
|
if (cmpMeta.$members$) {
|
|
1402
|
+
if (Cstr.watchers) {
|
|
1403
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1404
|
+
}
|
|
1164
1405
|
// It's better to have a const than two Object.entries()
|
|
1165
1406
|
const members = Object.entries(cmpMeta.$members$);
|
|
1166
1407
|
const prototype = Cstr.prototype;
|
|
1167
1408
|
members.map(([memberName, [memberFlags]]) => {
|
|
1168
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1169
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1409
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1410
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1170
1411
|
// proxyComponent - prop
|
|
1171
1412
|
Object.defineProperty(prototype, memberName, {
|
|
1172
1413
|
get() {
|
|
@@ -1182,7 +1423,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1182
1423
|
});
|
|
1183
1424
|
}
|
|
1184
1425
|
});
|
|
1185
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1426
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1186
1427
|
const attrNameToPropName = new Map();
|
|
1187
1428
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1188
1429
|
plt.jmp(() => {
|
|
@@ -1238,10 +1479,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1238
1479
|
// create an array of attributes to observe
|
|
1239
1480
|
// and also create a map of html attribute name to js property name
|
|
1240
1481
|
Cstr.observedAttributes = members
|
|
1241
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1482
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1242
1483
|
.map(([propName, m]) => {
|
|
1243
1484
|
const attrName = m[1] || propName;
|
|
1244
1485
|
attrNameToPropName.set(attrName, propName);
|
|
1486
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1487
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1488
|
+
}
|
|
1245
1489
|
return attrName;
|
|
1246
1490
|
});
|
|
1247
1491
|
}
|
|
@@ -1250,10 +1494,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1250
1494
|
};
|
|
1251
1495
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1252
1496
|
// initializeComponent
|
|
1253
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1497
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1254
1498
|
{
|
|
1255
1499
|
// we haven't initialized this element yet
|
|
1256
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1500
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1257
1501
|
// lazy loaded components
|
|
1258
1502
|
// request the component's implementation to be
|
|
1259
1503
|
// wired up with the host element
|
|
@@ -1265,7 +1509,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1265
1509
|
endLoad();
|
|
1266
1510
|
}
|
|
1267
1511
|
if (!Cstr.isProxied) {
|
|
1268
|
-
|
|
1512
|
+
// we've never proxied this Constructor before
|
|
1513
|
+
// let's add the getters/setters to its prototype before
|
|
1514
|
+
// the first time we create an instance of the implementation
|
|
1515
|
+
{
|
|
1516
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1517
|
+
}
|
|
1518
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1269
1519
|
Cstr.isProxied = true;
|
|
1270
1520
|
}
|
|
1271
1521
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1273,7 +1523,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1273
1523
|
// but let's keep track of when we start and stop
|
|
1274
1524
|
// so that the getters/setters don't incorrectly step on data
|
|
1275
1525
|
{
|
|
1276
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1526
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1277
1527
|
}
|
|
1278
1528
|
// construct the lazy-loaded component implementation
|
|
1279
1529
|
// passing the hostRef is very important during
|
|
@@ -1286,7 +1536,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1286
1536
|
consoleError(e);
|
|
1287
1537
|
}
|
|
1288
1538
|
{
|
|
1289
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1539
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1540
|
+
}
|
|
1541
|
+
{
|
|
1542
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1290
1543
|
}
|
|
1291
1544
|
endNewInstance();
|
|
1292
1545
|
}
|
|
@@ -1296,7 +1549,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1296
1549
|
const scopeId = getScopeId(cmpMeta);
|
|
1297
1550
|
if (!styles.has(scopeId)) {
|
|
1298
1551
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1299
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1552
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1300
1553
|
endRegisterStyles();
|
|
1301
1554
|
}
|
|
1302
1555
|
}
|
|
@@ -1318,19 +1571,19 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1318
1571
|
}
|
|
1319
1572
|
};
|
|
1320
1573
|
const connectedCallback = (elm) => {
|
|
1321
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1574
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1322
1575
|
const hostRef = getHostRef(elm);
|
|
1323
1576
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1324
1577
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1325
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1578
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1326
1579
|
// first time this component has connected
|
|
1327
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1580
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1328
1581
|
{
|
|
1329
1582
|
// initUpdate
|
|
1330
1583
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1331
1584
|
// in here to act as original content anchors as we move nodes around
|
|
1332
1585
|
// host element has been connected to the DOM
|
|
1333
|
-
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1586
|
+
if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1334
1587
|
setContentReference(elm);
|
|
1335
1588
|
}
|
|
1336
1589
|
}
|
|
@@ -1353,7 +1606,7 @@ const connectedCallback = (elm) => {
|
|
|
1353
1606
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1354
1607
|
if (cmpMeta.$members$) {
|
|
1355
1608
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1356
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1609
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1357
1610
|
const value = elm[memberName];
|
|
1358
1611
|
delete elm[memberName];
|
|
1359
1612
|
elm[memberName] = value;
|
|
@@ -1385,14 +1638,18 @@ const setContentReference = (elm) => {
|
|
|
1385
1638
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1386
1639
|
};
|
|
1387
1640
|
const disconnectedCallback = (elm) => {
|
|
1388
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1641
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1389
1642
|
const hostRef = getHostRef(elm);
|
|
1643
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1390
1644
|
{
|
|
1391
1645
|
if (hostRef.$rmListeners$) {
|
|
1392
1646
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1393
1647
|
hostRef.$rmListeners$ = undefined;
|
|
1394
1648
|
}
|
|
1395
1649
|
}
|
|
1650
|
+
{
|
|
1651
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1652
|
+
}
|
|
1396
1653
|
}
|
|
1397
1654
|
};
|
|
1398
1655
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -1422,6 +1679,12 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1422
1679
|
{
|
|
1423
1680
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1424
1681
|
}
|
|
1682
|
+
{
|
|
1683
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1684
|
+
}
|
|
1685
|
+
{
|
|
1686
|
+
cmpMeta.$watchers$ = {};
|
|
1687
|
+
}
|
|
1425
1688
|
const tagName = cmpMeta.$tagName$;
|
|
1426
1689
|
const HostElement = class extends HTMLElement {
|
|
1427
1690
|
// StencilLazyHost
|
|
@@ -1430,7 +1693,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1430
1693
|
super(self);
|
|
1431
1694
|
self = this;
|
|
1432
1695
|
registerHost(self, cmpMeta);
|
|
1433
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1696
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1434
1697
|
// this component is using shadow dom
|
|
1435
1698
|
// and this browser supports shadow dom
|
|
1436
1699
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1465,7 +1728,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1465
1728
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1466
1729
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1467
1730
|
cmpTags.push(tagName);
|
|
1468
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1731
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1469
1732
|
}
|
|
1470
1733
|
});
|
|
1471
1734
|
});
|
|
@@ -1487,7 +1750,45 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1487
1750
|
// Fallback appLoad event
|
|
1488
1751
|
endBootstrap();
|
|
1489
1752
|
};
|
|
1490
|
-
const
|
|
1753
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1754
|
+
if (listeners) {
|
|
1755
|
+
listeners.map(([flags, name, method]) => {
|
|
1756
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1757
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1758
|
+
const opts = hostListenerOpts(flags);
|
|
1759
|
+
plt.ael(target, name, handler, opts);
|
|
1760
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1765
|
+
try {
|
|
1766
|
+
{
|
|
1767
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1768
|
+
// instance is ready, let's call it's member method for this event
|
|
1769
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1770
|
+
}
|
|
1771
|
+
else {
|
|
1772
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
catch (e) {
|
|
1777
|
+
consoleError(e);
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1781
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1782
|
+
return doc;
|
|
1783
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1784
|
+
return win;
|
|
1785
|
+
if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
1786
|
+
return doc.body;
|
|
1787
|
+
return elm;
|
|
1788
|
+
};
|
|
1789
|
+
// prettier-ignore
|
|
1790
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1791
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1491
1792
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1492
1793
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1493
1794
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1516,7 +1817,160 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1516
1817
|
if (module) {
|
|
1517
1818
|
return module[exportName];
|
|
1518
1819
|
}
|
|
1519
|
-
|
|
1820
|
+
|
|
1821
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1822
|
+
const processMod = importedModule => {
|
|
1823
|
+
cmpModules.set(bundleId, importedModule);
|
|
1824
|
+
return importedModule[exportName];
|
|
1825
|
+
}
|
|
1826
|
+
switch(bundleId) {
|
|
1827
|
+
|
|
1828
|
+
case 'p-button_3.cjs':
|
|
1829
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1830
|
+
/* webpackMode: "lazy" */
|
|
1831
|
+
'./p-button_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1832
|
+
case 'p-accordion.cjs':
|
|
1833
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1834
|
+
/* webpackMode: "lazy" */
|
|
1835
|
+
'./p-accordion.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1836
|
+
case 'p-avatar.cjs':
|
|
1837
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1838
|
+
/* webpackMode: "lazy" */
|
|
1839
|
+
'./p-avatar.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1840
|
+
case 'p-avatar-group.cjs':
|
|
1841
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1842
|
+
/* webpackMode: "lazy" */
|
|
1843
|
+
'./p-avatar-group.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1844
|
+
case 'p-card-body.cjs':
|
|
1845
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1846
|
+
/* webpackMode: "lazy" */
|
|
1847
|
+
'./p-card-body.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1848
|
+
case 'p-card-container.cjs':
|
|
1849
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1850
|
+
/* webpackMode: "lazy" */
|
|
1851
|
+
'./p-card-container.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1852
|
+
case 'p-card-header.cjs':
|
|
1853
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1854
|
+
/* webpackMode: "lazy" */
|
|
1855
|
+
'./p-card-header.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1856
|
+
case 'p-content-slider.cjs':
|
|
1857
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1858
|
+
/* webpackMode: "lazy" */
|
|
1859
|
+
'./p-content-slider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1860
|
+
case 'p-drawer.cjs':
|
|
1861
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1862
|
+
/* webpackMode: "lazy" */
|
|
1863
|
+
'./p-drawer.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1864
|
+
case 'p-info-panel.cjs':
|
|
1865
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1866
|
+
/* webpackMode: "lazy" */
|
|
1867
|
+
'./p-info-panel.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1868
|
+
case 'p-layout.cjs':
|
|
1869
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1870
|
+
/* webpackMode: "lazy" */
|
|
1871
|
+
'./p-layout.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1872
|
+
case 'p-modal.cjs':
|
|
1873
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1874
|
+
/* webpackMode: "lazy" */
|
|
1875
|
+
'./p-modal.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1876
|
+
case 'p-navbar.cjs':
|
|
1877
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1878
|
+
/* webpackMode: "lazy" */
|
|
1879
|
+
'./p-navbar.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1880
|
+
case 'p-navigation-item.cjs':
|
|
1881
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1882
|
+
/* webpackMode: "lazy" */
|
|
1883
|
+
'./p-navigation-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1884
|
+
case 'p-profile.cjs':
|
|
1885
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1886
|
+
/* webpackMode: "lazy" */
|
|
1887
|
+
'./p-profile.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1888
|
+
case 'p-select.cjs':
|
|
1889
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1890
|
+
/* webpackMode: "lazy" */
|
|
1891
|
+
'./p-select.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1892
|
+
case 'p-status.cjs':
|
|
1893
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1894
|
+
/* webpackMode: "lazy" */
|
|
1895
|
+
'./p-status.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1896
|
+
case 'p-stepper.cjs':
|
|
1897
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1898
|
+
/* webpackMode: "lazy" */
|
|
1899
|
+
'./p-stepper.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1900
|
+
case 'p-tab-group.cjs':
|
|
1901
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1902
|
+
/* webpackMode: "lazy" */
|
|
1903
|
+
'./p-tab-group.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1904
|
+
case 'p-tab-item.cjs':
|
|
1905
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1906
|
+
/* webpackMode: "lazy" */
|
|
1907
|
+
'./p-tab-item.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1908
|
+
case 'p-table.cjs':
|
|
1909
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1910
|
+
/* webpackMode: "lazy" */
|
|
1911
|
+
'./p-table.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1912
|
+
case 'p-table-column.cjs':
|
|
1913
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1914
|
+
/* webpackMode: "lazy" */
|
|
1915
|
+
'./p-table-column.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1916
|
+
case 'p-toast.cjs':
|
|
1917
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1918
|
+
/* webpackMode: "lazy" */
|
|
1919
|
+
'./p-toast.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1920
|
+
case 'p-toast-container.cjs':
|
|
1921
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1922
|
+
/* webpackMode: "lazy" */
|
|
1923
|
+
'./p-toast-container.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1924
|
+
case 'p-counter.cjs':
|
|
1925
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1926
|
+
/* webpackMode: "lazy" */
|
|
1927
|
+
'./p-counter.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1928
|
+
case 'p-drawer-body_3.cjs':
|
|
1929
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1930
|
+
/* webpackMode: "lazy" */
|
|
1931
|
+
'./p-drawer-body_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1932
|
+
case 'p-illustration_6.cjs':
|
|
1933
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1934
|
+
/* webpackMode: "lazy" */
|
|
1935
|
+
'./p-illustration_6.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1936
|
+
case 'p-modal-body_4.cjs':
|
|
1937
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1938
|
+
/* webpackMode: "lazy" */
|
|
1939
|
+
'./p-modal-body_4.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1940
|
+
case 'p-slider-indicator.cjs':
|
|
1941
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1942
|
+
/* webpackMode: "lazy" */
|
|
1943
|
+
'./p-slider-indicator.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1944
|
+
case 'p-stepper-item_2.cjs':
|
|
1945
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1946
|
+
/* webpackMode: "lazy" */
|
|
1947
|
+
'./p-stepper-item_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1948
|
+
case 'p-input-group_4.cjs':
|
|
1949
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1950
|
+
/* webpackMode: "lazy" */
|
|
1951
|
+
'./p-input-group_4.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1952
|
+
case 'p-page-size-select_3.cjs':
|
|
1953
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1954
|
+
/* webpackMode: "lazy" */
|
|
1955
|
+
'./p-page-size-select_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1956
|
+
case 'p-backdrop.cjs':
|
|
1957
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1958
|
+
/* webpackMode: "lazy" */
|
|
1959
|
+
'./p-backdrop.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1960
|
+
case 'p-dropdown_3.cjs':
|
|
1961
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1962
|
+
/* webpackMode: "lazy" */
|
|
1963
|
+
'./p-dropdown_3.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1964
|
+
case 'p-helper_2.cjs':
|
|
1965
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1966
|
+
/* webpackMode: "lazy" */
|
|
1967
|
+
'./p-helper_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1968
|
+
case 'p-divider.cjs':
|
|
1969
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1970
|
+
/* webpackMode: "lazy" */
|
|
1971
|
+
'./p-divider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1520
1974
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1521
1975
|
/* @vite-ignore */
|
|
1522
1976
|
/* webpackInclude: /\.entry\.js$/ */
|
|
@@ -1529,14 +1983,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1529
1983
|
return importedModule[exportName];
|
|
1530
1984
|
}, consoleError);
|
|
1531
1985
|
};
|
|
1532
|
-
const styles = new Map();
|
|
1986
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1987
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
1988
|
+
const doc = win.document || { head: {} };
|
|
1989
|
+
const plt = {
|
|
1990
|
+
$flags$: 0,
|
|
1991
|
+
$resourcesUrl$: '',
|
|
1992
|
+
jmp: (h) => h(),
|
|
1993
|
+
raf: (h) => requestAnimationFrame(h),
|
|
1994
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
1995
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
1996
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
1997
|
+
};
|
|
1998
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
1999
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2000
|
+
try {
|
|
2001
|
+
new CSSStyleSheet();
|
|
2002
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2003
|
+
}
|
|
2004
|
+
catch (e) { }
|
|
2005
|
+
return false;
|
|
2006
|
+
})()
|
|
2007
|
+
;
|
|
1533
2008
|
const queueDomReads = [];
|
|
1534
2009
|
const queueDomWrites = [];
|
|
1535
2010
|
const queueTask = (queue, write) => (cb) => {
|
|
1536
2011
|
queue.push(cb);
|
|
1537
2012
|
if (!queuePending) {
|
|
1538
2013
|
queuePending = true;
|
|
1539
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2014
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1540
2015
|
nextTick(flush);
|
|
1541
2016
|
}
|
|
1542
2017
|
else {
|