@revolist/revogrid 3.6.11 → 3.6.14
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/custom-element/_baseIteratee.js +0 -2
- package/custom-element/columnService.js +3 -5
- package/custom-element/consts.js +0 -2
- package/custom-element/data.store.js +32 -54
- package/custom-element/debounce.js +0 -2
- package/custom-element/dimension.helpers.js +0 -2
- package/custom-element/each.js +0 -2
- package/custom-element/filter.button.js +0 -2
- package/custom-element/identity.js +0 -2
- package/custom-element/index.d.ts +16 -21
- package/custom-element/index.js +15 -42
- package/custom-element/isSymbol.js +0 -2
- package/custom-element/keys.js +0 -2
- package/custom-element/localScrollService.js +0 -2
- package/custom-element/resize-observer.js +0 -2
- package/custom-element/revo-grid.js +99 -32
- package/custom-element/revogr-clipboard.js +4 -4
- package/custom-element/revogr-data.js +0 -2
- package/custom-element/revogr-data2.js +2 -13
- package/custom-element/revogr-edit.js +0 -2
- package/custom-element/revogr-edit2.js +2 -6
- package/custom-element/revogr-filter-panel.js +6 -10
- package/custom-element/revogr-focus.js +0 -2
- package/custom-element/revogr-focus2.js +2 -8
- package/custom-element/revogr-header.js +0 -2
- package/custom-element/revogr-header2.js +2 -10
- package/custom-element/revogr-order-editor.js +0 -2
- package/custom-element/revogr-order-editor2.js +2 -7
- package/custom-element/revogr-overlay-selection.js +0 -2
- package/custom-element/revogr-overlay-selection2.js +2 -14
- package/custom-element/revogr-row-headers.js +0 -2
- package/custom-element/revogr-row-headers2.js +2 -9
- package/custom-element/revogr-scroll-virtual.js +0 -2
- package/custom-element/revogr-scroll-virtual2.js +2 -5
- package/custom-element/revogr-temp-range.js +0 -2
- package/custom-element/revogr-temp-range2.js +3 -7
- package/custom-element/revogr-viewport-scroll.js +0 -2
- package/custom-element/revogr-viewport-scroll2.js +10 -5
- package/custom-element/selection.utils.js +0 -2
- package/custom-element/toInteger.js +0 -2
- package/custom-element/toNumber.js +0 -2
- package/custom-element/utils.js +0 -2
- package/dist/cjs/css-shim-9f5bc84d.js +9 -0
- package/dist/cjs/{debounce-a0628875.js → debounce-6cea2774.js} +1 -3
- package/dist/cjs/dom-fcb646f0.js +78 -0
- package/dist/cjs/{index-c209f988.js → index-cb904e00.js} +315 -667
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +25 -5
- package/dist/cjs/{resize-observer-cc749e66.js → resize-observer-bf327d6a.js} +0 -2
- package/dist/cjs/revo-grid.cjs.js +59 -8
- package/dist/cjs/revo-grid_11.cjs.entry.js +144 -143
- package/dist/cjs/revogr-clipboard.cjs.entry.js +3 -4
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -11
- package/dist/collection/collection-manifest.json +16 -16
- package/dist/collection/components/button/button.js +1 -2
- package/dist/collection/components/clipboard/revogr-clipboard.js +80 -86
- package/dist/collection/components/data/cellRenderer.js +5 -5
- package/dist/collection/components/data/columnService.js +8 -9
- package/dist/collection/components/data/revogr-data.js +226 -258
- package/dist/collection/components/data/rowRenderer.js +1 -2
- package/dist/collection/components/header/headerCellRenderer.js +7 -6
- package/dist/collection/components/header/headerRenderer.js +8 -7
- package/dist/collection/components/header/revogr-header.js +233 -259
- package/dist/collection/components/order/orderRenderer.js +6 -3
- package/dist/collection/components/order/revogr-order-editor.js +252 -279
- package/dist/collection/components/order/rowOrderService.js +1 -2
- package/dist/collection/components/overlay/autofill.service.js +7 -8
- package/dist/collection/components/overlay/clipboard.service.js +3 -4
- package/dist/collection/components/overlay/editors/edit.utils.js +1 -2
- package/dist/collection/components/overlay/editors/text.js +3 -4
- package/dist/collection/components/overlay/keyboard.service.js +5 -6
- package/dist/collection/components/overlay/revogr-edit.js +96 -112
- package/dist/collection/components/overlay/revogr-overlay-selection.js +476 -520
- package/dist/collection/components/overlay/selection.utils.js +1 -2
- package/dist/collection/components/revo-grid/revo-grid-style.css +13 -7
- package/dist/collection/components/revo-grid/revo-grid.js +1638 -1668
- package/dist/collection/components/revo-grid/viewport.helpers.js +0 -1
- package/dist/collection/components/revo-grid/viewport.interfaces.js +3 -1
- package/dist/collection/components/revo-grid/viewport.js +7 -4
- package/dist/collection/components/revo-grid/viewport.resize.service.js +2 -3
- package/dist/collection/components/revo-grid/viewport.scrolling.service.js +0 -1
- package/dist/collection/components/revo-grid/viewport.section.js +7 -5
- package/dist/collection/components/revo-grid/viewport.service.js +6 -7
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +147 -161
- package/dist/collection/components/rowHeaders/row-header-render.js +0 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +4 -2
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +168 -172
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +137 -159
- package/dist/collection/components/selection-focus/revogr-focus.js +128 -153
- package/dist/collection/components/selection-temp-range/revogr-temp-range-style.css +1 -1
- package/dist/collection/components/selection-temp-range/revogr-temp-range.js +77 -92
- package/dist/collection/global/global.js +2 -3
- package/dist/collection/index.js +0 -1
- package/dist/collection/plugins/autoSizeColumn.js +6 -7
- package/dist/collection/plugins/basePlugin.js +0 -1
- package/dist/collection/plugins/dispatcher.js +0 -1
- package/dist/collection/plugins/export/csv.js +1 -2
- package/dist/collection/plugins/export/export.plugin.js +5 -6
- package/dist/collection/plugins/export/types.js +3 -1
- package/dist/collection/plugins/filter/conditions/equal.js +0 -1
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js +0 -1
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +2 -3
- package/dist/collection/plugins/filter/conditions/number/lessThan.js +0 -1
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +2 -3
- package/dist/collection/plugins/filter/conditions/set.js +0 -1
- package/dist/collection/plugins/filter/conditions/string/beginswith.js +0 -1
- package/dist/collection/plugins/filter/conditions/string/contains.js +0 -1
- package/dist/collection/plugins/filter/filter.button.js +12 -7
- package/dist/collection/plugins/filter/filter.plugin.js +4 -5
- package/dist/collection/plugins/filter/filter.pop.js +238 -254
- package/dist/collection/plugins/filter/filter.service.js +8 -9
- package/dist/collection/plugins/filter/filter.style.css +3 -2
- package/dist/collection/plugins/filter/filter.types.js +3 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +5 -6
- package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +3 -4
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +3 -4
- package/dist/collection/plugins/groupingRow/grouping.const.js +1 -2
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +2 -3
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +13 -14
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +10 -6
- package/dist/collection/plugins/groupingRow/grouping.row.types.js +3 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js +1 -2
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +1 -2
- package/dist/collection/plugins/moveColumn/columnDragPlugin.js +7 -8
- package/dist/collection/plugins/moveColumn/columnOrderHandler.js +1 -2
- package/dist/collection/plugins/sorting/sorting.plugin.js +7 -8
- package/dist/collection/plugins/sorting/sorting.sign.js +1 -2
- package/dist/collection/plugins/stretchPlugin.js +3 -4
- package/dist/collection/plugins/trimmed/trimmed.plugin.js +0 -1
- package/dist/collection/services/cell.helpers.js +1 -2
- package/dist/collection/services/column.data.provider.js +13 -14
- package/dist/collection/services/data.provider.js +3 -4
- package/dist/collection/services/dimension.provider.js +4 -5
- package/dist/collection/services/localScrollService.js +1 -2
- package/dist/collection/services/resizable.directive.js +4 -3
- package/dist/collection/services/selection.store.connector.js +2 -3
- package/dist/collection/services/viewport.provider.js +3 -4
- package/dist/collection/store/dataSource/data.proxy.js +0 -1
- package/dist/collection/store/dataSource/data.store.js +9 -10
- package/dist/collection/store/dimension/dimension.helpers.js +4 -5
- package/dist/collection/store/dimension/dimension.store.js +7 -9
- package/dist/collection/store/selection/selection.helpers.js +1 -2
- package/dist/collection/store/selection/selection.store.js +3 -4
- package/dist/collection/store/selection/selection.store.service.js +1 -2
- package/dist/collection/store/storeTypes.js +0 -1
- package/dist/collection/store/viewPort/viewport.helpers.js +1 -2
- package/dist/collection/store/viewPort/viewport.store.js +3 -4
- package/dist/collection/themeManager/theme.compact.js +0 -1
- package/dist/collection/themeManager/theme.default.js +0 -1
- package/dist/collection/themeManager/theme.material.js +0 -1
- package/dist/collection/themeManager/themeService.js +8 -9
- package/dist/collection/utils/closestPolifill.js +0 -1
- package/dist/collection/utils/consts.js +0 -1
- package/dist/collection/utils/generateAlphabetHeader.js +0 -1
- package/dist/collection/utils/keyCodes.js +0 -1
- package/dist/collection/utils/keyCodes.utils.js +3 -4
- package/dist/collection/utils/platform.js +0 -1
- package/dist/collection/utils/resizeObserver.js +0 -1
- package/dist/collection/utils/store.utils.js +0 -1
- package/dist/collection/utils/utils.js +0 -1
- package/dist/esm/css-shim-e1e1ea5e.js +7 -0
- package/dist/esm/{debounce-cb7aac48.js → debounce-e4e6dd45.js} +1 -3
- package/dist/esm/dom-21bd1807.js +76 -0
- package/dist/esm/{index-f21f8a13.js → index-6f753b3c.js} +311 -667
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +25 -5
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/{resize-observer-4f34a839.js → resize-observer-00c48d78.js} +0 -2
- package/dist/esm/revo-grid.js +60 -6
- package/dist/esm/revo-grid_11.entry.js +144 -143
- package/dist/esm/revogr-clipboard.entry.js +3 -4
- package/dist/esm/revogr-filter-panel.entry.js +6 -11
- package/dist/esm-es5/css-shim-e1e1ea5e.js +4 -0
- package/dist/esm-es5/{debounce-cb7aac48.js → debounce-e4e6dd45.js} +1 -2
- package/dist/esm-es5/dom-21bd1807.js +24 -0
- package/dist/esm-es5/index-6f753b3c.js +4 -0
- package/dist/esm-es5/index.js +0 -1
- package/dist/esm-es5/loader.js +1 -2
- package/dist/esm-es5/{resize-observer-4f34a839.js → resize-observer-00c48d78.js} +1 -2
- package/dist/esm-es5/revo-grid.js +1 -2
- package/dist/esm-es5/revo-grid_11.entry.js +2 -3
- package/dist/esm-es5/revogr-clipboard.entry.js +2 -3
- package/dist/esm-es5/revogr-filter-panel.entry.js +2 -3
- package/dist/revo-grid/css-shim-bcf89cc0.system.js +4 -0
- package/dist/revo-grid/css-shim-e1e1ea5e.js +4 -0
- package/dist/revo-grid/{debounce-3aba7c4d.system.js → debounce-5a33c710.system.js} +1 -2
- package/dist/revo-grid/debounce-726bdadb.js +4 -0
- package/dist/revo-grid/dom-21bd1807.js +22 -0
- package/dist/revo-grid/dom-726246e2.system.js +24 -0
- package/dist/revo-grid/index-f14b41a0.system.js +5 -0
- package/dist/revo-grid/index-f30d1de1.js +5 -0
- package/dist/revo-grid/index.esm.js +0 -2
- package/dist/revo-grid/index.system.js +1 -2
- package/dist/revo-grid/resize-observer-00c48d78.js +4 -0
- package/dist/revo-grid/{resize-observer-2a36c9e4.system.js → resize-observer-8af0bc0e.system.js} +1 -2
- package/dist/revo-grid/revo-grid.esm.js +1 -2
- package/dist/revo-grid/revo-grid.js +7 -1
- package/dist/revo-grid/revo-grid.system.js +1 -2
- package/dist/revo-grid/revo-grid_11.entry.js +1 -2
- package/dist/revo-grid/revo-grid_11.system.entry.js +2 -3
- package/dist/revo-grid/revogr-clipboard.entry.js +1 -2
- package/dist/revo-grid/revogr-clipboard.system.entry.js +2 -3
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -2
- package/dist/revo-grid/revogr-filter-panel.system.entry.js +2 -3
- package/dist/types/components/data/cellRenderer.d.ts +1 -1
- package/dist/types/components/data/columnService.d.ts +4 -4
- package/dist/types/components/header/headerCellRenderer.d.ts +1 -1
- package/dist/types/components/header/headerRenderer.d.ts +1 -1
- package/dist/types/components/order/orderRenderer.d.ts +1 -1
- package/dist/types/components/order/rowOrderService.d.ts +1 -1
- package/dist/types/components/overlay/autofill.service.d.ts +1 -1
- package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/types/components/overlay/editors/text.d.ts +1 -1
- package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
- package/dist/types/components/overlay/selection.utils.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.interfaces.d.ts +5 -5
- package/dist/types/components/revo-grid/viewport.scrolling.service.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.section.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.service.d.ts +3 -3
- package/dist/types/components/rowHeaders/row-header-render.d.ts +1 -1
- package/dist/types/components.d.ts +0 -26
- package/dist/types/plugins/autoSizeColumn.d.ts +1 -1
- package/dist/types/plugins/dispatcher.d.ts +1 -1
- package/dist/types/plugins/export/csv.d.ts +1 -1
- package/dist/types/plugins/export/export.plugin.d.ts +1 -1
- package/dist/types/plugins/export/types.d.ts +2 -2
- package/dist/types/plugins/filter/filter.button.d.ts +1 -1
- package/dist/types/plugins/filter/filter.plugin.d.ts +6 -6
- package/dist/types/plugins/filter/filter.pop.d.ts +4 -4
- package/dist/types/plugins/filter/filter.service.d.ts +1 -1
- package/dist/types/plugins/filter/filter.types.d.ts +5 -5
- package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +1 -1
- package/dist/types/plugins/groupingColumn/grouping.col.plugin.d.ts +1 -1
- package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.row.renderer.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +5 -5
- package/dist/types/plugins/groupingRow/grouping.service.d.ts +1 -1
- package/dist/types/plugins/moveColumn/columnDragPlugin.d.ts +5 -5
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +1 -1
- package/dist/types/plugins/sorting/sorting.sign.d.ts +1 -1
- package/dist/types/plugins/trimmed/trimmed.plugin.d.ts +2 -2
- package/dist/types/services/column.data.provider.d.ts +4 -4
- package/dist/types/services/data.provider.d.ts +1 -1
- package/dist/types/services/dimension.provider.d.ts +2 -2
- package/dist/types/services/localScrollService.d.ts +1 -1
- package/dist/types/services/resizable.directive.d.ts +2 -2
- package/dist/types/services/selection.store.connector.d.ts +2 -2
- package/dist/types/services/viewport.provider.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +20 -95
- package/dist/types/store/dataSource/data.proxy.d.ts +1 -1
- package/dist/types/store/dataSource/data.store.d.ts +4 -4
- package/dist/types/store/dimension/dimension.helpers.d.ts +3 -3
- package/dist/types/store/selection/selection.store.d.ts +1 -1
- package/dist/types/store/viewPort/viewport.helpers.d.ts +2 -2
- package/loader/index.d.ts +1 -10
- package/loader/package.json +0 -1
- package/package.json +10 -10
- package/custom-element/_baseIteratee.js.map +0 -1
- package/custom-element/columnService.js.map +0 -1
- package/custom-element/consts.js.map +0 -1
- package/custom-element/data.store.js.map +0 -1
- package/custom-element/debounce.js.map +0 -1
- package/custom-element/dimension.helpers.js.map +0 -1
- package/custom-element/each.js.map +0 -1
- package/custom-element/filter.button.js.map +0 -1
- package/custom-element/identity.js.map +0 -1
- package/custom-element/index.js.map +0 -1
- package/custom-element/isSymbol.js.map +0 -1
- package/custom-element/keys.js.map +0 -1
- package/custom-element/localScrollService.js.map +0 -1
- package/custom-element/resize-observer.js.map +0 -1
- package/custom-element/revo-grid.js.map +0 -1
- package/custom-element/revogr-clipboard.js.map +0 -1
- package/custom-element/revogr-data.js.map +0 -1
- package/custom-element/revogr-data2.js.map +0 -1
- package/custom-element/revogr-edit.js.map +0 -1
- package/custom-element/revogr-edit2.js.map +0 -1
- package/custom-element/revogr-filter-panel.js.map +0 -1
- package/custom-element/revogr-focus.js.map +0 -1
- package/custom-element/revogr-focus2.js.map +0 -1
- package/custom-element/revogr-header.js.map +0 -1
- package/custom-element/revogr-header2.js.map +0 -1
- package/custom-element/revogr-order-editor.js.map +0 -1
- package/custom-element/revogr-order-editor2.js.map +0 -1
- package/custom-element/revogr-overlay-selection.js.map +0 -1
- package/custom-element/revogr-overlay-selection2.js.map +0 -1
- package/custom-element/revogr-row-headers.js.map +0 -1
- package/custom-element/revogr-row-headers2.js.map +0 -1
- package/custom-element/revogr-scroll-virtual.js.map +0 -1
- package/custom-element/revogr-scroll-virtual2.js.map +0 -1
- package/custom-element/revogr-temp-range.js.map +0 -1
- package/custom-element/revogr-temp-range2.js.map +0 -1
- package/custom-element/revogr-viewport-scroll.js.map +0 -1
- package/custom-element/revogr-viewport-scroll2.js.map +0 -1
- package/custom-element/selection.utils.js.map +0 -1
- package/custom-element/toInteger.js.map +0 -1
- package/custom-element/toNumber.js.map +0 -1
- package/custom-element/utils.js.map +0 -1
- package/dist/cjs/debounce-a0628875.js.map +0 -1
- package/dist/cjs/index-c209f988.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/resize-observer-cc749e66.js.map +0 -1
- package/dist/cjs/revo-grid.cjs.js.map +0 -1
- package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
- package/dist/cjs/revogr-clipboard.cjs.entry.js.map +0 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +0 -1
- package/dist/collection/components/button/button.js.map +0 -1
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +0 -1
- package/dist/collection/components/data/cellRenderer.js.map +0 -1
- package/dist/collection/components/data/columnService.js.map +0 -1
- package/dist/collection/components/data/revogr-data.js.map +0 -1
- package/dist/collection/components/data/rowRenderer.js.map +0 -1
- package/dist/collection/components/header/headerCellRenderer.js.map +0 -1
- package/dist/collection/components/header/headerRenderer.js.map +0 -1
- package/dist/collection/components/header/revogr-header.js.map +0 -1
- package/dist/collection/components/order/orderRenderer.js.map +0 -1
- package/dist/collection/components/order/revogr-order-editor.js.map +0 -1
- package/dist/collection/components/order/rowOrderService.js.map +0 -1
- package/dist/collection/components/overlay/autofill.service.js.map +0 -1
- package/dist/collection/components/overlay/clipboard.service.js.map +0 -1
- package/dist/collection/components/overlay/editors/edit.utils.js.map +0 -1
- package/dist/collection/components/overlay/editors/text.js.map +0 -1
- package/dist/collection/components/overlay/keyboard.service.js.map +0 -1
- package/dist/collection/components/overlay/revogr-edit.js.map +0 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +0 -1
- package/dist/collection/components/overlay/selection.utils.js.map +0 -1
- package/dist/collection/components/revo-grid/revo-grid.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.helpers.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.interfaces.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.resize.service.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.scrolling.service.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.section.js.map +0 -1
- package/dist/collection/components/revo-grid/viewport.service.js.map +0 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +0 -1
- package/dist/collection/components/rowHeaders/row-header-render.js.map +0 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +0 -1
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +0 -1
- package/dist/collection/components/selection-focus/revogr-focus.js.map +0 -1
- package/dist/collection/components/selection-temp-range/revogr-temp-range.js.map +0 -1
- package/dist/collection/global/global.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/plugins/autoSizeColumn.js.map +0 -1
- package/dist/collection/plugins/basePlugin.js.map +0 -1
- package/dist/collection/plugins/dispatcher.js.map +0 -1
- package/dist/collection/plugins/export/csv.js.map +0 -1
- package/dist/collection/plugins/export/export.plugin.js.map +0 -1
- package/dist/collection/plugins/export/types.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/equal.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/number/lessThan.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/set.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/string/beginswith.js.map +0 -1
- package/dist/collection/plugins/filter/conditions/string/contains.js.map +0 -1
- package/dist/collection/plugins/filter/filter.button.js.map +0 -1
- package/dist/collection/plugins/filter/filter.plugin.js.map +0 -1
- package/dist/collection/plugins/filter/filter.pop.js.map +0 -1
- package/dist/collection/plugins/filter/filter.service.js.map +0 -1
- package/dist/collection/plugins/filter/filter.types.js.map +0 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +0 -1
- package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js.map +0 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.const.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.row.types.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js.map +0 -1
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js.map +0 -1
- package/dist/collection/plugins/moveColumn/columnDragPlugin.js.map +0 -1
- package/dist/collection/plugins/moveColumn/columnOrderHandler.js.map +0 -1
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +0 -1
- package/dist/collection/plugins/sorting/sorting.sign.js.map +0 -1
- package/dist/collection/plugins/stretchPlugin.js.map +0 -1
- package/dist/collection/plugins/trimmed/trimmed.plugin.js.map +0 -1
- package/dist/collection/services/cell.helpers.js.map +0 -1
- package/dist/collection/services/column.data.provider.js.map +0 -1
- package/dist/collection/services/data.provider.js.map +0 -1
- package/dist/collection/services/dimension.provider.js.map +0 -1
- package/dist/collection/services/localScrollService.js.map +0 -1
- package/dist/collection/services/resizable.directive.js.map +0 -1
- package/dist/collection/services/selection.store.connector.js.map +0 -1
- package/dist/collection/services/viewport.provider.js.map +0 -1
- package/dist/collection/store/dataSource/data.proxy.js.map +0 -1
- package/dist/collection/store/dataSource/data.store.js.map +0 -1
- package/dist/collection/store/dimension/dimension.helpers.js.map +0 -1
- package/dist/collection/store/dimension/dimension.store.js.map +0 -1
- package/dist/collection/store/selection/selection.helpers.js.map +0 -1
- package/dist/collection/store/selection/selection.store.js.map +0 -1
- package/dist/collection/store/selection/selection.store.service.js.map +0 -1
- package/dist/collection/store/storeTypes.js.map +0 -1
- package/dist/collection/store/viewPort/viewport.helpers.js.map +0 -1
- package/dist/collection/store/viewPort/viewport.store.js.map +0 -1
- package/dist/collection/themeManager/theme.compact.js.map +0 -1
- package/dist/collection/themeManager/theme.default.js.map +0 -1
- package/dist/collection/themeManager/theme.material.js.map +0 -1
- package/dist/collection/themeManager/themeService.js.map +0 -1
- package/dist/collection/utils/closestPolifill.js.map +0 -1
- package/dist/collection/utils/consts.js.map +0 -1
- package/dist/collection/utils/generateAlphabetHeader.js.map +0 -1
- package/dist/collection/utils/keyCodes.js.map +0 -1
- package/dist/collection/utils/keyCodes.utils.js.map +0 -1
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/collection/utils/resizeObserver.js.map +0 -1
- package/dist/collection/utils/store.utils.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/esm/debounce-cb7aac48.js.map +0 -1
- package/dist/esm/index-f21f8a13.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/resize-observer-4f34a839.js.map +0 -1
- package/dist/esm/revo-grid.js.map +0 -1
- package/dist/esm/revo-grid_11.entry.js.map +0 -1
- package/dist/esm/revogr-clipboard.entry.js.map +0 -1
- package/dist/esm/revogr-filter-panel.entry.js.map +0 -1
- package/dist/esm-es5/debounce-cb7aac48.js.map +0 -1
- package/dist/esm-es5/index-f21f8a13.js +0 -5
- package/dist/esm-es5/index-f21f8a13.js.map +0 -1
- package/dist/esm-es5/index.js.map +0 -1
- package/dist/esm-es5/loader.js.map +0 -1
- package/dist/esm-es5/resize-observer-4f34a839.js.map +0 -1
- package/dist/esm-es5/revo-grid.js.map +0 -1
- package/dist/esm-es5/revo-grid_11.entry.js.map +0 -1
- package/dist/esm-es5/revogr-clipboard.entry.js.map +0 -1
- package/dist/esm-es5/revogr-filter-panel.entry.js.map +0 -1
- package/dist/revo-grid/debounce-3aba7c4d.system.js.map +0 -1
- package/dist/revo-grid/debounce-cb7aac48.js +0 -5
- package/dist/revo-grid/debounce-cb7aac48.js.map +0 -1
- package/dist/revo-grid/index-20224007.system.js +0 -6
- package/dist/revo-grid/index-20224007.system.js.map +0 -1
- package/dist/revo-grid/index-f21f8a13.js +0 -6
- package/dist/revo-grid/index-f21f8a13.js.map +0 -1
- package/dist/revo-grid/index.esm.js.map +0 -1
- package/dist/revo-grid/index.system.js.map +0 -1
- package/dist/revo-grid/resize-observer-2a36c9e4.system.js.map +0 -1
- package/dist/revo-grid/resize-observer-4f34a839.js +0 -5
- package/dist/revo-grid/resize-observer-4f34a839.js.map +0 -1
- package/dist/revo-grid/revo-grid.esm.js.map +0 -1
- package/dist/revo-grid/revo-grid.system.js.map +0 -1
- package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
- package/dist/revo-grid/revo-grid_11.system.entry.js.map +0 -1
- package/dist/revo-grid/revogr-clipboard.entry.js.map +0 -1
- package/dist/revo-grid/revogr-clipboard.system.entry.js.map +0 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +0 -1
- package/dist/revo-grid/revogr-filter-panel.system.entry.js.map +0 -1
|
@@ -25,14 +25,6 @@ function _interopNamespace(e) {
|
|
|
25
25
|
|
|
26
26
|
const NAMESPACE = 'revo-grid';
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Virtual DOM patching algorithm based on Snabbdom by
|
|
30
|
-
* Simon Friis Vindum (@paldepind)
|
|
31
|
-
* Licensed under the MIT License
|
|
32
|
-
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
33
|
-
*
|
|
34
|
-
* Modified for Stencil's renderer and slot projection
|
|
35
|
-
*/
|
|
36
28
|
let contentRef;
|
|
37
29
|
let hostTagName;
|
|
38
30
|
let useNativeShadowDom = false;
|
|
@@ -41,6 +33,64 @@ let checkSlotRelocate = false;
|
|
|
41
33
|
let isSvgMode = false;
|
|
42
34
|
let renderingRef = null;
|
|
43
35
|
let queuePending = false;
|
|
36
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
37
|
+
const CSS = win.CSS ;
|
|
38
|
+
const doc = win.document || { head: {} };
|
|
39
|
+
const plt = {
|
|
40
|
+
$flags$: 0,
|
|
41
|
+
$resourcesUrl$: '',
|
|
42
|
+
jmp: (h) => h(),
|
|
43
|
+
raf: (h) => requestAnimationFrame(h),
|
|
44
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
45
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
46
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
47
|
+
};
|
|
48
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
49
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
50
|
+
try {
|
|
51
|
+
new CSSStyleSheet();
|
|
52
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
53
|
+
}
|
|
54
|
+
catch (e) { }
|
|
55
|
+
return false;
|
|
56
|
+
})()
|
|
57
|
+
;
|
|
58
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
59
|
+
if (listeners) {
|
|
60
|
+
listeners.map(([flags, name, method]) => {
|
|
61
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
62
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
63
|
+
const opts = hostListenerOpts(flags);
|
|
64
|
+
plt.ael(target, name, handler, opts);
|
|
65
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
70
|
+
try {
|
|
71
|
+
{
|
|
72
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
73
|
+
// instance is ready, let's call it's member method for this event
|
|
74
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
consoleError(e);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
86
|
+
if (flags & 4 /* TargetDocument */)
|
|
87
|
+
return doc;
|
|
88
|
+
return elm;
|
|
89
|
+
};
|
|
90
|
+
// prettier-ignore
|
|
91
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
92
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
93
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
44
94
|
const createTime = (fnName, tagName = '') => {
|
|
45
95
|
{
|
|
46
96
|
return () => {
|
|
@@ -55,8 +105,75 @@ const uniqueTime = (key, measureText) => {
|
|
|
55
105
|
};
|
|
56
106
|
}
|
|
57
107
|
};
|
|
58
|
-
const
|
|
59
|
-
const
|
|
108
|
+
const rootAppliedStyles = new WeakMap();
|
|
109
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
110
|
+
let style = styles.get(scopeId);
|
|
111
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
112
|
+
style = (style || new CSSStyleSheet());
|
|
113
|
+
if (typeof style === 'string') {
|
|
114
|
+
style = cssText;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
style.replaceSync(cssText);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
style = cssText;
|
|
122
|
+
}
|
|
123
|
+
styles.set(scopeId, style);
|
|
124
|
+
};
|
|
125
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
126
|
+
let scopeId = getScopeId(cmpMeta);
|
|
127
|
+
const style = styles.get(scopeId);
|
|
128
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
129
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
130
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
131
|
+
if (style) {
|
|
132
|
+
if (typeof style === 'string') {
|
|
133
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
134
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
135
|
+
let styleElm;
|
|
136
|
+
if (!appliedStyles) {
|
|
137
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
138
|
+
}
|
|
139
|
+
if (!appliedStyles.has(scopeId)) {
|
|
140
|
+
{
|
|
141
|
+
if (plt.$cssShim$) {
|
|
142
|
+
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
|
|
143
|
+
const newScopeId = styleElm['s-sc'];
|
|
144
|
+
if (newScopeId) {
|
|
145
|
+
scopeId = newScopeId;
|
|
146
|
+
// we don't want to add this styleID to the appliedStyles Set
|
|
147
|
+
// since the cssVarShim might need to apply several different
|
|
148
|
+
// stylesheets for the same component
|
|
149
|
+
appliedStyles = null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
styleElm = doc.createElement('style');
|
|
154
|
+
styleElm.innerHTML = style;
|
|
155
|
+
}
|
|
156
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
157
|
+
}
|
|
158
|
+
if (appliedStyles) {
|
|
159
|
+
appliedStyles.add(scopeId);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
164
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return scopeId;
|
|
168
|
+
};
|
|
169
|
+
const attachStyles = (hostRef) => {
|
|
170
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
171
|
+
const elm = hostRef.$hostElement$;
|
|
172
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
173
|
+
addStyle(elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
|
|
174
|
+
endAttachStyles();
|
|
175
|
+
};
|
|
176
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
60
177
|
/**
|
|
61
178
|
* Default style mode id
|
|
62
179
|
*/
|
|
@@ -70,30 +187,11 @@ const EMPTY_OBJ = {};
|
|
|
70
187
|
*/
|
|
71
188
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
72
189
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
73
|
-
/**
|
|
74
|
-
* Check whether a value is a 'complex type', defined here as an object or a
|
|
75
|
-
* function.
|
|
76
|
-
*
|
|
77
|
-
* @param o the value to check
|
|
78
|
-
* @returns whether it's a complex type or not
|
|
79
|
-
*/
|
|
80
190
|
const isComplexType = (o) => {
|
|
81
191
|
// https://jsperf.com/typeof-fn-object/5
|
|
82
192
|
o = typeof o;
|
|
83
193
|
return o === 'object' || o === 'function';
|
|
84
194
|
};
|
|
85
|
-
/**
|
|
86
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
|
87
|
-
* out of a DOM's head.
|
|
88
|
-
*
|
|
89
|
-
* @param doc The DOM containing the `head` to query against
|
|
90
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
91
|
-
* exists or the tag has no content.
|
|
92
|
-
*/
|
|
93
|
-
function queryNonceMetaTagContent(doc) {
|
|
94
|
-
var _a, _b, _c;
|
|
95
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
96
|
-
}
|
|
97
195
|
/**
|
|
98
196
|
* Production h() function based on Preact by
|
|
99
197
|
* Jason Miller (@developit)
|
|
@@ -102,6 +200,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
102
200
|
*
|
|
103
201
|
* Modified for Stencil's compiler and vdom
|
|
104
202
|
*/
|
|
203
|
+
// const stack: any[] = [];
|
|
105
204
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
106
205
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
107
206
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -171,14 +270,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
171
270
|
}
|
|
172
271
|
return vnode;
|
|
173
272
|
};
|
|
174
|
-
/**
|
|
175
|
-
* A utility function for creating a virtual DOM node from a tag and some
|
|
176
|
-
* possible text content.
|
|
177
|
-
*
|
|
178
|
-
* @param tag the tag for this element
|
|
179
|
-
* @param text possible text content for the node
|
|
180
|
-
* @returns a newly-minted virtual DOM node
|
|
181
|
-
*/
|
|
182
273
|
const newVNode = (tag, text) => {
|
|
183
274
|
const vnode = {
|
|
184
275
|
$flags$: 0,
|
|
@@ -199,31 +290,11 @@ const newVNode = (tag, text) => {
|
|
|
199
290
|
return vnode;
|
|
200
291
|
};
|
|
201
292
|
const Host = {};
|
|
202
|
-
/**
|
|
203
|
-
* Check whether a given node is a Host node or not
|
|
204
|
-
*
|
|
205
|
-
* @param node the virtual DOM node to check
|
|
206
|
-
* @returns whether it's a Host node or not
|
|
207
|
-
*/
|
|
208
293
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
209
|
-
/**
|
|
210
|
-
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
211
|
-
*
|
|
212
|
-
* Note that these functions convert from {@link d.VNode} to
|
|
213
|
-
* {@link d.ChildNode} to give functional component developers a friendly
|
|
214
|
-
* interface.
|
|
215
|
-
*/
|
|
216
294
|
const vdomFnUtils = {
|
|
217
295
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
218
296
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
219
297
|
};
|
|
220
|
-
/**
|
|
221
|
-
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
222
|
-
* friendlier public interface (hence, 'convertToPublic').
|
|
223
|
-
*
|
|
224
|
-
* @param node the virtual DOM node to convert
|
|
225
|
-
* @returns a converted child node
|
|
226
|
-
*/
|
|
227
298
|
const convertToPublic = (node) => ({
|
|
228
299
|
vattrs: node.$attrs$,
|
|
229
300
|
vchildren: node.$children$,
|
|
@@ -232,15 +303,6 @@ const convertToPublic = (node) => ({
|
|
|
232
303
|
vtag: node.$tag$,
|
|
233
304
|
vtext: node.$text$,
|
|
234
305
|
});
|
|
235
|
-
/**
|
|
236
|
-
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
237
|
-
* order to use the resulting object in the virtual DOM. The initial object was
|
|
238
|
-
* likely created as part of presenting a public API, so converting it back
|
|
239
|
-
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
240
|
-
*
|
|
241
|
-
* @param node the child node to convert
|
|
242
|
-
* @returns a converted virtual DOM node
|
|
243
|
-
*/
|
|
244
306
|
const convertToPrivate = (node) => {
|
|
245
307
|
if (typeof node.vtag === 'function') {
|
|
246
308
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -259,141 +321,6 @@ const convertToPrivate = (node) => {
|
|
|
259
321
|
vnode.$name$ = node.vname;
|
|
260
322
|
return vnode;
|
|
261
323
|
};
|
|
262
|
-
/**
|
|
263
|
-
* Parse a new property value for a given property type.
|
|
264
|
-
*
|
|
265
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
266
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
267
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
268
|
-
* 2. the type stored from `propType`.
|
|
269
|
-
*
|
|
270
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
271
|
-
*
|
|
272
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
273
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
274
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
275
|
-
* ```tsx
|
|
276
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
277
|
-
* ```
|
|
278
|
-
*
|
|
279
|
-
* HTML prop values on the other hand, will always a string
|
|
280
|
-
*
|
|
281
|
-
* @param propValue the new value to coerce to some type
|
|
282
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
283
|
-
* @returns the parsed/coerced value
|
|
284
|
-
*/
|
|
285
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
286
|
-
// ensure this value is of the correct prop type
|
|
287
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
288
|
-
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
289
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
290
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
291
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
292
|
-
}
|
|
293
|
-
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
294
|
-
// force it to be a number
|
|
295
|
-
return parseFloat(propValue);
|
|
296
|
-
}
|
|
297
|
-
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
298
|
-
// could have been passed as a number or boolean
|
|
299
|
-
// but we still want it as a string
|
|
300
|
-
return String(propValue);
|
|
301
|
-
}
|
|
302
|
-
// redundant return here for better minification
|
|
303
|
-
return propValue;
|
|
304
|
-
}
|
|
305
|
-
// not sure exactly what type we want
|
|
306
|
-
// so no need to change to a different type
|
|
307
|
-
return propValue;
|
|
308
|
-
};
|
|
309
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
310
|
-
const createEvent = (ref, name, flags) => {
|
|
311
|
-
const elm = getElement(ref);
|
|
312
|
-
return {
|
|
313
|
-
emit: (detail) => {
|
|
314
|
-
return emitEvent(elm, name, {
|
|
315
|
-
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
316
|
-
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
317
|
-
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
318
|
-
detail,
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
/**
|
|
324
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
325
|
-
* @param elm the target of the Event
|
|
326
|
-
* @param name the name to give the custom Event
|
|
327
|
-
* @param opts options for configuring a custom Event
|
|
328
|
-
* @returns the custom Event
|
|
329
|
-
*/
|
|
330
|
-
const emitEvent = (elm, name, opts) => {
|
|
331
|
-
const ev = plt.ce(name, opts);
|
|
332
|
-
elm.dispatchEvent(ev);
|
|
333
|
-
return ev;
|
|
334
|
-
};
|
|
335
|
-
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
336
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
337
|
-
let style = styles.get(scopeId);
|
|
338
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
339
|
-
style = (style || new CSSStyleSheet());
|
|
340
|
-
if (typeof style === 'string') {
|
|
341
|
-
style = cssText;
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
style.replaceSync(cssText);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
style = cssText;
|
|
349
|
-
}
|
|
350
|
-
styles.set(scopeId, style);
|
|
351
|
-
};
|
|
352
|
-
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
353
|
-
var _a;
|
|
354
|
-
const scopeId = getScopeId(cmpMeta);
|
|
355
|
-
const style = styles.get(scopeId);
|
|
356
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
357
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
358
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
359
|
-
if (style) {
|
|
360
|
-
if (typeof style === 'string') {
|
|
361
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
362
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
363
|
-
let styleElm;
|
|
364
|
-
if (!appliedStyles) {
|
|
365
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
366
|
-
}
|
|
367
|
-
if (!appliedStyles.has(scopeId)) {
|
|
368
|
-
{
|
|
369
|
-
styleElm = doc.createElement('style');
|
|
370
|
-
styleElm.innerHTML = style;
|
|
371
|
-
// Apply CSP nonce to the style tag if it exists
|
|
372
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
373
|
-
if (nonce != null) {
|
|
374
|
-
styleElm.setAttribute('nonce', nonce);
|
|
375
|
-
}
|
|
376
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
377
|
-
}
|
|
378
|
-
if (appliedStyles) {
|
|
379
|
-
appliedStyles.add(scopeId);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
384
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
return scopeId;
|
|
388
|
-
};
|
|
389
|
-
const attachStyles = (hostRef) => {
|
|
390
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
391
|
-
const elm = hostRef.$hostElement$;
|
|
392
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
393
|
-
addStyle(elm.getRootNode(), cmpMeta);
|
|
394
|
-
endAttachStyles();
|
|
395
|
-
};
|
|
396
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
397
324
|
/**
|
|
398
325
|
* Production setAccessor() function based on Preact by
|
|
399
326
|
* Jason Miller (@developit)
|
|
@@ -530,7 +457,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
530
457
|
}
|
|
531
458
|
}
|
|
532
459
|
}
|
|
533
|
-
else if ((!isProp || flags & 4 /*
|
|
460
|
+
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
534
461
|
newValue = newValue === true ? '' : newValue;
|
|
535
462
|
if (xlink) {
|
|
536
463
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -548,7 +475,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
548
475
|
// if the element passed in is a shadow root, which is a document fragment
|
|
549
476
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
550
477
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
551
|
-
const elm = newVnode.$elm$.nodeType === 11 /*
|
|
478
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
552
479
|
? newVnode.$elm$.host
|
|
553
480
|
: newVnode.$elm$;
|
|
554
481
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -566,16 +493,6 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
566
493
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
567
494
|
}
|
|
568
495
|
};
|
|
569
|
-
/**
|
|
570
|
-
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
571
|
-
*
|
|
572
|
-
* @param oldParentVNode the parent VNode from the previous render
|
|
573
|
-
* @param newParentVNode the parent VNode from the current render
|
|
574
|
-
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
575
|
-
* children, for which we will create a new DOM node
|
|
576
|
-
* @param parentElm the parent DOM node which our new node will be a child of
|
|
577
|
-
* @returns the newly created node
|
|
578
|
-
*/
|
|
579
496
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
580
497
|
// tslint:disable-next-line: prefer-const
|
|
581
498
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -589,16 +506,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
589
506
|
if (newVNode.$tag$ === 'slot') {
|
|
590
507
|
newVNode.$flags$ |= newVNode.$children$
|
|
591
508
|
? // slot element has fallback content
|
|
592
|
-
2 /*
|
|
509
|
+
2 /* isSlotFallback */
|
|
593
510
|
: // slot element does not have fallback content
|
|
594
|
-
1 /*
|
|
511
|
+
1 /* isSlotReference */;
|
|
595
512
|
}
|
|
596
513
|
}
|
|
597
514
|
if (newVNode.$text$ !== null) {
|
|
598
515
|
// create text node
|
|
599
516
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
600
517
|
}
|
|
601
|
-
else if (newVNode.$flags$ & 1 /*
|
|
518
|
+
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
602
519
|
// create a slot reference node
|
|
603
520
|
elm = newVNode.$elm$ =
|
|
604
521
|
doc.createTextNode('');
|
|
@@ -608,7 +525,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
608
525
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
609
526
|
}
|
|
610
527
|
// create element
|
|
611
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /*
|
|
528
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
612
529
|
? 'slot-fb'
|
|
613
530
|
: newVNode.$tag$)
|
|
614
531
|
);
|
|
@@ -643,7 +560,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
643
560
|
}
|
|
644
561
|
{
|
|
645
562
|
elm['s-hn'] = hostTagName;
|
|
646
|
-
if (newVNode.$flags$ & (2 /*
|
|
563
|
+
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
647
564
|
// remember the content reference comment
|
|
648
565
|
elm['s-sr'] = true;
|
|
649
566
|
// remember the content reference comment
|
|
@@ -662,7 +579,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
662
579
|
return elm;
|
|
663
580
|
};
|
|
664
581
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
665
|
-
plt.$flags$ |= 1 /*
|
|
582
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
666
583
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
667
584
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
668
585
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -683,23 +600,8 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
683
600
|
putBackInOriginalLocation(childNode, recursive);
|
|
684
601
|
}
|
|
685
602
|
}
|
|
686
|
-
plt.$flags$ &= ~1 /*
|
|
603
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
687
604
|
};
|
|
688
|
-
/**
|
|
689
|
-
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
690
|
-
* add them to the DOM in the appropriate place.
|
|
691
|
-
*
|
|
692
|
-
* @param parentElm the DOM node which should be used as a parent for the new
|
|
693
|
-
* DOM nodes
|
|
694
|
-
* @param before a child of the `parentElm` which the new children should be
|
|
695
|
-
* inserted before (optional)
|
|
696
|
-
* @param parentVNode the parent virtual DOM node
|
|
697
|
-
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
698
|
-
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
699
|
-
* creating DOM nodes (inclusive)
|
|
700
|
-
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
701
|
-
* creating DOM nodes (inclusive)
|
|
702
|
-
*/
|
|
703
605
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
704
606
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
705
607
|
let childNode;
|
|
@@ -713,112 +615,30 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
713
615
|
}
|
|
714
616
|
}
|
|
715
617
|
};
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
if (elm) {
|
|
734
|
-
{
|
|
735
|
-
// we're removing this element
|
|
736
|
-
// so it's possible we need to show slot fallback content now
|
|
737
|
-
checkSlotFallbackVisibility = true;
|
|
738
|
-
if (elm['s-ol']) {
|
|
739
|
-
// remove the original location comment
|
|
740
|
-
elm['s-ol'].remove();
|
|
741
|
-
}
|
|
742
|
-
else {
|
|
743
|
-
// it's possible that child nodes of the node
|
|
744
|
-
// that's being removed are slot nodes
|
|
745
|
-
putBackInOriginalLocation(elm, true);
|
|
746
|
-
}
|
|
618
|
+
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
619
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
620
|
+
if ((vnode = vnodes[startIdx])) {
|
|
621
|
+
elm = vnode.$elm$;
|
|
622
|
+
callNodeRefs(vnode);
|
|
623
|
+
{
|
|
624
|
+
// we're removing this element
|
|
625
|
+
// so it's possible we need to show slot fallback content now
|
|
626
|
+
checkSlotFallbackVisibility = true;
|
|
627
|
+
if (elm['s-ol']) {
|
|
628
|
+
// remove the original location comment
|
|
629
|
+
elm['s-ol'].remove();
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
// it's possible that child nodes of the node
|
|
633
|
+
// that's being removed are slot nodes
|
|
634
|
+
putBackInOriginalLocation(elm, true);
|
|
747
635
|
}
|
|
748
|
-
// remove the vnode's element from the dom
|
|
749
|
-
elm.remove();
|
|
750
636
|
}
|
|
637
|
+
// remove the vnode's element from the dom
|
|
638
|
+
elm.remove();
|
|
751
639
|
}
|
|
752
640
|
}
|
|
753
641
|
};
|
|
754
|
-
/**
|
|
755
|
-
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
756
|
-
* traversing the two collections of children, identifying nodes that are
|
|
757
|
-
* conserved or changed, calling out to `patch` to make any necessary
|
|
758
|
-
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
759
|
-
*
|
|
760
|
-
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
761
|
-
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
762
|
-
* 'windows' by storing start and end indices and references to the
|
|
763
|
-
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
764
|
-
* to the entire array, but we progressively narrow the windows until there are
|
|
765
|
-
* no children left to update by doing the following:
|
|
766
|
-
*
|
|
767
|
-
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
768
|
-
* that if we have an initial array like the following we'll end up dealing
|
|
769
|
-
* only with a window bounded by the highlighted elements:
|
|
770
|
-
*
|
|
771
|
-
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
772
|
-
* ^^^^^^ ^^^^^^
|
|
773
|
-
*
|
|
774
|
-
* 2. Check to see if the elements at the head and tail positions are equal
|
|
775
|
-
* across the windows. This will basically detect elements which haven't
|
|
776
|
-
* been added, removed, or changed position, i.e. if you had the following
|
|
777
|
-
* VNode elements (represented as HTML):
|
|
778
|
-
*
|
|
779
|
-
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
780
|
-
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
781
|
-
*
|
|
782
|
-
* Then when comparing the children of the `<div>` tag we check the equality
|
|
783
|
-
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
784
|
-
* same tag in the same position, we'd be able to avoid completely
|
|
785
|
-
* re-rendering the subtree under them with a new DOM element and would just
|
|
786
|
-
* call out to `patch` to handle reconciling their children and so on.
|
|
787
|
-
*
|
|
788
|
-
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
789
|
-
* window corresponds to the element at the end of the other window. This is
|
|
790
|
-
* a heuristic which will let us identify _some_ situations in which
|
|
791
|
-
* elements have changed position, for instance it _should_ detect that the
|
|
792
|
-
* children nodes themselves have not changed but merely moved in the
|
|
793
|
-
* following example:
|
|
794
|
-
*
|
|
795
|
-
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
796
|
-
* newVNode: `<div><element-two /><element-one /></div>`
|
|
797
|
-
*
|
|
798
|
-
* If we find cases like this then we also need to move the concrete DOM
|
|
799
|
-
* elements corresponding to the moved children to write the re-order to the
|
|
800
|
-
* DOM.
|
|
801
|
-
*
|
|
802
|
-
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
803
|
-
* nodes in the old children which have the same key as the first element in
|
|
804
|
-
* our window on the new children. If we find such a node we handle calling
|
|
805
|
-
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
806
|
-
* what we find.
|
|
807
|
-
*
|
|
808
|
-
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
809
|
-
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
810
|
-
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
811
|
-
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
812
|
-
* children has collapsed we still have more nodes on the new children that
|
|
813
|
-
* we haven't dealt with yet then we need to add them, or if the new children
|
|
814
|
-
* collapse but we still have unhandled _old_ children then we need to make
|
|
815
|
-
* sure the corresponding DOM nodes are removed.
|
|
816
|
-
*
|
|
817
|
-
* @param parentElm the node into which the parent VNode is rendered
|
|
818
|
-
* @param oldCh the old children of the parent node
|
|
819
|
-
* @param newVNode the new VNode which will replace the parent
|
|
820
|
-
* @param newCh the new children of the parent node
|
|
821
|
-
*/
|
|
822
642
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
823
643
|
let oldStartIdx = 0;
|
|
824
644
|
let newStartIdx = 0;
|
|
@@ -834,7 +654,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
834
654
|
let elmToMove;
|
|
835
655
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
836
656
|
if (oldStartVnode == null) {
|
|
837
|
-
//
|
|
657
|
+
// Vnode might have been moved left
|
|
838
658
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
839
659
|
}
|
|
840
660
|
else if (oldEndVnode == null) {
|
|
@@ -847,100 +667,37 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
847
667
|
newEndVnode = newCh[--newEndIdx];
|
|
848
668
|
}
|
|
849
669
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
850
|
-
// if the start nodes are the same then we should patch the new VNode
|
|
851
|
-
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
852
|
-
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
853
|
-
// since things are matched up in order.
|
|
854
670
|
patch(oldStartVnode, newStartVnode);
|
|
855
671
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
856
672
|
newStartVnode = newCh[++newStartIdx];
|
|
857
673
|
}
|
|
858
674
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
859
|
-
// likewise, if the end nodes are the same we patch new onto old and
|
|
860
|
-
// decrement our end indices, and also likewise in this case we don't
|
|
861
|
-
// need to move any DOM Nodes.
|
|
862
675
|
patch(oldEndVnode, newEndVnode);
|
|
863
676
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
864
677
|
newEndVnode = newCh[--newEndIdx];
|
|
865
678
|
}
|
|
866
679
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
867
|
-
//
|
|
868
|
-
//
|
|
869
|
-
// We've found that the last node in our window on the new children is
|
|
870
|
-
// the same VNode as the _first_ node in our window on the old children
|
|
871
|
-
// we're dealing with now. Visually, this is the layout of these two
|
|
872
|
-
// nodes:
|
|
873
|
-
//
|
|
874
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
875
|
-
// ^^^^^^^^^^^
|
|
876
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
877
|
-
// ^^^^^^^^^^^^^
|
|
878
|
-
//
|
|
879
|
-
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
880
|
-
// and move the DOM element for `oldStartVnode`.
|
|
680
|
+
// Vnode moved right
|
|
881
681
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
882
682
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
883
683
|
}
|
|
884
684
|
patch(oldStartVnode, newEndVnode);
|
|
885
|
-
// We need to move the element for `oldStartVnode` into a position which
|
|
886
|
-
// will be appropriate for `newEndVnode`. For this we can use
|
|
887
|
-
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
888
|
-
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
889
|
-
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
890
|
-
//
|
|
891
|
-
// <old-start-node />
|
|
892
|
-
// <some-intervening-node />
|
|
893
|
-
// <old-end-node />
|
|
894
|
-
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
895
|
-
// <next-sibling />
|
|
896
|
-
//
|
|
897
|
-
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
898
|
-
// the node for `oldStartVnode` at the end of the children of
|
|
899
|
-
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
900
|
-
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
901
|
-
// append it to the children of the parent element.
|
|
902
685
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
903
686
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
904
687
|
newEndVnode = newCh[--newEndIdx];
|
|
905
688
|
}
|
|
906
689
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
907
|
-
//
|
|
908
|
-
//
|
|
909
|
-
// We've found that the first node in our window on the new children is
|
|
910
|
-
// the same VNode as the _last_ node in our window on the old children.
|
|
911
|
-
// Visually, this is the layout of these two nodes:
|
|
912
|
-
//
|
|
913
|
-
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
914
|
-
// ^^^^^^^^^^^^^
|
|
915
|
-
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
916
|
-
// ^^^^^^^^^^^
|
|
917
|
-
//
|
|
918
|
-
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
919
|
-
// (which will handle updating any changed attributes, reconciling their
|
|
920
|
-
// children etc) but we also need to move the DOM node to which
|
|
921
|
-
// `oldEndVnode` corresponds.
|
|
690
|
+
// Vnode moved left
|
|
922
691
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
923
692
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
924
693
|
}
|
|
925
694
|
patch(oldEndVnode, newStartVnode);
|
|
926
|
-
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
927
|
-
// the same node, so since we're here we know that they are not. Thus we
|
|
928
|
-
// can move the element for `oldEndVnode` _before_ the element for
|
|
929
|
-
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
930
|
-
// future.
|
|
931
695
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
932
696
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
933
697
|
newStartVnode = newCh[++newStartIdx];
|
|
934
698
|
}
|
|
935
699
|
else {
|
|
936
|
-
//
|
|
937
|
-
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
938
|
-
// in the JSX for a DOM element in the implementation of a Stencil
|
|
939
|
-
// component.
|
|
940
|
-
//
|
|
941
|
-
// First we check to see if there are any nodes in the array of old
|
|
942
|
-
// children which have the same key as the first node in the new
|
|
943
|
-
// children.
|
|
700
|
+
// createKeyToOldIdx
|
|
944
701
|
idxInOld = -1;
|
|
945
702
|
{
|
|
946
703
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -951,32 +708,23 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
951
708
|
}
|
|
952
709
|
}
|
|
953
710
|
if (idxInOld >= 0) {
|
|
954
|
-
// We found a node in the old children which matches up with the first
|
|
955
|
-
// node in the new children! So let's deal with that
|
|
956
711
|
elmToMove = oldCh[idxInOld];
|
|
957
712
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
958
|
-
// the tag doesn't match so we'll need a new DOM element
|
|
959
713
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
960
714
|
}
|
|
961
715
|
else {
|
|
962
716
|
patch(elmToMove, newStartVnode);
|
|
963
|
-
// invalidate the matching old node so that we won't try to update it
|
|
964
|
-
// again later on
|
|
965
717
|
oldCh[idxInOld] = undefined;
|
|
966
718
|
node = elmToMove.$elm$;
|
|
967
719
|
}
|
|
968
720
|
newStartVnode = newCh[++newStartIdx];
|
|
969
721
|
}
|
|
970
722
|
else {
|
|
971
|
-
//
|
|
972
|
-
// the key of the first new child OR the build is not using `key`
|
|
973
|
-
// attributes at all. In either case we need to create a new element
|
|
974
|
-
// for the new node.
|
|
723
|
+
// new element
|
|
975
724
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
976
725
|
newStartVnode = newCh[++newStartIdx];
|
|
977
726
|
}
|
|
978
727
|
if (node) {
|
|
979
|
-
// if we created a new node then handle inserting it to the DOM
|
|
980
728
|
{
|
|
981
729
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
982
730
|
}
|
|
@@ -984,44 +732,21 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
984
732
|
}
|
|
985
733
|
}
|
|
986
734
|
if (oldStartIdx > oldEndIdx) {
|
|
987
|
-
// we have some more new nodes to add which don't match up with old nodes
|
|
988
735
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
989
736
|
}
|
|
990
737
|
else if (newStartIdx > newEndIdx) {
|
|
991
|
-
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
992
|
-
// in the new array, so lets remove them (which entails cleaning up the
|
|
993
|
-
// relevant DOM nodes)
|
|
994
738
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
995
739
|
}
|
|
996
740
|
};
|
|
997
|
-
|
|
998
|
-
* Compare two VNodes to determine if they are the same
|
|
999
|
-
*
|
|
1000
|
-
* **NB**: This function is an equality _heuristic_ based on the available
|
|
1001
|
-
* information set on the two VNodes and can be misleading under certain
|
|
1002
|
-
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
1003
|
-
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
1004
|
-
* checking that they have the same tag.
|
|
1005
|
-
*
|
|
1006
|
-
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
1007
|
-
* changing order within a `children` array or something along those lines then
|
|
1008
|
-
* we could obtain a false negative and then have to do needless re-rendering
|
|
1009
|
-
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
1010
|
-
*
|
|
1011
|
-
* @param leftVNode the first VNode to check
|
|
1012
|
-
* @param rightVNode the second VNode to check
|
|
1013
|
-
* @returns whether they're equal or not
|
|
1014
|
-
*/
|
|
1015
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
741
|
+
const isSameVnode = (vnode1, vnode2) => {
|
|
1016
742
|
// compare if two vnode to see if they're "technically" the same
|
|
1017
743
|
// need to have the same element tag, and same key to be the same
|
|
1018
|
-
if (
|
|
1019
|
-
if (
|
|
1020
|
-
return
|
|
744
|
+
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
745
|
+
if (vnode1.$tag$ === 'slot') {
|
|
746
|
+
return vnode1.$name$ === vnode2.$name$;
|
|
1021
747
|
}
|
|
1022
|
-
// this will be set if components in the build have `key` attrs set on them
|
|
1023
748
|
{
|
|
1024
|
-
return
|
|
749
|
+
return vnode1.$key$ === vnode2.$key$;
|
|
1025
750
|
}
|
|
1026
751
|
}
|
|
1027
752
|
return false;
|
|
@@ -1034,14 +759,6 @@ const referenceNode = (node) => {
|
|
|
1034
759
|
return (node && node['s-ol']) || node;
|
|
1035
760
|
};
|
|
1036
761
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
1037
|
-
/**
|
|
1038
|
-
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1039
|
-
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1040
|
-
* children of the two nodes (if any).
|
|
1041
|
-
*
|
|
1042
|
-
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1043
|
-
* @param newVNode a new VNode representing an updated version of the old one
|
|
1044
|
-
*/
|
|
1045
762
|
const patch = (oldVNode, newVNode) => {
|
|
1046
763
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
1047
764
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1055,6 +772,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1055
772
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1056
773
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1057
774
|
}
|
|
775
|
+
// element node
|
|
1058
776
|
{
|
|
1059
777
|
if (tag === 'slot')
|
|
1060
778
|
;
|
|
@@ -1067,7 +785,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1067
785
|
}
|
|
1068
786
|
if (oldChildren !== null && newChildren !== null) {
|
|
1069
787
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1070
|
-
// so we need to call `updateChildren` to reconcile them
|
|
1071
788
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
1072
789
|
}
|
|
1073
790
|
else if (newChildren !== null) {
|
|
@@ -1108,7 +825,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1108
825
|
let nodeType;
|
|
1109
826
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1110
827
|
childNode = childNodes[i];
|
|
1111
|
-
if (childNode.nodeType === 1 /*
|
|
828
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1112
829
|
if (childNode['s-sr']) {
|
|
1113
830
|
// this is a slot fallback node
|
|
1114
831
|
// get the slot name for this slot reference node
|
|
@@ -1120,7 +837,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1120
837
|
nodeType = childNodes[j].nodeType;
|
|
1121
838
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
1122
839
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
1123
|
-
if (nodeType === 1 /*
|
|
840
|
+
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1124
841
|
childNode.hidden = true;
|
|
1125
842
|
break;
|
|
1126
843
|
}
|
|
@@ -1129,8 +846,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1129
846
|
// this is a default fallback slot node
|
|
1130
847
|
// any element or text node (with content)
|
|
1131
848
|
// should hide the default fallback slot node
|
|
1132
|
-
if (nodeType === 1 /*
|
|
1133
|
-
(nodeType === 3 /*
|
|
849
|
+
if (nodeType === 1 /* ElementNode */ ||
|
|
850
|
+
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1134
851
|
childNode.hidden = true;
|
|
1135
852
|
break;
|
|
1136
853
|
}
|
|
@@ -1208,13 +925,13 @@ const relocateSlotContent = (elm) => {
|
|
|
1208
925
|
}
|
|
1209
926
|
}
|
|
1210
927
|
}
|
|
1211
|
-
if (childNode.nodeType === 1 /*
|
|
928
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1212
929
|
relocateSlotContent(childNode);
|
|
1213
930
|
}
|
|
1214
931
|
}
|
|
1215
932
|
};
|
|
1216
933
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
1217
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
934
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1218
935
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
1219
936
|
return true;
|
|
1220
937
|
}
|
|
@@ -1228,31 +945,12 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
|
1228
945
|
}
|
|
1229
946
|
return slotNameAttr === '';
|
|
1230
947
|
};
|
|
1231
|
-
|
|
1232
|
-
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
|
|
1233
|
-
* calling them with `null`. This signals that the DOM element corresponding to
|
|
1234
|
-
* the VDom node has been removed from the DOM.
|
|
1235
|
-
*
|
|
1236
|
-
* @param vNode a virtual DOM node
|
|
1237
|
-
*/
|
|
1238
|
-
const nullifyVNodeRefs = (vNode) => {
|
|
948
|
+
const callNodeRefs = (vNode) => {
|
|
1239
949
|
{
|
|
1240
950
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1241
|
-
vNode.$children$ && vNode.$children$.map(
|
|
951
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1242
952
|
}
|
|
1243
953
|
};
|
|
1244
|
-
/**
|
|
1245
|
-
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1246
|
-
*
|
|
1247
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1248
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1249
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1250
|
-
* relocation, and reflecting attributes.
|
|
1251
|
-
*
|
|
1252
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1253
|
-
* the DOM node into which it should be rendered.
|
|
1254
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1255
|
-
*/
|
|
1256
954
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
1257
955
|
const hostElm = hostRef.$hostElement$;
|
|
1258
956
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -1264,12 +962,12 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1264
962
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1265
963
|
}
|
|
1266
964
|
rootVnode.$tag$ = null;
|
|
1267
|
-
rootVnode.$flags$ |= 4 /*
|
|
965
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1268
966
|
hostRef.$vnode$ = rootVnode;
|
|
1269
967
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
1270
968
|
{
|
|
1271
969
|
contentRef = hostElm['s-cr'];
|
|
1272
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /*
|
|
970
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1273
971
|
// always reset
|
|
1274
972
|
checkSlotFallbackVisibility = false;
|
|
1275
973
|
}
|
|
@@ -1278,7 +976,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1278
976
|
{
|
|
1279
977
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1280
978
|
// the disconnectCallback from working
|
|
1281
|
-
plt.$flags$ |= 1 /*
|
|
979
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1282
980
|
if (checkSlotRelocate) {
|
|
1283
981
|
relocateSlotContent(rootVnode.$elm$);
|
|
1284
982
|
let relocateData;
|
|
@@ -1336,7 +1034,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1336
1034
|
}
|
|
1337
1035
|
else {
|
|
1338
1036
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1339
|
-
if (nodeToRelocate.nodeType === 1 /*
|
|
1037
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1340
1038
|
nodeToRelocate.hidden = true;
|
|
1341
1039
|
}
|
|
1342
1040
|
}
|
|
@@ -1347,11 +1045,37 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1347
1045
|
}
|
|
1348
1046
|
// done moving nodes around
|
|
1349
1047
|
// allow the disconnect callback to work again
|
|
1350
|
-
plt.$flags$ &= ~1 /*
|
|
1048
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1351
1049
|
// always reset
|
|
1352
1050
|
relocateNodes.length = 0;
|
|
1353
1051
|
}
|
|
1354
1052
|
};
|
|
1053
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
1054
|
+
const createEvent = (ref, name, flags) => {
|
|
1055
|
+
const elm = getElement(ref);
|
|
1056
|
+
return {
|
|
1057
|
+
emit: (detail) => {
|
|
1058
|
+
return emitEvent(elm, name, {
|
|
1059
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1060
|
+
composed: !!(flags & 2 /* Composed */),
|
|
1061
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1062
|
+
detail,
|
|
1063
|
+
});
|
|
1064
|
+
},
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
1069
|
+
* @param elm the target of the Event
|
|
1070
|
+
* @param name the name to give the custom Event
|
|
1071
|
+
* @param opts options for configuring a custom Event
|
|
1072
|
+
* @returns the custom Event
|
|
1073
|
+
*/
|
|
1074
|
+
const emitEvent = (elm, name, opts) => {
|
|
1075
|
+
const ev = plt.ce(name, opts);
|
|
1076
|
+
elm.dispatchEvent(ev);
|
|
1077
|
+
return ev;
|
|
1078
|
+
};
|
|
1355
1079
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1356
1080
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1357
1081
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1359,10 +1083,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1359
1083
|
};
|
|
1360
1084
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1361
1085
|
{
|
|
1362
|
-
hostRef.$flags$ |= 16 /*
|
|
1086
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1363
1087
|
}
|
|
1364
|
-
if (hostRef.$flags$ & 4 /*
|
|
1365
|
-
hostRef.$flags$ |= 512 /*
|
|
1088
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1089
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1366
1090
|
return;
|
|
1367
1091
|
}
|
|
1368
1092
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1372,86 +1096,30 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
1372
1096
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1373
1097
|
return writeTask(dispatch) ;
|
|
1374
1098
|
};
|
|
1375
|
-
/**
|
|
1376
|
-
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
1377
|
-
* component lifecycle methods like `componentWillLoad` as well as
|
|
1378
|
-
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
1379
|
-
*
|
|
1380
|
-
* @param hostRef a reference to a host DOM node
|
|
1381
|
-
* @param isInitialLoad whether we're on the initial load or not
|
|
1382
|
-
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
1383
|
-
* the component
|
|
1384
|
-
*/
|
|
1385
1099
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1386
1100
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1387
1101
|
const instance = hostRef.$lazyInstance$ ;
|
|
1388
|
-
|
|
1389
|
-
// little promise-based queue. We start out with it `undefined`. When we add
|
|
1390
|
-
// the first function to the queue we'll set this variable to be that
|
|
1391
|
-
// function's return value. When we attempt to add subsequent values to the
|
|
1392
|
-
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
1393
|
-
// the new function off of that `Promise` using `.then()`. This will give our
|
|
1394
|
-
// queue two nice properties:
|
|
1395
|
-
//
|
|
1396
|
-
// 1. If all functions added to the queue are synchronous they'll be called
|
|
1397
|
-
// synchronously right away.
|
|
1398
|
-
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
1399
|
-
// called in order after `dispatchHooks` exits.
|
|
1400
|
-
let maybePromise;
|
|
1102
|
+
let promise;
|
|
1401
1103
|
if (isInitialLoad) {
|
|
1402
1104
|
{
|
|
1403
|
-
hostRef.$flags$ |= 256 /*
|
|
1105
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1404
1106
|
if (hostRef.$queuedListeners$) {
|
|
1405
1107
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1406
|
-
hostRef.$queuedListeners$ =
|
|
1108
|
+
hostRef.$queuedListeners$ = null;
|
|
1407
1109
|
}
|
|
1408
1110
|
}
|
|
1409
1111
|
{
|
|
1410
|
-
|
|
1411
|
-
// whatever's going on in that `Promise` before we launch into
|
|
1412
|
-
// rendering the component, doing other lifecycle stuff, etc. So
|
|
1413
|
-
// in that case we assign the returned promise to the variable we
|
|
1414
|
-
// declared above to hold a possible 'queueing' Promise
|
|
1415
|
-
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
1112
|
+
promise = safeCall(instance, 'componentWillLoad');
|
|
1416
1113
|
}
|
|
1417
1114
|
}
|
|
1418
1115
|
{
|
|
1419
|
-
|
|
1116
|
+
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1420
1117
|
}
|
|
1421
1118
|
endSchedule();
|
|
1422
|
-
return
|
|
1119
|
+
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1423
1120
|
};
|
|
1424
|
-
/**
|
|
1425
|
-
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
1426
|
-
* of functions to be called.
|
|
1427
|
-
*
|
|
1428
|
-
* The queue is ordered on the basis of the first argument. If it's
|
|
1429
|
-
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
1430
|
-
* be called synchronously (although note that this function may return a
|
|
1431
|
-
* `Promise`). The idea is that then the return value of that enqueueing
|
|
1432
|
-
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
1433
|
-
* functions can be enqueued by calling this function again with that `Promise`
|
|
1434
|
-
* as the first argument.
|
|
1435
|
-
*
|
|
1436
|
-
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
1437
|
-
* @param fn a function to enqueue
|
|
1438
|
-
* @returns either a `Promise` or the return value of the provided function
|
|
1439
|
-
*/
|
|
1440
|
-
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
1441
|
-
/**
|
|
1442
|
-
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
1443
|
-
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
1444
|
-
* the global has been overwritten, this is could be misleading, so we also do
|
|
1445
|
-
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
1446
|
-
* defined and a function.
|
|
1447
|
-
*
|
|
1448
|
-
* @param maybePromise it might be a promise!
|
|
1449
|
-
* @returns whether it is or not
|
|
1450
|
-
*/
|
|
1451
|
-
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
1452
|
-
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
1453
1121
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1454
|
-
|
|
1122
|
+
// updateComponent
|
|
1455
1123
|
const elm = hostRef.$hostElement$;
|
|
1456
1124
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1457
1125
|
const rc = elm['s-rc'];
|
|
@@ -1463,6 +1131,9 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1463
1131
|
{
|
|
1464
1132
|
callRender(hostRef, instance);
|
|
1465
1133
|
}
|
|
1134
|
+
if (plt.$cssShim$) {
|
|
1135
|
+
plt.$cssShim$.updateHost(elm);
|
|
1136
|
+
}
|
|
1466
1137
|
if (rc) {
|
|
1467
1138
|
// ok, so turns out there are some child host elements
|
|
1468
1139
|
// waiting on this parent element to load
|
|
@@ -1473,14 +1144,14 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1473
1144
|
endRender();
|
|
1474
1145
|
endUpdate();
|
|
1475
1146
|
{
|
|
1476
|
-
const childrenPromises =
|
|
1147
|
+
const childrenPromises = elm['s-p'];
|
|
1477
1148
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1478
1149
|
if (childrenPromises.length === 0) {
|
|
1479
1150
|
postUpdate();
|
|
1480
1151
|
}
|
|
1481
1152
|
else {
|
|
1482
1153
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1483
|
-
hostRef.$flags$ |= 4 /*
|
|
1154
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1484
1155
|
childrenPromises.length = 0;
|
|
1485
1156
|
}
|
|
1486
1157
|
}
|
|
@@ -1490,10 +1161,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1490
1161
|
renderingRef = instance;
|
|
1491
1162
|
instance = instance.render && instance.render();
|
|
1492
1163
|
{
|
|
1493
|
-
hostRef.$flags$ &= ~16 /*
|
|
1164
|
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1494
1165
|
}
|
|
1495
1166
|
{
|
|
1496
|
-
hostRef.$flags$ |= 2 /*
|
|
1167
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1497
1168
|
}
|
|
1498
1169
|
{
|
|
1499
1170
|
{
|
|
@@ -1522,8 +1193,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1522
1193
|
{
|
|
1523
1194
|
safeCall(instance, 'componentDidRender');
|
|
1524
1195
|
}
|
|
1525
|
-
if (!(hostRef.$flags$ & 64 /*
|
|
1526
|
-
hostRef.$flags$ |= 64 /*
|
|
1196
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1197
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1527
1198
|
{
|
|
1528
1199
|
// DOM WRITE!
|
|
1529
1200
|
addHydratedFlag(elm);
|
|
@@ -1552,10 +1223,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1552
1223
|
hostRef.$onRenderResolve$();
|
|
1553
1224
|
hostRef.$onRenderResolve$ = undefined;
|
|
1554
1225
|
}
|
|
1555
|
-
if (hostRef.$flags$ & 512 /*
|
|
1226
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1556
1227
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1557
1228
|
}
|
|
1558
|
-
hostRef.$flags$ &= ~(4 /*
|
|
1229
|
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1559
1230
|
}
|
|
1560
1231
|
// ( •_•)
|
|
1561
1232
|
// ( •_•)>⌐■-■
|
|
@@ -1566,7 +1237,7 @@ const forceUpdate = (ref) => {
|
|
|
1566
1237
|
const hostRef = getHostRef(ref);
|
|
1567
1238
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1568
1239
|
if (isConnected &&
|
|
1569
|
-
(hostRef.$flags$ & (2 /*
|
|
1240
|
+
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1570
1241
|
scheduleUpdate(hostRef, false);
|
|
1571
1242
|
}
|
|
1572
1243
|
// Returns "true" when the forced update was successfully scheduled
|
|
@@ -1592,8 +1263,58 @@ const safeCall = (instance, method, arg) => {
|
|
|
1592
1263
|
}
|
|
1593
1264
|
return undefined;
|
|
1594
1265
|
};
|
|
1266
|
+
const then = (promise, thenFn) => {
|
|
1267
|
+
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1268
|
+
};
|
|
1595
1269
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1596
1270
|
;
|
|
1271
|
+
/**
|
|
1272
|
+
* Parse a new property value for a given property type.
|
|
1273
|
+
*
|
|
1274
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
1275
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
1276
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
1277
|
+
* 2. the type stored from `propType`.
|
|
1278
|
+
*
|
|
1279
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1280
|
+
*
|
|
1281
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1282
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1283
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1284
|
+
* ```tsx
|
|
1285
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
1286
|
+
* ```
|
|
1287
|
+
*
|
|
1288
|
+
* HTML prop values on the other hand, will always a string
|
|
1289
|
+
*
|
|
1290
|
+
* @param propValue the new value to coerce to some type
|
|
1291
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
1292
|
+
* @returns the parsed/coerced value
|
|
1293
|
+
*/
|
|
1294
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
1295
|
+
// ensure this value is of the correct prop type
|
|
1296
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
1297
|
+
if (propType & 4 /* Boolean */) {
|
|
1298
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
1299
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1300
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1301
|
+
}
|
|
1302
|
+
if (propType & 2 /* Number */) {
|
|
1303
|
+
// force it to be a number
|
|
1304
|
+
return parseFloat(propValue);
|
|
1305
|
+
}
|
|
1306
|
+
if (propType & 1 /* String */) {
|
|
1307
|
+
// could have been passed as a number or boolean
|
|
1308
|
+
// but we still want it as a string
|
|
1309
|
+
return String(propValue);
|
|
1310
|
+
}
|
|
1311
|
+
// redundant return here for better minification
|
|
1312
|
+
return propValue;
|
|
1313
|
+
}
|
|
1314
|
+
// not sure exactly what type we want
|
|
1315
|
+
// so no need to change to a different type
|
|
1316
|
+
return propValue;
|
|
1317
|
+
};
|
|
1597
1318
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1598
1319
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1599
1320
|
// check our new property value against our internal value
|
|
@@ -1606,13 +1327,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1606
1327
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1607
1328
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1608
1329
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1609
|
-
if ((!(flags & 8 /*
|
|
1330
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1610
1331
|
// gadzooks! the property's value has changed!!
|
|
1611
1332
|
// set our new value!
|
|
1612
1333
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1613
1334
|
if (instance) {
|
|
1614
1335
|
// get an array of method names of watch functions to call
|
|
1615
|
-
if (cmpMeta.$watchers$ && flags & 128 /*
|
|
1336
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1616
1337
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1617
1338
|
if (watchMethods) {
|
|
1618
1339
|
// this instance is watching for when this property changed
|
|
@@ -1627,7 +1348,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1627
1348
|
});
|
|
1628
1349
|
}
|
|
1629
1350
|
}
|
|
1630
|
-
if ((flags & (2 /*
|
|
1351
|
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1631
1352
|
// looks like this value actually changed, so we've got work to do!
|
|
1632
1353
|
// but only if we've already rendered, otherwise just chill out
|
|
1633
1354
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1637,16 +1358,6 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1637
1358
|
}
|
|
1638
1359
|
}
|
|
1639
1360
|
};
|
|
1640
|
-
/**
|
|
1641
|
-
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1642
|
-
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1643
|
-
* decorators, callbacks for when attributes change, and so on.
|
|
1644
|
-
*
|
|
1645
|
-
* @param Cstr the constructor for a component that we need to process
|
|
1646
|
-
* @param cmpMeta metadata collected previously about the component
|
|
1647
|
-
* @param flags a number used to store a series of bit flags
|
|
1648
|
-
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1649
|
-
*/
|
|
1650
1361
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1651
1362
|
if (cmpMeta.$members$) {
|
|
1652
1363
|
if (Cstr.watchers) {
|
|
@@ -1656,8 +1367,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1656
1367
|
const members = Object.entries(cmpMeta.$members$);
|
|
1657
1368
|
const prototype = Cstr.prototype;
|
|
1658
1369
|
members.map(([memberName, [memberFlags]]) => {
|
|
1659
|
-
if ((memberFlags & 31 /*
|
|
1660
|
-
((flags & 2 /*
|
|
1370
|
+
if ((memberFlags & 31 /* Prop */ ||
|
|
1371
|
+
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1661
1372
|
// proxyComponent - prop
|
|
1662
1373
|
Object.defineProperty(prototype, memberName, {
|
|
1663
1374
|
get() {
|
|
@@ -1672,8 +1383,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1672
1383
|
enumerable: true,
|
|
1673
1384
|
});
|
|
1674
1385
|
}
|
|
1675
|
-
else if (flags & 1 /*
|
|
1676
|
-
memberFlags & 64 /*
|
|
1386
|
+
else if (flags & 1 /* isElementConstructor */ &&
|
|
1387
|
+
memberFlags & 64 /* Method */) {
|
|
1677
1388
|
// proxyComponent - method
|
|
1678
1389
|
Object.defineProperty(prototype, memberName, {
|
|
1679
1390
|
value(...args) {
|
|
@@ -1683,7 +1394,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1683
1394
|
});
|
|
1684
1395
|
}
|
|
1685
1396
|
});
|
|
1686
|
-
if ((flags & 1 /*
|
|
1397
|
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
1687
1398
|
const attrNameToPropName = new Map();
|
|
1688
1399
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1689
1400
|
plt.jmp(() => {
|
|
@@ -1739,11 +1450,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1739
1450
|
// create an array of attributes to observe
|
|
1740
1451
|
// and also create a map of html attribute name to js property name
|
|
1741
1452
|
Cstr.observedAttributes = members
|
|
1742
|
-
.filter(([_, m]) => m[0] & 15 /*
|
|
1453
|
+
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1743
1454
|
.map(([propName, m]) => {
|
|
1744
1455
|
const attrName = m[1] || propName;
|
|
1745
1456
|
attrNameToPropName.set(attrName, propName);
|
|
1746
|
-
if (m[0] & 512 /*
|
|
1457
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1747
1458
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1748
1459
|
}
|
|
1749
1460
|
return attrName;
|
|
@@ -1754,10 +1465,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1754
1465
|
};
|
|
1755
1466
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1756
1467
|
// initializeComponent
|
|
1757
|
-
if ((hostRef.$flags$ & 32 /*
|
|
1758
|
-
// Let the runtime know that the component has been initialized
|
|
1759
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1468
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1760
1469
|
{
|
|
1470
|
+
// we haven't initialized this element yet
|
|
1471
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1761
1472
|
// lazy loaded components
|
|
1762
1473
|
// request the component's implementation to be
|
|
1763
1474
|
// wired up with the host element
|
|
@@ -1775,7 +1486,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1775
1486
|
{
|
|
1776
1487
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1777
1488
|
}
|
|
1778
|
-
proxyComponent(Cstr, cmpMeta, 2 /*
|
|
1489
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1779
1490
|
Cstr.isProxied = true;
|
|
1780
1491
|
}
|
|
1781
1492
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1783,7 +1494,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1783
1494
|
// but let's keep track of when we start and stop
|
|
1784
1495
|
// so that the getters/setters don't incorrectly step on data
|
|
1785
1496
|
{
|
|
1786
|
-
hostRef.$flags$ |= 8 /*
|
|
1497
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1787
1498
|
}
|
|
1788
1499
|
// construct the lazy-loaded component implementation
|
|
1789
1500
|
// passing the hostRef is very important during
|
|
@@ -1796,10 +1507,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1796
1507
|
consoleError(e);
|
|
1797
1508
|
}
|
|
1798
1509
|
{
|
|
1799
|
-
hostRef.$flags$ &= ~8 /*
|
|
1510
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1800
1511
|
}
|
|
1801
1512
|
{
|
|
1802
|
-
hostRef.$flags$ |= 128 /*
|
|
1513
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1803
1514
|
}
|
|
1804
1515
|
endNewInstance();
|
|
1805
1516
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1810,7 +1521,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1810
1521
|
const scopeId = getScopeId(cmpMeta);
|
|
1811
1522
|
if (!styles.has(scopeId)) {
|
|
1812
1523
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1813
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /*
|
|
1524
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1814
1525
|
endRegisterStyles();
|
|
1815
1526
|
}
|
|
1816
1527
|
}
|
|
@@ -1837,20 +1548,19 @@ const fireConnectedCallback = (instance) => {
|
|
|
1837
1548
|
}
|
|
1838
1549
|
};
|
|
1839
1550
|
const connectedCallback = (elm) => {
|
|
1840
|
-
if ((plt.$flags$ & 1 /*
|
|
1551
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1841
1552
|
const hostRef = getHostRef(elm);
|
|
1842
1553
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1843
1554
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1844
|
-
if (!(hostRef.$flags$ & 1 /*
|
|
1555
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1845
1556
|
// first time this component has connected
|
|
1846
|
-
hostRef.$flags$ |= 1 /*
|
|
1557
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1847
1558
|
{
|
|
1848
1559
|
// initUpdate
|
|
1849
1560
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1850
1561
|
// in here to act as original content anchors as we move nodes around
|
|
1851
1562
|
// host element has been connected to the DOM
|
|
1852
|
-
if ((
|
|
1853
|
-
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1563
|
+
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1854
1564
|
setContentReference(elm);
|
|
1855
1565
|
}
|
|
1856
1566
|
}
|
|
@@ -1873,7 +1583,7 @@ const connectedCallback = (elm) => {
|
|
|
1873
1583
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1874
1584
|
if (cmpMeta.$members$) {
|
|
1875
1585
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1876
|
-
if (memberFlags & 31 /*
|
|
1586
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1877
1587
|
const value = elm[memberName];
|
|
1878
1588
|
delete elm[memberName];
|
|
1879
1589
|
elm[memberName] = value;
|
|
@@ -1911,7 +1621,7 @@ const setContentReference = (elm) => {
|
|
|
1911
1621
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1912
1622
|
};
|
|
1913
1623
|
const disconnectedCallback = (elm) => {
|
|
1914
|
-
if ((plt.$flags$ & 1 /*
|
|
1624
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1915
1625
|
const hostRef = getHostRef(elm);
|
|
1916
1626
|
const instance = hostRef.$lazyInstance$ ;
|
|
1917
1627
|
{
|
|
@@ -1920,13 +1630,16 @@ const disconnectedCallback = (elm) => {
|
|
|
1920
1630
|
hostRef.$rmListeners$ = undefined;
|
|
1921
1631
|
}
|
|
1922
1632
|
}
|
|
1633
|
+
// clear CSS var-shim tracking
|
|
1634
|
+
if (plt.$cssShim$) {
|
|
1635
|
+
plt.$cssShim$.removeHost(elm);
|
|
1636
|
+
}
|
|
1923
1637
|
{
|
|
1924
1638
|
safeCall(instance, 'disconnectedCallback');
|
|
1925
1639
|
}
|
|
1926
1640
|
}
|
|
1927
1641
|
};
|
|
1928
1642
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1929
|
-
var _a;
|
|
1930
1643
|
const endBootstrap = createTime();
|
|
1931
1644
|
const cmpTags = [];
|
|
1932
1645
|
const exclude = options.exclude || [];
|
|
@@ -1991,18 +1704,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1991
1704
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1992
1705
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1993
1706
|
cmpTags.push(tagName);
|
|
1994
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /*
|
|
1707
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1995
1708
|
}
|
|
1996
1709
|
});
|
|
1997
1710
|
});
|
|
1998
1711
|
{
|
|
1999
1712
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
2000
1713
|
visibilityStyle.setAttribute('data-styles', '');
|
|
2001
|
-
// Apply CSP nonce to the style tag if it exists
|
|
2002
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
2003
|
-
if (nonce != null) {
|
|
2004
|
-
visibilityStyle.setAttribute('nonce', nonce);
|
|
2005
|
-
}
|
|
2006
1714
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
2007
1715
|
}
|
|
2008
1716
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -2018,48 +1726,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2018
1726
|
// Fallback appLoad event
|
|
2019
1727
|
endBootstrap();
|
|
2020
1728
|
};
|
|
2021
|
-
const
|
|
2022
|
-
if (listeners) {
|
|
2023
|
-
listeners.map(([flags, name, method]) => {
|
|
2024
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
2025
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
2026
|
-
const opts = hostListenerOpts(flags);
|
|
2027
|
-
plt.ael(target, name, handler, opts);
|
|
2028
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
2029
|
-
});
|
|
2030
|
-
}
|
|
2031
|
-
};
|
|
2032
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
2033
|
-
try {
|
|
2034
|
-
{
|
|
2035
|
-
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
2036
|
-
// instance is ready, let's call it's member method for this event
|
|
2037
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
2038
|
-
}
|
|
2039
|
-
else {
|
|
2040
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
catch (e) {
|
|
2045
|
-
consoleError(e);
|
|
2046
|
-
}
|
|
2047
|
-
};
|
|
2048
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
2049
|
-
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
2050
|
-
return doc;
|
|
2051
|
-
return elm;
|
|
2052
|
-
};
|
|
2053
|
-
// prettier-ignore
|
|
2054
|
-
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
2055
|
-
/**
|
|
2056
|
-
* Assigns the given value to the nonce property on the runtime platform object.
|
|
2057
|
-
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
2058
|
-
* @param nonce The value to be assigned to the platform nonce property.
|
|
2059
|
-
* @returns void
|
|
2060
|
-
*/
|
|
2061
|
-
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
2062
|
-
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1729
|
+
const hostRefs = new WeakMap();
|
|
2063
1730
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
2064
1731
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
2065
1732
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -2125,35 +1792,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2125
1792
|
return importedModule[exportName];
|
|
2126
1793
|
}, consoleError);
|
|
2127
1794
|
};
|
|
2128
|
-
const styles =
|
|
2129
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
2130
|
-
const doc = win.document || { head: {} };
|
|
2131
|
-
const plt = {
|
|
2132
|
-
$flags$: 0,
|
|
2133
|
-
$resourcesUrl$: '',
|
|
2134
|
-
jmp: (h) => h(),
|
|
2135
|
-
raf: (h) => requestAnimationFrame(h),
|
|
2136
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2137
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2138
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2139
|
-
};
|
|
2140
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
2141
|
-
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2142
|
-
try {
|
|
2143
|
-
new CSSStyleSheet();
|
|
2144
|
-
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2145
|
-
}
|
|
2146
|
-
catch (e) { }
|
|
2147
|
-
return false;
|
|
2148
|
-
})()
|
|
2149
|
-
;
|
|
1795
|
+
const styles = new Map();
|
|
2150
1796
|
const queueDomReads = [];
|
|
2151
1797
|
const queueDomWrites = [];
|
|
2152
1798
|
const queueTask = (queue, write) => (cb) => {
|
|
2153
1799
|
queue.push(cb);
|
|
2154
1800
|
if (!queuePending) {
|
|
2155
1801
|
queuePending = true;
|
|
2156
|
-
if (write && plt.$flags$ & 4 /*
|
|
1802
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2157
1803
|
nextTick(flush);
|
|
2158
1804
|
}
|
|
2159
1805
|
else {
|
|
@@ -2190,15 +1836,17 @@ const flush = () => {
|
|
|
2190
1836
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
2191
1837
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2192
1838
|
|
|
1839
|
+
exports.CSS = CSS;
|
|
2193
1840
|
exports.Host = Host;
|
|
1841
|
+
exports.NAMESPACE = NAMESPACE;
|
|
2194
1842
|
exports.bootstrapLazy = bootstrapLazy;
|
|
2195
1843
|
exports.createEvent = createEvent;
|
|
1844
|
+
exports.doc = doc;
|
|
2196
1845
|
exports.forceUpdate = forceUpdate;
|
|
2197
1846
|
exports.getElement = getElement;
|
|
2198
1847
|
exports.getRenderingRef = getRenderingRef;
|
|
2199
1848
|
exports.h = h;
|
|
1849
|
+
exports.plt = plt;
|
|
2200
1850
|
exports.promiseResolve = promiseResolve;
|
|
2201
1851
|
exports.registerInstance = registerInstance;
|
|
2202
|
-
exports.
|
|
2203
|
-
|
|
2204
|
-
//# sourceMappingURL=index-c209f988.js.map
|
|
1852
|
+
exports.win = win;
|