@heartlandone/vega 2.72.0 → 2.74.0-RTE-table-preview
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/dist/cjs/align-left-4a76df69.js +22 -0
- package/dist/cjs/{app-globals-c6be6013.js → app-globals-be2e868e.js} +18 -17
- package/dist/cjs/{child-nodes-event-prevent-slimmer-871855df.js → child-nodes-event-prevent-slimmer-536d29fc.js} +1 -1
- package/dist/cjs/{code-block-a7c8825f.js → code-block-22ee2550.js} +35 -4
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-868de3c4.js → component-value-history-controller-slimmer.abstract-3486cbc0.js} +26 -5
- package/dist/cjs/{dto-renderer-manager-f3820a6b.js → content-state-0be6fda3.js} +33 -60
- package/dist/cjs/{design-token-d9c4dff6.js → design-token-505997df.js} +1 -1
- package/dist/cjs/dto-renderer-manager-ae5fcbba.js +58 -0
- package/dist/cjs/{element-appender-slimmer-3dc36dfa.js → element-appender-slimmer-26420c09.js} +6 -6
- package/dist/cjs/{event-emit-slimmer-f7255138.js → event-emit-slimmer-6a591353.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-57525f26.js → form-field-controller-slimmer-56c551ea.js} +2 -2
- package/dist/cjs/{image-annotation-action-64414e40.js → image-annotation-action-462fd073.js} +3 -3
- package/dist/cjs/index-58ea899e.js +8 -4
- package/dist/cjs/{index-c7fbf32b.js → index-fc538f17.js} +1 -1
- package/dist/cjs/index.cjs.js +44 -39
- package/dist/cjs/{internal-vega-event-manager-0e1ba774.js → internal-vega-event-manager-d587a33c.js} +1 -1
- package/dist/cjs/{language-extension-d23e5369.js → language-extension-414149c2.js} +8 -8
- package/dist/cjs/loader.cjs.js +14 -9
- package/dist/cjs/{public-rules-0847e6fa.js → public-rules-2d18cf41.js} +4 -4
- package/dist/cjs/{range-14190f6b.js → range-439a0c0c.js} +1 -1
- package/dist/cjs/{responsive-format-facade-77d357fb.js → responsive-format-facade-0ececeb3.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-65d85060.js → rich-text-editor-required-rule-5a4f3626.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-4332d1c7.js → string-input-formatter-slimmer-a8f4a9b1.js} +2 -2
- package/dist/cjs/{style-formatter-4fd65f6f.js → style-formatter-142500c0.js} +1 -1
- package/dist/cjs/styles.constants-3aff0b56.js +1306 -0
- package/dist/cjs/{sub-state-notify-slimmer-9fe1ab65.js → sub-state-notify-slimmer-011866d9.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-2f6f4d28.js → sub-state-observer-slimmer-23d43f1e.js} +1 -1
- package/dist/cjs/table-extension-2a20da57.js +6018 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +12 -8
- package/dist/cjs/vega-app-header-button.cjs.entry.js +32 -10
- package/dist/cjs/vega-banner.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +12 -8
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-circle.cjs.entry.js +13 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +12 -8
- package/dist/cjs/vega-calendar_4.cjs.entry.js +6 -6
- package/dist/cjs/vega-card.cjs.entry.js +11 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +11 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +13 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +18 -14
- package/dist/cjs/vega-dialog_2.cjs.entry.js +20 -16
- package/dist/cjs/vega-divider.cjs.entry.js +11 -7
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +27 -14
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +5 -5
- package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -7
- package/dist/cjs/vega-flex.cjs.entry.js +12 -8
- package/dist/cjs/vega-font.cjs.entry.js +11 -7
- package/dist/cjs/vega-form.cjs.entry.js +7 -7
- package/dist/cjs/vega-grid.cjs.entry.js +11 -7
- package/dist/cjs/vega-icon.cjs.entry.js +11 -7
- package/dist/cjs/vega-image-uploader.cjs.entry.js +15 -11
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-numeric.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-passcode.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +14 -10
- package/dist/cjs/vega-input-range.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-select.cjs.entry.js +184 -53
- package/dist/cjs/vega-input.cjs.entry.js +541 -188
- package/dist/cjs/{vega-internal-event-id-a5ef414b.js → vega-internal-event-id-73334b4b.js} +10 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +19 -15
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +12 -8
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +12 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +16 -11
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +907 -0
- package/dist/cjs/vega-radio_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +10 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +73 -57
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +1313 -0
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +15 -11
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +17 -13
- package/dist/cjs/vega-signature-capture.cjs.entry.js +14 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_11.cjs.entry.js +19 -16
- package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +15 -11
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +11 -7
- package/dist/cjs/vega.cjs.js +14 -9
- package/dist/collection/collection-manifest.json +17 -5
- package/dist/collection/components/vega-app-header-button/slimmers/renderers/vega-app-header-button-dropdown-renderer.js +13 -1
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +46 -3
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +6 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +31 -0
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +77 -7
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-value-controller.js +79 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +100 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +178 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +72 -0
- package/dist/collection/components/vega-input/vega-input.css +8 -0
- package/dist/collection/components/vega-input/vega-input.js +28 -158
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.js +89 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +33 -13
- package/dist/collection/components/vega-input-select/vega-input-select.js +28 -8
- package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +1 -0
- package/dist/collection/components/vega-popover/vega-popover.js +14 -4
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +75 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.js +88 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.js +11 -12
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +125 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.js +40 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +32 -39
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.js +43 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.css +79 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +84 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +5 -80
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +40 -22
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +24 -2
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +18 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +18 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.js +133 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +82 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +121 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.js +40 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/constants/styles.constants.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +119 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +66 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +53 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.js +71 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +254 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +149 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +148 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.js +78 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.js +131 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.js +109 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.js +132 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +152 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +371 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +234 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/utils.js +102 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.js +106 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.js +259 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.js +58 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.js +93 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +148 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +241 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.js +83 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.css +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +80 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +86 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +101 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +75 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +215 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +21 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +23 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +6 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +257 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/annotation-handler-registration.test.js +164 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-annotation-handler.test.js +293 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.js +295 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-head-cell-annotation-handler.test.js +415 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.js +89 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.js +79 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.js +128 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-dto.test.js +517 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-element-to-dto-strategies.test.js +1450 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-test-utils.js +172 -0
- package/dist/collection/components/vega-rich-text-editor/test/spec-utils.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +4 -0
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -2
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +5 -0
- package/dist/collection/utils/spec-utils.js +4 -3
- package/dist/esm/align-left-7f959adf.js +17 -0
- package/dist/esm/{app-globals-3d7e8bad.js → app-globals-8b873b6f.js} +7 -6
- package/dist/esm/{child-nodes-event-prevent-slimmer-6f7ae2c7.js → child-nodes-event-prevent-slimmer-a6afdb1e.js} +1 -1
- package/dist/esm/{code-block-8fb548ff.js → code-block-76b29be1.js} +37 -6
- package/dist/esm/{component-value-history-controller-slimmer.abstract-05f3ff05.js → component-value-history-controller-slimmer.abstract-e1b0e163.js} +27 -6
- package/dist/esm/{dto-renderer-manager-d185c7ba.js → content-state-03f1d302.js} +32 -61
- package/dist/esm/{design-token-ee017ea0.js → design-token-8fedb532.js} +1 -1
- package/dist/esm/{dom-node-subject-observer-factory-479cc5ef.js → dom-node-subject-observer-factory-e998eba4.js} +1 -1
- package/dist/esm/dto-renderer-manager-12bc9121.js +56 -0
- package/dist/esm/{element-appender-slimmer-00bc1a3c.js → element-appender-slimmer-7b9326e2.js} +4 -4
- package/dist/esm/{event-emit-slimmer-76fbfe1f.js → event-emit-slimmer-bbf6668c.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-14379261.js → form-field-controller-slimmer-a0cff4d3.js} +3 -3
- package/dist/esm/{image-annotation-action-3ce95526.js → image-annotation-action-47cdc068.js} +3 -3
- package/dist/esm/index-090d31ca.js +8 -4
- package/dist/esm/{index-03a016ed.js → index-da7e5fe5.js} +2 -2
- package/dist/esm/index.js +17 -13
- package/dist/esm/{internal-vega-event-manager-e44672ed.js → internal-vega-event-manager-e799c54a.js} +2 -2
- package/dist/esm/{language-extension-36c79ea1.js → language-extension-de6e6caf.js} +2 -2
- package/dist/esm/loader.js +15 -10
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{public-rules-0f5a36c2.js → public-rules-c48cc5c9.js} +5 -5
- package/dist/esm/{range-f10f4c85.js → range-af6150a8.js} +1 -1
- package/dist/esm/{responsive-format-facade-6df7d17a.js → responsive-format-facade-16da4623.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-d0cde24f.js → rich-text-editor-required-rule-7255832e.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-af085f0a.js → string-input-formatter-slimmer-82f85b0b.js} +3 -3
- package/dist/esm/{style-formatter-e6879600.js → style-formatter-6ca58f6b.js} +1 -1
- package/dist/esm/styles.constants-0dd6f7fa.js +1277 -0
- package/dist/esm/{sub-state-notify-slimmer-430e150c.js → sub-state-notify-slimmer-4060c333.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-17bb0328.js → sub-state-observer-slimmer-bfa5e63e.js} +2 -2
- package/dist/esm/table-extension-c83b7a56.js +5998 -0
- package/dist/esm/vega-accordion.entry.js +13 -9
- package/dist/esm/vega-app-header-button.entry.js +33 -11
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +13 -9
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +14 -10
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +13 -9
- package/dist/esm/vega-calendar_4.entry.js +7 -7
- package/dist/esm/vega-card.entry.js +12 -8
- package/dist/esm/vega-carousel.entry.js +12 -8
- package/dist/esm/vega-checkbox_2.entry.js +7 -7
- package/dist/esm/vega-chip.entry.js +14 -10
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-combo-box.entry.js +7 -7
- package/dist/esm/vega-date-picker_2.entry.js +19 -15
- package/dist/esm/vega-dialog_2.entry.js +14 -10
- package/dist/esm/vega-divider.entry.js +12 -8
- package/dist/esm/vega-dropdown_5.entry.js +28 -15
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- package/dist/esm/vega-flag-icon.entry.js +12 -8
- package/dist/esm/vega-flex.entry.js +13 -9
- package/dist/esm/vega-font.entry.js +12 -8
- package/dist/esm/vega-form.entry.js +8 -8
- package/dist/esm/vega-grid.entry.js +12 -8
- package/dist/esm/vega-icon.entry.js +12 -8
- package/dist/esm/vega-image-uploader.entry.js +15 -11
- package/dist/esm/vega-input-credit-card.entry.js +7 -7
- package/dist/esm/vega-input-numeric.entry.js +8 -8
- package/dist/esm/vega-input-passcode.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +15 -11
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +185 -54
- package/dist/esm/vega-input.entry.js +542 -189
- package/dist/esm/{vega-internal-event-id-71c67c39.js → vega-internal-event-id-3edc9b4e.js} +6 -1
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +16 -12
- package/dist/esm/vega-loader-wrapper_2.entry.js +11 -7
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +13 -9
- package/dist/esm/vega-popover_2.entry.js +17 -12
- package/dist/esm/vega-progress-tracker_2.entry.js +902 -0
- package/dist/esm/vega-radio_2.entry.js +7 -7
- package/dist/esm/vega-rich-text-content.entry.js +8 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +53 -37
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +1307 -0
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +16 -12
- package/dist/esm/vega-selection-tile_2.entry.js +8 -8
- package/dist/esm/vega-sidenav_3.entry.js +14 -10
- package/dist/esm/vega-signature-capture.entry.js +15 -11
- package/dist/esm/vega-stepper.entry.js +7 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +14 -11
- package/dist/esm/vega-textarea.entry.js +7 -7
- package/dist/esm/vega-time-picker_2.entry.js +16 -12
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +12 -8
- package/dist/esm/vega.js +15 -10
- package/dist/sri/vega-sri-manifest.json +695 -295
- package/dist/types/components/vega-app-header-button/slimmers/renderers/vega-app-header-button-dropdown-renderer.d.ts +7 -0
- package/dist/types/components/vega-app-header-button/types.d.ts +2 -0
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +14 -0
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +8 -1
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +33 -6
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-value-controller.d.ts +32 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.d.ts +27 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +57 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +18 -0
- package/dist/types/components/vega-input/vega-input.d.ts +8 -36
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.d.ts +29 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -1
- package/dist/types/components/vega-input-select/types.d.ts +5 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +12 -4
- package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +1 -0
- package/dist/types/components/vega-popover/vega-popover.d.ts +2 -1
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +55 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.d.ts +27 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.d.ts +1 -3
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.d.ts +39 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.d.ts +21 -0
- package/dist/types/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.d.ts +5 -3
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.d.ts +12 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +22 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +14 -4
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -6
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +15 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +64 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +67 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/constants/styles.constants.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +79 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +34 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +88 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +149 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.d.ts +86 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/utils/utils.d.ts +53 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.d.ts +49 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.d.ts +99 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +57 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +39 -2
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +19 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/annotation-handler-registration.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-head-cell-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-dto.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-element-to-dto-strategies.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-test-utils.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/test/spec-utils.d.ts +4 -0
- package/dist/types/components.d.ts +191 -7
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +5 -0
- package/dist/types/types/components.type.d.ts +5 -0
- package/dist/types/utils/spec-utils.d.ts +2 -3
- package/dist/vega/app-globals-955a2b3b.js +427 -0
- package/dist/vega/child-nodes-event-prevent-slimmer-a604a6dd.js +156 -0
- package/dist/vega/design-token-56b26205.js +402 -0
- package/dist/vega/element-appender-slimmer-8355fb28.js +1508 -0
- package/dist/vega/event-emit-slimmer-7a14f5e9.js +265 -0
- package/dist/vega/index.esm.js +57 -1
- package/dist/vega/internal-vega-event-manager-8c62c88e.js +458 -0
- package/dist/vega/p-068ee55e.entry.js +1 -0
- package/dist/vega/p-088f4613.entry.js +1 -0
- package/dist/vega/p-08b4d097.entry.js +1 -0
- package/dist/vega/p-0e4cecbd.entry.js +1 -0
- package/dist/vega/p-10ffb765.js +1 -0
- package/dist/vega/{p-4cc49d2b.entry.js → p-12a97dad.entry.js} +1 -1
- package/dist/vega/p-151b1deb.js +1 -0
- package/dist/vega/{p-17f3897a.js → p-16af7681.js} +1 -1
- package/dist/vega/p-1b44db34.js +1 -0
- package/dist/vega/p-1bda4016.entry.js +1 -0
- package/dist/vega/{p-86b1e8dd.entry.js → p-1f4a814e.entry.js} +1 -1
- package/dist/vega/{p-c4b010be.entry.js → p-206245d2.entry.js} +1 -1
- package/dist/vega/p-213be5e9.entry.js +1 -0
- package/dist/vega/{p-563b67a0.entry.js → p-216f3436.entry.js} +1 -1
- package/dist/vega/p-224a4f3f.entry.js +1 -0
- package/dist/vega/p-22c76be7.entry.js +1 -0
- package/dist/vega/p-22da15d7.entry.js +1 -0
- package/dist/vega/{p-b6c92e7a.entry.js → p-24766b9d.entry.js} +1 -1
- package/dist/vega/p-29a9c8f5.entry.js +1 -0
- package/dist/vega/p-34a994a1.entry.js +1 -0
- package/dist/vega/p-39d56e3d.js +1 -0
- package/dist/vega/{p-b1ad3107.entry.js → p-3bc7e162.entry.js} +1 -1
- package/dist/vega/p-40660c09.js +1 -0
- package/dist/vega/p-50a506ea.entry.js +1 -0
- package/dist/vega/{p-e8d0e71c.js → p-5367eaab.js} +1 -1
- package/dist/vega/p-550ce71a.entry.js +1 -0
- package/dist/vega/p-5d2704c1.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-61ae4e9c.entry.js +1 -0
- package/dist/vega/{p-59e02528.js → p-63246470.js} +1 -1
- package/dist/vega/p-6665d083.entry.js +1 -0
- package/dist/vega/p-69af3422.entry.js +1 -0
- package/dist/vega/p-6d9731c1.entry.js +1 -0
- package/dist/vega/p-6f08e3e1.entry.js +1 -0
- package/dist/vega/p-7172332a.entry.js +1 -0
- package/dist/vega/{p-06ab90c4.entry.js → p-73688c4e.entry.js} +1 -1
- package/dist/vega/p-73689ec0.entry.js +1 -0
- package/dist/vega/{p-d4413277.entry.js → p-780cbfb0.entry.js} +1 -1
- package/dist/vega/p-79e8236a.entry.js +1 -0
- package/dist/vega/{p-5c71a548.js → p-7ca9f6f1.js} +1 -1
- package/dist/vega/{p-ec4c21d1.entry.js → p-813b2915.entry.js} +1 -1
- package/dist/vega/p-8162980c.js +1 -0
- package/dist/vega/p-82ec9721.entry.js +1 -0
- package/dist/vega/{p-fa63b926.entry.js → p-86caa739.entry.js} +1 -1
- package/dist/vega/p-8a4d8139.entry.js +1 -0
- package/dist/vega/{p-7c22e766.entry.js → p-8ac453cb.entry.js} +1 -1
- package/dist/vega/p-98b78c75.entry.js +1 -0
- package/dist/vega/{p-2872565e.js → p-99e3dcab.js} +1 -1
- package/dist/vega/{p-efa4ee14.entry.js → p-9aac9879.entry.js} +1 -1
- package/dist/vega/p-a007b493.entry.js +1 -0
- package/dist/vega/{p-314bf1d5.entry.js → p-a439e59b.entry.js} +1 -1
- package/dist/vega/p-a4d0ab07.js +1 -0
- package/dist/vega/{p-a23f6ed1.entry.js → p-a6e03df4.entry.js} +1 -1
- package/dist/vega/{p-c5cf9a89.entry.js → p-a924c1e2.entry.js} +1 -1
- package/dist/vega/p-ab0e013c.entry.js +1 -0
- package/dist/vega/p-abf871cd.entry.js +1 -0
- package/dist/vega/{p-883192ed.js → p-ac4bd1f8.js} +1 -1
- package/dist/vega/{p-eebe9176.js → p-b91c2c9d.js} +1 -1
- package/dist/vega/{p-41026b90.js → p-c00adad9.js} +1 -1
- package/dist/vega/p-c335088c.js +1 -0
- package/dist/vega/{p-3fbfffa1.entry.js → p-c3d388b5.entry.js} +1 -1
- package/dist/vega/p-c674b07c.js +1 -0
- package/dist/vega/p-c6d98c60.entry.js +1 -0
- package/dist/vega/p-c78fe943.js +1 -0
- package/dist/vega/{p-bc1cbd6c.js → p-c8ad47c9.js} +1 -1
- package/dist/vega/{p-09cd025a.entry.js → p-c9541fc2.entry.js} +1 -1
- package/dist/vega/{p-c4b30117.entry.js → p-d07d04e0.entry.js} +1 -1
- package/dist/vega/p-d1349401.entry.js +1 -0
- package/dist/vega/{p-3d128c07.js → p-d2033624.js} +1 -1
- package/dist/vega/{p-b2eea369.js → p-d466baf7.js} +1 -1
- package/dist/vega/p-d4719c14.entry.js +1 -0
- package/dist/vega/p-d4e35d2e.entry.js +1 -0
- package/dist/vega/p-d55365b9.entry.js +1 -0
- package/dist/vega/p-db482ee1.js +1 -0
- package/dist/vega/p-dc2813eb.entry.js +1 -0
- package/dist/vega/{p-213310e1.entry.js → p-dd5d917b.entry.js} +1 -1
- package/dist/vega/{p-cb7211c3.js → p-ddf81373.js} +1 -1
- package/dist/vega/p-e0cefd90.entry.js +1 -0
- package/dist/vega/p-e13c163c.entry.js +1 -0
- package/dist/vega/{p-e1e306c3.entry.js → p-e788598a.entry.js} +1 -1
- package/dist/vega/{p-7089cafe.entry.js → p-e797bf8d.entry.js} +1 -1
- package/dist/vega/p-f4b46f6b.entry.js +1 -0
- package/dist/vega/p-f519cdc3.entry.js +1 -0
- package/dist/vega/{p-cbefc113.entry.js → p-f6eab527.entry.js} +1 -1
- package/dist/vega/p-fa34ace2.entry.js +1 -0
- package/dist/vega/p-fbfb4c70.entry.js +1 -0
- package/dist/vega/p-fcabf0dc.js +1 -0
- package/dist/vega/{p-b842f649.js → p-ff57c872.js} +1 -1
- package/dist/vega/p-ff921d10.js +1 -0
- package/dist/vega/p-ff9a0e6e.js +1 -0
- package/dist/vega/public-api-8dd022fa.js +6043 -0
- package/dist/vega/public-api-baaf7593.js +4 -0
- package/dist/vega/responsive-format-facade-98596535.js +913 -0
- package/dist/vega/style-formatter-0ae102e9.js +32 -0
- package/dist/vega/vega-accordion.entry.js +291 -0
- package/dist/vega/vega-app-header-button.entry.js +452 -0
- package/dist/vega/vega-banner.entry.js +351 -0
- package/dist/vega/vega-box.entry.js +353 -0
- package/dist/vega/vega-breadcrumb.entry.js +249 -0
- package/dist/vega/vega-button-circle.entry.js +245 -0
- package/dist/vega/vega-button-group.entry.js +203 -0
- package/dist/vega/vega-button-link.entry.js +226 -0
- package/dist/vega/vega-button.entry.js +259 -0
- package/dist/vega/vega-calendar.entry.js +3884 -0
- package/dist/vega/vega-card.entry.js +226 -0
- package/dist/vega/vega-carousel.entry.js +540 -0
- package/dist/vega/vega-checkbox-group.entry.js +266 -0
- package/dist/vega/vega-checkbox.entry.js +335 -0
- package/dist/vega/vega-chip.entry.js +321 -0
- package/dist/vega/vega-code-block.entry.js +4372 -0
- package/dist/vega/vega-color-picker.entry.js +258 -0
- package/dist/vega/vega-combo-box.entry.js +748 -0
- package/dist/vega/vega-date-picker-calendar.entry.js +1381 -0
- package/dist/vega/vega-date-picker.entry.js +1646 -0
- package/dist/vega/vega-dialog.entry.js +158 -0
- package/dist/vega/vega-divider.entry.js +179 -0
- package/dist/vega/vega-dropdown-content-box.entry.js +57 -0
- package/dist/vega/vega-dropdown-item.entry.js +352 -0
- package/dist/vega/vega-dropdown.entry.js +2136 -0
- package/dist/vega/vega-field-label.entry.js +182 -0
- package/dist/vega/vega-file-uploader.entry.js +751 -0
- package/dist/vega/vega-flag-icon.entry.js +216 -0
- package/dist/vega/vega-flex.entry.js +224 -0
- package/dist/vega/vega-font.entry.js +327 -0
- package/dist/vega/vega-form.entry.js +1008 -0
- package/dist/vega/vega-grid.entry.js +129 -0
- package/dist/vega/vega-icon.entry.js +256 -0
- package/dist/vega/vega-image-uploader.entry.js +977 -0
- package/dist/vega/vega-input-credit-card.entry.js +549 -0
- package/dist/vega/vega-input-numeric.entry.js +471 -0
- package/dist/vega/vega-input-passcode.entry.js +728 -0
- package/dist/vega/vega-input-phone-number.entry.js +9143 -0
- package/dist/vega/vega-input-range.entry.js +693 -0
- package/dist/vega/vega-input-select.entry.js +1268 -0
- package/dist/vega/vega-input.entry.js +1735 -0
- package/dist/vega/vega-item-toggle.entry.js +190 -0
- package/dist/vega/vega-left-nav-group.entry.js +433 -0
- package/dist/vega/vega-left-nav-link.entry.js +317 -0
- package/dist/vega/vega-left-nav-section.entry.js +97 -0
- package/dist/vega/vega-left-nav.entry.js +654 -0
- package/dist/vega/vega-loading-indicator.entry.js +209 -0
- package/dist/vega/vega-modal.entry.js +1287 -0
- package/dist/vega/vega-nav-card.entry.js +163 -0
- package/dist/vega/vega-pagination-page-selector-mobile.entry.js +214 -0
- package/dist/vega/vega-pagination.entry.js +629 -0
- package/dist/vega/vega-popover-content-box.entry.js +101 -0
- package/dist/vega/vega-popover.entry.js +362 -0
- package/dist/vega/vega-progress-tracker.entry.js +757 -0
- package/dist/vega/vega-radio-group.entry.js +496 -0
- package/dist/vega/vega-radio.entry.js +272 -0
- package/dist/vega/vega-rich-text-editor-toolbar-button.entry.js +169 -0
- package/dist/vega/vega-rich-text-editor.entry.js +4107 -0
- package/dist/vega/vega-rich-text-image-editor.entry.js +216 -0
- package/dist/vega/vega-rich-text-link-editor.entry.js +238 -0
- package/dist/vega/vega-rich-text-table-properties.entry.js +641 -0
- package/dist/vega/vega-rich-text-table-setting.entry.js +525 -0
- package/dist/vega/vega-segment-control.entry.js +350 -0
- package/dist/vega/vega-selection-chip-group.entry.js +447 -0
- package/dist/vega/vega-selection-chip.entry.js +443 -0
- package/dist/vega/vega-selection-tile-group.entry.js +438 -0
- package/dist/vega/vega-selection-tile.entry.js +409 -0
- package/dist/vega/vega-sidenav-link.entry.js +160 -0
- package/dist/vega/vega-sidenav.entry.js +766 -0
- package/dist/vega/vega-signature-capture.entry.js +589 -0
- package/dist/vega/vega-stepper.entry.js +292 -0
- package/dist/vega/vega-tab-group-panel.entry.js +79 -0
- package/dist/vega/vega-tab-group.entry.js +1281 -0
- package/dist/vega/vega-table-body.entry.js +48 -0
- package/dist/vega/vega-table-cell.entry.js +243 -0
- package/dist/vega/vega-table-foot-cell.entry.js +169 -0
- package/dist/vega/vega-table-foot-row.entry.js +219 -0
- package/dist/vega/vega-table-foot.entry.js +136 -0
- package/dist/vega/vega-table-head-cell.entry.js +339 -0
- package/dist/vega/vega-table-head-row.entry.js +416 -0
- package/dist/vega/vega-table-head.entry.js +113 -0
- package/dist/vega/vega-table-row.entry.js +666 -0
- package/dist/vega/vega-table.entry.js +3707 -0
- package/dist/vega/vega-textarea.entry.js +329 -0
- package/dist/vega/vega-time-picker.entry.js +2039 -0
- package/dist/vega/vega-toggle-switch.entry.js +194 -0
- package/dist/vega/vega-tooltip.entry.js +339 -0
- package/dist/vega/vega.esm.js +172 -1
- package/package.json +2 -2
- package/style/vega-icons.css +17266 -0
- package/dist/cjs/function-extension-d4fc3b7a.js +0 -2927
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +0 -492
- package/dist/esm/function-extension-3f886d01.js +0 -2908
- package/dist/esm/vega-progress-tracker.entry.js +0 -488
- package/dist/vega/p-0b696b0e.entry.js +0 -1
- package/dist/vega/p-0f5453a7.entry.js +0 -1
- package/dist/vega/p-154f39e4.entry.js +0 -1
- package/dist/vega/p-169b7252.entry.js +0 -1
- package/dist/vega/p-1832e051.js +0 -1
- package/dist/vega/p-19728819.js +0 -1
- package/dist/vega/p-27e641a0.entry.js +0 -1
- package/dist/vega/p-294b0b76.js +0 -1
- package/dist/vega/p-2c744c20.js +0 -1
- package/dist/vega/p-34f624d6.entry.js +0 -1
- package/dist/vega/p-39b8dda9.entry.js +0 -1
- package/dist/vega/p-3af9421b.entry.js +0 -1
- package/dist/vega/p-3eb0d55c.entry.js +0 -1
- package/dist/vega/p-4ea28b2b.entry.js +0 -1
- package/dist/vega/p-4f56da1d.entry.js +0 -1
- package/dist/vega/p-5ac6bf4e.entry.js +0 -1
- package/dist/vega/p-5c379abd.entry.js +0 -1
- package/dist/vega/p-5fdbff48.js +0 -1
- package/dist/vega/p-62e45daf.entry.js +0 -1
- package/dist/vega/p-65749591.entry.js +0 -1
- package/dist/vega/p-6ee95368.entry.js +0 -1
- package/dist/vega/p-707d542e.js +0 -1
- package/dist/vega/p-74f3516e.entry.js +0 -1
- package/dist/vega/p-7a5b3ad3.entry.js +0 -1
- package/dist/vega/p-8233c5b6.entry.js +0 -1
- package/dist/vega/p-82bd84f9.js +0 -1
- package/dist/vega/p-87960572.entry.js +0 -1
- package/dist/vega/p-8c5acc0b.entry.js +0 -1
- package/dist/vega/p-94a58223.entry.js +0 -1
- package/dist/vega/p-95059e57.entry.js +0 -1
- package/dist/vega/p-990b11a7.entry.js +0 -1
- package/dist/vega/p-a7633138.entry.js +0 -1
- package/dist/vega/p-a9268981.entry.js +0 -1
- package/dist/vega/p-afb834d8.js +0 -1
- package/dist/vega/p-b05ec86a.entry.js +0 -1
- package/dist/vega/p-b3d29c1e.entry.js +0 -1
- package/dist/vega/p-b8a7a54b.js +0 -1
- package/dist/vega/p-b96b7f33.entry.js +0 -1
- package/dist/vega/p-bc7df5e7.entry.js +0 -1
- package/dist/vega/p-bca97027.entry.js +0 -1
- package/dist/vega/p-beed225e.entry.js +0 -1
- package/dist/vega/p-c1db0a81.entry.js +0 -1
- package/dist/vega/p-cb72ebb5.js +0 -1
- package/dist/vega/p-e49c6368.js +0 -1
- package/dist/vega/p-e9838fb4.entry.js +0 -1
- package/dist/vega/p-ea0b6e85.entry.js +0 -1
- package/dist/vega/p-ec412511.entry.js +0 -1
- package/dist/vega/p-f9facf79.entry.js +0 -1
- package/dist/vega/p-fc6fca08.entry.js +0 -1
- package/dist/vega/p-fcb3ff5b.entry.js +0 -1
|
@@ -0,0 +1,3707 @@
|
|
|
1
|
+
import { h, F as Fragment, g as Host, r as registerInstance, e as createEvent, i as getElement } from './index-01a2f9c9.js';
|
|
2
|
+
import { V as VegaSlimmer, L as LogUtility, b as MapToComponentField, M as MapToComponentMethod, m as methodPlaceholder, a as InjectVegaSlimmer, d as slotPlaceholder, e as InjectVegaGlobalSlimmer } from './vega-slimmer-core-83fd0e22.js';
|
|
3
|
+
import { g as getValueByPath } from './object-66c37948.js';
|
|
4
|
+
import { V as VegaTableExpandRowController } from './vega-table-expand-row-controller-22993540.js';
|
|
5
|
+
import { C as ChangeManager } from './change-manager-b115783e.js';
|
|
6
|
+
import { O as Observer } from './observer-3959f9dd.js';
|
|
7
|
+
import { k as TABLE_ROW_SELECTION, l as TABLE_ROW_SELECTION_ALL, m as TABLE_ROW_CLICK, S as SHADOW_ROOT_ELEMENT_SCROLLING } from './static-subject-title-6fdf8c8b.js';
|
|
8
|
+
import { f as findParent, a as arrayToClassString, j as extractNumberFromString } from './ui-5f775fd9.js';
|
|
9
|
+
import { r as remoteInvocationRegistry } from './remote-invocation-registry-4219120b.js';
|
|
10
|
+
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-5798693b.js';
|
|
11
|
+
import { L as VegaInternalTableRowSelect, M as VegaInternalTableRowSelectAll, N as VegaInternalColumnHeadRowRenderInputRIC, O as VegaInternalColumnHeadCellRenderInputRIC, P as VegaInternalColumnBodyCellRenderInputRIC } from './vega-internal-event-id-b65a01a3.js';
|
|
12
|
+
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-3b49c6b3.js';
|
|
13
|
+
import { a as VegaClick, h as VegaChange, S as VegaPageSizeChange, d as VegaExpand, W as VegaSelectChange, X as VegaSelectAllChange, Y as VegaRowClick, Z as VegaRowExpand, _ as VegaRowSelect, $ as VegaRowSelectAll } from './vega-event-id-61c8bd9f.js';
|
|
14
|
+
import { r as responsiveFormatFacade } from './responsive-format-facade-d4abfdb9.js';
|
|
15
|
+
import { i as isNonNullable, w as isBreakpointsTokenType, aj as isVegaTableColumnGroupingModelType } from './type-guard-09acedc9.js';
|
|
16
|
+
import { s as sanitizeVegaComponent } from './component-0cff85cf.js';
|
|
17
|
+
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-8565f08b.js';
|
|
18
|
+
import { P as PageResizeObserverSlimmer, g as getCurrentBreakpoint } from './page-resize-observer-slimmer-ee8774a6.js';
|
|
19
|
+
import { M as MutationObserverSlimmer } from './mutation-observer-slimmer-7065c745.js';
|
|
20
|
+
import { T as TagNameMutationFilter } from './mutation-observer-filters-6c515793.js';
|
|
21
|
+
import { c as createSubStateNotifySlimmer } from './sub-state-notify-slimmer-2c2e1a57.js';
|
|
22
|
+
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-fcfc9c8b.js';
|
|
23
|
+
import { c as createEventEmitSlimmer } from './event-emit-slimmer-61db3eef.js';
|
|
24
|
+
import { I as ImmutableMap } from './immutable-map-612922a2.js';
|
|
25
|
+
import { V as VegaComponentUsageRuntimeMetricsSlimmer } from './component-usage-runtime-metrics-0513698f.js';
|
|
26
|
+
import './index-9fdb7060.js';
|
|
27
|
+
import { T as TranslationSlimmer } from './translation-slimmer-3c4e2876.js';
|
|
28
|
+
import './number-4398f2e1.js';
|
|
29
|
+
import './ui-189dae23.js';
|
|
30
|
+
import './pixel-f32c07ce.js';
|
|
31
|
+
import './breakpoints-d9faf11c.js';
|
|
32
|
+
import './array-a1d98264.js';
|
|
33
|
+
import './public-api-a77a0b33.js';
|
|
34
|
+
import './vega-env-manager-8f8dc473.js';
|
|
35
|
+
import './internal-vega-event-manager-826279b7.js';
|
|
36
|
+
import './internal-vega-z-index-manager-f0ca0975.js';
|
|
37
|
+
import './feature-flag-controller-24b9f956.js';
|
|
38
|
+
import './index-1f9eab8f.js';
|
|
39
|
+
import './_commonjsHelpers-2088bffa.js';
|
|
40
|
+
import './dark-mode-style-controller-e2a2f76c.js';
|
|
41
|
+
import './vega-nonce-manager-497e5eb5.js';
|
|
42
|
+
import './try-get-document-bef0f526.js';
|
|
43
|
+
import './internal-icon-manager-9279071a.js';
|
|
44
|
+
import './valid-credit-card-number-rule-04b032a6.js';
|
|
45
|
+
import './internal-form-field-validation-rule.abstract-f5b6bdbf.js';
|
|
46
|
+
import './index-b04c1ee0.js';
|
|
47
|
+
import './index-81ce67e2.js';
|
|
48
|
+
import './content-state-fc9d98e0.js';
|
|
49
|
+
import './code-block-b5f8fc8a.js';
|
|
50
|
+
import './string-a953eafc.js';
|
|
51
|
+
import './dto-renderer-manager-12bc9121.js';
|
|
52
|
+
import './base-renderer-101f6d04.js';
|
|
53
|
+
import './column-operation-a1620c67.js';
|
|
54
|
+
import './timer-9321173b.js';
|
|
55
|
+
import './styles.constants-b320e4a7.js';
|
|
56
|
+
import './range-429fb0e2.js';
|
|
57
|
+
import './typography-396de03f.js';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Immutable Set cannot be changed once created
|
|
61
|
+
*/
|
|
62
|
+
class ImmutableSet {
|
|
63
|
+
/**
|
|
64
|
+
* The constructor of ImmutableSet
|
|
65
|
+
*
|
|
66
|
+
* @typedef T generic type parameter
|
|
67
|
+
* @param {Set<T>} initialSet - The initial set to use. If not provided, the set will be empty.
|
|
68
|
+
* @param {() => void} onMutate - A callback function that will be called whenever the set is mutated.
|
|
69
|
+
*/
|
|
70
|
+
constructor(initialSet, onMutate) {
|
|
71
|
+
this.size = 0;
|
|
72
|
+
this.set = new Set();
|
|
73
|
+
if (initialSet) {
|
|
74
|
+
this.set = initialSet;
|
|
75
|
+
this.size = initialSet.size;
|
|
76
|
+
}
|
|
77
|
+
if (onMutate) {
|
|
78
|
+
this.onMutate = onMutate;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The function is called when the set is mutated
|
|
83
|
+
*
|
|
84
|
+
* @param {Immutable<Set<T>>} _newSet - The new set that was created.
|
|
85
|
+
*/
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
+
onMutate(_newSet) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Add new items to the set, and then call the onMutate with the new ImmutableSet
|
|
92
|
+
*
|
|
93
|
+
* @typedef T generic type parameter
|
|
94
|
+
* @param {T[]} value - The items to add to the set.
|
|
95
|
+
* @returns {ImmutableSet<T>} A new ImmutableSet with the new items added.
|
|
96
|
+
*/
|
|
97
|
+
add(...value) {
|
|
98
|
+
return this.withMutation((set) => {
|
|
99
|
+
value.forEach((value) => set.add(value));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* clear the set values
|
|
104
|
+
*
|
|
105
|
+
* @typedef T generic type parameter
|
|
106
|
+
*/
|
|
107
|
+
clear() {
|
|
108
|
+
this.withMutation((set) => set.clear());
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* delete item from set
|
|
112
|
+
*
|
|
113
|
+
* @typedef T generic type parameter
|
|
114
|
+
* @param {T} value - The key to delete from the set.
|
|
115
|
+
* @returns {ImmutableSet<T>} A new ImmutableSet
|
|
116
|
+
*/
|
|
117
|
+
delete(value) {
|
|
118
|
+
return this.withMutation((set) => {
|
|
119
|
+
set.delete(value);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* It takes a function that mutates a set, and returns a new immutable set that is the result of that mutation
|
|
124
|
+
*
|
|
125
|
+
* @param {(set: Set<T>) => void} fn - (set: Set<T>) => void
|
|
126
|
+
* @returns {ImmutableSet<T>} A new ImmutableSet
|
|
127
|
+
*/
|
|
128
|
+
withMutation(fn) {
|
|
129
|
+
const newSet = new Set(this.set);
|
|
130
|
+
fn(newSet);
|
|
131
|
+
const newImmutableSet = new ImmutableSet(newSet, this.onMutate);
|
|
132
|
+
this.onMutate(newImmutableSet);
|
|
133
|
+
return newImmutableSet;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* It returns true if the value is in the set, and false otherwise
|
|
137
|
+
*
|
|
138
|
+
* @typedef T generic type parameter
|
|
139
|
+
* @param {T} value - The value to check for.
|
|
140
|
+
* @returns {boolean} A boolean value.
|
|
141
|
+
*/
|
|
142
|
+
has(value) {
|
|
143
|
+
return this.set.has(value);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* It returns an array of the values in the set
|
|
147
|
+
*
|
|
148
|
+
* @returns {T[]} An array of the values in the set.
|
|
149
|
+
*/
|
|
150
|
+
toArray() {
|
|
151
|
+
return [...this.set];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const VegaTableEditableFieldTypes = [
|
|
156
|
+
'input',
|
|
157
|
+
'input-select',
|
|
158
|
+
'stepper',
|
|
159
|
+
'checkbox',
|
|
160
|
+
'textarea',
|
|
161
|
+
'combo-box',
|
|
162
|
+
'date-picker',
|
|
163
|
+
'time-picker',
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
var __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
167
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
168
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
169
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
170
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
171
|
+
};
|
|
172
|
+
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
173
|
+
var t = {};
|
|
174
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
175
|
+
t[p] = s[p];
|
|
176
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
177
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
178
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
179
|
+
t[p[i]] = s[p[i]];
|
|
180
|
+
}
|
|
181
|
+
return t;
|
|
182
|
+
};
|
|
183
|
+
class VegaTableCellRenderer extends VegaSlimmer {
|
|
184
|
+
constructor() {
|
|
185
|
+
super(...arguments);
|
|
186
|
+
this.renderTableCellContent = (column, record, index) => {
|
|
187
|
+
var _a, _b;
|
|
188
|
+
const value = getValueByPath(record, column.prop);
|
|
189
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(record);
|
|
190
|
+
const isNewRow = !this.vegaTableDataSourceController
|
|
191
|
+
.getDataSource()
|
|
192
|
+
.find((item) => this.vegaTableDataSourceController.getRecordKey(item) === rowKey);
|
|
193
|
+
const editing = this.vegaTableEditableController.isEditing(rowKey);
|
|
194
|
+
const rowForm = this.vegaTableEditableController.getRowFormRefMap().get(rowKey);
|
|
195
|
+
if (editing && rowForm && column.renderFormItem) {
|
|
196
|
+
return column.renderFormItem(h, column.prop ? value : rowKey, record, index, {
|
|
197
|
+
rowForm,
|
|
198
|
+
isNewRow,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
if (editing && rowForm && column.editable) {
|
|
202
|
+
const formItemProps = (_a = column.formItemProps) === null || _a === void 0 ? void 0 : _a.call(column, rowForm, {
|
|
203
|
+
record,
|
|
204
|
+
index,
|
|
205
|
+
});
|
|
206
|
+
const mergedProps = Object.assign({ dataVegaForm: (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.dataVegaForm) || column.prop, size: 'small', value: value }, (_b = column.formItemProps) === null || _b === void 0 ? void 0 : _b.call(column, rowForm, { record, index }));
|
|
207
|
+
return this.generateEditComponentByType(column.formItemType, mergedProps);
|
|
208
|
+
}
|
|
209
|
+
if (column.render) {
|
|
210
|
+
return column.render(h, column.prop ? value : rowKey, record, index);
|
|
211
|
+
}
|
|
212
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
213
|
+
return String(value);
|
|
214
|
+
}
|
|
215
|
+
else if (typeof value === 'undefined' || value === null) {
|
|
216
|
+
return '';
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
LogUtility.error(`Column ${column.prop}'s value has a wrong type(${typeof record[column.prop]}) in table cell. Only 'VegaTableNode | string | number' can be rendered in table cell`);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Generate edit component by
|
|
224
|
+
*
|
|
225
|
+
* @param {VegaTableFormItemType} type - The type of the vega components
|
|
226
|
+
* @param {VegaTableEditComponentProps} props - The component props
|
|
227
|
+
* @returns {VegaTableNode} The node of VegaTable
|
|
228
|
+
*/
|
|
229
|
+
this.generateEditComponentByType = (type = 'input', props) => {
|
|
230
|
+
const tagName = `vega-${type}`;
|
|
231
|
+
const { dataVegaForm } = props, componentProps = __rest$1(props, ["dataVegaForm"]);
|
|
232
|
+
if (!this.isVegaTableEditableFieldType(tagName)) {
|
|
233
|
+
LogUtility.error(`Type must be one of the form field types. [${VegaTableEditableFieldTypes.join(',')}]`);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
return h(tagName, Object.assign(Object.assign({}, componentProps), { 'data-vega-form': dataVegaForm }));
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Verify the tagName is editable field type
|
|
240
|
+
*
|
|
241
|
+
* @param {string} tagName The component tag name
|
|
242
|
+
* @returns {boolean} return true if the tagName is editable field in VegaTable
|
|
243
|
+
*/
|
|
244
|
+
this.isVegaTableEditableFieldType = (tagName) => {
|
|
245
|
+
return (tagName.toUpperCase().startsWith('VEGA') &&
|
|
246
|
+
new RegExp(VegaTableEditableFieldTypes.join('|'), 'i').test(tagName));
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
render(renderInput, record, index) {
|
|
250
|
+
const column = this.columns.find((column) => column.key === renderInput.key ||
|
|
251
|
+
column.prop === renderInput.key ||
|
|
252
|
+
column.label === renderInput.key);
|
|
253
|
+
if (column) {
|
|
254
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(record);
|
|
255
|
+
const columnKey = `${rowKey}_${column.key || column.prop}`;
|
|
256
|
+
return (h("vega-table-cell", { key: columnKey, textAlign: column.align, breakpoint: column.breakpoint, overflow: column.overflow, ref: (ref) => {
|
|
257
|
+
this.vegaTableRenderInputController.addCellRenderInputMap(ref, renderInput);
|
|
258
|
+
} }, this.renderTableCellContent(column, record, index)));
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
return (h("vega-table-cell", { key: renderInput.key, ref: (ref) => {
|
|
262
|
+
this.vegaTableRenderInputController.addCellRenderInputMap(ref, renderInput);
|
|
263
|
+
} }));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
__decorate$i([
|
|
268
|
+
MapToComponentField()
|
|
269
|
+
], VegaTableCellRenderer.prototype, "rowKey", void 0);
|
|
270
|
+
__decorate$i([
|
|
271
|
+
MapToComponentField()
|
|
272
|
+
], VegaTableCellRenderer.prototype, "columns", void 0);
|
|
273
|
+
__decorate$i([
|
|
274
|
+
MapToComponentField()
|
|
275
|
+
], VegaTableCellRenderer.prototype, "vegaTableDataSourceController", void 0);
|
|
276
|
+
__decorate$i([
|
|
277
|
+
MapToComponentField()
|
|
278
|
+
], VegaTableCellRenderer.prototype, "vegaTableEditableController", void 0);
|
|
279
|
+
__decorate$i([
|
|
280
|
+
MapToComponentField()
|
|
281
|
+
], VegaTableCellRenderer.prototype, "vegaTableRenderInputController", void 0);
|
|
282
|
+
|
|
283
|
+
var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
284
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
285
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
286
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
287
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
class VegaTableRowSelectionController extends VegaSlimmer {
|
|
293
|
+
constructor() {
|
|
294
|
+
super(...arguments);
|
|
295
|
+
/**
|
|
296
|
+
* The method for handling row selection change
|
|
297
|
+
*
|
|
298
|
+
* @param {boolean} checked - true: the row is selected, otherwise not selected
|
|
299
|
+
* @param {VegaTableDataSourceItem} record - The record of the changed row
|
|
300
|
+
*/
|
|
301
|
+
this.handleRowSelect = (checked, record) => {
|
|
302
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(record);
|
|
303
|
+
let isChanged = false;
|
|
304
|
+
if (checked) {
|
|
305
|
+
if (!this.selectedRowKeySet.has(rowKey)) {
|
|
306
|
+
this.selectedRowKeySet.add(rowKey);
|
|
307
|
+
isChanged = true;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
if (this.selectedRowKeySet.has(rowKey)) {
|
|
312
|
+
this.selectedRowKeySet.delete(rowKey);
|
|
313
|
+
isChanged = true;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (isChanged) {
|
|
317
|
+
this.selectChangeEventEmitter.emit({
|
|
318
|
+
selected: checked,
|
|
319
|
+
record: record,
|
|
320
|
+
selectedRows: this.getSelectedRecords(),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Get the row selection type
|
|
326
|
+
*
|
|
327
|
+
* @returns {Nullable<'multiple' | 'single'>} Return the type of the row selection
|
|
328
|
+
*/
|
|
329
|
+
this.getRowSelectionType = () => {
|
|
330
|
+
if (!this.rowSelection)
|
|
331
|
+
return;
|
|
332
|
+
return this.rowSelection.type || 'multiple';
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* The method for handing the single row selection
|
|
336
|
+
*
|
|
337
|
+
* @param {VegaTableDataSourceItem} record - The record of the single selected row
|
|
338
|
+
*/
|
|
339
|
+
this.handleSingleRowSelect = (record) => {
|
|
340
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(record);
|
|
341
|
+
if (this.isChecked(rowKey)) {
|
|
342
|
+
this.handleRowSelect(false, record);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
this.selectedRowKeySet.clear();
|
|
346
|
+
this.handleRowSelect(true, record);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* Verify the row is checked or not for row selection
|
|
351
|
+
*
|
|
352
|
+
* @param {string} key - The row key of the row
|
|
353
|
+
* @returns {boolean} Return true if the row is selected, otherwise false
|
|
354
|
+
*/
|
|
355
|
+
this.isChecked = (key) => {
|
|
356
|
+
return this.selectedRowKeySet.has(key);
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* The method to handling select all rows
|
|
360
|
+
*
|
|
361
|
+
* @param {boolean} checkedAll - true: all rows are selected; false: not selected all rows
|
|
362
|
+
*/
|
|
363
|
+
this.handleSelectAll = (checkedAll) => {
|
|
364
|
+
if (checkedAll) {
|
|
365
|
+
const recordKeys = this.vegaTableDataSourceController.getAllRecordKeys();
|
|
366
|
+
this.selectedRowKeySet.add(...recordKeys.filter((key) => !this.selectedRowKeySet.has(key)));
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
if (this.isCheckedAll()) {
|
|
370
|
+
this.selectedRowKeySet.clear();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* Verify if all rows are selected
|
|
376
|
+
*
|
|
377
|
+
* @returns {boolean} return true if all rows are selected, otherwise false
|
|
378
|
+
*/
|
|
379
|
+
this.isCheckedAll = () => {
|
|
380
|
+
return (this.selectedRowKeySet.size > 0 &&
|
|
381
|
+
this.vegaTableDataSourceController
|
|
382
|
+
.getCurrentData()
|
|
383
|
+
.every((record) => this.selectedRowKeySet.has(this.vegaTableDataSourceController.getRecordKey(record))));
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Set up the row selection config
|
|
387
|
+
*
|
|
388
|
+
* @param {VegaTableRowSelectionConfig} config - The config of the row selection
|
|
389
|
+
*/
|
|
390
|
+
this.setupRowSelection = (config) => {
|
|
391
|
+
this.rowSelection = Object.assign({ hideSelectAll: false, type: 'multiple' }, config);
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* Get the selected rows records array
|
|
395
|
+
*
|
|
396
|
+
* @returns {VegaTableDataSourceItem[]} The array of the all selected row's records
|
|
397
|
+
*/
|
|
398
|
+
this.getSelectedRecords = () => {
|
|
399
|
+
return this.selectedRowKeySet
|
|
400
|
+
.toArray()
|
|
401
|
+
.map(this.vegaTableDataSourceController.getRecordByKey)
|
|
402
|
+
.filter(Boolean);
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Sync up the selected row's key when current data changed
|
|
406
|
+
*
|
|
407
|
+
* @param {VegaTableDataSourceItem[]} currentData - The current data of the source
|
|
408
|
+
*/
|
|
409
|
+
this.syncUpSelectedKeySetWithCurrentData = (currentData) => {
|
|
410
|
+
this.selectedRowKeySet.withMutation((set) => {
|
|
411
|
+
set.clear();
|
|
412
|
+
currentData.forEach((item) => {
|
|
413
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(item);
|
|
414
|
+
if (this.selectedRowKeySet.has(rowKey)) {
|
|
415
|
+
set.add(rowKey);
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Component lifecycle - connectedCallback
|
|
423
|
+
*/
|
|
424
|
+
connectedCallback() {
|
|
425
|
+
this.initRowSelection();
|
|
426
|
+
this.initRowClickObserver();
|
|
427
|
+
this.initRowSelectionAllObserver();
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
*
|
|
431
|
+
*/
|
|
432
|
+
disconnectedCallback() {
|
|
433
|
+
ChangeManager.unregister(TABLE_ROW_SELECTION, this.rowSelectionObserver);
|
|
434
|
+
ChangeManager.unregister(TABLE_ROW_SELECTION_ALL, this.rowSelectionAllObserver);
|
|
435
|
+
ChangeManager.unregister(TABLE_ROW_CLICK, this.rowClickObserver);
|
|
436
|
+
remoteInvocationRegistry.unRegister(domNodeSubjectFactory.getSubject(this.host, VegaInternalTableRowSelect));
|
|
437
|
+
remoteInvocationRegistry.unRegister(domNodeSubjectFactory.getSubject(this.host, VegaInternalTableRowSelectAll));
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Component lifecycle - componentWillLoad
|
|
441
|
+
*/
|
|
442
|
+
componentWillLoad() {
|
|
443
|
+
if (this.rowSelection) {
|
|
444
|
+
this.setupRowSelection(this.rowSelection);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* The callback to handle [watchRowSelection]{@link VegaTable.watchRowSelection}
|
|
449
|
+
*
|
|
450
|
+
* @param {VegaTableRowSelectionConfig} newValue - The changed value of rowSelection
|
|
451
|
+
* @param {VegaTableRowSelectionConfig} oldValue - The value of rowSelection before changing
|
|
452
|
+
*/
|
|
453
|
+
watchRowSelection(newValue, oldValue) {
|
|
454
|
+
if ((oldValue === null || oldValue === void 0 ? void 0 : oldValue.type) !== (newValue === null || newValue === void 0 ? void 0 : newValue.type)) {
|
|
455
|
+
void this.clearSelection();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* The callback to handle [setSelection]{@link VegaTable.setSelection}
|
|
460
|
+
*
|
|
461
|
+
* @param {string[]} keys - The keys array of which you want to select
|
|
462
|
+
*/
|
|
463
|
+
setSelection(keys) {
|
|
464
|
+
if (this.getRowSelectionType() === 'single') {
|
|
465
|
+
keys.splice(1);
|
|
466
|
+
}
|
|
467
|
+
this.selectedRowKeySet.toArray().forEach((key) => {
|
|
468
|
+
ChangeManager.notify(TABLE_ROW_SELECTION, {
|
|
469
|
+
host: this.host,
|
|
470
|
+
rowKey: key,
|
|
471
|
+
checked: false,
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
this.selectedRowKeySet.clear();
|
|
475
|
+
keys.forEach((key) => {
|
|
476
|
+
if (this.vegaTableDataSourceController.getRecordByKey(key)) {
|
|
477
|
+
this.selectedRowKeySet.add(key);
|
|
478
|
+
ChangeManager.notify(TABLE_ROW_SELECTION, {
|
|
479
|
+
host: this.host,
|
|
480
|
+
rowKey: key,
|
|
481
|
+
checked: true,
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* The callback to handle [watchCurrentData]{@link VegaTable.watchCurrentData}
|
|
488
|
+
*
|
|
489
|
+
* @param {VegaTableDataSourceItem} currentData - The changed value of currentData
|
|
490
|
+
*/
|
|
491
|
+
watchCurrentData(currentData) {
|
|
492
|
+
this.syncUpSelectedKeySetWithCurrentData(currentData);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* The callback to handle [clearSelection]{@link VegaTable.clearSelection}
|
|
496
|
+
*/
|
|
497
|
+
clearSelection() {
|
|
498
|
+
this.selectedRowKeySet.clear();
|
|
499
|
+
ChangeManager.notify(TABLE_ROW_SELECTION_ALL, {
|
|
500
|
+
host: this.host,
|
|
501
|
+
checked: false,
|
|
502
|
+
noneChecked: this.selectedRowKeySet.size === 0,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* The callback to handle [getSelection]{@link VegaTable.getSelection}
|
|
507
|
+
*
|
|
508
|
+
* @returns {string[]} The selected row keys array
|
|
509
|
+
*/
|
|
510
|
+
getSelection() {
|
|
511
|
+
return this.selectedRowKeySet.toArray();
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
*
|
|
515
|
+
*/
|
|
516
|
+
watchSelectedRowKeySet() {
|
|
517
|
+
this.isSelectedAll = this.isCheckedAll();
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
*
|
|
521
|
+
*/
|
|
522
|
+
watchSelectedAll() {
|
|
523
|
+
ChangeManager.notify(TABLE_ROW_SELECTION_ALL, {
|
|
524
|
+
host: this.host,
|
|
525
|
+
checked: this.isCheckedAll(),
|
|
526
|
+
noneChecked: this.selectedRowKeySet.size === 0,
|
|
527
|
+
});
|
|
528
|
+
this.selectAllChangeEventEmitter.emit({
|
|
529
|
+
selected: this.isCheckedAll(),
|
|
530
|
+
selectedRows: this.getSelectedRecords(),
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* The function checks if the input is an acceptable table row observer by verifying its host tag name and ensuring it is a child of a vega-table element.
|
|
535
|
+
*
|
|
536
|
+
* @param {unknown} input - The `input` parameter is of type `unknown`, which means it can be any type.
|
|
537
|
+
* @returns {boolean} boolean value indicating whether the input is of type T and satisfies certain conditions.
|
|
538
|
+
*/
|
|
539
|
+
isAcceptableRowSelectionObserver(input) {
|
|
540
|
+
if (input['host']['tagName'] === 'VEGA-TABLE') {
|
|
541
|
+
return this.host === input['host'];
|
|
542
|
+
}
|
|
543
|
+
if (input['host']['tagName'] === 'VEGA-TABLE-ROW') {
|
|
544
|
+
return this.host === findParent(input['host'], 'vega-table');
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* The function checks if the input is an acceptable observer for a table head row in a Vega table.
|
|
549
|
+
*
|
|
550
|
+
* @param {unknown} input - The `input` parameter is of type `unknown`, which means it can be any type.
|
|
551
|
+
* @returns {boolean} boolean value.
|
|
552
|
+
*/
|
|
553
|
+
isAcceptableRowSelectionAllObserver(input) {
|
|
554
|
+
if (input['host']['tagName'] === 'VEGA-TABLE') {
|
|
555
|
+
return this.host === input['host'];
|
|
556
|
+
}
|
|
557
|
+
if (input['host']['tagName'] === 'VEGA-TABLE-HEAD-ROW') {
|
|
558
|
+
return this.host === findParent(input['host'], 'vega-table');
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* The function initializes a row selection.
|
|
563
|
+
*/
|
|
564
|
+
initRowSelection() {
|
|
565
|
+
this.rowSelectionObserver = new Observer(this.isAcceptableRowSelectionObserver.bind(this), (payload) => {
|
|
566
|
+
const { rowKey, checked } = payload;
|
|
567
|
+
const record = this.vegaTableDataSourceController.getRecordByKey(rowKey);
|
|
568
|
+
this.handleRowSelect(checked, record);
|
|
569
|
+
});
|
|
570
|
+
ChangeManager.register(TABLE_ROW_SELECTION, this.rowSelectionObserver);
|
|
571
|
+
remoteInvocationRegistry.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalTableRowSelect), ({ rowKey, checked }) => {
|
|
572
|
+
return this.rowSelectEventEmitter.emit({
|
|
573
|
+
selected: checked,
|
|
574
|
+
record: this.vegaTableDataSourceController.getRecordByKey(rowKey),
|
|
575
|
+
selectedRows: this.getSelectedRecords(),
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
remoteInvocationRegistry.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalTableRowSelectAll), ({ checked }) => {
|
|
579
|
+
return this.rowSelectAllEventEmitter.emit({
|
|
580
|
+
selected: checked,
|
|
581
|
+
selectedRows: this.getSelectedRecords(),
|
|
582
|
+
changedRows: checked
|
|
583
|
+
? this.vegaTableDataSourceController
|
|
584
|
+
.getCurrentData()
|
|
585
|
+
.filter((record) => !this.selectedRowKeySet.has(record.key))
|
|
586
|
+
: this.getSelectedRecords(),
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* The function initializes an observer for row selection all in a table
|
|
592
|
+
*/
|
|
593
|
+
initRowSelectionAllObserver() {
|
|
594
|
+
this.rowSelectionAllObserver = new Observer(this.isAcceptableRowSelectionAllObserver.bind(this), (payload) => {
|
|
595
|
+
this.handleSelectAll(payload.checked);
|
|
596
|
+
});
|
|
597
|
+
ChangeManager.register(TABLE_ROW_SELECTION_ALL, this.rowSelectionAllObserver);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* The function initializes a row click observer that handles row selection in a table.
|
|
601
|
+
*/
|
|
602
|
+
initRowClickObserver() {
|
|
603
|
+
this.rowClickObserver = new Observer(this.isAcceptableRowClickObserver.bind(this), (payload) => {
|
|
604
|
+
if (this.getRowSelectionType() === 'single') {
|
|
605
|
+
const record = this.vegaTableDataSourceController.getRecordByKey(payload.rowKey);
|
|
606
|
+
this.handleSingleRowSelect(record);
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
ChangeManager.register(TABLE_ROW_CLICK, this.rowClickObserver);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* The function checks if the input is an acceptable row click observer.
|
|
613
|
+
*
|
|
614
|
+
* @param {unknown} input - The input parameter is of type unknown, which means it can be any type.
|
|
615
|
+
* @returns {boolean} a boolean value indicating whether the input is acceptable observer.
|
|
616
|
+
*/
|
|
617
|
+
isAcceptableRowClickObserver(input) {
|
|
618
|
+
return (input['host']['tagName'] === 'VEGA-TABLE-ROW' &&
|
|
619
|
+
this.host === findParent(input['host'], 'vega-table'));
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
__decorate$h([
|
|
623
|
+
MapToComponentField()
|
|
624
|
+
], VegaTableRowSelectionController.prototype, "host", void 0);
|
|
625
|
+
__decorate$h([
|
|
626
|
+
MapToComponentField({ writable: true })
|
|
627
|
+
], VegaTableRowSelectionController.prototype, "isSelectedAll", void 0);
|
|
628
|
+
__decorate$h([
|
|
629
|
+
MapToComponentField()
|
|
630
|
+
], VegaTableRowSelectionController.prototype, "selectedRowKeySet", void 0);
|
|
631
|
+
__decorate$h([
|
|
632
|
+
MapToComponentField({ writable: true })
|
|
633
|
+
], VegaTableRowSelectionController.prototype, "rowSelection", void 0);
|
|
634
|
+
__decorate$h([
|
|
635
|
+
MapToComponentField()
|
|
636
|
+
], VegaTableRowSelectionController.prototype, "rowKey", void 0);
|
|
637
|
+
__decorate$h([
|
|
638
|
+
MapToComponentField()
|
|
639
|
+
], VegaTableRowSelectionController.prototype, "selectChangeEventEmitter", void 0);
|
|
640
|
+
__decorate$h([
|
|
641
|
+
MapToComponentField()
|
|
642
|
+
], VegaTableRowSelectionController.prototype, "selectAllChangeEventEmitter", void 0);
|
|
643
|
+
__decorate$h([
|
|
644
|
+
MapToComponentField()
|
|
645
|
+
], VegaTableRowSelectionController.prototype, "vegaTableDataSourceController", void 0);
|
|
646
|
+
__decorate$h([
|
|
647
|
+
MapToComponentField()
|
|
648
|
+
], VegaTableRowSelectionController.prototype, "rowSelectEventEmitter", void 0);
|
|
649
|
+
__decorate$h([
|
|
650
|
+
MapToComponentField()
|
|
651
|
+
], VegaTableRowSelectionController.prototype, "rowSelectAllEventEmitter", void 0);
|
|
652
|
+
__decorate$h([
|
|
653
|
+
MapToComponentMethod('connectedCallback')
|
|
654
|
+
], VegaTableRowSelectionController.prototype, "connectedCallback", null);
|
|
655
|
+
__decorate$h([
|
|
656
|
+
MapToComponentMethod('disconnectedCallback')
|
|
657
|
+
], VegaTableRowSelectionController.prototype, "disconnectedCallback", null);
|
|
658
|
+
__decorate$h([
|
|
659
|
+
MapToComponentMethod('componentWillLoad')
|
|
660
|
+
], VegaTableRowSelectionController.prototype, "componentWillLoad", null);
|
|
661
|
+
__decorate$h([
|
|
662
|
+
MapToComponentMethod('watchRowSelection')
|
|
663
|
+
], VegaTableRowSelectionController.prototype, "watchRowSelection", null);
|
|
664
|
+
__decorate$h([
|
|
665
|
+
MapToComponentMethod('setSelection')
|
|
666
|
+
], VegaTableRowSelectionController.prototype, "setSelection", null);
|
|
667
|
+
__decorate$h([
|
|
668
|
+
MapToComponentMethod('watchCurrentData')
|
|
669
|
+
], VegaTableRowSelectionController.prototype, "watchCurrentData", null);
|
|
670
|
+
__decorate$h([
|
|
671
|
+
MapToComponentMethod('clearSelection')
|
|
672
|
+
], VegaTableRowSelectionController.prototype, "clearSelection", null);
|
|
673
|
+
__decorate$h([
|
|
674
|
+
MapToComponentMethod('getSelection')
|
|
675
|
+
], VegaTableRowSelectionController.prototype, "getSelection", null);
|
|
676
|
+
__decorate$h([
|
|
677
|
+
MapToComponentMethod('watchSelectedRowKeySet')
|
|
678
|
+
], VegaTableRowSelectionController.prototype, "watchSelectedRowKeySet", null);
|
|
679
|
+
__decorate$h([
|
|
680
|
+
MapToComponentMethod('watchSelectedAll')
|
|
681
|
+
], VegaTableRowSelectionController.prototype, "watchSelectedAll", null);
|
|
682
|
+
|
|
683
|
+
var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
684
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
685
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
686
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
687
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
688
|
+
};
|
|
689
|
+
/**
|
|
690
|
+
* The dataSource controller for the vega-table
|
|
691
|
+
*/
|
|
692
|
+
class VegaTableDataSourceController extends VegaSlimmer {
|
|
693
|
+
constructor() {
|
|
694
|
+
super(...arguments);
|
|
695
|
+
/**
|
|
696
|
+
* Get the key of the record
|
|
697
|
+
*
|
|
698
|
+
* @param {VegaTableDataSourceItem} record - The record of the dataSource
|
|
699
|
+
* @returns {string} The key of the record
|
|
700
|
+
*/
|
|
701
|
+
this.getRecordKey = (record) => {
|
|
702
|
+
if (record[this.rowKey] !== undefined && record[this.rowKey] !== null) {
|
|
703
|
+
return String(record[this.rowKey]);
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
return '';
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Get the record from [currentData]{@link currentData} by key
|
|
711
|
+
*
|
|
712
|
+
* @param {string} key - The key of the record
|
|
713
|
+
* @returns {VegaTableDataSourceItem} The record of the [currentData]{@link currentData}
|
|
714
|
+
*/
|
|
715
|
+
this.getRecordByKey = (key) => {
|
|
716
|
+
return this.currentData.find((record) => this.getRecordKey(record) === key);
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Update the [currentData]{@link currentData} by new data source
|
|
720
|
+
*
|
|
721
|
+
* @param {VegaTableDataSourceItem[]} data - New data source
|
|
722
|
+
*/
|
|
723
|
+
this.setCurrentData = (data) => {
|
|
724
|
+
if (this.tableDataValidation(data)) {
|
|
725
|
+
this.currentData = data;
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
this.currentData = [];
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Component lifecycle - componentWillLoad
|
|
734
|
+
*/
|
|
735
|
+
componentWillLoad() {
|
|
736
|
+
this.vegaTableSortController.syncSortOrder();
|
|
737
|
+
this.syncCurrentData();
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* The callback of [watchSortersMap]{@link VegaTable.watchSortersMap}
|
|
741
|
+
*/
|
|
742
|
+
watchSortersMap() {
|
|
743
|
+
this.syncCurrentData();
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* The callback of watchDataSource
|
|
747
|
+
*/
|
|
748
|
+
watchDataSource() {
|
|
749
|
+
this.syncCurrentData();
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Get currentData item keys
|
|
753
|
+
*
|
|
754
|
+
* @returns {string[]} The key array of currentData
|
|
755
|
+
*/
|
|
756
|
+
getAllRecordKeys() {
|
|
757
|
+
return this.currentData.map(this.getRecordKey);
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* The getter of dataSource
|
|
761
|
+
*
|
|
762
|
+
* @returns {VegaTableDataSourceItem[]} The value of dataSource
|
|
763
|
+
*/
|
|
764
|
+
getDataSource() {
|
|
765
|
+
return this.dataSource;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* The setter of [dataSource]{@link dataSource}
|
|
769
|
+
*
|
|
770
|
+
* @param {VegaTableDataSourceItem[]} data - The new data source
|
|
771
|
+
*/
|
|
772
|
+
setDataSource(data) {
|
|
773
|
+
this.dataSource = data;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* The getter of [currentData]{@link currentData}
|
|
777
|
+
*
|
|
778
|
+
* @returns {VegaTableDataSourceItem[]} the value of currentData
|
|
779
|
+
*/
|
|
780
|
+
getCurrentData() {
|
|
781
|
+
return this.currentData;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Check whether the currentData is empty
|
|
785
|
+
*
|
|
786
|
+
* @returns {boolean} return true if the currentData is empty
|
|
787
|
+
*/
|
|
788
|
+
isCurrentDataEmpty() {
|
|
789
|
+
return this.currentData.length === 0;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Verify whether the data is valid
|
|
793
|
+
*
|
|
794
|
+
* @param {VegaTableDataSourceItem[]} data - The data source
|
|
795
|
+
* @returns {boolean} Return true if the data is valid, otherwise false
|
|
796
|
+
*/
|
|
797
|
+
tableDataValidation(data) {
|
|
798
|
+
if (data.some((item) => !this.getRecordKey(item))) {
|
|
799
|
+
LogUtility.error('Each item in dataSource should have a unique "key" prop.', ' Otherwise, you should specify the primary key of dataSource item via rowKey.', ' For more details, please refer to: https://heartlandpayments.github.io/Vega/?path=/docs/components-table-v2--basic-table#rowkey');
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
return true;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Update the currentData with sorted data if there is sorted status.
|
|
806
|
+
* Otherwise, update with the dataSource directly
|
|
807
|
+
*/
|
|
808
|
+
syncCurrentData() {
|
|
809
|
+
if (this.isTemplateRenderMode) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
const sortedColumns = this.sortersMap.size > 0
|
|
813
|
+
? this.columns.filter((column) => column.sorter && column.sorter !== 'event' && this.sortersMap.has(column.prop))
|
|
814
|
+
: [];
|
|
815
|
+
if (sortedColumns.length > 0) {
|
|
816
|
+
this.setCurrentData(this.vegaTableSortController.sortData(this.dataSource, Array.from(this.sortersMap.values())));
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
this.setCurrentData(this.dataSource);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
__decorate$g([
|
|
824
|
+
MapToComponentField()
|
|
825
|
+
], VegaTableDataSourceController.prototype, "rowKey", void 0);
|
|
826
|
+
__decorate$g([
|
|
827
|
+
MapToComponentField({ writable: true })
|
|
828
|
+
], VegaTableDataSourceController.prototype, "currentData", void 0);
|
|
829
|
+
__decorate$g([
|
|
830
|
+
MapToComponentField({ writable: true })
|
|
831
|
+
], VegaTableDataSourceController.prototype, "dataSource", void 0);
|
|
832
|
+
__decorate$g([
|
|
833
|
+
MapToComponentField()
|
|
834
|
+
], VegaTableDataSourceController.prototype, "columns", void 0);
|
|
835
|
+
__decorate$g([
|
|
836
|
+
MapToComponentField()
|
|
837
|
+
], VegaTableDataSourceController.prototype, "sortersMap", void 0);
|
|
838
|
+
__decorate$g([
|
|
839
|
+
MapToComponentField()
|
|
840
|
+
], VegaTableDataSourceController.prototype, "vegaTableSortController", void 0);
|
|
841
|
+
__decorate$g([
|
|
842
|
+
MapToComponentField()
|
|
843
|
+
], VegaTableDataSourceController.prototype, "vegaTableRenderer", void 0);
|
|
844
|
+
__decorate$g([
|
|
845
|
+
MapToComponentField()
|
|
846
|
+
], VegaTableDataSourceController.prototype, "isTemplateRenderMode", void 0);
|
|
847
|
+
__decorate$g([
|
|
848
|
+
MapToComponentMethod('componentWillLoad')
|
|
849
|
+
], VegaTableDataSourceController.prototype, "componentWillLoad", null);
|
|
850
|
+
__decorate$g([
|
|
851
|
+
MapToComponentMethod('watchSortersMap')
|
|
852
|
+
], VegaTableDataSourceController.prototype, "watchSortersMap", null);
|
|
853
|
+
__decorate$g([
|
|
854
|
+
MapToComponentMethod('watchDataSource')
|
|
855
|
+
], VegaTableDataSourceController.prototype, "watchDataSource", null);
|
|
856
|
+
|
|
857
|
+
var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
858
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
859
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
860
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
861
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
862
|
+
};
|
|
863
|
+
class VegaTableBodyRenderer extends VegaSlimmer {
|
|
864
|
+
constructor() {
|
|
865
|
+
super(...arguments);
|
|
866
|
+
this.renderTableBody = (editable) => {
|
|
867
|
+
const currentData = this.vegaTableDataSourceController.getCurrentData();
|
|
868
|
+
return (h("vega-table-body", null, currentData.map((record, index) => {
|
|
869
|
+
const rowKey = this.vegaTableDataSourceController.getRecordKey(record);
|
|
870
|
+
const isVisibleInCurrentPage = this.vegaTablePaginationController.isRowVisible(index);
|
|
871
|
+
const isLastRow = index === currentData.length - 1;
|
|
872
|
+
return (h(Fragment, null,
|
|
873
|
+
this.vegaTableRowRenderer.render({
|
|
874
|
+
rowKey,
|
|
875
|
+
index,
|
|
876
|
+
record,
|
|
877
|
+
isVisibleInCurrentPage,
|
|
878
|
+
isLastRow: isLastRow,
|
|
879
|
+
}, editable),
|
|
880
|
+
this.rowExpandable && (h("vega-table-expand-row", { class: {
|
|
881
|
+
'v-hidden': !isVisibleInCurrentPage,
|
|
882
|
+
}, key: `vega-table-expanded-row-${rowKey}`, rowKey: rowKey, striped: this.striped && index % 2 === 1 },
|
|
883
|
+
h("slot", { name: `${VegaTableExpandRowController.expandRowSlotNamePrefix}${rowKey}` })))));
|
|
884
|
+
})));
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
getTableFormRef() {
|
|
888
|
+
return this.tableFormRef;
|
|
889
|
+
}
|
|
890
|
+
render() {
|
|
891
|
+
const editable = this.columnStructureModel
|
|
892
|
+
.generateColumnConfigByLeaves(this.columns)
|
|
893
|
+
.some((item) => item === null || item === void 0 ? void 0 : item.editable);
|
|
894
|
+
return editable ? (h("vega-form", { ref: (ref) => (this.tableFormRef = ref) }, this.renderTableBody(editable))) : (this.renderTableBody(false));
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
__decorate$f([
|
|
898
|
+
MapToComponentField()
|
|
899
|
+
], VegaTableBodyRenderer.prototype, "striped", void 0);
|
|
900
|
+
__decorate$f([
|
|
901
|
+
MapToComponentField()
|
|
902
|
+
], VegaTableBodyRenderer.prototype, "rowDivider", void 0);
|
|
903
|
+
__decorate$f([
|
|
904
|
+
MapToComponentField()
|
|
905
|
+
], VegaTableBodyRenderer.prototype, "columns", void 0);
|
|
906
|
+
__decorate$f([
|
|
907
|
+
MapToComponentField()
|
|
908
|
+
], VegaTableBodyRenderer.prototype, "currentBreakpoint", void 0);
|
|
909
|
+
__decorate$f([
|
|
910
|
+
MapToComponentField()
|
|
911
|
+
], VegaTableBodyRenderer.prototype, "rowExpandable", void 0);
|
|
912
|
+
__decorate$f([
|
|
913
|
+
MapToComponentField()
|
|
914
|
+
], VegaTableBodyRenderer.prototype, "rowClickable", void 0);
|
|
915
|
+
__decorate$f([
|
|
916
|
+
MapToComponentField()
|
|
917
|
+
], VegaTableBodyRenderer.prototype, "vegaTableDataSourceController", void 0);
|
|
918
|
+
__decorate$f([
|
|
919
|
+
MapToComponentField()
|
|
920
|
+
], VegaTableBodyRenderer.prototype, "vegaTablePaginationController", void 0);
|
|
921
|
+
__decorate$f([
|
|
922
|
+
MapToComponentField()
|
|
923
|
+
], VegaTableBodyRenderer.prototype, "vegaTableRowSelectionController", void 0);
|
|
924
|
+
__decorate$f([
|
|
925
|
+
MapToComponentField()
|
|
926
|
+
], VegaTableBodyRenderer.prototype, "vegaTableRowRenderer", void 0);
|
|
927
|
+
__decorate$f([
|
|
928
|
+
MapToComponentField()
|
|
929
|
+
], VegaTableBodyRenderer.prototype, "columnStructureModel", void 0);
|
|
930
|
+
|
|
931
|
+
var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
932
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
933
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
934
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
935
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
936
|
+
};
|
|
937
|
+
class VegaTableHeaderRenderer extends VegaSlimmer {
|
|
938
|
+
constructor() {
|
|
939
|
+
super(...arguments);
|
|
940
|
+
this.renderHeaderRows = () => {
|
|
941
|
+
const renderInputs = this.vegaTableRenderInputController.getHeadRenderInputs();
|
|
942
|
+
const rows = [];
|
|
943
|
+
let levelRenderInputs = renderInputs;
|
|
944
|
+
while (levelRenderInputs.length > 0) {
|
|
945
|
+
rows.push(levelRenderInputs);
|
|
946
|
+
levelRenderInputs = levelRenderInputs.flatMap((n) => n.children);
|
|
947
|
+
}
|
|
948
|
+
return rows.map((cells) => {
|
|
949
|
+
var _a;
|
|
950
|
+
return (h("vega-table-head-row", { hideSelectAll: (_a = this.rowSelection) === null || _a === void 0 ? void 0 : _a.hideSelectAll, ref: (ref) => {
|
|
951
|
+
this.vegaTableRenderInputController.addHeadRowRenderInputMap(ref, cells);
|
|
952
|
+
} }, cells.map((renderInput) => {
|
|
953
|
+
if (renderInput.label) {
|
|
954
|
+
return this.renderGroupCell(renderInput);
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
const column = this.columns.find((column) => column.key === renderInput.key ||
|
|
958
|
+
column.prop === renderInput.key ||
|
|
959
|
+
column.label === renderInput.key);
|
|
960
|
+
return this.renderCell(renderInput, column);
|
|
961
|
+
}
|
|
962
|
+
})));
|
|
963
|
+
});
|
|
964
|
+
};
|
|
965
|
+
this.renderGroupCell = (renderInput) => {
|
|
966
|
+
return (h("vega-table-head-cell", { key: renderInput.key, ref: (ref) => {
|
|
967
|
+
this.vegaTableRenderInputController.addHeadCellRenderInputMap(ref, renderInput);
|
|
968
|
+
} }, renderInput.label));
|
|
969
|
+
};
|
|
970
|
+
this.renderCell = (renderInput, column) => {
|
|
971
|
+
var _a;
|
|
972
|
+
if (column) {
|
|
973
|
+
return (h("vega-table-head-cell", { key: column.key || column.prop, textAlign: column.align, sorter: column.sorter, sortOrder: (_a = this.sortersMap.get(column.prop)) === null || _a === void 0 ? void 0 : _a.getSortOrder(), sortConfig: this.sortConfig, breakpoint: column.breakpoint,
|
|
974
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
975
|
+
ref: (ref) => {
|
|
976
|
+
this.vegaTableRenderInputController.addHeadCellRenderInputMap(ref, renderInput);
|
|
977
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, (input) => {
|
|
978
|
+
const sortOrder = input.detail.sortOrder;
|
|
979
|
+
this.vegaTableSortController.handleHeadSortClick(column, sortOrder);
|
|
980
|
+
});
|
|
981
|
+
} }, column.label));
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
return (h("vega-table-head-cell", { key: renderInput.key, ref: (ref) => {
|
|
985
|
+
this.vegaTableRenderInputController.addHeadCellRenderInputMap(ref, renderInput);
|
|
986
|
+
} }));
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
render() {
|
|
991
|
+
return this.showHeader && h("vega-table-head", null, this.renderHeaderRows());
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
__decorate$e([
|
|
995
|
+
MapToComponentField()
|
|
996
|
+
], VegaTableHeaderRenderer.prototype, "showHeader", void 0);
|
|
997
|
+
__decorate$e([
|
|
998
|
+
MapToComponentField()
|
|
999
|
+
], VegaTableHeaderRenderer.prototype, "sortersMap", void 0);
|
|
1000
|
+
__decorate$e([
|
|
1001
|
+
MapToComponentField()
|
|
1002
|
+
], VegaTableHeaderRenderer.prototype, "sortConfig", void 0);
|
|
1003
|
+
__decorate$e([
|
|
1004
|
+
MapToComponentField()
|
|
1005
|
+
], VegaTableHeaderRenderer.prototype, "columns", void 0);
|
|
1006
|
+
__decorate$e([
|
|
1007
|
+
MapToComponentField()
|
|
1008
|
+
], VegaTableHeaderRenderer.prototype, "rowSelection", void 0);
|
|
1009
|
+
__decorate$e([
|
|
1010
|
+
MapToComponentField()
|
|
1011
|
+
], VegaTableHeaderRenderer.prototype, "vegaTableSortController", void 0);
|
|
1012
|
+
__decorate$e([
|
|
1013
|
+
MapToComponentField()
|
|
1014
|
+
], VegaTableHeaderRenderer.prototype, "vegaTableDataSourceController", void 0);
|
|
1015
|
+
__decorate$e([
|
|
1016
|
+
MapToComponentField()
|
|
1017
|
+
], VegaTableHeaderRenderer.prototype, "vegaTableRenderInputController", void 0);
|
|
1018
|
+
|
|
1019
|
+
var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1020
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1021
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1022
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1023
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1024
|
+
};
|
|
1025
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1026
|
+
var t = {};
|
|
1027
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1028
|
+
t[p] = s[p];
|
|
1029
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1030
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1031
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1032
|
+
t[p[i]] = s[p[i]];
|
|
1033
|
+
}
|
|
1034
|
+
return t;
|
|
1035
|
+
};
|
|
1036
|
+
class VegaTablePaginationRenderer extends VegaSlimmer {
|
|
1037
|
+
constructor() {
|
|
1038
|
+
super(...arguments);
|
|
1039
|
+
this.paginationRefCallback = (ref) => {
|
|
1040
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaChange, this.handlePaginationChange);
|
|
1041
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaPageSizeChange, this.handlePaginationPageSizeChange);
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* handle the pagination page change after observer the notify
|
|
1045
|
+
*
|
|
1046
|
+
* @param {NotifyObserverPayload<number>} input payload message, detail is the current page index
|
|
1047
|
+
*/
|
|
1048
|
+
this.handlePaginationChange = (input) => {
|
|
1049
|
+
var _a, _b;
|
|
1050
|
+
this.vegaTablePaginationController.setCurrentPage(input.detail);
|
|
1051
|
+
const event = new CustomEvent('vegaChange', { detail: input.detail });
|
|
1052
|
+
(_b = (_a = this.pagination).vegaChange) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1053
|
+
};
|
|
1054
|
+
/**
|
|
1055
|
+
* handle the pagination page size change after observer the notify
|
|
1056
|
+
*
|
|
1057
|
+
* @param {NotifyObserverPayload<number>} input payload message, detail is the current page size
|
|
1058
|
+
*/
|
|
1059
|
+
this.handlePaginationPageSizeChange = (input) => {
|
|
1060
|
+
var _a, _b;
|
|
1061
|
+
this.vegaTablePaginationController.setPageSize(input.detail);
|
|
1062
|
+
const event = new CustomEvent('vegaPageSizeChange', {
|
|
1063
|
+
detail: input.detail,
|
|
1064
|
+
});
|
|
1065
|
+
(_b = (_a = this.pagination).vegaPageSizeChange) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1066
|
+
};
|
|
1067
|
+
this.getPaginationConfig = () => {
|
|
1068
|
+
const _a = this.pagination, { position } = _a, otherProps = __rest(_a, ["position"]);
|
|
1069
|
+
const currentExtensions = responsiveFormatFacade.formatCustom(this.pagination.extensions);
|
|
1070
|
+
return Object.assign(Object.assign({}, otherProps), { position: (currentExtensions === null || currentExtensions === void 0 ? void 0 : currentExtensions.length) > 1 ? undefined : position || 'bottom-center', pageSize: this.pageSize });
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
render() {
|
|
1074
|
+
if (!this.pagination)
|
|
1075
|
+
return;
|
|
1076
|
+
const { pageSize, position, extensions, pageSizeSelectorOptions } = this.getPaginationConfig();
|
|
1077
|
+
const paginationWrapperClasses = ['vega-table-pagination-container', position];
|
|
1078
|
+
const total = this.vegaTableDataSourceController.getCurrentData().length;
|
|
1079
|
+
return (total > 0 && (h("div", { class: arrayToClassString(paginationWrapperClasses) },
|
|
1080
|
+
h("vega-pagination", { total: total, pageSize: pageSize, current: this.currentPage, extensions: extensions, pageSizeSelectorOptions: pageSizeSelectorOptions,
|
|
1081
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
1082
|
+
ref: this.paginationRefCallback }))));
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
__decorate$d([
|
|
1086
|
+
MapToComponentField()
|
|
1087
|
+
], VegaTablePaginationRenderer.prototype, "pagination", void 0);
|
|
1088
|
+
__decorate$d([
|
|
1089
|
+
MapToComponentField()
|
|
1090
|
+
], VegaTablePaginationRenderer.prototype, "pageSize", void 0);
|
|
1091
|
+
__decorate$d([
|
|
1092
|
+
MapToComponentField()
|
|
1093
|
+
], VegaTablePaginationRenderer.prototype, "currentPage", void 0);
|
|
1094
|
+
__decorate$d([
|
|
1095
|
+
MapToComponentField()
|
|
1096
|
+
], VegaTablePaginationRenderer.prototype, "vegaTablePaginationController", void 0);
|
|
1097
|
+
__decorate$d([
|
|
1098
|
+
MapToComponentField()
|
|
1099
|
+
], VegaTablePaginationRenderer.prototype, "vegaTableDataSourceController", void 0);
|
|
1100
|
+
|
|
1101
|
+
const VegaTableScrollableContainer = ({ scrollConfig = {}, ref, onScroll }, children) => {
|
|
1102
|
+
const { maxHeight } = scrollConfig;
|
|
1103
|
+
const isVerticalScrollable = isNonNullable(maxHeight);
|
|
1104
|
+
const handleVerticalScroll = (e) => {
|
|
1105
|
+
if (!isVerticalScrollable)
|
|
1106
|
+
return;
|
|
1107
|
+
const target = e.target;
|
|
1108
|
+
if (target.scrollTop === 0) {
|
|
1109
|
+
target.classList.remove('scrolled');
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
if (target.scrollTop > 0 && !target.classList.contains('scrolled')) {
|
|
1113
|
+
target.classList.add('scrolled');
|
|
1114
|
+
}
|
|
1115
|
+
onScroll(e);
|
|
1116
|
+
};
|
|
1117
|
+
return (h("div", { class: "vega-table-scrollable-container", style: {
|
|
1118
|
+
maxHeight: typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight,
|
|
1119
|
+
}, ref: ref,
|
|
1120
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
1121
|
+
onScroll: handleVerticalScroll }, children));
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1125
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1126
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1127
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1128
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1129
|
+
};
|
|
1130
|
+
class VegaTableScrollContainerRenderer extends VegaSlimmer {
|
|
1131
|
+
constructor() {
|
|
1132
|
+
super(...arguments);
|
|
1133
|
+
this.scrollContainerToTop = () => {
|
|
1134
|
+
if (this.tableScrollContainerRef) {
|
|
1135
|
+
this.tableScrollContainerRef.scrollTop = 0;
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
this.notifyContentScrolling = () => {
|
|
1139
|
+
this.isTemplateRenderMode &&
|
|
1140
|
+
ChangeManager.notify(SHADOW_ROOT_ELEMENT_SCROLLING, {
|
|
1141
|
+
host: this.host,
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
watchCurrentPage() {
|
|
1146
|
+
this.scrollContainerToTop();
|
|
1147
|
+
}
|
|
1148
|
+
render(children) {
|
|
1149
|
+
return (h(VegaTableScrollableContainer, { scrollConfig: this.scrollConfig, ref: (ref) => this.setTableScrollContainerRef(ref),
|
|
1150
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
1151
|
+
onScroll: () => this.notifyContentScrolling() }, children));
|
|
1152
|
+
}
|
|
1153
|
+
setTableScrollContainerRef(ref) {
|
|
1154
|
+
this.tableScrollContainerRef = ref;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
__decorate$c([
|
|
1158
|
+
MapToComponentField()
|
|
1159
|
+
], VegaTableScrollContainerRenderer.prototype, "scrollConfig", void 0);
|
|
1160
|
+
__decorate$c([
|
|
1161
|
+
MapToComponentField()
|
|
1162
|
+
], VegaTableScrollContainerRenderer.prototype, "host", void 0);
|
|
1163
|
+
__decorate$c([
|
|
1164
|
+
MapToComponentField()
|
|
1165
|
+
], VegaTableScrollContainerRenderer.prototype, "isTemplateRenderMode", void 0);
|
|
1166
|
+
__decorate$c([
|
|
1167
|
+
MapToComponentMethod('watchCurrentPage')
|
|
1168
|
+
], VegaTableScrollContainerRenderer.prototype, "watchCurrentPage", null);
|
|
1169
|
+
|
|
1170
|
+
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1171
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1172
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1173
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1174
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1175
|
+
};
|
|
1176
|
+
class VegaTableRenderer extends VegaSlimmer {
|
|
1177
|
+
constructor() {
|
|
1178
|
+
super(...arguments);
|
|
1179
|
+
this.renderInternalTable = () => {
|
|
1180
|
+
const tableLayoutFixed = this.columns.some((column) => column.overflow) ||
|
|
1181
|
+
Array.from(this.host.querySelectorAll('vega-table-cell')).some((cell) => cell.overflow);
|
|
1182
|
+
return (h("table", { class: {
|
|
1183
|
+
'v-table-fixed': tableLayoutFixed,
|
|
1184
|
+
} },
|
|
1185
|
+
this.columns.length > 0 && [
|
|
1186
|
+
this.vegaTableColGroupRenderer.render(),
|
|
1187
|
+
this.vegaTableHeaderRenderer.render(),
|
|
1188
|
+
],
|
|
1189
|
+
(this.dataSource.length > 0 || this.editingRows.size > 0) &&
|
|
1190
|
+
this.vegaTableBodyRenderer.render(),
|
|
1191
|
+
this.isTemplateRenderMode && h("slot", null)));
|
|
1192
|
+
};
|
|
1193
|
+
this.renderEmpty = () => {
|
|
1194
|
+
return (this.vegaTableDataSourceController.isCurrentDataEmpty() &&
|
|
1195
|
+
this.emptyDescription && (h("div", { class: "vega-table-empty-description" }, this.translationSlimmer.t(this.emptyDescription))));
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
render() {
|
|
1199
|
+
const hostClasses = arrayToClassString([
|
|
1200
|
+
this.rowDivider && 'row-divider',
|
|
1201
|
+
this.columnDivider && 'column-divider',
|
|
1202
|
+
`density-${responsiveFormatFacade.formatCustom(this.density)}`,
|
|
1203
|
+
this.striped && 'striped',
|
|
1204
|
+
this.columnStructureModel.hasGroupColumn() && 'is-group-table',
|
|
1205
|
+
(this.columnStructureModel.hasLeftPinnedColumn() ||
|
|
1206
|
+
this.columnStructureModel.hasRightPinnedColumn()) &&
|
|
1207
|
+
'is-pinned-table',
|
|
1208
|
+
]);
|
|
1209
|
+
return sanitizeVegaComponent(h(Host, { class: hostClasses },
|
|
1210
|
+
this.vegaTableScrollContainerRenderer.render(this.renderInternalTable()),
|
|
1211
|
+
this.vegaTablePaginationRenderer.render(),
|
|
1212
|
+
this.renderEmpty()), this.host);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
__decorate$b([
|
|
1216
|
+
MapToComponentField()
|
|
1217
|
+
], VegaTableRenderer.prototype, "host", void 0);
|
|
1218
|
+
__decorate$b([
|
|
1219
|
+
MapToComponentField()
|
|
1220
|
+
], VegaTableRenderer.prototype, "columns", void 0);
|
|
1221
|
+
__decorate$b([
|
|
1222
|
+
MapToComponentField()
|
|
1223
|
+
], VegaTableRenderer.prototype, "emptyDescription", void 0);
|
|
1224
|
+
__decorate$b([
|
|
1225
|
+
MapToComponentField()
|
|
1226
|
+
], VegaTableRenderer.prototype, "rowDivider", void 0);
|
|
1227
|
+
__decorate$b([
|
|
1228
|
+
MapToComponentField()
|
|
1229
|
+
], VegaTableRenderer.prototype, "columnDivider", void 0);
|
|
1230
|
+
__decorate$b([
|
|
1231
|
+
MapToComponentField()
|
|
1232
|
+
], VegaTableRenderer.prototype, "density", void 0);
|
|
1233
|
+
__decorate$b([
|
|
1234
|
+
MapToComponentField()
|
|
1235
|
+
], VegaTableRenderer.prototype, "dataSource", void 0);
|
|
1236
|
+
__decorate$b([
|
|
1237
|
+
MapToComponentField()
|
|
1238
|
+
], VegaTableRenderer.prototype, "striped", void 0);
|
|
1239
|
+
__decorate$b([
|
|
1240
|
+
MapToComponentField()
|
|
1241
|
+
], VegaTableRenderer.prototype, "columnStructureModel", void 0);
|
|
1242
|
+
__decorate$b([
|
|
1243
|
+
MapToComponentField()
|
|
1244
|
+
], VegaTableRenderer.prototype, "vegaTableHeaderRenderer", void 0);
|
|
1245
|
+
__decorate$b([
|
|
1246
|
+
MapToComponentField()
|
|
1247
|
+
], VegaTableRenderer.prototype, "vegaTableBodyRenderer", void 0);
|
|
1248
|
+
__decorate$b([
|
|
1249
|
+
MapToComponentField()
|
|
1250
|
+
], VegaTableRenderer.prototype, "vegaTableColGroupRenderer", void 0);
|
|
1251
|
+
__decorate$b([
|
|
1252
|
+
MapToComponentField()
|
|
1253
|
+
], VegaTableRenderer.prototype, "vegaTableScrollContainerRenderer", void 0);
|
|
1254
|
+
__decorate$b([
|
|
1255
|
+
MapToComponentField()
|
|
1256
|
+
], VegaTableRenderer.prototype, "vegaTablePaginationRenderer", void 0);
|
|
1257
|
+
__decorate$b([
|
|
1258
|
+
MapToComponentField()
|
|
1259
|
+
], VegaTableRenderer.prototype, "vegaTableDataSourceController", void 0);
|
|
1260
|
+
__decorate$b([
|
|
1261
|
+
MapToComponentField()
|
|
1262
|
+
], VegaTableRenderer.prototype, "translationSlimmer", void 0);
|
|
1263
|
+
__decorate$b([
|
|
1264
|
+
MapToComponentField({ writable: true })
|
|
1265
|
+
], VegaTableRenderer.prototype, "vegaTableChildrenController", void 0);
|
|
1266
|
+
__decorate$b([
|
|
1267
|
+
MapToComponentField()
|
|
1268
|
+
], VegaTableRenderer.prototype, "isTemplateRenderMode", void 0);
|
|
1269
|
+
__decorate$b([
|
|
1270
|
+
MapToComponentField()
|
|
1271
|
+
], VegaTableRenderer.prototype, "editingRows", void 0);
|
|
1272
|
+
|
|
1273
|
+
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1274
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1275
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1276
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1277
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1278
|
+
};
|
|
1279
|
+
/**
|
|
1280
|
+
* The table pagination of VegaTable
|
|
1281
|
+
*/
|
|
1282
|
+
class VegaTablePaginationController extends VegaSlimmer {
|
|
1283
|
+
/**
|
|
1284
|
+
* Component lifecycle - componentWillLoad
|
|
1285
|
+
*/
|
|
1286
|
+
componentWillLoad() {
|
|
1287
|
+
var _a, _b;
|
|
1288
|
+
this.currentPage = ((_a = this.pagination) === null || _a === void 0 ? void 0 : _a.current) || 1;
|
|
1289
|
+
this.pageSize = ((_b = this.pagination) === null || _b === void 0 ? void 0 : _b.pageSize) || 10;
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
*
|
|
1293
|
+
*/
|
|
1294
|
+
watchPagination() {
|
|
1295
|
+
if (this.pagination) {
|
|
1296
|
+
const { pageSize, current } = this.pagination;
|
|
1297
|
+
if (pageSize > 0) {
|
|
1298
|
+
this.pageSize = pageSize;
|
|
1299
|
+
}
|
|
1300
|
+
if (current > 0) {
|
|
1301
|
+
this.currentPage = current;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Set pageSize value
|
|
1307
|
+
*
|
|
1308
|
+
* @param {number} pageSize - New value for pageSize
|
|
1309
|
+
*/
|
|
1310
|
+
setPageSize(pageSize) {
|
|
1311
|
+
this.pageSize = pageSize;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Set currentPage value
|
|
1315
|
+
*
|
|
1316
|
+
* @param {number} currentPage - New value for currentPage
|
|
1317
|
+
*/
|
|
1318
|
+
setCurrentPage(currentPage) {
|
|
1319
|
+
this.currentPage = currentPage;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Whether the row is visible in current page
|
|
1323
|
+
*
|
|
1324
|
+
* @param {number} index - The record index of the currentData
|
|
1325
|
+
* @returns {boolean} Return true if the row is visible
|
|
1326
|
+
*/
|
|
1327
|
+
isRowVisible(index) {
|
|
1328
|
+
if (!this.pagination)
|
|
1329
|
+
return true;
|
|
1330
|
+
const pageSize = this.pageSize;
|
|
1331
|
+
const current = this.currentPage;
|
|
1332
|
+
const start = (current - 1) * pageSize;
|
|
1333
|
+
const end = current * pageSize;
|
|
1334
|
+
return index >= start && index < end;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
__decorate$a([
|
|
1338
|
+
MapToComponentField()
|
|
1339
|
+
], VegaTablePaginationController.prototype, "pagination", void 0);
|
|
1340
|
+
__decorate$a([
|
|
1341
|
+
MapToComponentField({ writable: true })
|
|
1342
|
+
], VegaTablePaginationController.prototype, "pageSize", void 0);
|
|
1343
|
+
__decorate$a([
|
|
1344
|
+
MapToComponentField({ writable: true })
|
|
1345
|
+
], VegaTablePaginationController.prototype, "currentPage", void 0);
|
|
1346
|
+
__decorate$a([
|
|
1347
|
+
MapToComponentMethod('componentWillLoad')
|
|
1348
|
+
], VegaTablePaginationController.prototype, "componentWillLoad", null);
|
|
1349
|
+
__decorate$a([
|
|
1350
|
+
MapToComponentMethod('watchPagination')
|
|
1351
|
+
], VegaTablePaginationController.prototype, "watchPagination", null);
|
|
1352
|
+
|
|
1353
|
+
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1354
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1355
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1356
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1357
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1358
|
+
};
|
|
1359
|
+
/**
|
|
1360
|
+
* Edit table controller
|
|
1361
|
+
*/
|
|
1362
|
+
class VegaTableEditableController extends VegaSlimmer {
|
|
1363
|
+
constructor() {
|
|
1364
|
+
super(...arguments);
|
|
1365
|
+
this.rowFormRefMap = new Map();
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Get the map of the row form refs
|
|
1369
|
+
*
|
|
1370
|
+
* @returns {Map<string, HTMLVegaFormElement>} The map of row form refs
|
|
1371
|
+
*/
|
|
1372
|
+
getRowFormRefMap() {
|
|
1373
|
+
return this.rowFormRefMap;
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* The callback to handle [saveAllEditRows]{@link VegaTable.saveAllEditRows}
|
|
1377
|
+
*/
|
|
1378
|
+
async saveAllEditRows() {
|
|
1379
|
+
if (!this.canMethodBeInvokedInCurrentState('saveAllEditRows')) {
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
const currentData = this.vegaTableDataSourceController
|
|
1383
|
+
.getCurrentData()
|
|
1384
|
+
.slice();
|
|
1385
|
+
for (const rowKey of this.editingRows.toArray()) {
|
|
1386
|
+
const rowData = await this.getRowData(rowKey);
|
|
1387
|
+
const index = currentData.findIndex((item) => this.vegaTableDataSourceController.getRecordKey(item) === rowKey);
|
|
1388
|
+
if (index > -1) {
|
|
1389
|
+
currentData.splice(index, 1, rowData);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
this.vegaTableDataSourceController.setDataSource([...currentData]);
|
|
1393
|
+
void this.stopAllRowEditMode();
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* The callback to handle [stopAllRowEditMode]{@link VegaTable.stopAllRowEditMode}
|
|
1397
|
+
*/
|
|
1398
|
+
stopAllRowEditMode() {
|
|
1399
|
+
if (!this.canMethodBeInvokedInCurrentState('stopAllRowEditMode')) {
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
this.editingRows.clear();
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Stop the removed editing row when the data source changed
|
|
1406
|
+
*
|
|
1407
|
+
* @param {VegaTableDataSourceItem[]} newValue - The new data source
|
|
1408
|
+
*/
|
|
1409
|
+
watchDataSource(newValue) {
|
|
1410
|
+
if (this.isEditableTable()) {
|
|
1411
|
+
this.getEditingRowsKey().forEach((rowKey) => {
|
|
1412
|
+
if (!newValue.find((item) => item.key === rowKey)) {
|
|
1413
|
+
this.stopRowEditMode(rowKey);
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* The callback to handle [saveEditRow]{@link VegaTable.saveEditRow}
|
|
1420
|
+
*
|
|
1421
|
+
* @param {string} rowKey - The key of the row's record
|
|
1422
|
+
*/
|
|
1423
|
+
async saveEditRow(rowKey) {
|
|
1424
|
+
if (!this.canMethodBeInvokedInCurrentState('saveEditRow')) {
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
const rowData = await this.getRowData(rowKey);
|
|
1428
|
+
const currentData = this.vegaTableDataSourceController
|
|
1429
|
+
.getCurrentData()
|
|
1430
|
+
.slice();
|
|
1431
|
+
const index = currentData.findIndex((item) => this.vegaTableDataSourceController.getRecordKey(item) === rowKey);
|
|
1432
|
+
if (index > -1) {
|
|
1433
|
+
currentData.splice(index, 1, rowData);
|
|
1434
|
+
this.vegaTableDataSourceController.setDataSource([...currentData]);
|
|
1435
|
+
}
|
|
1436
|
+
void this.stopRowEditMode(rowKey);
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* The callback to handle [stopRowEditMode]{@link VegaTable.stopRowEditMode}
|
|
1440
|
+
*
|
|
1441
|
+
* @param {string} rowKey - The key of the row's record
|
|
1442
|
+
*/
|
|
1443
|
+
stopRowEditMode(rowKey) {
|
|
1444
|
+
if (!this.canMethodBeInvokedInCurrentState('stopRowEditMode')) {
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
this.editingRows.delete(rowKey);
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* The callback to handle [removeRow]{@link VegaTable.removeRow}
|
|
1451
|
+
*
|
|
1452
|
+
* @param {string} rowKey - The key of the row's record
|
|
1453
|
+
*/
|
|
1454
|
+
removeRow(rowKey) {
|
|
1455
|
+
if (!this.canMethodBeInvokedInCurrentState('removeRow')) {
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
this.vegaTableDataSourceController.setDataSource(this.vegaTableDataSourceController
|
|
1459
|
+
.getCurrentData()
|
|
1460
|
+
.filter((item) => this.vegaTableDataSourceController.getRecordKey(item) !== rowKey));
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* The callback to handle [startRowEditMode]{@link VegaTable.startRowEditMode}
|
|
1464
|
+
*
|
|
1465
|
+
* @param {string} rowKey - The key of the row's record
|
|
1466
|
+
*/
|
|
1467
|
+
startRowEditMode(rowKey) {
|
|
1468
|
+
if (!this.canMethodBeInvokedInCurrentState('startRowEditMode')) {
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
this.editingRows.add(rowKey);
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* The callback to handle [addNewRow]{@link VegaTable.addNewRow}
|
|
1475
|
+
*
|
|
1476
|
+
* @param {VegaTableDataSourceItem} record - The record for adding
|
|
1477
|
+
* @returns {string} The rowKey of the new added row record
|
|
1478
|
+
*/
|
|
1479
|
+
addNewRow(record = {}) {
|
|
1480
|
+
var _a;
|
|
1481
|
+
if (!this.canMethodBeInvokedInCurrentState('addNewRow')) {
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
const rowKey = ((_a = record[this.rowKey]) === null || _a === void 0 ? void 0 : _a.toString()) || generateUUID();
|
|
1485
|
+
const newRowItem = Object.assign({}, record);
|
|
1486
|
+
newRowItem[this.rowKey] = rowKey;
|
|
1487
|
+
this.vegaTableDataSourceController.setCurrentData([
|
|
1488
|
+
...this.vegaTableDataSourceController.getCurrentData(),
|
|
1489
|
+
newRowItem,
|
|
1490
|
+
]);
|
|
1491
|
+
this.editingRows.add(rowKey);
|
|
1492
|
+
return rowKey;
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* The callback to handle [getRowsData]{@link VegaTable.getRowsData}
|
|
1496
|
+
*/
|
|
1497
|
+
async getRowsData() {
|
|
1498
|
+
if (!this.canMethodBeInvokedInCurrentState('getRowsData')) {
|
|
1499
|
+
return;
|
|
1500
|
+
}
|
|
1501
|
+
const tableFormRef = this.vegaTableBodyRenderer.getTableFormRef();
|
|
1502
|
+
const formValues = tableFormRef ? await tableFormRef.getValue() : [];
|
|
1503
|
+
return [
|
|
1504
|
+
...this.vegaTableDataSourceController.getCurrentData().map((record) => {
|
|
1505
|
+
const value = formValues[`${VegaTableEditableController.rowFormKeyPrefix}${this.vegaTableDataSourceController.getRecordKey(record)}`];
|
|
1506
|
+
return Object.assign(Object.assign({}, record), value);
|
|
1507
|
+
}),
|
|
1508
|
+
];
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* The callback to handle [getEditingRowsKey]{@link VegaTable.getEditingRowsKey}
|
|
1512
|
+
*
|
|
1513
|
+
* @returns {string[]} The key of the rows which is editing
|
|
1514
|
+
*/
|
|
1515
|
+
getEditingRowsKey() {
|
|
1516
|
+
if (!this.canMethodBeInvokedInCurrentState('getEditingRowsKey')) {
|
|
1517
|
+
return;
|
|
1518
|
+
}
|
|
1519
|
+
return this.editingRows.toArray();
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* The callback to handle [getFormRef]{@link VegaTable.getFormRef}
|
|
1523
|
+
*
|
|
1524
|
+
* @param {string} rowKey - The key of the row's record
|
|
1525
|
+
* @returns {HTMLVegaFormElement} The form ref of the row
|
|
1526
|
+
*/
|
|
1527
|
+
getFormRef(rowKey) {
|
|
1528
|
+
if (!this.canMethodBeInvokedInCurrentState('getFormRef')) {
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
return rowKey ? this.rowFormRefMap.get(rowKey) : this.vegaTableBodyRenderer.getTableFormRef();
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* The callback to handle [getRowData]{@link VegaTable.getRowData}
|
|
1535
|
+
*
|
|
1536
|
+
* @param {string} rowKey - The key of the row's record
|
|
1537
|
+
* @returns {Promise<VegaTableDataSourceItem>} The promise of the row data
|
|
1538
|
+
*/
|
|
1539
|
+
async getRowData(rowKey) {
|
|
1540
|
+
if (!this.canMethodBeInvokedInCurrentState('getRowData')) {
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
const formValue = await this.rowFormRefMap.get(rowKey).getValue();
|
|
1544
|
+
return Object.assign(Object.assign({}, this.vegaTableDataSourceController.getRecordByKey(rowKey)), formValue);
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Whether the row is in editing status
|
|
1548
|
+
*
|
|
1549
|
+
* @param {string} rowKey - The key of the row's record
|
|
1550
|
+
* @returns {boolean} return true if the row is in editing status, otherwise false
|
|
1551
|
+
*/
|
|
1552
|
+
isEditing(rowKey) {
|
|
1553
|
+
return this.editingRows.has(rowKey);
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* The function `isEditableTable` checks if any column in a table is editable.
|
|
1557
|
+
*
|
|
1558
|
+
* @returns {boolean} The `isEditableTable` method is returning a boolean value. It checks if any of the columns
|
|
1559
|
+
* in the `columns` array have the `editable` property set to true. If at least one column is editable,
|
|
1560
|
+
* the method returns `true`, otherwise it returns `false`.
|
|
1561
|
+
*/
|
|
1562
|
+
isEditableTable() {
|
|
1563
|
+
return this.columns.some((item) => item.editable);
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* The function `canMethodBeInvokedInCurrentState` checks if the table is editable and logs a warning message if not.
|
|
1567
|
+
*
|
|
1568
|
+
* @param {string} methodName - The `methodName` parameter is a string that represents the name of the
|
|
1569
|
+
* method being processed in the `canMethodBeInvokedInCurrentState` function.
|
|
1570
|
+
* @returns {boolean} The method `canMethodBeInvokedInCurrentState` is returning a boolean value. If the table is not editable,
|
|
1571
|
+
* it will log a warning message and return `false`. Otherwise, it will return `true`.
|
|
1572
|
+
*/
|
|
1573
|
+
canMethodBeInvokedInCurrentState(methodName) {
|
|
1574
|
+
if (!this.isEditableTable()) {
|
|
1575
|
+
LogUtility.warn(`Method ${methodName} only works with editable tables`);
|
|
1576
|
+
return false;
|
|
1577
|
+
}
|
|
1578
|
+
return true;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
VegaTableEditableController.rowFormKeyPrefix = 'vega-table-row-form-';
|
|
1582
|
+
__decorate$9([
|
|
1583
|
+
MapToComponentField()
|
|
1584
|
+
], VegaTableEditableController.prototype, "editingRows", void 0);
|
|
1585
|
+
__decorate$9([
|
|
1586
|
+
MapToComponentField()
|
|
1587
|
+
], VegaTableEditableController.prototype, "rowKey", void 0);
|
|
1588
|
+
__decorate$9([
|
|
1589
|
+
MapToComponentField()
|
|
1590
|
+
], VegaTableEditableController.prototype, "columns", void 0);
|
|
1591
|
+
__decorate$9([
|
|
1592
|
+
MapToComponentField()
|
|
1593
|
+
], VegaTableEditableController.prototype, "vegaTableDataSourceController", void 0);
|
|
1594
|
+
__decorate$9([
|
|
1595
|
+
MapToComponentField()
|
|
1596
|
+
], VegaTableEditableController.prototype, "vegaTableBodyRenderer", void 0);
|
|
1597
|
+
__decorate$9([
|
|
1598
|
+
MapToComponentMethod('saveAllEditRows')
|
|
1599
|
+
], VegaTableEditableController.prototype, "saveAllEditRows", null);
|
|
1600
|
+
__decorate$9([
|
|
1601
|
+
MapToComponentMethod('stopAllRowEditMode')
|
|
1602
|
+
], VegaTableEditableController.prototype, "stopAllRowEditMode", null);
|
|
1603
|
+
__decorate$9([
|
|
1604
|
+
MapToComponentMethod('watchDataSource')
|
|
1605
|
+
], VegaTableEditableController.prototype, "watchDataSource", null);
|
|
1606
|
+
__decorate$9([
|
|
1607
|
+
MapToComponentMethod('saveEditRow')
|
|
1608
|
+
], VegaTableEditableController.prototype, "saveEditRow", null);
|
|
1609
|
+
__decorate$9([
|
|
1610
|
+
MapToComponentMethod('stopRowEditMode')
|
|
1611
|
+
], VegaTableEditableController.prototype, "stopRowEditMode", null);
|
|
1612
|
+
__decorate$9([
|
|
1613
|
+
MapToComponentMethod('removeRow')
|
|
1614
|
+
], VegaTableEditableController.prototype, "removeRow", null);
|
|
1615
|
+
__decorate$9([
|
|
1616
|
+
MapToComponentMethod('startRowEditMode')
|
|
1617
|
+
], VegaTableEditableController.prototype, "startRowEditMode", null);
|
|
1618
|
+
__decorate$9([
|
|
1619
|
+
MapToComponentMethod('addNewRow')
|
|
1620
|
+
], VegaTableEditableController.prototype, "addNewRow", null);
|
|
1621
|
+
__decorate$9([
|
|
1622
|
+
MapToComponentMethod('getRowsData')
|
|
1623
|
+
], VegaTableEditableController.prototype, "getRowsData", null);
|
|
1624
|
+
__decorate$9([
|
|
1625
|
+
MapToComponentMethod('getEditingRowsKey')
|
|
1626
|
+
], VegaTableEditableController.prototype, "getEditingRowsKey", null);
|
|
1627
|
+
__decorate$9([
|
|
1628
|
+
MapToComponentMethod('getFormRef')
|
|
1629
|
+
], VegaTableEditableController.prototype, "getFormRef", null);
|
|
1630
|
+
__decorate$9([
|
|
1631
|
+
MapToComponentMethod('getRowData')
|
|
1632
|
+
], VegaTableEditableController.prototype, "getRowData", null);
|
|
1633
|
+
|
|
1634
|
+
/**
|
|
1635
|
+
* Vega Table Sorter
|
|
1636
|
+
* This is a helper class for sorting table data based on defined columns to be sorted
|
|
1637
|
+
* Supports multi-column sorting
|
|
1638
|
+
*/
|
|
1639
|
+
class VegaTableSorter {
|
|
1640
|
+
constructor(prop, order, sorter) {
|
|
1641
|
+
this.prop = prop;
|
|
1642
|
+
this.order = order;
|
|
1643
|
+
this.sorter = sorter;
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Sort utility
|
|
1647
|
+
*
|
|
1648
|
+
* @param {VegaTableDataSourceItem} a column value
|
|
1649
|
+
* @param {VegaTableDataSourceItem} b column value
|
|
1650
|
+
* @returns {Nullable<number>} compare result
|
|
1651
|
+
*/
|
|
1652
|
+
sort(a, b) {
|
|
1653
|
+
const compareResult = this.sorter(a, b);
|
|
1654
|
+
if (compareResult !== 0) {
|
|
1655
|
+
return this.order === 'asc' ? compareResult : -compareResult;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Get params from sorter object for external use
|
|
1660
|
+
*
|
|
1661
|
+
* @returns {VegaTableSorterType} sorter prop and order
|
|
1662
|
+
*/
|
|
1663
|
+
toExternalFormat() {
|
|
1664
|
+
return { prop: this.prop, order: this.order };
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Get sorter order value
|
|
1668
|
+
*
|
|
1669
|
+
* @returns {VegaTableSortOrderType} sorter order
|
|
1670
|
+
*/
|
|
1671
|
+
getSortOrder() {
|
|
1672
|
+
return this.order;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1677
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1678
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1679
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1680
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1681
|
+
};
|
|
1682
|
+
/**
|
|
1683
|
+
* The sort controller for the vega-table
|
|
1684
|
+
*/
|
|
1685
|
+
class VegaTableSortController extends VegaSlimmer {
|
|
1686
|
+
/**
|
|
1687
|
+
* The callback of [watchColumns]{@link VegaTable.watchColumns}
|
|
1688
|
+
*/
|
|
1689
|
+
watchColumns() {
|
|
1690
|
+
this.syncSortOrder();
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* The method for header cell sort click
|
|
1694
|
+
*
|
|
1695
|
+
* @param {VegaTableColumnConfig} column - The column for sorting
|
|
1696
|
+
* @param {VegaTableSortOrderType} nextSortOrder - The next sorter order
|
|
1697
|
+
*/
|
|
1698
|
+
handleHeadSortClick(column, nextSortOrder) {
|
|
1699
|
+
if (this.sortConfig.type === 'single') {
|
|
1700
|
+
this.sortersMap.clear();
|
|
1701
|
+
}
|
|
1702
|
+
if (!nextSortOrder) {
|
|
1703
|
+
if (this.sortersMap.has(column.prop)) {
|
|
1704
|
+
this.sortersMap.delete(column.prop);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
else {
|
|
1708
|
+
this.sortersMap.set(column.prop, new VegaTableSorter(column.prop, nextSortOrder, column.sorter));
|
|
1709
|
+
}
|
|
1710
|
+
if (column.sorter !== 'event') {
|
|
1711
|
+
this.vegaTableDataSourceController.setCurrentData(this.sortData(this.vegaTableDataSourceController.getDataSource(), Array.from(this.sortersMap.values())));
|
|
1712
|
+
}
|
|
1713
|
+
this.changeEventEmitter.emit({
|
|
1714
|
+
sorters: Array.from(this.sortersMap.values()).map((s) => s.toExternalFormat()),
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Sync the default sort order from the columns
|
|
1719
|
+
*/
|
|
1720
|
+
syncSortOrder() {
|
|
1721
|
+
this.columns
|
|
1722
|
+
.filter((column) => isNonNullable(column.sorter) && isNonNullable(column.sortOrder))
|
|
1723
|
+
.forEach((item) => {
|
|
1724
|
+
this.sortersMap.set(item.prop, new VegaTableSorter(item.prop, item.sortOrder, item.sorter));
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* The method to sort the data by sorter which include prop name and order
|
|
1729
|
+
*
|
|
1730
|
+
* @param {VegaTableDataSourceItem[]} data - The source that will be sorted
|
|
1731
|
+
* @param {VegaTableSorter[]} sorters - array of sorters ordered by sequence of columns to be sorted
|
|
1732
|
+
* @returns {VegaTableDataSourceItem[]} The sorted data source
|
|
1733
|
+
*/
|
|
1734
|
+
sortData(data, sorters) {
|
|
1735
|
+
return [...data].sort((a, b) => {
|
|
1736
|
+
for (const sorter of sorters) {
|
|
1737
|
+
const result = sorter.sort(a, b);
|
|
1738
|
+
if (isNonNullable(result)) {
|
|
1739
|
+
return result;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
return 0;
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
__decorate$8([
|
|
1747
|
+
MapToComponentField({ writable: true })
|
|
1748
|
+
], VegaTableSortController.prototype, "sortersMap", void 0);
|
|
1749
|
+
__decorate$8([
|
|
1750
|
+
MapToComponentField()
|
|
1751
|
+
], VegaTableSortController.prototype, "columns", void 0);
|
|
1752
|
+
__decorate$8([
|
|
1753
|
+
MapToComponentField()
|
|
1754
|
+
], VegaTableSortController.prototype, "changeEventEmitter", void 0);
|
|
1755
|
+
__decorate$8([
|
|
1756
|
+
MapToComponentField()
|
|
1757
|
+
], VegaTableSortController.prototype, "vegaTableDataSourceController", void 0);
|
|
1758
|
+
__decorate$8([
|
|
1759
|
+
MapToComponentField()
|
|
1760
|
+
], VegaTableSortController.prototype, "sortConfig", void 0);
|
|
1761
|
+
__decorate$8([
|
|
1762
|
+
MapToComponentMethod('watchColumns')
|
|
1763
|
+
], VegaTableSortController.prototype, "watchColumns", null);
|
|
1764
|
+
|
|
1765
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1766
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1767
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1768
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1769
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1770
|
+
};
|
|
1771
|
+
class VegaTableColGroupRenderer extends VegaSlimmer {
|
|
1772
|
+
constructor() {
|
|
1773
|
+
super(...arguments);
|
|
1774
|
+
this.getColResponsiveClass = (column) => {
|
|
1775
|
+
return column.breakpoint && isBreakpointsTokenType(column.breakpoint)
|
|
1776
|
+
? `v-hidden ${column.breakpoint}:v-table-column`
|
|
1777
|
+
: '';
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
render() {
|
|
1781
|
+
return (h("colgroup", null,
|
|
1782
|
+
h("col", { style: { minWidth: this.paddingX[0], width: this.paddingX[0] } }),
|
|
1783
|
+
this.vegaTableRowSelectionController.getRowSelectionType() === 'multiple' && (h("col", { style: { minWidth: '40px', width: '40px' } })),
|
|
1784
|
+
this.columnStructureModel
|
|
1785
|
+
.generateColumnConfigByLeaves(this.columns)
|
|
1786
|
+
.map((column) => {
|
|
1787
|
+
if (column) {
|
|
1788
|
+
const responsiveClass = this.getColResponsiveClass(column);
|
|
1789
|
+
return (h("col", { class: responsiveClass, style: { width: column.width ? column.width : null } }));
|
|
1790
|
+
}
|
|
1791
|
+
else {
|
|
1792
|
+
return h("col", null);
|
|
1793
|
+
}
|
|
1794
|
+
}),
|
|
1795
|
+
this.rowExpandable && h("col", { style: { minWidth: '40px', width: '40px' } }),
|
|
1796
|
+
h("col", { style: { minWidth: this.paddingX[1], width: this.paddingX[1] } })));
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
__decorate$7([
|
|
1800
|
+
MapToComponentField()
|
|
1801
|
+
], VegaTableColGroupRenderer.prototype, "paddingX", void 0);
|
|
1802
|
+
__decorate$7([
|
|
1803
|
+
MapToComponentField()
|
|
1804
|
+
], VegaTableColGroupRenderer.prototype, "columnStructureModel", void 0);
|
|
1805
|
+
__decorate$7([
|
|
1806
|
+
MapToComponentField()
|
|
1807
|
+
], VegaTableColGroupRenderer.prototype, "columns", void 0);
|
|
1808
|
+
__decorate$7([
|
|
1809
|
+
MapToComponentField()
|
|
1810
|
+
], VegaTableColGroupRenderer.prototype, "rowExpandable", void 0);
|
|
1811
|
+
__decorate$7([
|
|
1812
|
+
MapToComponentField()
|
|
1813
|
+
], VegaTableColGroupRenderer.prototype, "vegaTableRowSelectionController", void 0);
|
|
1814
|
+
|
|
1815
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1816
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1817
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1818
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1819
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1820
|
+
};
|
|
1821
|
+
/**
|
|
1822
|
+
* The controller for the table children components.
|
|
1823
|
+
*/
|
|
1824
|
+
class VegaTableChildrenController extends VegaSlimmer {
|
|
1825
|
+
constructor() {
|
|
1826
|
+
super(...arguments);
|
|
1827
|
+
this.currentDataObserver = new MutationObserverSlimmer({
|
|
1828
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1829
|
+
target: () => this.host,
|
|
1830
|
+
options: { childList: true, subtree: true },
|
|
1831
|
+
/*
|
|
1832
|
+
* The below method is e2e-test covered in
|
|
1833
|
+
* @see{module:should-render-striped-rows-and-not-show-empty-message-when-lazy-render-table-body-with-table-rows}
|
|
1834
|
+
*/
|
|
1835
|
+
mutationFilter: TagNameMutationFilter('VEGA-TABLE-BODY', 'VEGA-TABLE-ROW'),
|
|
1836
|
+
callback:
|
|
1837
|
+
/*
|
|
1838
|
+
* The below method is e2e-test covered in
|
|
1839
|
+
* @see{module:should-not-render-empty-message-when-async-render-table-rows}
|
|
1840
|
+
*/
|
|
1841
|
+
/* istanbul ignore next */
|
|
1842
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1843
|
+
() => {
|
|
1844
|
+
this.syncUpTableCurrentData();
|
|
1845
|
+
this.syncUpTableHeadRowProps();
|
|
1846
|
+
},
|
|
1847
|
+
});
|
|
1848
|
+
this.rowStripedObserver = new MutationObserverSlimmer({
|
|
1849
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1850
|
+
target: () => this.host,
|
|
1851
|
+
options: { childList: true, subtree: true },
|
|
1852
|
+
/*
|
|
1853
|
+
* The below method is e2e-test covered in
|
|
1854
|
+
* @see{module:should-render-striped-rows-and-not-show-empty-message-when-lazy-render-table-body-with-table-rows}
|
|
1855
|
+
*/
|
|
1856
|
+
mutationFilter: TagNameMutationFilter('VEGA-TABLE-BODY', 'VEGA-TABLE-ROW', 'VEGA-TABLE-EXPAND-ROW'),
|
|
1857
|
+
callback:
|
|
1858
|
+
/*
|
|
1859
|
+
* The below method is e2e-test covered in
|
|
1860
|
+
* @see{module:should-render-striped-row-when-async-render-table-rows}
|
|
1861
|
+
* @see{module:should-render-striped-row-and-expanded-row-when-async-render-table-rows}
|
|
1862
|
+
*/
|
|
1863
|
+
/* istanbul ignore next */
|
|
1864
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1865
|
+
() => {
|
|
1866
|
+
this.syncRowStates();
|
|
1867
|
+
},
|
|
1868
|
+
});
|
|
1869
|
+
/**
|
|
1870
|
+
* Syncs up the properties of vega-table-row
|
|
1871
|
+
*/
|
|
1872
|
+
this.syncUpTableCurrentData = () => {
|
|
1873
|
+
if (!this.isTemplateRenderMode)
|
|
1874
|
+
return;
|
|
1875
|
+
const currentData = Array.from(this.host.querySelectorAll('vega-table-row')).map((row) => {
|
|
1876
|
+
return { key: row.rowKey };
|
|
1877
|
+
});
|
|
1878
|
+
this.vegaTableDataSourceController.setCurrentData(currentData);
|
|
1879
|
+
};
|
|
1880
|
+
/**
|
|
1881
|
+
* Sync up the properties of vega-table-expand-row
|
|
1882
|
+
*/
|
|
1883
|
+
this.syncRowStates = () => {
|
|
1884
|
+
const rows = this.host.querySelectorAll('vega-table-row');
|
|
1885
|
+
rows.forEach((row, index) => {
|
|
1886
|
+
this.updateRowStriped(row, index);
|
|
1887
|
+
this.updateRowDivider(row, index === rows.length - 1);
|
|
1888
|
+
});
|
|
1889
|
+
const expandRows = this.host.querySelectorAll('vega-table-expand-row');
|
|
1890
|
+
expandRows.forEach((row, index) => {
|
|
1891
|
+
this.updateRowStriped(row, index);
|
|
1892
|
+
});
|
|
1893
|
+
};
|
|
1894
|
+
/**
|
|
1895
|
+
* Syncs up the properties of vega-table-head-row
|
|
1896
|
+
*/
|
|
1897
|
+
this.syncUpTableHeadRowProps = () => {
|
|
1898
|
+
var _a;
|
|
1899
|
+
if (!this.isTemplateRenderMode)
|
|
1900
|
+
return;
|
|
1901
|
+
const headRow = this.host.querySelector('vega-table-head-row');
|
|
1902
|
+
if (headRow) {
|
|
1903
|
+
headRow.hideSelectAll = headRow.hideSelectAll || ((_a = this.rowSelection) === null || _a === void 0 ? void 0 : _a.hideSelectAll);
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
/*
|
|
1908
|
+
* The below method is e2e-test covered in
|
|
1909
|
+
* @see module:should-render-striped-row-as-expected-when-component-re-attached
|
|
1910
|
+
*/
|
|
1911
|
+
/**
|
|
1912
|
+
* Used by rowStripedObserver{@link rowStripedObserver} and currentDataObserver{@link currentDataObserver}
|
|
1913
|
+
*/
|
|
1914
|
+
connectedCallback() {
|
|
1915
|
+
methodPlaceholder();
|
|
1916
|
+
}
|
|
1917
|
+
/*
|
|
1918
|
+
* The below method is e2e-test covered in
|
|
1919
|
+
* @see module:should-render-striped-row-as-expected-when-component-re-attached
|
|
1920
|
+
*/
|
|
1921
|
+
/**
|
|
1922
|
+
* Used by rowStripedObserver{@link rowStripedObserver} and currentDataObserver{@link currentDataObserver}
|
|
1923
|
+
*/
|
|
1924
|
+
disconnectedCallback() {
|
|
1925
|
+
methodPlaceholder();
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Component lifecycle - [componentWillLoad]{@link VegaTable.componentWillLoad}
|
|
1929
|
+
*/
|
|
1930
|
+
componentWillLoad() {
|
|
1931
|
+
this.syncUpTableCurrentData();
|
|
1932
|
+
this.syncUpTableHeadRowProps();
|
|
1933
|
+
this.syncRowStates();
|
|
1934
|
+
this.syncUpTableFootVisibility();
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Component lifecycle - [componentDidLoad]{@link VegaTable.componentDidLoad}
|
|
1938
|
+
*/
|
|
1939
|
+
componentDidLoad() {
|
|
1940
|
+
methodPlaceholder();
|
|
1941
|
+
}
|
|
1942
|
+
/**
|
|
1943
|
+
* The callback to handle [clearSelection]{@link VegaTable.clearSelection}
|
|
1944
|
+
*/
|
|
1945
|
+
clearSelection() {
|
|
1946
|
+
ChangeManager.notify(TABLE_ROW_SELECTION_ALL, {
|
|
1947
|
+
host: this.host,
|
|
1948
|
+
checked: false,
|
|
1949
|
+
noneChecked: true,
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* The callback to handle [watchCurrentData]{@link VegaTable.watchCurrentData}
|
|
1954
|
+
*/
|
|
1955
|
+
watchCurrentData() {
|
|
1956
|
+
this.syncUpTableFootVisibility();
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* {@link VegaTable.watchStriped}
|
|
1960
|
+
*/
|
|
1961
|
+
watchStriped() {
|
|
1962
|
+
this.syncRowStates();
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* {@link VegaTable.watchRowDivider}
|
|
1966
|
+
*/
|
|
1967
|
+
watchRowDivider() {
|
|
1968
|
+
this.syncRowStates();
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1971
|
+
* Update the row striped attr
|
|
1972
|
+
*
|
|
1973
|
+
* @param {HTMLElement} row - row or expand row element
|
|
1974
|
+
* @param {number} index - index of the row
|
|
1975
|
+
*/
|
|
1976
|
+
updateRowStriped(row, index) {
|
|
1977
|
+
row.striped = this.striped && index % 2 === 1;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Update the row striped attr
|
|
1981
|
+
*
|
|
1982
|
+
* @param {HTMLElement} row - row or expand row element
|
|
1983
|
+
* @param {boolean} isLastRow - Is last row
|
|
1984
|
+
*/
|
|
1985
|
+
updateRowDivider(row, isLastRow) {
|
|
1986
|
+
row.rowDivider = this.rowDivider && !isLastRow;
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Sync up the visibility of table foot based on current data
|
|
1990
|
+
*/
|
|
1991
|
+
syncUpTableFootVisibility() {
|
|
1992
|
+
const tableFoot = this.host.querySelector('vega-table-foot');
|
|
1993
|
+
if (tableFoot) {
|
|
1994
|
+
if (this.vegaTableDataSourceController.isCurrentDataEmpty()) {
|
|
1995
|
+
tableFoot.classList.add('v-hidden');
|
|
1996
|
+
}
|
|
1997
|
+
else {
|
|
1998
|
+
tableFoot.classList.remove('v-hidden');
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
__decorate$6([
|
|
2004
|
+
MapToComponentField()
|
|
2005
|
+
], VegaTableChildrenController.prototype, "host", void 0);
|
|
2006
|
+
__decorate$6([
|
|
2007
|
+
MapToComponentField()
|
|
2008
|
+
], VegaTableChildrenController.prototype, "columns", void 0);
|
|
2009
|
+
__decorate$6([
|
|
2010
|
+
MapToComponentField()
|
|
2011
|
+
], VegaTableChildrenController.prototype, "dataSource", void 0);
|
|
2012
|
+
__decorate$6([
|
|
2013
|
+
MapToComponentField()
|
|
2014
|
+
], VegaTableChildrenController.prototype, "currentData", void 0);
|
|
2015
|
+
__decorate$6([
|
|
2016
|
+
MapToComponentField()
|
|
2017
|
+
], VegaTableChildrenController.prototype, "rowSelection", void 0);
|
|
2018
|
+
__decorate$6([
|
|
2019
|
+
MapToComponentField()
|
|
2020
|
+
], VegaTableChildrenController.prototype, "striped", void 0);
|
|
2021
|
+
__decorate$6([
|
|
2022
|
+
MapToComponentField()
|
|
2023
|
+
], VegaTableChildrenController.prototype, "rowDivider", void 0);
|
|
2024
|
+
__decorate$6([
|
|
2025
|
+
MapToComponentField()
|
|
2026
|
+
], VegaTableChildrenController.prototype, "vegaTableDataSourceController", void 0);
|
|
2027
|
+
__decorate$6([
|
|
2028
|
+
MapToComponentField()
|
|
2029
|
+
], VegaTableChildrenController.prototype, "vegaTableRenderer", void 0);
|
|
2030
|
+
__decorate$6([
|
|
2031
|
+
MapToComponentField()
|
|
2032
|
+
], VegaTableChildrenController.prototype, "isTemplateRenderMode", void 0);
|
|
2033
|
+
__decorate$6([
|
|
2034
|
+
InjectVegaSlimmer()
|
|
2035
|
+
], VegaTableChildrenController.prototype, "currentDataObserver", void 0);
|
|
2036
|
+
__decorate$6([
|
|
2037
|
+
InjectVegaSlimmer()
|
|
2038
|
+
], VegaTableChildrenController.prototype, "rowStripedObserver", void 0);
|
|
2039
|
+
__decorate$6([
|
|
2040
|
+
MapToComponentMethod('connectedCallback')
|
|
2041
|
+
], VegaTableChildrenController.prototype, "connectedCallback", null);
|
|
2042
|
+
__decorate$6([
|
|
2043
|
+
MapToComponentMethod('disconnectedCallback')
|
|
2044
|
+
], VegaTableChildrenController.prototype, "disconnectedCallback", null);
|
|
2045
|
+
__decorate$6([
|
|
2046
|
+
MapToComponentMethod('componentWillLoad')
|
|
2047
|
+
], VegaTableChildrenController.prototype, "componentWillLoad", null);
|
|
2048
|
+
__decorate$6([
|
|
2049
|
+
MapToComponentMethod('componentDidLoad')
|
|
2050
|
+
], VegaTableChildrenController.prototype, "componentDidLoad", null);
|
|
2051
|
+
__decorate$6([
|
|
2052
|
+
MapToComponentMethod('clearSelection')
|
|
2053
|
+
], VegaTableChildrenController.prototype, "clearSelection", null);
|
|
2054
|
+
__decorate$6([
|
|
2055
|
+
MapToComponentMethod('watchCurrentData')
|
|
2056
|
+
], VegaTableChildrenController.prototype, "watchCurrentData", null);
|
|
2057
|
+
__decorate$6([
|
|
2058
|
+
MapToComponentMethod('watchStriped')
|
|
2059
|
+
], VegaTableChildrenController.prototype, "watchStriped", null);
|
|
2060
|
+
__decorate$6([
|
|
2061
|
+
MapToComponentMethod('watchRowDivider')
|
|
2062
|
+
], VegaTableChildrenController.prototype, "watchRowDivider", null);
|
|
2063
|
+
|
|
2064
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2065
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2066
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2067
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2068
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2069
|
+
};
|
|
2070
|
+
class VegaTableRowRenderer extends VegaSlimmer {
|
|
2071
|
+
constructor() {
|
|
2072
|
+
super(...arguments);
|
|
2073
|
+
this.renderTableRowComponent = (rowProps) => {
|
|
2074
|
+
const { rowKey, index, record, isVisibleInCurrentPage } = rowProps;
|
|
2075
|
+
const renderInputs = this.vegaTableRenderInputController.getLeafRenderInputs();
|
|
2076
|
+
return (h("vega-table-row", { class: {
|
|
2077
|
+
'v-hidden': !isVisibleInCurrentPage,
|
|
2078
|
+
}, key: `vega-table-row-${rowKey}`, rowKey: rowKey,
|
|
2079
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2080
|
+
ref: (ref) => {
|
|
2081
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaClick, () => {
|
|
2082
|
+
this.rowClickEventEmitter.emit({ record: record, index: index });
|
|
2083
|
+
});
|
|
2084
|
+
}, striped: this.striped && index % 2 === 1, rowDivider: this.rowDivider && !rowProps.isLastRow }, renderInputs.map((renderInput) => {
|
|
2085
|
+
return this.vegaTableCellRenderer.render(renderInput, record, index);
|
|
2086
|
+
})));
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
render(rowProps, editable) {
|
|
2090
|
+
const { rowKey } = rowProps;
|
|
2091
|
+
return editable ? (h("vega-form", { key: `vega-table-row-form-${rowKey}`, "data-vega-form": `${VegaTableEditableController.rowFormKeyPrefix}${rowKey}`, ref: (ref) => this.vegaTableEditableController.getRowFormRefMap().set(rowKey, ref) }, this.renderTableRowComponent(rowProps))) : (this.renderTableRowComponent(rowProps));
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
__decorate$5([
|
|
2095
|
+
MapToComponentField()
|
|
2096
|
+
], VegaTableRowRenderer.prototype, "rowClickEventEmitter", void 0);
|
|
2097
|
+
__decorate$5([
|
|
2098
|
+
MapToComponentField()
|
|
2099
|
+
], VegaTableRowRenderer.prototype, "vegaTableEditableController", void 0);
|
|
2100
|
+
__decorate$5([
|
|
2101
|
+
MapToComponentField()
|
|
2102
|
+
], VegaTableRowRenderer.prototype, "vegaTableCellRenderer", void 0);
|
|
2103
|
+
__decorate$5([
|
|
2104
|
+
MapToComponentField()
|
|
2105
|
+
], VegaTableRowRenderer.prototype, "striped", void 0);
|
|
2106
|
+
__decorate$5([
|
|
2107
|
+
MapToComponentField()
|
|
2108
|
+
], VegaTableRowRenderer.prototype, "rowDivider", void 0);
|
|
2109
|
+
__decorate$5([
|
|
2110
|
+
MapToComponentField()
|
|
2111
|
+
], VegaTableRowRenderer.prototype, "vegaTableRenderInputController", void 0);
|
|
2112
|
+
|
|
2113
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2114
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2115
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2116
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2117
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2118
|
+
};
|
|
2119
|
+
/**
|
|
2120
|
+
* The render mode controller of the table
|
|
2121
|
+
*/
|
|
2122
|
+
class VegaTableRenderModeController extends VegaSlimmer {
|
|
2123
|
+
constructor() {
|
|
2124
|
+
super(...arguments);
|
|
2125
|
+
this.currentDataObserver = new MutationObserverSlimmer({
|
|
2126
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
2127
|
+
target: () => this.host,
|
|
2128
|
+
options: { childList: true, subtree: true },
|
|
2129
|
+
mutationFilter: TagNameMutationFilter('VEGA-TABLE-ROW'),
|
|
2130
|
+
callback:
|
|
2131
|
+
/* istanbul ignore next */
|
|
2132
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
2133
|
+
() => {
|
|
2134
|
+
this.isTemplateRenderMode = this.checkIsTemplateRenderMode(this.host);
|
|
2135
|
+
},
|
|
2136
|
+
});
|
|
2137
|
+
/**
|
|
2138
|
+
* Check whether render mode is template render
|
|
2139
|
+
*
|
|
2140
|
+
* @param {HTMLElement} tableRef - VegaTable ref
|
|
2141
|
+
* @returns {boolean} return true if the mode is template, otherwise false
|
|
2142
|
+
*/
|
|
2143
|
+
this.checkIsTemplateRenderMode = (tableRef) => {
|
|
2144
|
+
return Array.from(tableRef.children).some((el) => el.tagName.startsWith('VEGA-TABLE-'));
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Used by {@link currentDataObserver}
|
|
2149
|
+
*/
|
|
2150
|
+
connectedCallback() {
|
|
2151
|
+
methodPlaceholder();
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* Used by {@link currentDataObserver}
|
|
2155
|
+
*/
|
|
2156
|
+
disconnectedCallback() {
|
|
2157
|
+
methodPlaceholder();
|
|
2158
|
+
}
|
|
2159
|
+
/**
|
|
2160
|
+
* init the isTemplateRenderMode value
|
|
2161
|
+
*/
|
|
2162
|
+
componentWillLoad() {
|
|
2163
|
+
this.isTemplateRenderMode = this.checkIsTemplateRenderMode(this.host);
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Used by {@link currentDataObserver}
|
|
2167
|
+
*/
|
|
2168
|
+
componentDidLoad() {
|
|
2169
|
+
methodPlaceholder();
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
__decorate$4([
|
|
2173
|
+
MapToComponentField()
|
|
2174
|
+
], VegaTableRenderModeController.prototype, "host", void 0);
|
|
2175
|
+
__decorate$4([
|
|
2176
|
+
MapToComponentField({ writable: true })
|
|
2177
|
+
], VegaTableRenderModeController.prototype, "isTemplateRenderMode", void 0);
|
|
2178
|
+
__decorate$4([
|
|
2179
|
+
InjectVegaSlimmer()
|
|
2180
|
+
], VegaTableRenderModeController.prototype, "currentDataObserver", void 0);
|
|
2181
|
+
__decorate$4([
|
|
2182
|
+
MapToComponentMethod('connectedCallback')
|
|
2183
|
+
], VegaTableRenderModeController.prototype, "connectedCallback", null);
|
|
2184
|
+
__decorate$4([
|
|
2185
|
+
MapToComponentMethod('disconnectedCallback')
|
|
2186
|
+
], VegaTableRenderModeController.prototype, "disconnectedCallback", null);
|
|
2187
|
+
__decorate$4([
|
|
2188
|
+
MapToComponentMethod('componentWillLoad')
|
|
2189
|
+
], VegaTableRenderModeController.prototype, "componentWillLoad", null);
|
|
2190
|
+
__decorate$4([
|
|
2191
|
+
MapToComponentMethod('componentDidLoad')
|
|
2192
|
+
], VegaTableRenderModeController.prototype, "componentDidLoad", null);
|
|
2193
|
+
|
|
2194
|
+
const VegaTableRuntimeMetricsPayloadDefinition = [
|
|
2195
|
+
{
|
|
2196
|
+
payloadKey: 'IS_USING_TEMPLATE',
|
|
2197
|
+
payloadDescription: 'Contains the data records to be rendered and displayed within the table',
|
|
2198
|
+
/**
|
|
2199
|
+
* The function checks if the length `dataSource` property of the `host` element is equal to '0'.
|
|
2200
|
+
* If it is, the function will return `true`.
|
|
2201
|
+
*
|
|
2202
|
+
* @param {HTMLElement} host - The element to check
|
|
2203
|
+
* @returns {boolean} A boolean value
|
|
2204
|
+
*/
|
|
2205
|
+
payloadValue: (host) => host.dataSource.length === 0,
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
payloadKey: 'IS_USING_DATA_SOURCE',
|
|
2209
|
+
payloadDescription: 'Contains the data records to be rendered and displayed within the table',
|
|
2210
|
+
/**
|
|
2211
|
+
* The function checks if the length `dataSource` property of the `host` element is not equal to '0'.
|
|
2212
|
+
* If it is, the function will return `true`.
|
|
2213
|
+
*
|
|
2214
|
+
* @param {HTMLElement} host - The element to check
|
|
2215
|
+
* @returns {boolean} A boolean value
|
|
2216
|
+
*/
|
|
2217
|
+
payloadValue: (host) => host.dataSource.length > 0,
|
|
2218
|
+
},
|
|
2219
|
+
];
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* Represents the hierarchical structure of table columns (including group columns).
|
|
2223
|
+
*
|
|
2224
|
+
* Responsibilities:
|
|
2225
|
+
* - Build the tree from flat or grouped column configs (.from / .fromGroupColumns)
|
|
2226
|
+
* - Provide traversal helpers (iterator / dfs) with caching
|
|
2227
|
+
* - Provide utility checks (isLeaf, hasGroupColumn, hasPinnedColumn)
|
|
2228
|
+
* - Produce leaf column configs for rendering (generateColumnConfigByLeaves)
|
|
2229
|
+
* - Order root children by pinned type for rendering (orderChildrenByPinned)
|
|
2230
|
+
*/
|
|
2231
|
+
class ColumnStructureModel {
|
|
2232
|
+
/**
|
|
2233
|
+
* Constructor for ColumnStructureModel.
|
|
2234
|
+
*
|
|
2235
|
+
* @param {string} key - Unique key for the column.
|
|
2236
|
+
* @param {number} level - Row level of this column (root uses ROOT_LEVEL).
|
|
2237
|
+
* @param {ColumnStructureModel} [parent] - Optional parent node.
|
|
2238
|
+
* @param {string} [label] - Optional display label for the column.
|
|
2239
|
+
* @param {VegaTablePinnedType} [pinned] - Optional pinned metadata ('left'|'right'|null).
|
|
2240
|
+
*/
|
|
2241
|
+
constructor(key, level, parent, label, pinned) {
|
|
2242
|
+
this.key = key;
|
|
2243
|
+
this.level = level;
|
|
2244
|
+
this.parent = parent;
|
|
2245
|
+
this.label = label;
|
|
2246
|
+
this.pinned = pinned;
|
|
2247
|
+
this.leaves = [];
|
|
2248
|
+
this.orderedChildren = [];
|
|
2249
|
+
this.iteratorCacheMap = new Map();
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Creates the root ColumnStructureModel from column configs.
|
|
2253
|
+
*
|
|
2254
|
+
* @param {VegaTableColumnConfig[]} columnsConfig - Array of column configs.
|
|
2255
|
+
* @param {Nullable<VegaTableGroupColumnConfig[]>} groupColumnConfig - Optional grouping configuration.
|
|
2256
|
+
* @returns {ColumnStructureModel} Root column structure model.
|
|
2257
|
+
*/
|
|
2258
|
+
static from(columnsConfig, groupColumnConfig) {
|
|
2259
|
+
const rootModel = new ColumnStructureModel(this.ROOT_KEY, ColumnStructureModel.ROOT_LEVEL);
|
|
2260
|
+
if (groupColumnConfig) {
|
|
2261
|
+
rootModel.children = this.fromGroupColumns(rootModel, groupColumnConfig);
|
|
2262
|
+
return rootModel;
|
|
2263
|
+
}
|
|
2264
|
+
else if (columnsConfig) {
|
|
2265
|
+
rootModel.children = columnsConfig.map((column) => new ColumnStructureModel(column.key || column.prop || column.label, 0, rootModel, null, column.pinned));
|
|
2266
|
+
return rootModel;
|
|
2267
|
+
}
|
|
2268
|
+
else {
|
|
2269
|
+
rootModel.children = [];
|
|
2270
|
+
return rootModel;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Recursively creates ColumnStructureModel children from group column configs.
|
|
2275
|
+
*
|
|
2276
|
+
* @param {ColumnStructureModel} parent - Parent node for the created children.
|
|
2277
|
+
* @param {VegaTableGroupColumnConfig[]} groupColumns - Array of group column configs.
|
|
2278
|
+
* @param {number} level - Current row level.
|
|
2279
|
+
* @returns {ColumnStructureModel[]} Array of child column structure models.
|
|
2280
|
+
*/
|
|
2281
|
+
static fromGroupColumns(parent, groupColumns, level = 0) {
|
|
2282
|
+
if (groupColumns && groupColumns.length > 0) {
|
|
2283
|
+
return groupColumns.map((groupColumn) => {
|
|
2284
|
+
if (isVegaTableColumnGroupingModelType(groupColumn)) {
|
|
2285
|
+
const current = new ColumnStructureModel(groupColumn.key, level, parent, groupColumn.label, groupColumn.pinned);
|
|
2286
|
+
current.children = this.fromGroupColumns(current, groupColumn.children, level + 1);
|
|
2287
|
+
return current;
|
|
2288
|
+
}
|
|
2289
|
+
else {
|
|
2290
|
+
return new ColumnStructureModel(groupColumn.key, level, parent);
|
|
2291
|
+
}
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
return [];
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Generates an array of VegaTableColumnConfig for all leaf columns.
|
|
2298
|
+
*
|
|
2299
|
+
* @param {VegaTableColumnConfig[]} columns - Array of all column configs.
|
|
2300
|
+
* @returns {VegaTableColumnConfig[]} Array of configs for leaf columns.
|
|
2301
|
+
*/
|
|
2302
|
+
generateColumnConfigByLeaves(columns) {
|
|
2303
|
+
return this.getLeaves().map((leaf) => columns.find((column) => column.key === leaf.key || column.prop === leaf.key || column.label === leaf.key));
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Compute the maximum depth (highest level value) under this node.
|
|
2307
|
+
* This is useful to determine the number of header rows required for rendering.
|
|
2308
|
+
*
|
|
2309
|
+
* @returns {number} Maximum level found in the subtree (or 0 when empty).
|
|
2310
|
+
*/
|
|
2311
|
+
getMaxDepth() {
|
|
2312
|
+
const models = this.dfsIterator();
|
|
2313
|
+
if (models.length === 0) {
|
|
2314
|
+
return 0;
|
|
2315
|
+
}
|
|
2316
|
+
return Math.max(...models.map((model) => model.level)) + 1;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Checks if this subtree contains any group (non-leaf) columns.
|
|
2320
|
+
*
|
|
2321
|
+
* @returns {boolean} True if any descendant is a group column.
|
|
2322
|
+
*/
|
|
2323
|
+
hasGroupColumn() {
|
|
2324
|
+
return !!this.children.find((model) => !model.isLeaf());
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* Checks if this subtree contains any left pinned children.
|
|
2328
|
+
*
|
|
2329
|
+
* @returns {boolean} True if any immediate child has a pinned value.
|
|
2330
|
+
*/
|
|
2331
|
+
hasLeftPinnedColumn() {
|
|
2332
|
+
return !!this.children.find((model) => model.pinned === 'left');
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Checks if this subtree contains any right pinned children.
|
|
2336
|
+
*
|
|
2337
|
+
* @returns {boolean} True if any immediate child has a pinned value.
|
|
2338
|
+
*/
|
|
2339
|
+
hasRightPinnedColumn() {
|
|
2340
|
+
return !!this.children.find((model) => model.pinned === 'right');
|
|
2341
|
+
}
|
|
2342
|
+
/**
|
|
2343
|
+
* Checks if this node is a leaf (no children).
|
|
2344
|
+
*
|
|
2345
|
+
* @returns {boolean} True when this node has no children.
|
|
2346
|
+
*/
|
|
2347
|
+
isLeaf() {
|
|
2348
|
+
return !this.children || this.children.length === 0;
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Return an array of nodes for this subtree using the specified traversal mode.
|
|
2352
|
+
*
|
|
2353
|
+
* Currently only depth-first search ('dfs') is supported. The returned array is
|
|
2354
|
+
* cached per-mode to avoid repeated traversal costs.
|
|
2355
|
+
*
|
|
2356
|
+
* @param {IteratorMode} mode - Traversal mode to use. Defaults to 'dfs'.
|
|
2357
|
+
* @returns {ColumnStructureModel[]} Array of ColumnStructureModel nodes in traversal order.
|
|
2358
|
+
*/
|
|
2359
|
+
iterator(mode = 'dfs') {
|
|
2360
|
+
if (mode === 'dfs') {
|
|
2361
|
+
return this.dfsIterator();
|
|
2362
|
+
}
|
|
2363
|
+
return [];
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Gets all leaf nodes in the subtree, with caching.
|
|
2367
|
+
*
|
|
2368
|
+
* Subsequent calls return the cached array until the underlying model is rebuilt.
|
|
2369
|
+
*
|
|
2370
|
+
* @returns {ColumnStructureModel[]} Array of leaf column models.
|
|
2371
|
+
*/
|
|
2372
|
+
getLeaves() {
|
|
2373
|
+
if (this.leaves.length > 0) {
|
|
2374
|
+
return this.leaves;
|
|
2375
|
+
}
|
|
2376
|
+
const leaves = this.dfsIterator().filter((model) => model.isLeaf());
|
|
2377
|
+
this.leaves = leaves;
|
|
2378
|
+
return leaves;
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* For root nodes, returns children ordered by pinned type (left, none, right).
|
|
2382
|
+
* For non-root nodes, returns children in their natural order.
|
|
2383
|
+
*
|
|
2384
|
+
* @returns {ColumnStructureModel[]} Array of child column models.
|
|
2385
|
+
*/
|
|
2386
|
+
getOrderedChildren() {
|
|
2387
|
+
if (!this.isRoot())
|
|
2388
|
+
return this.children;
|
|
2389
|
+
return this.orderedChildren;
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Orders root children by pinned type (left, none, right) and caches the result.
|
|
2393
|
+
*
|
|
2394
|
+
* For non-root nodes this method returns children in their natural order.
|
|
2395
|
+
*
|
|
2396
|
+
* @returns {ColumnStructureModel[]} Array of ordered child column models.
|
|
2397
|
+
*/
|
|
2398
|
+
orderChildrenByPinned() {
|
|
2399
|
+
if (!this.isRoot())
|
|
2400
|
+
return this.children;
|
|
2401
|
+
if (this.orderedChildren.length > 0) {
|
|
2402
|
+
return this.orderedChildren;
|
|
2403
|
+
}
|
|
2404
|
+
const leftPinned = [];
|
|
2405
|
+
const noPinned = [];
|
|
2406
|
+
const rightPinned = [];
|
|
2407
|
+
this.children.forEach((child) => {
|
|
2408
|
+
if (child.pinned === 'left') {
|
|
2409
|
+
leftPinned.push(child);
|
|
2410
|
+
}
|
|
2411
|
+
else if (child.pinned === 'right') {
|
|
2412
|
+
rightPinned.push(child);
|
|
2413
|
+
}
|
|
2414
|
+
else {
|
|
2415
|
+
noPinned.push(child);
|
|
2416
|
+
}
|
|
2417
|
+
});
|
|
2418
|
+
const children = [...leftPinned, ...noPinned, ...rightPinned];
|
|
2419
|
+
this.orderedChildren = children;
|
|
2420
|
+
return children;
|
|
2421
|
+
}
|
|
2422
|
+
/**
|
|
2423
|
+
* Checks if this node is the root node.
|
|
2424
|
+
*
|
|
2425
|
+
* @returns {boolean} True if root node, false otherwise.
|
|
2426
|
+
*/
|
|
2427
|
+
isRoot() {
|
|
2428
|
+
return this.level === ColumnStructureModel.ROOT_LEVEL;
|
|
2429
|
+
}
|
|
2430
|
+
/**
|
|
2431
|
+
* Performs a depth-first traversal of the column structure.
|
|
2432
|
+
*
|
|
2433
|
+
* The traversal respects root-child pinned ordering (left/no/right) for the root node.
|
|
2434
|
+
* Results are cached per-node to avoid repeated recursion costs.
|
|
2435
|
+
*
|
|
2436
|
+
* @returns {ColumnStructureModel[]} Array of all nodes in DFS order.
|
|
2437
|
+
*/
|
|
2438
|
+
dfsIterator() {
|
|
2439
|
+
if (this.iteratorCacheMap.has('dfs')) {
|
|
2440
|
+
return this.iteratorCacheMap.get('dfs');
|
|
2441
|
+
}
|
|
2442
|
+
const localResult = [];
|
|
2443
|
+
const children = this.orderChildrenByPinned();
|
|
2444
|
+
if (!this.isRoot()) {
|
|
2445
|
+
localResult.push(this);
|
|
2446
|
+
}
|
|
2447
|
+
if (children && children.length > 0) {
|
|
2448
|
+
children.forEach((child) => {
|
|
2449
|
+
localResult.push(...child.dfsIterator());
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
this.iteratorCacheMap.set('dfs', localResult);
|
|
2453
|
+
return localResult;
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
ColumnStructureModel.ROOT_LEVEL = -1;
|
|
2457
|
+
ColumnStructureModel.ROOT_KEY = '#root-model#';
|
|
2458
|
+
|
|
2459
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2460
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2461
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2462
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2463
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2464
|
+
};
|
|
2465
|
+
/**
|
|
2466
|
+
* Controller responsible for building and keeping the ColumnStructureModel in sync
|
|
2467
|
+
* with the component's `columns` and `groupColumns` properties.
|
|
2468
|
+
*
|
|
2469
|
+
* This slimmer maps relevant component fields and lifecycle/watch hooks to
|
|
2470
|
+
* automatically rebuild the column structure when inputs change.
|
|
2471
|
+
*/
|
|
2472
|
+
class VegaTableColumnStructureModelController extends VegaSlimmer {
|
|
2473
|
+
/**
|
|
2474
|
+
* Component lifecycle hook mapped to the host's componentWillLoad.
|
|
2475
|
+
* Initializes the ColumnStructureModel prior to initial render.
|
|
2476
|
+
*/
|
|
2477
|
+
componentWillLoad() {
|
|
2478
|
+
this.setColumnStructureModel();
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Watch handler mapped to the host's watchColumns.
|
|
2482
|
+
* Rebuilds the ColumnStructureModel when `columns` changes.
|
|
2483
|
+
*/
|
|
2484
|
+
watchColumns() {
|
|
2485
|
+
this.setColumnStructureModel();
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Watch handler mapped to the host's watchGroupColumns.
|
|
2489
|
+
* Rebuilds the ColumnStructureModel when `groupColumns` changes.
|
|
2490
|
+
*/
|
|
2491
|
+
watchGroupColumns() {
|
|
2492
|
+
this.setColumnStructureModel();
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Build and assign the ColumnStructureModel from current `columns` and `groupColumns`.
|
|
2496
|
+
* Uses `ColumnStructureModel.from` which returns a root model representing the column tree.
|
|
2497
|
+
*/
|
|
2498
|
+
setColumnStructureModel() {
|
|
2499
|
+
this.columnStructureModel = ColumnStructureModel.from(this.columns, this.groupColumns);
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
__decorate$3([
|
|
2503
|
+
MapToComponentField()
|
|
2504
|
+
], VegaTableColumnStructureModelController.prototype, "host", void 0);
|
|
2505
|
+
__decorate$3([
|
|
2506
|
+
MapToComponentField()
|
|
2507
|
+
], VegaTableColumnStructureModelController.prototype, "columns", void 0);
|
|
2508
|
+
__decorate$3([
|
|
2509
|
+
MapToComponentField()
|
|
2510
|
+
], VegaTableColumnStructureModelController.prototype, "groupColumns", void 0);
|
|
2511
|
+
__decorate$3([
|
|
2512
|
+
MapToComponentField({ writable: true })
|
|
2513
|
+
], VegaTableColumnStructureModelController.prototype, "columnStructureModel", void 0);
|
|
2514
|
+
__decorate$3([
|
|
2515
|
+
MapToComponentMethod('componentWillLoad')
|
|
2516
|
+
], VegaTableColumnStructureModelController.prototype, "componentWillLoad", null);
|
|
2517
|
+
__decorate$3([
|
|
2518
|
+
MapToComponentMethod('watchColumns')
|
|
2519
|
+
], VegaTableColumnStructureModelController.prototype, "watchColumns", null);
|
|
2520
|
+
__decorate$3([
|
|
2521
|
+
MapToComponentMethod('watchGroupColumns')
|
|
2522
|
+
], VegaTableColumnStructureModelController.prototype, "watchGroupColumns", null);
|
|
2523
|
+
|
|
2524
|
+
/**
|
|
2525
|
+
* ColumnRenderInputModel
|
|
2526
|
+
*
|
|
2527
|
+
* Render-time representation of a column or group node used by header/body renderers.
|
|
2528
|
+
* Built from a ColumnStructureModel tree, it carries computed layout metadata required
|
|
2529
|
+
* for rendering and pinned/sticky calculations (colSpan, rowSpan, pinned boundaries, etc).
|
|
2530
|
+
*
|
|
2531
|
+
* Instances form a forest (root-level nodes in an array) that mirrors the structure model
|
|
2532
|
+
* but contains additional render-specific properties and parent/child links for renderers.
|
|
2533
|
+
*/
|
|
2534
|
+
class ColumnRenderInputModel {
|
|
2535
|
+
/**
|
|
2536
|
+
* Create a new render input node.
|
|
2537
|
+
*
|
|
2538
|
+
* @param {string} key - Unique key (matches ColumnStructureModel.key).
|
|
2539
|
+
* @param {string} label - Optional display label (from structure model).
|
|
2540
|
+
* @param {VegaTablePinnedType} pinned - Pinned type for this node ('left' | 'right' | null).
|
|
2541
|
+
* @param {Nullable<number>} colSpan - Number of visual columns spanned by this node's subtree.
|
|
2542
|
+
* @param {Nullable<number>} rowSpan - Number of header rows this node should span.
|
|
2543
|
+
* @param {boolean} isViewStart - True when this node is the start of a visible view range.
|
|
2544
|
+
* @param {boolean} isViewEnd - True when this node is the end of a visible view range.
|
|
2545
|
+
* @param {boolean} isLeftEndPinned - True when node is last left-pinned sibling.
|
|
2546
|
+
* @param {boolean} isRightStartPinned - True when node is first right-pinned sibling.
|
|
2547
|
+
* @param {boolean} isNoPinnedEnd - True when node is last non-pinned sibling.
|
|
2548
|
+
* @param {boolean} headHasGroupColumn - Header contains group columns (affects rowSpan).
|
|
2549
|
+
* @param {boolean} headHasPinnedColumn - Header contains pinned columns.
|
|
2550
|
+
* @param {number} headMaxDepth - Maximum header depth (number of header rows).
|
|
2551
|
+
* @param {number} level - Level/index of this node within header rows (0-based).
|
|
2552
|
+
* @param {number} columnIndex - Sequential leaf index (used for ordering).
|
|
2553
|
+
* @param {Nullable<ColumnRenderInputModel>} parent - Parent render input node (null for root-level).
|
|
2554
|
+
* @param {ColumnRenderInputModel[]} children - Child render input nodes.
|
|
2555
|
+
*/
|
|
2556
|
+
constructor(key, label, pinned, colSpan, rowSpan, isViewStart, isViewEnd, isLeftEndPinned, isRightStartPinned, isNoPinnedEnd, headHasGroupColumn, headHasPinnedColumn, headMaxDepth, level, columnIndex, parent, children = []) {
|
|
2557
|
+
this.key = key;
|
|
2558
|
+
this.label = label;
|
|
2559
|
+
this.pinned = pinned;
|
|
2560
|
+
this.colSpan = colSpan;
|
|
2561
|
+
this.rowSpan = rowSpan;
|
|
2562
|
+
this.isViewStart = isViewStart;
|
|
2563
|
+
this.isViewEnd = isViewEnd;
|
|
2564
|
+
this.isLeftEndPinned = isLeftEndPinned;
|
|
2565
|
+
this.isRightStartPinned = isRightStartPinned;
|
|
2566
|
+
this.isNoPinnedEnd = isNoPinnedEnd;
|
|
2567
|
+
this.headHasGroupColumn = headHasGroupColumn;
|
|
2568
|
+
this.headHasPinnedColumn = headHasPinnedColumn;
|
|
2569
|
+
this.headMaxDepth = headMaxDepth;
|
|
2570
|
+
this.level = level;
|
|
2571
|
+
this.columnIndex = columnIndex;
|
|
2572
|
+
this.parent = parent;
|
|
2573
|
+
this.children = children;
|
|
2574
|
+
this.iteratorCacheMap = new Map();
|
|
2575
|
+
this.leaves = [];
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* Build a forest of ColumnRenderInputModel nodes from a ColumnStructureModel root.
|
|
2579
|
+
*
|
|
2580
|
+
* @param {ColumnStructureModel} rootModel - Root ColumnStructureModel that supplies tree and level data.
|
|
2581
|
+
* @returns {ColumnRenderInputModel[]} Array of root-level ColumnRenderInputModel nodes (the render forest).
|
|
2582
|
+
*/
|
|
2583
|
+
static from(rootModel) {
|
|
2584
|
+
const renderInputs = [];
|
|
2585
|
+
const parentStack = [];
|
|
2586
|
+
const maxLevel = rootModel.getMaxDepth();
|
|
2587
|
+
const hasGroupColumn = rootModel.hasGroupColumn();
|
|
2588
|
+
const hasPinnedColumn = rootModel.hasLeftPinnedColumn() || rootModel.hasRightPinnedColumn();
|
|
2589
|
+
let columnIndex = 0;
|
|
2590
|
+
// Iterate structure model (DFS by default) and construct render nodes.
|
|
2591
|
+
rootModel.iterator().forEach((model) => {
|
|
2592
|
+
const parent = model.level > 0 ? parentStack[model.level - 1] : null;
|
|
2593
|
+
const isParentStart = hasGroupColumn && this.isParentStart(model);
|
|
2594
|
+
const isParentEnd = hasGroupColumn && this.isParentEnd(model);
|
|
2595
|
+
const renderInput = new ColumnRenderInputModel(model.key, model.label, parent ? parent.pinned : model.pinned, hasGroupColumn ? this.getColSpan(model) : null, hasGroupColumn ? (model.isLeaf() ? maxLevel - model.level : 1) : null, parent ? parent.isViewStart && isParentStart : isParentStart, parent ? parent.isViewEnd && isParentEnd : isParentEnd, parent
|
|
2596
|
+
? parent.isLeftEndPinned && isParentEnd
|
|
2597
|
+
: hasPinnedColumn && this.isLeftEndPinned(model), parent
|
|
2598
|
+
? parent.isRightStartPinned && isParentStart
|
|
2599
|
+
: hasPinnedColumn && this.isRightStartPinned(model), parent ? parent.isNoPinnedEnd && isParentEnd : hasPinnedColumn && this.isNoPinnedEnd(model), hasGroupColumn, hasPinnedColumn, maxLevel, model.level, columnIndex, parent);
|
|
2600
|
+
// Attach to parent if present, otherwise add to root-level array.
|
|
2601
|
+
parent ? parent.children.push(renderInput) : renderInputs.push(renderInput);
|
|
2602
|
+
// Maintain parent stack keyed by level to allow next nodes to find their parent.
|
|
2603
|
+
parentStack[model.level] = renderInput;
|
|
2604
|
+
parentStack.length = model.level + 1;
|
|
2605
|
+
// Increment leaf index when encountering a leaf structure node.
|
|
2606
|
+
if (model.isLeaf())
|
|
2607
|
+
columnIndex++;
|
|
2608
|
+
});
|
|
2609
|
+
return renderInputs;
|
|
2610
|
+
}
|
|
2611
|
+
/**
|
|
2612
|
+
* True when the provided structure model is the last left-pinned sibling in its parent's children.
|
|
2613
|
+
* Used to mark boundary nodes for left-pinned groups.
|
|
2614
|
+
*
|
|
2615
|
+
* @param {ColumnStructureModel} model - Structure model to check.
|
|
2616
|
+
* @returns {boolean} True when model is the last left-pinned sibling.
|
|
2617
|
+
*/
|
|
2618
|
+
static isLeftEndPinned(model) {
|
|
2619
|
+
const siblings = model.parent
|
|
2620
|
+
.getOrderedChildren()
|
|
2621
|
+
.filter((child) => child.pinned === 'left');
|
|
2622
|
+
return siblings[siblings.length - 1] === model;
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* True when the provided structure model is the first right-pinned sibling in its parent's children.
|
|
2626
|
+
* Used to mark boundary nodes for right-pinned groups.
|
|
2627
|
+
*
|
|
2628
|
+
* @param {ColumnStructureModel} model - Structure model to check.
|
|
2629
|
+
* @returns {boolean} True when model is the first right-pinned sibling.
|
|
2630
|
+
*/
|
|
2631
|
+
static isRightStartPinned(model) {
|
|
2632
|
+
const siblings = model.parent
|
|
2633
|
+
.getOrderedChildren()
|
|
2634
|
+
.filter((child) => child.pinned === 'right');
|
|
2635
|
+
return siblings[0] === model;
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* True when the provided structure model is the last non-pinned sibling in its parent's children.
|
|
2639
|
+
* Useful to handle the 'no-pinned-end' condition.
|
|
2640
|
+
*
|
|
2641
|
+
* @param {ColumnStructureModel} model - Structure model to check.
|
|
2642
|
+
* @returns {boolean} True when model is the last non-pinned sibling.
|
|
2643
|
+
*/
|
|
2644
|
+
static isNoPinnedEnd(model) {
|
|
2645
|
+
const siblings = model.parent
|
|
2646
|
+
.getOrderedChildren()
|
|
2647
|
+
.filter((child) => !child.pinned);
|
|
2648
|
+
return siblings[siblings.length - 1] === model;
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* True when the provided model is the first child of its parent.
|
|
2652
|
+
*
|
|
2653
|
+
* @param {ColumnStructureModel} model - Structure model to check.
|
|
2654
|
+
* @returns {boolean} True when model is the first child.
|
|
2655
|
+
*/
|
|
2656
|
+
static isParentStart(model) {
|
|
2657
|
+
return model.parent.getOrderedChildren()[0] === model;
|
|
2658
|
+
}
|
|
2659
|
+
/**
|
|
2660
|
+
* True when the provided model is the last child of its parent.
|
|
2661
|
+
*
|
|
2662
|
+
* @param {ColumnStructureModel} model - Structure model to check.
|
|
2663
|
+
* @returns {boolean} True when model is the last child.
|
|
2664
|
+
*/
|
|
2665
|
+
static isParentEnd(model) {
|
|
2666
|
+
const parentChildren = model.parent.getOrderedChildren();
|
|
2667
|
+
return parentChildren[parentChildren.length - 1] === model;
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Compute a node's colSpan by iterating its subtree and counting the maximum number
|
|
2671
|
+
* of nodes present at any single level (visual column span).
|
|
2672
|
+
*
|
|
2673
|
+
* @param {ColumnStructureModel} mode - ColumnStructureModel node to examine.
|
|
2674
|
+
* @returns {number} Number of visual columns spanned by the node.
|
|
2675
|
+
*/
|
|
2676
|
+
static getColSpan(mode) {
|
|
2677
|
+
const children = mode.iterator();
|
|
2678
|
+
const rowMap = {};
|
|
2679
|
+
children.forEach((node) => {
|
|
2680
|
+
rowMap[node.level] = (rowMap[node.level] || 0) + 1;
|
|
2681
|
+
});
|
|
2682
|
+
return Math.max(...Object.values(rowMap));
|
|
2683
|
+
}
|
|
2684
|
+
/**
|
|
2685
|
+
* Return cached leaf render nodes for this subtree.
|
|
2686
|
+
* Caches the result on first call and returns cached array on subsequent calls.
|
|
2687
|
+
*
|
|
2688
|
+
* @returns {ColumnRenderInputModel[]} Array of leaf render input nodes.
|
|
2689
|
+
*/
|
|
2690
|
+
getLeaves() {
|
|
2691
|
+
if (this.leaves.length > 0) {
|
|
2692
|
+
return this.leaves;
|
|
2693
|
+
}
|
|
2694
|
+
const leaves = this.iterator().filter((model) => model.isLeaf());
|
|
2695
|
+
this.leaves = leaves;
|
|
2696
|
+
return leaves;
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Generic iterator that supports traversal modes ('dfs' currently implemented).
|
|
2700
|
+
*
|
|
2701
|
+
* @param {IteratorMode} [mode='dfs'] - Iterator mode ('dfs' | 'bfs').
|
|
2702
|
+
* @returns {ColumnRenderInputModel[]} Traversal-ordered array of nodes.
|
|
2703
|
+
*/
|
|
2704
|
+
iterator(mode = 'dfs') {
|
|
2705
|
+
if (mode === 'dfs') {
|
|
2706
|
+
return this.dfsIterator();
|
|
2707
|
+
}
|
|
2708
|
+
// Future: implement BFS mode here.
|
|
2709
|
+
return [];
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* Depth-first pre-order traversal of this node and its descendants.
|
|
2713
|
+
* Caches the result for the 'dfs' mode to avoid repeated recursion.
|
|
2714
|
+
*
|
|
2715
|
+
* @returns {ColumnRenderInputModel[]} Array of nodes in DFS order (includes this node).
|
|
2716
|
+
*/
|
|
2717
|
+
dfsIterator() {
|
|
2718
|
+
if (this.iteratorCacheMap.has('dfs')) {
|
|
2719
|
+
return this.iteratorCacheMap.get('dfs');
|
|
2720
|
+
}
|
|
2721
|
+
const localResult = [];
|
|
2722
|
+
localResult.push(this);
|
|
2723
|
+
if (this.children && this.children.length > 0) {
|
|
2724
|
+
this.children.forEach((child) => {
|
|
2725
|
+
localResult.push(...child.dfsIterator());
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
this.iteratorCacheMap.set('dfs', localResult);
|
|
2729
|
+
return localResult;
|
|
2730
|
+
}
|
|
2731
|
+
/**
|
|
2732
|
+
* True when this render node has no children (visual leaf).
|
|
2733
|
+
*
|
|
2734
|
+
* @returns {boolean} True when node is a leaf.
|
|
2735
|
+
*/
|
|
2736
|
+
isLeaf() {
|
|
2737
|
+
return !this.children || this.children.length === 0;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2742
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2743
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2744
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2745
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2746
|
+
};
|
|
2747
|
+
/**
|
|
2748
|
+
* VegaTableRenderInputController
|
|
2749
|
+
*
|
|
2750
|
+
* Central controller that computes and provides render input data for table header rows,
|
|
2751
|
+
* header cells and body cells. Responsibilities:
|
|
2752
|
+
* - Build and cache shared header layout context (depth, width, pinned indices).
|
|
2753
|
+
* - Generate per-head-row and per-body-row render inputs used by head/row renderers.
|
|
2754
|
+
* - Expose render inputs to shadow DOM cells via Remote Invocation Call (RIC) registry.
|
|
2755
|
+
*/
|
|
2756
|
+
class VegaTableRenderInputController extends VegaSlimmer {
|
|
2757
|
+
constructor() {
|
|
2758
|
+
super(...arguments);
|
|
2759
|
+
this.headRowRenderInputMap = new Map();
|
|
2760
|
+
this.headCellRenderInputMap = new Map();
|
|
2761
|
+
this.pinnedColumnBodyCellRenderInputMap = new Map();
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Register remote invocation observers when controller is connected.
|
|
2765
|
+
* Called via component lifecycle mapping.
|
|
2766
|
+
*/
|
|
2767
|
+
connectedCallback() {
|
|
2768
|
+
this.registerRenderInputRICObserver();
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* Unregister remote invocation observers when controller is disconnected.
|
|
2772
|
+
* Called via component lifecycle mapping.
|
|
2773
|
+
*/
|
|
2774
|
+
disconnectedCallback() {
|
|
2775
|
+
this.unRegisterRenderInputRICObserver();
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* Initialize head context before component load.
|
|
2779
|
+
* Called via component lifecycle mapping.
|
|
2780
|
+
*/
|
|
2781
|
+
componentWillLoad() {
|
|
2782
|
+
this.setRenderInputModel();
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Recompute head context when the column structure model changes.
|
|
2786
|
+
* Called via watch mapping.
|
|
2787
|
+
*/
|
|
2788
|
+
watchColumnStructureModel() {
|
|
2789
|
+
this.setRenderInputModel();
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Return render input models for table body (flattened leaves).
|
|
2793
|
+
*
|
|
2794
|
+
* @returns {ColumnRenderInputModel[]} Flattened array of leaf render input models.
|
|
2795
|
+
*/
|
|
2796
|
+
getLeafRenderInputs() {
|
|
2797
|
+
return this.leavesRenderInputModels;
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
* Return render input models for table head (root-level forest).
|
|
2801
|
+
*
|
|
2802
|
+
* @returns {ColumnRenderInputModel[]} Root-level column render input models.
|
|
2803
|
+
*/
|
|
2804
|
+
getHeadRenderInputs() {
|
|
2805
|
+
return this.columnRenderInputModels;
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Store head row render input mapping for remote invocation.
|
|
2809
|
+
*
|
|
2810
|
+
* @param {HTMLElement} headRow - The head row element.
|
|
2811
|
+
* @param {ColumnRenderInputModel[]} renderInputs - Associated render input models.
|
|
2812
|
+
*/
|
|
2813
|
+
addHeadRowRenderInputMap(headRow, renderInputs) {
|
|
2814
|
+
this.headRowRenderInputMap.set(headRow, renderInputs);
|
|
2815
|
+
}
|
|
2816
|
+
/**
|
|
2817
|
+
* Store head cell render input mapping for remote invocation.
|
|
2818
|
+
*
|
|
2819
|
+
* @param {HTMLElement} headCell - The head cell element.
|
|
2820
|
+
* @param {ColumnRenderInputModel} renderInput - Associated render input model.
|
|
2821
|
+
*/
|
|
2822
|
+
addHeadCellRenderInputMap(headCell, renderInput) {
|
|
2823
|
+
this.headCellRenderInputMap.set(headCell, renderInput);
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* Store body cell render input mapping for pinned cells (used to update sticky positions).
|
|
2827
|
+
*
|
|
2828
|
+
* Only stores cells that require sticky positioning (left/right or no-pinned-end).
|
|
2829
|
+
*
|
|
2830
|
+
* @param {HTMLElement} cell - The body cell element.
|
|
2831
|
+
* @param {ColumnRenderInputModel} renderInput - Associated render input model.
|
|
2832
|
+
*/
|
|
2833
|
+
addCellRenderInputMap(cell, renderInput) {
|
|
2834
|
+
if ((cell && ['left', 'right'].includes(renderInput.pinned)) || renderInput.isNoPinnedEnd) {
|
|
2835
|
+
this.pinnedColumnBodyCellRenderInputMap.set(cell, renderInput);
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
/**
|
|
2839
|
+
* Expose the internal head-cell -> render-input mapping.
|
|
2840
|
+
*
|
|
2841
|
+
* @typedef {import('../../../../types/components').HTMLVegaTableHeadCellElement} HTMLVegaTableHeadCellElement
|
|
2842
|
+
* @returns {Map<HTMLVegaTableHeadCellElement, ColumnRenderInputModel>} Map of head cell elements to render input.
|
|
2843
|
+
*/
|
|
2844
|
+
getHeadCellRenderInputMap() {
|
|
2845
|
+
return this.headCellRenderInputMap;
|
|
2846
|
+
}
|
|
2847
|
+
/**
|
|
2848
|
+
* Expose the internal map of pinned body cells to their render inputs.
|
|
2849
|
+
*
|
|
2850
|
+
* @typedef {import('../../../../types/components').HTMLVegaTableCellElement} HTMLVegaTableCellElement
|
|
2851
|
+
* @returns {Map<HTMLVegaTableCellElement, ColumnRenderInputModel>} Map of body cell hosts requiring sticky positioning.
|
|
2852
|
+
*/
|
|
2853
|
+
getPinnedColumnBodyCellRenderInputMap() {
|
|
2854
|
+
return this.pinnedColumnBodyCellRenderInputMap;
|
|
2855
|
+
}
|
|
2856
|
+
/**
|
|
2857
|
+
* Register remote invocation callbacks to allow DOM nodes to request render inputs.
|
|
2858
|
+
*/
|
|
2859
|
+
registerRenderInputRICObserver() {
|
|
2860
|
+
remoteInvocationRegistry.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnHeadRowRenderInputRIC), (headRow) => {
|
|
2861
|
+
return this.headRowRenderInputMap.get(headRow);
|
|
2862
|
+
});
|
|
2863
|
+
remoteInvocationRegistry.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnHeadCellRenderInputRIC), (headCell) => {
|
|
2864
|
+
return this.headCellRenderInputMap.get(headCell);
|
|
2865
|
+
});
|
|
2866
|
+
remoteInvocationRegistry.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnBodyCellRenderInputRIC), (cell) => {
|
|
2867
|
+
return this.pinnedColumnBodyCellRenderInputMap.get(cell);
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
/**
|
|
2871
|
+
* Unregister remote invocation callbacks previously registered.
|
|
2872
|
+
*/
|
|
2873
|
+
unRegisterRenderInputRICObserver() {
|
|
2874
|
+
remoteInvocationRegistry.unRegister(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnHeadRowRenderInputRIC));
|
|
2875
|
+
remoteInvocationRegistry.unRegister(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnHeadCellRenderInputRIC));
|
|
2876
|
+
remoteInvocationRegistry.unRegister(domNodeSubjectFactory.getSubject(this.host, VegaInternalColumnBodyCellRenderInputRIC));
|
|
2877
|
+
}
|
|
2878
|
+
/**
|
|
2879
|
+
* Build the ColumnRenderInputModel forest from the current ColumnStructureModel.
|
|
2880
|
+
*/
|
|
2881
|
+
setRenderInputModel() {
|
|
2882
|
+
this.columnRenderInputModels = ColumnRenderInputModel.from(this.columnStructureModel);
|
|
2883
|
+
this.leavesRenderInputModels = this.columnRenderInputModels.flatMap((model) => model.getLeaves());
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
__decorate$2([
|
|
2887
|
+
MapToComponentField()
|
|
2888
|
+
], VegaTableRenderInputController.prototype, "host", void 0);
|
|
2889
|
+
__decorate$2([
|
|
2890
|
+
MapToComponentField()
|
|
2891
|
+
], VegaTableRenderInputController.prototype, "columnStructureModel", void 0);
|
|
2892
|
+
__decorate$2([
|
|
2893
|
+
MapToComponentField()
|
|
2894
|
+
], VegaTableRenderInputController.prototype, "vegaTableColGroupRenderer", void 0);
|
|
2895
|
+
__decorate$2([
|
|
2896
|
+
MapToComponentMethod('connectedCallback')
|
|
2897
|
+
], VegaTableRenderInputController.prototype, "connectedCallback", null);
|
|
2898
|
+
__decorate$2([
|
|
2899
|
+
MapToComponentMethod('disconnectedCallback')
|
|
2900
|
+
], VegaTableRenderInputController.prototype, "disconnectedCallback", null);
|
|
2901
|
+
__decorate$2([
|
|
2902
|
+
MapToComponentMethod('componentWillLoad')
|
|
2903
|
+
], VegaTableRenderInputController.prototype, "componentWillLoad", null);
|
|
2904
|
+
__decorate$2([
|
|
2905
|
+
MapToComponentMethod('watchColumnStructureModel')
|
|
2906
|
+
], VegaTableRenderInputController.prototype, "watchColumnStructureModel", null);
|
|
2907
|
+
|
|
2908
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2909
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2910
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2911
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2912
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2913
|
+
};
|
|
2914
|
+
class VegaTablePinnedRenderer extends VegaSlimmer {
|
|
2915
|
+
constructor() {
|
|
2916
|
+
super(...arguments);
|
|
2917
|
+
this.pageResizeObserverSlimmer = new PageResizeObserverSlimmer({
|
|
2918
|
+
// eslint-disable-next-line
|
|
2919
|
+
target: () => this.host.shadowRoot.querySelector('table'),
|
|
2920
|
+
isDeferred: true,
|
|
2921
|
+
/*
|
|
2922
|
+
* The below method is e2e-test covered in
|
|
2923
|
+
* @see{module:resize-pinned-position-by-edit-row}
|
|
2924
|
+
*/
|
|
2925
|
+
callback: /* istanbul ignore next */ async () => {
|
|
2926
|
+
await this.host.componentOnReady().then(() => {
|
|
2927
|
+
this.updateTableRowPinnedPosition();
|
|
2928
|
+
this.updateTableCellPinnedPosition();
|
|
2929
|
+
});
|
|
2930
|
+
},
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
componentDidLoad() {
|
|
2934
|
+
methodPlaceholder;
|
|
2935
|
+
}
|
|
2936
|
+
componentDidRender() {
|
|
2937
|
+
this.updateTableRowPinnedPosition();
|
|
2938
|
+
this.updateTableCellPinnedPosition();
|
|
2939
|
+
}
|
|
2940
|
+
updateTableCellPinnedPosition() {
|
|
2941
|
+
if (!this.columnStructureModel.hasLeftPinnedColumn() &&
|
|
2942
|
+
!this.columnStructureModel.hasRightPinnedColumn())
|
|
2943
|
+
return;
|
|
2944
|
+
// if not have head row, it means no pinned, so no need to update
|
|
2945
|
+
const row = this.host.shadowRoot.querySelector('vega-table-head-row');
|
|
2946
|
+
// to avoid window resize before table rendered.
|
|
2947
|
+
// @see{module:resize-pinned-position-by-edit-row}
|
|
2948
|
+
/* istanbul ignore next */
|
|
2949
|
+
if (!row)
|
|
2950
|
+
return;
|
|
2951
|
+
const headCellRenderInputMap = this.vegaTableRenderInputController.getHeadCellRenderInputMap();
|
|
2952
|
+
const pinnedColumnBodyCellRenderInputMap = this.vegaTableRenderInputController.getPinnedColumnBodyCellRenderInputMap();
|
|
2953
|
+
const [prevShadowThWidth, nextShadowThWidth] = this.getRowShadowThWidths();
|
|
2954
|
+
const leafWidths = this.getLeafWidths();
|
|
2955
|
+
headCellRenderInputMap.forEach((renderInput, headCell) => {
|
|
2956
|
+
this.updateCellPinnedPosition(renderInput, headCell, prevShadowThWidth, leafWidths, nextShadowThWidth);
|
|
2957
|
+
});
|
|
2958
|
+
pinnedColumnBodyCellRenderInputMap.forEach((renderInput, headCell) => {
|
|
2959
|
+
this.updateCellPinnedPosition(renderInput, headCell, prevShadowThWidth, leafWidths, nextShadowThWidth);
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
getRowShadowThWidths() {
|
|
2963
|
+
const row = this.host.shadowRoot.querySelector('vega-table-head-row');
|
|
2964
|
+
const rowShadow = row.shadowRoot;
|
|
2965
|
+
const firstTh = rowShadow.querySelector('th:first-of-type');
|
|
2966
|
+
const selectionTh = rowShadow.querySelector('.vega-table-selection-column');
|
|
2967
|
+
const expandTh = rowShadow.querySelector('.vega-table-expand-action-column');
|
|
2968
|
+
const lastTh = rowShadow.querySelector('th:last-of-type');
|
|
2969
|
+
if (firstTh) {
|
|
2970
|
+
const prevWidth = firstTh.getBoundingClientRect().width + ((selectionTh === null || selectionTh === void 0 ? void 0 : selectionTh.getBoundingClientRect().width) || 0);
|
|
2971
|
+
const nextWidth = ((expandTh === null || expandTh === void 0 ? void 0 : expandTh.getBoundingClientRect().width) || 0) + lastTh.getBoundingClientRect().width;
|
|
2972
|
+
return [prevWidth, nextWidth];
|
|
2973
|
+
}
|
|
2974
|
+
// to avoid window resize before row rendered.
|
|
2975
|
+
// @see{module:resize-pinned-position-by-edit-row}
|
|
2976
|
+
/* istanbul ignore next */
|
|
2977
|
+
return [0, 0];
|
|
2978
|
+
}
|
|
2979
|
+
getLeafWidths() {
|
|
2980
|
+
const headCellRenderInputMap = this.vegaTableRenderInputController.getHeadCellRenderInputMap();
|
|
2981
|
+
const leafRenderInputs = this.vegaTableRenderInputController.getLeafRenderInputs();
|
|
2982
|
+
return leafRenderInputs.map((leaf) => {
|
|
2983
|
+
var _a;
|
|
2984
|
+
for (const [cell, renderInput] of headCellRenderInputMap.entries()) {
|
|
2985
|
+
if (leaf === renderInput) {
|
|
2986
|
+
// to avoid window resize before cell rendered.
|
|
2987
|
+
// @see{module:resize-pinned-position-by-edit-row}
|
|
2988
|
+
/* istanbul ignore next */
|
|
2989
|
+
return ((_a = cell.shadowRoot.querySelector('th, td')) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
});
|
|
2993
|
+
}
|
|
2994
|
+
updateCellPinnedPosition(renderInput, headCell, prevShadowThWidth, leafWidths, nextShadowThWidth) {
|
|
2995
|
+
if (['left', 'right'].includes(renderInput.pinned)) {
|
|
2996
|
+
const shadowCell = headCell.shadowRoot.querySelector('th, td');
|
|
2997
|
+
if (renderInput.pinned === 'left') {
|
|
2998
|
+
const position = prevShadowThWidth +
|
|
2999
|
+
leafWidths
|
|
3000
|
+
.slice(0, renderInput.columnIndex)
|
|
3001
|
+
.reduce((count, colWidth) => count + colWidth, 0);
|
|
3002
|
+
this.updatePinnedPosition(shadowCell, 'left', position);
|
|
3003
|
+
}
|
|
3004
|
+
if (renderInput.pinned === 'right') {
|
|
3005
|
+
const colSpan = isNonNullable(renderInput.colSpan) ? renderInput.colSpan : 1;
|
|
3006
|
+
const position = nextShadowThWidth +
|
|
3007
|
+
leafWidths
|
|
3008
|
+
.slice(renderInput.columnIndex + (colSpan - 1) + 1)
|
|
3009
|
+
.reduce((count, colWidth) => count + colWidth, 0);
|
|
3010
|
+
this.updatePinnedPosition(shadowCell, 'right', position);
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
updateTableRowPinnedPosition() {
|
|
3015
|
+
const hasLeftPinnedColumn = this.columnStructureModel.hasLeftPinnedColumn();
|
|
3016
|
+
const hasRightPinnedColumn = this.columnStructureModel.hasRightPinnedColumn();
|
|
3017
|
+
const tableWidth = this.host.getBoundingClientRect().width;
|
|
3018
|
+
const leftPadding = extractNumberFromString(this.paddingX[0]);
|
|
3019
|
+
const rightPadding = extractNumberFromString(this.paddingX[1]);
|
|
3020
|
+
// table width - padding(8*2) - border(2);
|
|
3021
|
+
const expandContainerWidth = tableWidth - leftPadding - rightPadding - 2;
|
|
3022
|
+
this.host.shadowRoot
|
|
3023
|
+
.querySelectorAll('vega-table-head-row, vega-table-row, vega-table-expand-row')
|
|
3024
|
+
.forEach((row) => {
|
|
3025
|
+
const rowShadow = row.shadowRoot;
|
|
3026
|
+
if (hasLeftPinnedColumn) {
|
|
3027
|
+
const firstCell = rowShadow.querySelector('th:first-of-type, td:first-of-type');
|
|
3028
|
+
const selectionCell = rowShadow.querySelector('.vega-table-selection-column');
|
|
3029
|
+
this.updatePinnedPosition(firstCell, 'left', 0);
|
|
3030
|
+
this.updatePinnedPosition(selectionCell, 'left', leftPadding);
|
|
3031
|
+
}
|
|
3032
|
+
if (hasRightPinnedColumn) {
|
|
3033
|
+
const expandCell = rowShadow.querySelector('.vega-table-expand-action-column');
|
|
3034
|
+
const lastCell = rowShadow.querySelector('th:last-of-type, td:last-of-type');
|
|
3035
|
+
this.updatePinnedPosition(expandCell, 'right', rightPadding);
|
|
3036
|
+
this.updatePinnedPosition(lastCell, 'right', 0);
|
|
3037
|
+
}
|
|
3038
|
+
if (hasRightPinnedColumn || hasLeftPinnedColumn) {
|
|
3039
|
+
const expandCell = rowShadow.querySelector('.vega-table-expanded-row-slot-container');
|
|
3040
|
+
if (expandCell) {
|
|
3041
|
+
const slotInnerContainer = expandCell.querySelector('.expanded-row-slot-inner');
|
|
3042
|
+
this.updatePinnedPosition(slotInnerContainer, 'left', leftPadding);
|
|
3043
|
+
// we should set the width to make the expand slot not scroll by table scroll.
|
|
3044
|
+
// ticket: https://gethired.atlassian.net/browse/VD-7015
|
|
3045
|
+
slotInnerContainer.style.width = `${expandContainerWidth}px`;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
updatePinnedPosition(cell, type, position) {
|
|
3051
|
+
if (!cell)
|
|
3052
|
+
return;
|
|
3053
|
+
cell.style.position = 'sticky';
|
|
3054
|
+
cell.style.zIndex = '1';
|
|
3055
|
+
cell.style[type] = `${position}px`;
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
__decorate$1([
|
|
3059
|
+
MapToComponentField()
|
|
3060
|
+
], VegaTablePinnedRenderer.prototype, "host", void 0);
|
|
3061
|
+
__decorate$1([
|
|
3062
|
+
MapToComponentField()
|
|
3063
|
+
], VegaTablePinnedRenderer.prototype, "columnStructureModel", void 0);
|
|
3064
|
+
__decorate$1([
|
|
3065
|
+
MapToComponentField()
|
|
3066
|
+
], VegaTablePinnedRenderer.prototype, "paddingX", void 0);
|
|
3067
|
+
__decorate$1([
|
|
3068
|
+
MapToComponentField()
|
|
3069
|
+
], VegaTablePinnedRenderer.prototype, "vegaTableRenderInputController", void 0);
|
|
3070
|
+
__decorate$1([
|
|
3071
|
+
InjectVegaSlimmer()
|
|
3072
|
+
], VegaTablePinnedRenderer.prototype, "pageResizeObserverSlimmer", void 0);
|
|
3073
|
+
__decorate$1([
|
|
3074
|
+
MapToComponentMethod('componentDidLoad')
|
|
3075
|
+
], VegaTablePinnedRenderer.prototype, "componentDidLoad", null);
|
|
3076
|
+
__decorate$1([
|
|
3077
|
+
MapToComponentMethod('componentDidRender')
|
|
3078
|
+
], VegaTablePinnedRenderer.prototype, "componentDidRender", null);
|
|
3079
|
+
|
|
3080
|
+
const vegaTableCss = ":host{display:block}table{width:100%;border-spacing:0}.vega-table-empty-description{text-align:center;padding:24px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-table-empty-description{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-table-empty-description{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-table-empty-description{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}table.v-table-fixed{table-layout:fixed}.vega-table-scrollable-container{overflow:auto}.vega-table-scrollable-container vega-table-head{transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.vega-table-scrollable-container.scrolled vega-table-head.fixed-header,.vega-table-scrollable-container.scrolled ::slotted(vega-table-head.fixed-header){box-shadow:0px 4px 0px rgba(0, 0, 0, 0.1);}.vega-table-scrollable-container.scrolled vega-table-foot.fixed-footer::after,.vega-table-scrollable-container.scrolled ::slotted(vega-table-foot.fixed-footer)::after{content:\"\";position:absolute;top:0;left:0;width:100%;height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1))}vega-form{display:contents}*::part(field-error-message){display:none !important}.vega-table-pagination-container{margin-top:24px}.vega-table-pagination-container.bottom-center{display:flex;justify-content:center}.vega-table-pagination-container.bottom-right{display:flex;justify-content:flex-end}.vega-table-pagination-container.bottom-left{display:flex;justify-content:flex-start}col.v-hidden{display:none}@media (min-width: 320px){col.S\\:v-table-column{display:table-column}}@media (min-width: 768px){col.M\\:v-table-column{display:table-column}}@media (min-width: 1024px){col.L\\:v-table-column{display:table-column}}@media (min-width: 1440px){col.XL\\:v-table-column{display:table-column}}:host(.is-group-table) .vega-table-scrollable-container{border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));border-width:1px;border-style:solid}:host(.is-group-table.density-relaxed) .vega-table-scrollable-container{border-radius:12px}:host(.is-group-table.density-default) .vega-table-scrollable-container{border-radius:12px}:host(.is-group-table.density-compact) .vega-table-scrollable-container{border-radius:4px}:host(.is-pinned-table) table{min-width:max-content}";
|
|
3081
|
+
|
|
3082
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3083
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3084
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3085
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
3086
|
+
else
|
|
3087
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
3088
|
+
if (d = decorators[i])
|
|
3089
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3090
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3091
|
+
};
|
|
3092
|
+
const VegaTable = class {
|
|
3093
|
+
constructor(hostRef) {
|
|
3094
|
+
registerInstance(this, hostRef);
|
|
3095
|
+
this.vegaChange = createEvent(this, "vegaChange", 7);
|
|
3096
|
+
this.change = createEvent(this, "change", 7);
|
|
3097
|
+
this.vegaRowClick = createEvent(this, "vegaRowClick", 7);
|
|
3098
|
+
this.rowClick = createEvent(this, "rowClick", 7);
|
|
3099
|
+
this.vegaRowExpand = createEvent(this, "vegaRowExpand", 7);
|
|
3100
|
+
this.rowExpand = createEvent(this, "rowExpand", 7);
|
|
3101
|
+
this.vegaSelectChange = createEvent(this, "vegaSelectChange", 7);
|
|
3102
|
+
this.selectChange = createEvent(this, "selectChange", 7);
|
|
3103
|
+
this.vegaSelectAllChange = createEvent(this, "vegaSelectAllChange", 7);
|
|
3104
|
+
this.selectAllChange = createEvent(this, "selectAllChange", 7);
|
|
3105
|
+
this.vegaRowSelect = createEvent(this, "vegaRowSelect", 7);
|
|
3106
|
+
this.rowSelect = createEvent(this, "rowSelect", 7);
|
|
3107
|
+
this.vegaRowSelectAll = createEvent(this, "vegaRowSelectAll", 7);
|
|
3108
|
+
this.rowSelectAll = createEvent(this, "rowSelectAll", 7);
|
|
3109
|
+
this.globalSlimmers = {};
|
|
3110
|
+
this.translationSlimmer = new TranslationSlimmer();
|
|
3111
|
+
this.vegaTableRenderModeController = new VegaTableRenderModeController();
|
|
3112
|
+
this.vegaTableColumnStructureModelController = new VegaTableColumnStructureModelController();
|
|
3113
|
+
this.vegaTableRenderInputController = new VegaTableRenderInputController();
|
|
3114
|
+
this.vegaTablePinnedRenderer = new VegaTablePinnedRenderer();
|
|
3115
|
+
this.vegaTableRenderer = new VegaTableRenderer();
|
|
3116
|
+
this.vegaTableHeaderRenderer = new VegaTableHeaderRenderer();
|
|
3117
|
+
this.vegaTableBodyRenderer = new VegaTableBodyRenderer();
|
|
3118
|
+
this.vegaTableRowRenderer = new VegaTableRowRenderer();
|
|
3119
|
+
this.vegaTableCellRenderer = new VegaTableCellRenderer();
|
|
3120
|
+
this.vegaTablePaginationRenderer = new VegaTablePaginationRenderer();
|
|
3121
|
+
this.vegaTableScrollContainerRenderer = new VegaTableScrollContainerRenderer();
|
|
3122
|
+
this.vegaTableExpandRowController = new VegaTableExpandRowController();
|
|
3123
|
+
this.vegaTableRowSelectionController = new VegaTableRowSelectionController();
|
|
3124
|
+
this.vegaTableDataSourceController = new VegaTableDataSourceController();
|
|
3125
|
+
this.vegaTablePaginationController = new VegaTablePaginationController();
|
|
3126
|
+
this.vegaTableEditableController = new VegaTableEditableController();
|
|
3127
|
+
this.vegaTableSortController = new VegaTableSortController();
|
|
3128
|
+
this.vegaTableColGroupRenderer = new VegaTableColGroupRenderer();
|
|
3129
|
+
this.vegaTableChildrenController = new VegaTableChildrenController();
|
|
3130
|
+
/**
|
|
3131
|
+
* The below method is e2e-test covered in
|
|
3132
|
+
* @see{module:should-render-responsive-columns-with-expandable-row-and-current-breakpoint-is-smaller-than-S}
|
|
3133
|
+
*/
|
|
3134
|
+
this.pageResizeObserverSlimmer = new PageResizeObserverSlimmer();
|
|
3135
|
+
this.rowSelectionNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'rowSelection', 'watchRowSelection');
|
|
3136
|
+
this.rowExpandableNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'rowExpandable', 'watchRowExpandable');
|
|
3137
|
+
this.paddingXNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'paddingX', 'watchPaddingX');
|
|
3138
|
+
this.rowClickableNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'rowClickable', 'watchRowClickable');
|
|
3139
|
+
this.scrollConfigNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'scrollConfig', 'watchScrollConfig');
|
|
3140
|
+
this.eventsPrevent = new ChildNodesEventPreventSlimmer([VegaChange, VegaPageSizeChange, VegaExpand], () => this.host);
|
|
3141
|
+
this.changeEventEmitter = createEventEmitSlimmer(VegaTable, VegaChange);
|
|
3142
|
+
this.selectChangeEventEmitter = createEventEmitSlimmer(VegaTable, VegaSelectChange);
|
|
3143
|
+
this.selectAllChangeEventEmitter = createEventEmitSlimmer(VegaTable, VegaSelectAllChange);
|
|
3144
|
+
this.rowClickEventEmitter = createEventEmitSlimmer(VegaTable, VegaRowClick);
|
|
3145
|
+
this.rowExpandEventEmitter = createEventEmitSlimmer(VegaTable, VegaRowExpand);
|
|
3146
|
+
this.rowDividerNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'rowDivider', 'watchRowDivider');
|
|
3147
|
+
this.columnDividerNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'columnDivider', 'watchColumnDivider');
|
|
3148
|
+
this.densityNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'density', 'watchDensity');
|
|
3149
|
+
this.isTemplateRenderModeNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'isTemplateRenderMode', 'watchTemplateRenderMode');
|
|
3150
|
+
this.currentDataNotifySlimmer = createSubStateNotifySlimmer(VegaTable, 'currentData', 'watchCurrentData');
|
|
3151
|
+
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaTableRuntimeMetricsPayloadDefinition);
|
|
3152
|
+
this.rowSelectEventEmitter = createEventEmitSlimmer(VegaTable, VegaRowSelect);
|
|
3153
|
+
this.rowSelectAllEventEmitter = createEventEmitSlimmer(VegaTable, VegaRowSelectAll);
|
|
3154
|
+
this.selectedRowKeySet = new ImmutableSet(new Set(), (newSet) => {
|
|
3155
|
+
this.selectedRowKeySet = newSet;
|
|
3156
|
+
});
|
|
3157
|
+
this.expandedRowKeySet = new ImmutableSet(new Set(), (newSet) => {
|
|
3158
|
+
this.expandedRowKeySet = newSet;
|
|
3159
|
+
});
|
|
3160
|
+
this.currentBreakpoint = getCurrentBreakpoint();
|
|
3161
|
+
/** Current running sorters */
|
|
3162
|
+
this.sortersMap = new ImmutableMap(new Map(), (newMap) => {
|
|
3163
|
+
this.sortersMap = newMap;
|
|
3164
|
+
});
|
|
3165
|
+
/** The data for vega-table to render */
|
|
3166
|
+
this.currentData = [];
|
|
3167
|
+
/** Current page number of the table pagination */
|
|
3168
|
+
this.currentPage = 1;
|
|
3169
|
+
/**
|
|
3170
|
+
* The page size of the table pagination
|
|
3171
|
+
*/
|
|
3172
|
+
this.pageSize = 10;
|
|
3173
|
+
this.editingRows = new ImmutableSet(new Set(), (newSet) => {
|
|
3174
|
+
this.editingRows = newSet;
|
|
3175
|
+
});
|
|
3176
|
+
this.isSelectedAll = false;
|
|
3177
|
+
/**
|
|
3178
|
+
* Defines the columns of the table.
|
|
3179
|
+
*
|
|
3180
|
+
* @vegaVersion 1.3.0
|
|
3181
|
+
*/
|
|
3182
|
+
this.columns = [];
|
|
3183
|
+
/**
|
|
3184
|
+
* Contains the data records to be rendered and
|
|
3185
|
+
* displayed within the table.
|
|
3186
|
+
*
|
|
3187
|
+
* @vegaVersion 1.3.0
|
|
3188
|
+
*/
|
|
3189
|
+
/* eslint-disable-next-line @stencil/strict-mutable */
|
|
3190
|
+
this.dataSource = [];
|
|
3191
|
+
/**
|
|
3192
|
+
* Defines the behavior and options related to
|
|
3193
|
+
* row selection in the table.
|
|
3194
|
+
*
|
|
3195
|
+
* It allows users to select one or more rows in
|
|
3196
|
+
* the table for further actions or processing.
|
|
3197
|
+
*
|
|
3198
|
+
* @vegaVersion 1.3.0
|
|
3199
|
+
*/
|
|
3200
|
+
/* eslint-disable-next-line @stencil/strict-mutable */
|
|
3201
|
+
this.rowSelection = null;
|
|
3202
|
+
/**
|
|
3203
|
+
* Specifies whether rows in the table can be expanded
|
|
3204
|
+
* to show additional content or details.
|
|
3205
|
+
*/
|
|
3206
|
+
/**
|
|
3207
|
+
* Indicates whether the row is expandable.
|
|
3208
|
+
*
|
|
3209
|
+
* @vegaVersion 1.3.0
|
|
3210
|
+
*/
|
|
3211
|
+
this.rowExpandable = false;
|
|
3212
|
+
/**
|
|
3213
|
+
* Specifies whether rows in the table can be clicked.
|
|
3214
|
+
* If enabled, a `vegaRowClick` event will be
|
|
3215
|
+
* dispatched when a row is clicked.
|
|
3216
|
+
*
|
|
3217
|
+
* @vegaVersion 1.3.0
|
|
3218
|
+
*/
|
|
3219
|
+
this.rowClickable = false;
|
|
3220
|
+
/**
|
|
3221
|
+
* Specifies whether dividers should be displayed
|
|
3222
|
+
* between rows in the table.
|
|
3223
|
+
*
|
|
3224
|
+
* @vegaVersion 1.3.0
|
|
3225
|
+
*/
|
|
3226
|
+
this.rowDivider = false;
|
|
3227
|
+
/**
|
|
3228
|
+
* Specifies whether dividers should be displayed
|
|
3229
|
+
* between columns in the table.
|
|
3230
|
+
*
|
|
3231
|
+
* @vegaVersion 1.3.0
|
|
3232
|
+
*/
|
|
3233
|
+
this.columnDivider = false;
|
|
3234
|
+
/**
|
|
3235
|
+
* Specifies whether alternate colors should be applied
|
|
3236
|
+
* to the rows of the table.
|
|
3237
|
+
*
|
|
3238
|
+
* @vegaVersion 1.3.0
|
|
3239
|
+
*/
|
|
3240
|
+
this.striped = true;
|
|
3241
|
+
/**
|
|
3242
|
+
* Specifies the negative space within the table's cells.
|
|
3243
|
+
*
|
|
3244
|
+
* @vegaVersion 1.3.0
|
|
3245
|
+
*/
|
|
3246
|
+
this.density = 'default';
|
|
3247
|
+
/**
|
|
3248
|
+
* Controls the amount of horizontal padding applied to the table.
|
|
3249
|
+
*
|
|
3250
|
+
* @vegaVersion 1.3.0
|
|
3251
|
+
*/
|
|
3252
|
+
this.paddingX = ['8px', '8px'];
|
|
3253
|
+
/**
|
|
3254
|
+
* Specifies whether the table header should be displayed.
|
|
3255
|
+
*
|
|
3256
|
+
* @vegaVersion 1.3.0
|
|
3257
|
+
*/
|
|
3258
|
+
this.showHeader = true;
|
|
3259
|
+
/**
|
|
3260
|
+
* Specifies the pagination configuration.
|
|
3261
|
+
*
|
|
3262
|
+
* @vegaVersion 1.5.0
|
|
3263
|
+
*/
|
|
3264
|
+
this.pagination = null;
|
|
3265
|
+
/**
|
|
3266
|
+
* Provides a customized message or description that is
|
|
3267
|
+
* shown when the table's data source is empty.
|
|
3268
|
+
*
|
|
3269
|
+
* @vegaVersion 1.7.0
|
|
3270
|
+
*/
|
|
3271
|
+
this.emptyDescription = 'There is no data to display';
|
|
3272
|
+
/**
|
|
3273
|
+
* Defines a unique key for each row in the table.
|
|
3274
|
+
*
|
|
3275
|
+
* @vegaVersion 1.9.2
|
|
3276
|
+
*/
|
|
3277
|
+
this.rowKey = 'key';
|
|
3278
|
+
/**
|
|
3279
|
+
* Defines the column sorting options
|
|
3280
|
+
* Has optional property type: single | multiple
|
|
3281
|
+
* If not specified, it defaults to multiple column sorting
|
|
3282
|
+
*
|
|
3283
|
+
* @vegaVersion 2.22.0
|
|
3284
|
+
*/
|
|
3285
|
+
this.sortConfig = { type: 'multiple' };
|
|
3286
|
+
}
|
|
3287
|
+
watchSelectedRowKeySet() {
|
|
3288
|
+
methodPlaceholder();
|
|
3289
|
+
}
|
|
3290
|
+
watchSortersMap() {
|
|
3291
|
+
methodPlaceholder();
|
|
3292
|
+
}
|
|
3293
|
+
watchCurrentData(newValue, oldValue) {
|
|
3294
|
+
methodPlaceholder(newValue, oldValue);
|
|
3295
|
+
}
|
|
3296
|
+
watchCurrentPage() {
|
|
3297
|
+
methodPlaceholder();
|
|
3298
|
+
}
|
|
3299
|
+
watchSelectedAll() {
|
|
3300
|
+
methodPlaceholder();
|
|
3301
|
+
}
|
|
3302
|
+
watchTemplateRenderMode() {
|
|
3303
|
+
methodPlaceholder();
|
|
3304
|
+
}
|
|
3305
|
+
watchColumnStructureModel() {
|
|
3306
|
+
methodPlaceholder();
|
|
3307
|
+
}
|
|
3308
|
+
watchColumns() {
|
|
3309
|
+
methodPlaceholder();
|
|
3310
|
+
}
|
|
3311
|
+
watchGroupColumns() {
|
|
3312
|
+
methodPlaceholder();
|
|
3313
|
+
}
|
|
3314
|
+
watchDataSource() {
|
|
3315
|
+
methodPlaceholder();
|
|
3316
|
+
}
|
|
3317
|
+
watchRowSelection() {
|
|
3318
|
+
methodPlaceholder();
|
|
3319
|
+
}
|
|
3320
|
+
watchRowExpandable() {
|
|
3321
|
+
methodPlaceholder();
|
|
3322
|
+
}
|
|
3323
|
+
watchRowClickable() {
|
|
3324
|
+
methodPlaceholder();
|
|
3325
|
+
}
|
|
3326
|
+
watchRowDivider() {
|
|
3327
|
+
methodPlaceholder();
|
|
3328
|
+
}
|
|
3329
|
+
watchColumnDivider() {
|
|
3330
|
+
methodPlaceholder();
|
|
3331
|
+
}
|
|
3332
|
+
watchStriped() {
|
|
3333
|
+
methodPlaceholder();
|
|
3334
|
+
}
|
|
3335
|
+
watchDensity() {
|
|
3336
|
+
methodPlaceholder();
|
|
3337
|
+
}
|
|
3338
|
+
watchPaddingX() {
|
|
3339
|
+
methodPlaceholder();
|
|
3340
|
+
}
|
|
3341
|
+
watchPagination() {
|
|
3342
|
+
methodPlaceholder();
|
|
3343
|
+
}
|
|
3344
|
+
watchScrollConfig() {
|
|
3345
|
+
methodPlaceholder();
|
|
3346
|
+
}
|
|
3347
|
+
/**
|
|
3348
|
+
* Invoke this method to expand the row with the specified `rowKey`,
|
|
3349
|
+
* revealing additional content.
|
|
3350
|
+
*
|
|
3351
|
+
* @param rowKey
|
|
3352
|
+
* @vegaVersion 1.3.0
|
|
3353
|
+
*/
|
|
3354
|
+
async openExpandRow(rowKey) {
|
|
3355
|
+
methodPlaceholder(rowKey);
|
|
3356
|
+
}
|
|
3357
|
+
/**
|
|
3358
|
+
* Invoke this method to close the expanded row with the specified `rowKey`.
|
|
3359
|
+
*
|
|
3360
|
+
* @param rowKey
|
|
3361
|
+
* @vegaVersion 1.3.0
|
|
3362
|
+
*/
|
|
3363
|
+
async closeExpandRow(rowKey) {
|
|
3364
|
+
methodPlaceholder(rowKey);
|
|
3365
|
+
}
|
|
3366
|
+
/**
|
|
3367
|
+
* Invoke this method to close all expanded rows.
|
|
3368
|
+
*
|
|
3369
|
+
* @vegaVersion 1.3.0
|
|
3370
|
+
*/
|
|
3371
|
+
async closeAllExpandRow() {
|
|
3372
|
+
methodPlaceholder();
|
|
3373
|
+
}
|
|
3374
|
+
/**
|
|
3375
|
+
* Invoke this method to toggle the expandable row with the
|
|
3376
|
+
* specified `rowKey`, expanding it if it is currently
|
|
3377
|
+
* collapsed and collapsing it if it is currently expanded.
|
|
3378
|
+
*
|
|
3379
|
+
* @param rowKey
|
|
3380
|
+
* @vegaVersion 1.3.0
|
|
3381
|
+
*/
|
|
3382
|
+
async toggleExpandRow(rowKey) {
|
|
3383
|
+
methodPlaceholder(rowKey);
|
|
3384
|
+
}
|
|
3385
|
+
/**
|
|
3386
|
+
* Invoke this method to clear the selected row keys,
|
|
3387
|
+
* removing any current selection.
|
|
3388
|
+
*
|
|
3389
|
+
* @vegaVersion 1.3.0
|
|
3390
|
+
*/
|
|
3391
|
+
async clearSelection() {
|
|
3392
|
+
methodPlaceholder();
|
|
3393
|
+
}
|
|
3394
|
+
/**
|
|
3395
|
+
* Invoke this method to retrieve the selected row keys,
|
|
3396
|
+
* provided an array or list of the keys representing
|
|
3397
|
+
* the currently selected rows.
|
|
3398
|
+
*
|
|
3399
|
+
* @vegaVersion 1.3.0
|
|
3400
|
+
*/
|
|
3401
|
+
async getSelection() {
|
|
3402
|
+
return methodPlaceholder();
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* Invoke this method to set the selected row keys,
|
|
3406
|
+
* specifying an array or list of keys to represent
|
|
3407
|
+
* the desired selected rows.
|
|
3408
|
+
*
|
|
3409
|
+
* @param {string[]} keys - Row keys to be set as selected.
|
|
3410
|
+
* @vegaVersion 1.3.0
|
|
3411
|
+
*/
|
|
3412
|
+
async setSelection(keys) {
|
|
3413
|
+
methodPlaceholder(keys);
|
|
3414
|
+
}
|
|
3415
|
+
/**
|
|
3416
|
+
* Invoke this method to start the edit mode for the row
|
|
3417
|
+
* with the specified `rowKey`.
|
|
3418
|
+
*
|
|
3419
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3420
|
+
*
|
|
3421
|
+
* @vegaVersion 1.19.0
|
|
3422
|
+
*/
|
|
3423
|
+
async startRowEditMode(rowKey) {
|
|
3424
|
+
methodPlaceholder(rowKey);
|
|
3425
|
+
}
|
|
3426
|
+
/**
|
|
3427
|
+
* Invoke this method to stop the edit mode for the row
|
|
3428
|
+
* with the specified `rowKey`.
|
|
3429
|
+
*
|
|
3430
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3431
|
+
*
|
|
3432
|
+
* @vegaVersion 1.19.0
|
|
3433
|
+
*/
|
|
3434
|
+
async stopRowEditMode(rowKey) {
|
|
3435
|
+
methodPlaceholder(rowKey);
|
|
3436
|
+
}
|
|
3437
|
+
/**
|
|
3438
|
+
* Invoke this method to stop the edit mode for all rows,
|
|
3439
|
+
* exiting the edit mode for each row currently
|
|
3440
|
+
* in the editing state.
|
|
3441
|
+
*
|
|
3442
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3443
|
+
*
|
|
3444
|
+
* @vegaVersion 1.19.0
|
|
3445
|
+
*/
|
|
3446
|
+
async stopAllRowEditMode() {
|
|
3447
|
+
methodPlaceholder();
|
|
3448
|
+
}
|
|
3449
|
+
/**
|
|
3450
|
+
* Invoke this method to retrieve the data of the row with
|
|
3451
|
+
* the specified `rowKey`, obtaining the complete set of
|
|
3452
|
+
* information associated with that row.
|
|
3453
|
+
*
|
|
3454
|
+
* @param rowKey The row's unique key.
|
|
3455
|
+
*
|
|
3456
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3457
|
+
*
|
|
3458
|
+
* @vegaVersion 1.19.0
|
|
3459
|
+
*/
|
|
3460
|
+
async getRowData(rowKey) {
|
|
3461
|
+
return methodPlaceholder(rowKey);
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
* Invoke this method to retrieve all rows of data,
|
|
3465
|
+
* obtaining the complete set of information
|
|
3466
|
+
* associated with each row.
|
|
3467
|
+
*
|
|
3468
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3469
|
+
*
|
|
3470
|
+
* @vegaVersion 1.19.0
|
|
3471
|
+
*/
|
|
3472
|
+
async getRowsData() {
|
|
3473
|
+
return methodPlaceholder();
|
|
3474
|
+
}
|
|
3475
|
+
/**
|
|
3476
|
+
* Invoke this method to retrieve the table row reference
|
|
3477
|
+
* based on the provided `rowKey`.
|
|
3478
|
+
*
|
|
3479
|
+
* If the `rowKey` is empty, this method will return the
|
|
3480
|
+
* reference to the table form.
|
|
3481
|
+
*
|
|
3482
|
+
* @param optional rowKey
|
|
3483
|
+
*
|
|
3484
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3485
|
+
*
|
|
3486
|
+
* @vegaVersion 1.19.0
|
|
3487
|
+
*/
|
|
3488
|
+
async getFormRef(rowKey) {
|
|
3489
|
+
return methodPlaceholder(rowKey);
|
|
3490
|
+
}
|
|
3491
|
+
/**
|
|
3492
|
+
* Invoke this method to add a new row to the editable table.
|
|
3493
|
+
*
|
|
3494
|
+
* @param record the default record of the new row
|
|
3495
|
+
* @returns {Promise<string>} the rowKey of the new row
|
|
3496
|
+
*
|
|
3497
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3498
|
+
*
|
|
3499
|
+
* @vegaVersion 1.19.0
|
|
3500
|
+
*/
|
|
3501
|
+
async addNewRow(record = {}) {
|
|
3502
|
+
return methodPlaceholder(record);
|
|
3503
|
+
}
|
|
3504
|
+
/**
|
|
3505
|
+
* Invoke this method to save the edited row data to
|
|
3506
|
+
* the `currentData` and stop the edit mode
|
|
3507
|
+
* for that row.
|
|
3508
|
+
*
|
|
3509
|
+
* This action will not affect the editing mode of other rows.
|
|
3510
|
+
*
|
|
3511
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3512
|
+
*
|
|
3513
|
+
* @vegaVersion 1.19.0
|
|
3514
|
+
*/
|
|
3515
|
+
async saveEditRow(rowKey) {
|
|
3516
|
+
return methodPlaceholder(rowKey);
|
|
3517
|
+
}
|
|
3518
|
+
/**
|
|
3519
|
+
* Invoke this method to save the data of all edited rows to
|
|
3520
|
+
* the `currentData` and stop the edit mode for
|
|
3521
|
+
* all rows in the table.
|
|
3522
|
+
*
|
|
3523
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3524
|
+
*
|
|
3525
|
+
* @vegaVersion 1.19.0
|
|
3526
|
+
*/
|
|
3527
|
+
async saveAllEditRows() {
|
|
3528
|
+
methodPlaceholder();
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* Invoke this method to obtain the keys of the rows currently
|
|
3532
|
+
* in the editing mode in the table.
|
|
3533
|
+
*
|
|
3534
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3535
|
+
*
|
|
3536
|
+
* @vegaVersion 1.19.0
|
|
3537
|
+
*/
|
|
3538
|
+
async getEditingRowsKey() {
|
|
3539
|
+
return methodPlaceholder();
|
|
3540
|
+
}
|
|
3541
|
+
/**
|
|
3542
|
+
* Invoke this method to remove a row from the `currentData`
|
|
3543
|
+
* based on the specified `rowKey` in the table.
|
|
3544
|
+
*
|
|
3545
|
+
* @param rowKey The rowKey of the row to remove.
|
|
3546
|
+
*
|
|
3547
|
+
* @VegaWarning Note: This method only works with editable tables.
|
|
3548
|
+
*
|
|
3549
|
+
* @vegaVersion 1.19.0
|
|
3550
|
+
*/
|
|
3551
|
+
async removeRow(rowKey) {
|
|
3552
|
+
methodPlaceholder(rowKey);
|
|
3553
|
+
}
|
|
3554
|
+
render() {
|
|
3555
|
+
slotPlaceholder(h("slot", null));
|
|
3556
|
+
return this.vegaTableRenderer.render();
|
|
3557
|
+
}
|
|
3558
|
+
get host() { return getElement(this); }
|
|
3559
|
+
static get watchers() { return {
|
|
3560
|
+
"selectedRowKeySet": ["watchSelectedRowKeySet"],
|
|
3561
|
+
"sortersMap": ["watchSortersMap"],
|
|
3562
|
+
"currentData": ["watchCurrentData"],
|
|
3563
|
+
"currentPage": ["watchCurrentPage"],
|
|
3564
|
+
"isSelectedAll": ["watchSelectedAll"],
|
|
3565
|
+
"isTemplateRenderMode": ["watchTemplateRenderMode"],
|
|
3566
|
+
"columnStructureModel": ["watchColumnStructureModel"],
|
|
3567
|
+
"columns": ["watchColumns"],
|
|
3568
|
+
"groupColumns": ["watchGroupColumns"],
|
|
3569
|
+
"dataSource": ["watchDataSource"],
|
|
3570
|
+
"rowSelection": ["watchRowSelection"],
|
|
3571
|
+
"rowExpandable": ["watchRowExpandable"],
|
|
3572
|
+
"rowClickable": ["watchRowClickable"],
|
|
3573
|
+
"rowDivider": ["watchRowDivider"],
|
|
3574
|
+
"columnDivider": ["watchColumnDivider"],
|
|
3575
|
+
"striped": ["watchStriped"],
|
|
3576
|
+
"density": ["watchDensity"],
|
|
3577
|
+
"paddingX": ["watchPaddingX"],
|
|
3578
|
+
"pagination": ["watchPagination"],
|
|
3579
|
+
"scrollConfig": ["watchScrollConfig"]
|
|
3580
|
+
}; }
|
|
3581
|
+
};
|
|
3582
|
+
__decorate([
|
|
3583
|
+
InjectVegaGlobalSlimmer()
|
|
3584
|
+
], VegaTable.prototype, "globalSlimmers", void 0);
|
|
3585
|
+
__decorate([
|
|
3586
|
+
InjectVegaSlimmer()
|
|
3587
|
+
], VegaTable.prototype, "translationSlimmer", void 0);
|
|
3588
|
+
__decorate([
|
|
3589
|
+
InjectVegaSlimmer()
|
|
3590
|
+
], VegaTable.prototype, "vegaTableRenderModeController", void 0);
|
|
3591
|
+
__decorate([
|
|
3592
|
+
InjectVegaSlimmer()
|
|
3593
|
+
], VegaTable.prototype, "vegaTableColumnStructureModelController", void 0);
|
|
3594
|
+
__decorate([
|
|
3595
|
+
InjectVegaSlimmer()
|
|
3596
|
+
], VegaTable.prototype, "vegaTableRenderInputController", void 0);
|
|
3597
|
+
__decorate([
|
|
3598
|
+
InjectVegaSlimmer()
|
|
3599
|
+
], VegaTable.prototype, "vegaTablePinnedRenderer", void 0);
|
|
3600
|
+
__decorate([
|
|
3601
|
+
InjectVegaSlimmer()
|
|
3602
|
+
], VegaTable.prototype, "vegaTableRenderer", void 0);
|
|
3603
|
+
__decorate([
|
|
3604
|
+
InjectVegaSlimmer()
|
|
3605
|
+
], VegaTable.prototype, "vegaTableHeaderRenderer", void 0);
|
|
3606
|
+
__decorate([
|
|
3607
|
+
InjectVegaSlimmer()
|
|
3608
|
+
], VegaTable.prototype, "vegaTableBodyRenderer", void 0);
|
|
3609
|
+
__decorate([
|
|
3610
|
+
InjectVegaSlimmer()
|
|
3611
|
+
], VegaTable.prototype, "vegaTableRowRenderer", void 0);
|
|
3612
|
+
__decorate([
|
|
3613
|
+
InjectVegaSlimmer()
|
|
3614
|
+
], VegaTable.prototype, "vegaTableCellRenderer", void 0);
|
|
3615
|
+
__decorate([
|
|
3616
|
+
InjectVegaSlimmer()
|
|
3617
|
+
], VegaTable.prototype, "vegaTablePaginationRenderer", void 0);
|
|
3618
|
+
__decorate([
|
|
3619
|
+
InjectVegaSlimmer()
|
|
3620
|
+
], VegaTable.prototype, "vegaTableScrollContainerRenderer", void 0);
|
|
3621
|
+
__decorate([
|
|
3622
|
+
InjectVegaSlimmer()
|
|
3623
|
+
], VegaTable.prototype, "vegaTableExpandRowController", void 0);
|
|
3624
|
+
__decorate([
|
|
3625
|
+
InjectVegaSlimmer()
|
|
3626
|
+
], VegaTable.prototype, "vegaTableRowSelectionController", void 0);
|
|
3627
|
+
__decorate([
|
|
3628
|
+
InjectVegaSlimmer()
|
|
3629
|
+
], VegaTable.prototype, "vegaTableDataSourceController", void 0);
|
|
3630
|
+
__decorate([
|
|
3631
|
+
InjectVegaSlimmer()
|
|
3632
|
+
], VegaTable.prototype, "vegaTablePaginationController", void 0);
|
|
3633
|
+
__decorate([
|
|
3634
|
+
InjectVegaSlimmer()
|
|
3635
|
+
], VegaTable.prototype, "vegaTableEditableController", void 0);
|
|
3636
|
+
__decorate([
|
|
3637
|
+
InjectVegaSlimmer()
|
|
3638
|
+
], VegaTable.prototype, "vegaTableSortController", void 0);
|
|
3639
|
+
__decorate([
|
|
3640
|
+
InjectVegaSlimmer()
|
|
3641
|
+
], VegaTable.prototype, "vegaTableColGroupRenderer", void 0);
|
|
3642
|
+
__decorate([
|
|
3643
|
+
InjectVegaSlimmer()
|
|
3644
|
+
], VegaTable.prototype, "vegaTableChildrenController", void 0);
|
|
3645
|
+
__decorate([
|
|
3646
|
+
InjectVegaSlimmer()
|
|
3647
|
+
], VegaTable.prototype, "pageResizeObserverSlimmer", void 0);
|
|
3648
|
+
__decorate([
|
|
3649
|
+
InjectVegaSlimmer()
|
|
3650
|
+
], VegaTable.prototype, "rowSelectionNotifySlimmer", void 0);
|
|
3651
|
+
__decorate([
|
|
3652
|
+
InjectVegaSlimmer()
|
|
3653
|
+
], VegaTable.prototype, "rowExpandableNotifySlimmer", void 0);
|
|
3654
|
+
__decorate([
|
|
3655
|
+
InjectVegaSlimmer()
|
|
3656
|
+
], VegaTable.prototype, "paddingXNotifySlimmer", void 0);
|
|
3657
|
+
__decorate([
|
|
3658
|
+
InjectVegaSlimmer()
|
|
3659
|
+
], VegaTable.prototype, "rowClickableNotifySlimmer", void 0);
|
|
3660
|
+
__decorate([
|
|
3661
|
+
InjectVegaSlimmer()
|
|
3662
|
+
], VegaTable.prototype, "scrollConfigNotifySlimmer", void 0);
|
|
3663
|
+
__decorate([
|
|
3664
|
+
InjectVegaSlimmer()
|
|
3665
|
+
], VegaTable.prototype, "eventsPrevent", void 0);
|
|
3666
|
+
__decorate([
|
|
3667
|
+
InjectVegaSlimmer()
|
|
3668
|
+
], VegaTable.prototype, "changeEventEmitter", void 0);
|
|
3669
|
+
__decorate([
|
|
3670
|
+
InjectVegaSlimmer()
|
|
3671
|
+
], VegaTable.prototype, "selectChangeEventEmitter", void 0);
|
|
3672
|
+
__decorate([
|
|
3673
|
+
InjectVegaSlimmer()
|
|
3674
|
+
], VegaTable.prototype, "selectAllChangeEventEmitter", void 0);
|
|
3675
|
+
__decorate([
|
|
3676
|
+
InjectVegaSlimmer()
|
|
3677
|
+
], VegaTable.prototype, "rowClickEventEmitter", void 0);
|
|
3678
|
+
__decorate([
|
|
3679
|
+
InjectVegaSlimmer()
|
|
3680
|
+
], VegaTable.prototype, "rowExpandEventEmitter", void 0);
|
|
3681
|
+
__decorate([
|
|
3682
|
+
InjectVegaSlimmer()
|
|
3683
|
+
], VegaTable.prototype, "rowDividerNotifySlimmer", void 0);
|
|
3684
|
+
__decorate([
|
|
3685
|
+
InjectVegaSlimmer()
|
|
3686
|
+
], VegaTable.prototype, "columnDividerNotifySlimmer", void 0);
|
|
3687
|
+
__decorate([
|
|
3688
|
+
InjectVegaSlimmer()
|
|
3689
|
+
], VegaTable.prototype, "densityNotifySlimmer", void 0);
|
|
3690
|
+
__decorate([
|
|
3691
|
+
InjectVegaSlimmer()
|
|
3692
|
+
], VegaTable.prototype, "isTemplateRenderModeNotifySlimmer", void 0);
|
|
3693
|
+
__decorate([
|
|
3694
|
+
InjectVegaSlimmer()
|
|
3695
|
+
], VegaTable.prototype, "currentDataNotifySlimmer", void 0);
|
|
3696
|
+
__decorate([
|
|
3697
|
+
InjectVegaSlimmer()
|
|
3698
|
+
], VegaTable.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
3699
|
+
__decorate([
|
|
3700
|
+
InjectVegaSlimmer()
|
|
3701
|
+
], VegaTable.prototype, "rowSelectEventEmitter", void 0);
|
|
3702
|
+
__decorate([
|
|
3703
|
+
InjectVegaSlimmer()
|
|
3704
|
+
], VegaTable.prototype, "rowSelectAllEventEmitter", void 0);
|
|
3705
|
+
VegaTable.style = vegaTableCss;
|
|
3706
|
+
|
|
3707
|
+
export { VegaTable as vega_table };
|