@heartlandone/vega 2.73.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-cc162173.js → app-globals-be2e868e.js} +18 -17
- package/dist/cjs/{code-block-823cd481.js → code-block-22ee2550.js} +35 -4
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-e2e0c6f3.js → component-value-history-controller-slimmer.abstract-3486cbc0.js} +26 -5
- package/dist/cjs/{dto-renderer-manager-bd2bd447.js → content-state-0be6fda3.js} +33 -60
- package/dist/cjs/{design-token-11656685.js → design-token-505997df.js} +1 -1
- package/dist/cjs/dto-renderer-manager-ae5fcbba.js +58 -0
- package/dist/cjs/{element-appender-slimmer-12f40b8b.js → element-appender-slimmer-26420c09.js} +6 -6
- package/dist/cjs/{form-field-controller-slimmer-6e3e14fd.js → form-field-controller-slimmer-56c551ea.js} +2 -2
- package/dist/cjs/{image-annotation-action-7408a4b3.js → image-annotation-action-462fd073.js} +3 -3
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/{index-638a0f0d.js → index-fc538f17.js} +1 -1
- package/dist/cjs/index.cjs.js +43 -38
- package/dist/cjs/{language-extension-716015a5.js → language-extension-414149c2.js} +8 -8
- package/dist/cjs/loader.cjs.js +13 -8
- package/dist/cjs/{public-rules-2950f1fc.js → public-rules-2d18cf41.js} +4 -4
- package/dist/cjs/{range-c3c48132.js → range-439a0c0c.js} +1 -1
- package/dist/cjs/{responsive-format-facade-96c5f598.js → responsive-format-facade-0ececeb3.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-4aab05a3.js → rich-text-editor-required-rule-5a4f3626.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-338bbd73.js → string-input-formatter-slimmer-a8f4a9b1.js} +2 -2
- package/dist/cjs/{style-formatter-9c42d41b.js → style-formatter-142500c0.js} +1 -1
- package/dist/cjs/styles.constants-3aff0b56.js +1306 -0
- package/dist/cjs/{sub-state-notify-slimmer-1efa69c4.js → sub-state-notify-slimmer-011866d9.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-6afa62f5.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 +10 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -6
- package/dist/cjs/vega-box.cjs.entry.js +11 -7
- package/dist/cjs/vega-button-circle.cjs.entry.js +10 -6
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +9 -5
- package/dist/cjs/vega-calendar_4.cjs.entry.js +3 -3
- package/dist/cjs/vega-card.cjs.entry.js +10 -6
- package/dist/cjs/vega-carousel.cjs.entry.js +9 -5
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +10 -6
- package/dist/cjs/vega-code-block.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +15 -11
- package/dist/cjs/vega-dialog_2.cjs.entry.js +17 -13
- package/dist/cjs/vega-divider.cjs.entry.js +10 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +24 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -6
- package/dist/cjs/vega-flex.cjs.entry.js +11 -7
- package/dist/cjs/vega-font.cjs.entry.js +10 -6
- package/dist/cjs/vega-form.cjs.entry.js +4 -4
- package/dist/cjs/vega-grid.cjs.entry.js +10 -6
- package/dist/cjs/vega-icon.cjs.entry.js +10 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +12 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +10 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +181 -50
- package/dist/cjs/vega-input.cjs.entry.js +5 -5
- package/dist/cjs/{vega-internal-event-id-f2465f1b.js → vega-internal-event-id-73334b4b.js} +4 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +17 -13
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +9 -5
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +10 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +70 -54
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +1313 -0
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +15 -11
- package/dist/cjs/vega-signature-capture.cjs.entry.js +12 -8
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_11.cjs.entry.js +16 -13
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +12 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -6
- package/dist/cjs/vega.cjs.js +13 -8
- package/dist/collection/collection-manifest.json +10 -0
- 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-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 +27 -7
- package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +1 -0
- 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/vega-internal-event-id.js +2 -0
- package/dist/collection/utils/spec-utils.js +4 -3
- package/dist/esm/align-left-7f959adf.js +17 -0
- package/dist/esm/{app-globals-949d2e18.js → app-globals-8b873b6f.js} +7 -6
- package/dist/esm/{child-nodes-event-prevent-slimmer-e6f98de5.js → child-nodes-event-prevent-slimmer-a6afdb1e.js} +1 -1
- package/dist/esm/{code-block-666674d7.js → code-block-76b29be1.js} +37 -6
- package/dist/esm/{component-value-history-controller-slimmer.abstract-171dda08.js → component-value-history-controller-slimmer.abstract-e1b0e163.js} +27 -6
- package/dist/esm/{dto-renderer-manager-49ae5d56.js → content-state-03f1d302.js} +32 -61
- package/dist/esm/{design-token-9b510e59.js → design-token-8fedb532.js} +1 -1
- package/dist/esm/{dom-node-subject-observer-factory-1aaa1159.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-b9890dcb.js → element-appender-slimmer-7b9326e2.js} +4 -4
- package/dist/esm/{event-emit-slimmer-2d791d0e.js → event-emit-slimmer-bbf6668c.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-257928c1.js → form-field-controller-slimmer-a0cff4d3.js} +3 -3
- package/dist/esm/{image-annotation-action-b3eea6a2.js → image-annotation-action-47cdc068.js} +3 -3
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/{index-0d487fae.js → index-da7e5fe5.js} +2 -2
- package/dist/esm/index.js +17 -13
- package/dist/esm/{internal-vega-event-manager-fdee2a0a.js → internal-vega-event-manager-e799c54a.js} +1 -1
- package/dist/esm/{language-extension-b3f836d4.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-b164e40e.js → public-rules-c48cc5c9.js} +5 -5
- package/dist/esm/{range-9cc1422b.js → range-af6150a8.js} +1 -1
- package/dist/esm/{responsive-format-facade-94897ae8.js → responsive-format-facade-16da4623.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-2131f21c.js → rich-text-editor-required-rule-7255832e.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-3a42d9b8.js → string-input-formatter-slimmer-82f85b0b.js} +3 -3
- package/dist/esm/{style-formatter-bb5aec96.js → style-formatter-6ca58f6b.js} +1 -1
- package/dist/esm/styles.constants-0dd6f7fa.js +1277 -0
- package/dist/esm/{sub-state-notify-slimmer-71b9bbd5.js → sub-state-notify-slimmer-4060c333.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-41a1b380.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 +14 -10
- 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 +14 -10
- 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 +8 -8
- package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-3edc9b4e.js} +3 -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 +14 -10
- package/dist/esm/vega-progress-tracker_2.entry.js +14 -10
- 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 +696 -296
- 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-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-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 +155 -6
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +2 -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-3162a7fd.entry.js → p-08b4d097.entry.js} +1 -1
- package/dist/vega/p-0e4cecbd.entry.js +1 -0
- package/dist/vega/p-10ffb765.js +1 -0
- package/dist/vega/{p-ead1da57.entry.js → p-12a97dad.entry.js} +1 -1
- package/dist/vega/p-151b1deb.js +1 -0
- package/dist/vega/{p-30e7544c.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-6e84e451.entry.js → p-1f4a814e.entry.js} +1 -1
- package/dist/vega/{p-2ae5ad30.entry.js → p-206245d2.entry.js} +1 -1
- package/dist/vega/p-213be5e9.entry.js +1 -0
- package/dist/vega/{p-7a8c4cf8.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-2409a475.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-c7194674.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-f2c8c363.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-2971b17a.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-9d8e2939.entry.js → p-73688c4e.entry.js} +1 -1
- package/dist/vega/p-73689ec0.entry.js +1 -0
- package/dist/vega/{p-9fb71d8c.entry.js → p-780cbfb0.entry.js} +1 -1
- package/dist/vega/p-79e8236a.entry.js +1 -0
- package/dist/vega/{p-8fba7f9a.js → p-7ca9f6f1.js} +1 -1
- package/dist/vega/{p-f6cd7a08.entry.js → p-813b2915.entry.js} +1 -1
- package/dist/vega/{p-e88f2dc3.js → p-8162980c.js} +1 -1
- package/dist/vega/p-82ec9721.entry.js +1 -0
- package/dist/vega/{p-7f9acdf7.entry.js → p-86caa739.entry.js} +1 -1
- package/dist/vega/p-8a4d8139.entry.js +1 -0
- package/dist/vega/{p-be0b67b8.entry.js → p-8ac453cb.entry.js} +1 -1
- package/dist/vega/p-98b78c75.entry.js +1 -0
- package/dist/vega/{p-76e6c13a.js → p-99e3dcab.js} +1 -1
- package/dist/vega/{p-44bc9ea9.entry.js → p-9aac9879.entry.js} +1 -1
- package/dist/vega/p-a007b493.entry.js +1 -0
- package/dist/vega/p-a439e59b.entry.js +1 -0
- package/dist/vega/p-a4d0ab07.js +1 -0
- package/dist/vega/{p-f38a4be2.entry.js → p-a6e03df4.entry.js} +1 -1
- package/dist/vega/{p-4957f07a.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-9dfe2bbc.js → p-ac4bd1f8.js} +1 -1
- package/dist/vega/{p-3566ad76.js → p-b91c2c9d.js} +1 -1
- package/dist/vega/{p-184d8443.js → p-c00adad9.js} +1 -1
- package/dist/vega/{p-697eb0e1.js → p-c335088c.js} +1 -1
- package/dist/vega/{p-623c3911.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-7f86b3c8.js → p-c8ad47c9.js} +1 -1
- package/dist/vega/{p-96797fee.entry.js → p-c9541fc2.entry.js} +1 -1
- package/dist/vega/{p-a58bdbad.entry.js → p-d07d04e0.entry.js} +1 -1
- package/dist/vega/p-d1349401.entry.js +1 -0
- package/dist/vega/{p-c0036e71.js → p-d2033624.js} +1 -1
- package/dist/vega/{p-74a77cad.js → p-d466baf7.js} +1 -1
- package/dist/vega/p-d4719c14.entry.js +1 -0
- package/dist/vega/{p-82dbff54.entry.js → p-d4e35d2e.entry.js} +1 -1
- 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-676eaf3f.entry.js → p-dd5d917b.entry.js} +1 -1
- package/dist/vega/{p-5be29f14.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-a5d4d168.entry.js → p-e788598a.entry.js} +1 -1
- package/dist/vega/{p-6b9d2996.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-9b673fd4.entry.js → p-f6eab527.entry.js} +1 -1
- package/dist/vega/{p-c7f292dd.entry.js → p-fa34ace2.entry.js} +1 -1
- package/dist/vega/p-fbfb4c70.entry.js +1 -0
- package/dist/vega/p-fcabf0dc.js +1 -0
- package/dist/vega/{p-8bd496b4.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 +1 -1
- package/style/vega-icons.css +17266 -0
- package/dist/cjs/function-extension-78ec27e0.js +0 -2927
- package/dist/esm/function-extension-8b06c6f8.js +0 -2908
- package/dist/vega/p-03e16a05.entry.js +0 -1
- package/dist/vega/p-0ad59141.entry.js +0 -1
- package/dist/vega/p-0ba0f83d.entry.js +0 -1
- package/dist/vega/p-114c6df8.entry.js +0 -1
- package/dist/vega/p-1e019406.js +0 -1
- package/dist/vega/p-1faef917.entry.js +0 -1
- package/dist/vega/p-21cba83b.entry.js +0 -1
- package/dist/vega/p-21e7808a.entry.js +0 -1
- package/dist/vega/p-2b20a215.entry.js +0 -1
- package/dist/vega/p-2bc4f7d9.entry.js +0 -1
- package/dist/vega/p-2e0deef6.js +0 -1
- package/dist/vega/p-2f592078.entry.js +0 -1
- package/dist/vega/p-38ed3d59.entry.js +0 -1
- package/dist/vega/p-3938880f.entry.js +0 -1
- package/dist/vega/p-398220f5.entry.js +0 -1
- package/dist/vega/p-40561fa0.entry.js +0 -1
- package/dist/vega/p-42a283b5.entry.js +0 -1
- package/dist/vega/p-524ffc12.entry.js +0 -1
- package/dist/vega/p-59fa3f68.js +0 -1
- package/dist/vega/p-5b71c85e.js +0 -1
- package/dist/vega/p-5f09868d.entry.js +0 -1
- package/dist/vega/p-6e701542.entry.js +0 -1
- package/dist/vega/p-70b2906a.entry.js +0 -1
- package/dist/vega/p-721b2981.entry.js +0 -1
- package/dist/vega/p-75d91ee9.entry.js +0 -1
- package/dist/vega/p-79a544d6.js +0 -1
- package/dist/vega/p-7b337fd4.entry.js +0 -1
- package/dist/vega/p-7be3aefc.entry.js +0 -1
- package/dist/vega/p-94cf46ca.entry.js +0 -1
- package/dist/vega/p-a125cfec.entry.js +0 -1
- package/dist/vega/p-a3c4fa30.entry.js +0 -1
- package/dist/vega/p-aab0deab.js +0 -1
- package/dist/vega/p-adc615a4.entry.js +0 -1
- package/dist/vega/p-b007d0d5.entry.js +0 -1
- package/dist/vega/p-b406a846.entry.js +0 -1
- package/dist/vega/p-bd60c72e.entry.js +0 -1
- package/dist/vega/p-bf61d136.js +0 -1
- package/dist/vega/p-c2ac6b47.entry.js +0 -1
- package/dist/vega/p-c4700277.entry.js +0 -1
- package/dist/vega/p-ce2ffff7.js +0 -1
- package/dist/vega/p-d01fe83d.entry.js +0 -1
- package/dist/vega/p-db62b038.entry.js +0 -1
- package/dist/vega/p-dd72ad9e.js +0 -1
- package/dist/vega/p-e39aa2ea.entry.js +0 -1
- package/dist/vega/p-f3831dc9.entry.js +0 -1
- package/dist/vega/p-f427d88c.entry.js +0 -1
|
@@ -0,0 +1,1508 @@
|
|
|
1
|
+
import { b as MapToComponentField, V as VegaSlimmer, a as InjectVegaSlimmer, L as LogUtility, c as createDynamicSlimmer, m as methodPlaceholder, M as MapToComponentMethod } from './vega-slimmer-core-83fd0e22.js';
|
|
2
|
+
import { f as findParent, c as isElementVisible, b as isParent } from './ui-5f775fd9.js';
|
|
3
|
+
import { I as InternalVegaZIndexManager } from './internal-vega-z-index-manager-f0ca0975.js';
|
|
4
|
+
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-ee8774a6.js';
|
|
5
|
+
import { P as Placements, A as Alignments } from './ui-189dae23.js';
|
|
6
|
+
import { J as isTranslocationType } from './type-guard-09acedc9.js';
|
|
7
|
+
import { r as responsiveFormatFacade } from './responsive-format-facade-98596535.js';
|
|
8
|
+
import { C as ChangeManager } from './change-manager-b115783e.js';
|
|
9
|
+
import { S as SHADOW_ROOT_ELEMENT_SCROLLING } from './static-subject-title-6fdf8c8b.js';
|
|
10
|
+
import { O as Observer } from './observer-3959f9dd.js';
|
|
11
|
+
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-5798693b.js';
|
|
12
|
+
import { t as VegaInternalNestEAHierarchyTreeChange } from './vega-internal-event-id-b65a01a3.js';
|
|
13
|
+
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-3b49c6b3.js';
|
|
14
|
+
|
|
15
|
+
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
+
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;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* This class is is used to retrieve the body element of document.
|
|
23
|
+
*/
|
|
24
|
+
class DefaultWrapper {
|
|
25
|
+
/**
|
|
26
|
+
* The canRetrieve function return is always true.
|
|
27
|
+
*
|
|
28
|
+
* @returns {boolean} the boolean type.
|
|
29
|
+
*/
|
|
30
|
+
canRetrieve() {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The retrieve function get the body element of document.
|
|
35
|
+
*
|
|
36
|
+
* @returns {HTMLElement} the element.
|
|
37
|
+
*/
|
|
38
|
+
retrieve() {
|
|
39
|
+
// eslint-disable-next-line no-restricted-globals
|
|
40
|
+
const container = document.body;
|
|
41
|
+
if (this.showConfig.appendableElement.parentElement !== container) {
|
|
42
|
+
container.append(this.showConfig.appendableElement);
|
|
43
|
+
}
|
|
44
|
+
return container;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__decorate$a([
|
|
48
|
+
MapToComponentField()
|
|
49
|
+
], DefaultWrapper.prototype, "showConfig", void 0);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Body positioned wrapper.
|
|
53
|
+
*/
|
|
54
|
+
class BodyPositionedWrapper {
|
|
55
|
+
/**
|
|
56
|
+
* Valid is a body position used wrapper.
|
|
57
|
+
*
|
|
58
|
+
* @returns {boolean} can retrieve or not.
|
|
59
|
+
*/
|
|
60
|
+
canRetrieve() {
|
|
61
|
+
return !this.showConfig.isScreenPosition;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
66
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
67
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
68
|
+
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;
|
|
69
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* This class is is used to retrieve an HTML element based on a specified selector.
|
|
73
|
+
*
|
|
74
|
+
* @property {HTMLElement} showConfig the show config
|
|
75
|
+
*/
|
|
76
|
+
class PositionRelativeToWrapper extends BodyPositionedWrapper {
|
|
77
|
+
/**
|
|
78
|
+
* The canRetrieve function just determines whether the showConfig contains the positionRelativeTo object.
|
|
79
|
+
*
|
|
80
|
+
* @returns {boolean} the boolean type.
|
|
81
|
+
*/
|
|
82
|
+
canRetrieve() {
|
|
83
|
+
return (super.canRetrieve() &&
|
|
84
|
+
!!this.showConfig.positionRelativeTo &&
|
|
85
|
+
// eslint-disable-next-line no-restricted-globals
|
|
86
|
+
!!document.querySelector(this.showConfig.positionRelativeTo));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The retrieve function query the element of positionRelativeTo in showConfig.
|
|
90
|
+
*
|
|
91
|
+
* @returns {HTMLElement} the element.
|
|
92
|
+
*/
|
|
93
|
+
retrieve() {
|
|
94
|
+
// eslint-disable-next-line no-restricted-globals
|
|
95
|
+
const container = document.querySelector(this.showConfig.positionRelativeTo);
|
|
96
|
+
if (this.showConfig.appendableElement.parentElement !== container) {
|
|
97
|
+
container.append(this.showConfig.appendableElement);
|
|
98
|
+
}
|
|
99
|
+
return container;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
__decorate$9([
|
|
103
|
+
MapToComponentField()
|
|
104
|
+
], PositionRelativeToWrapper.prototype, "showConfig", void 0);
|
|
105
|
+
|
|
106
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
107
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
108
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
109
|
+
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;
|
|
110
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* This class is is used to get vega-modal element as a container and store the element appender element to slot.
|
|
114
|
+
*
|
|
115
|
+
* @property {HTMLElement} showConfig the show config
|
|
116
|
+
*/
|
|
117
|
+
class VegaModalWrapper extends BodyPositionedWrapper {
|
|
118
|
+
/**
|
|
119
|
+
* The canRetrieve function just determines whether the target of showConfig has the `vega-modal` element. If not, search upwards layer by layer.
|
|
120
|
+
*
|
|
121
|
+
* @returns {boolean} the boolean type.
|
|
122
|
+
*/
|
|
123
|
+
canRetrieve() {
|
|
124
|
+
return super.canRetrieve() && !!findParent(this.showConfig.target, 'vega-modal');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The retrieve function get the slot position of vega-modal element.
|
|
128
|
+
*
|
|
129
|
+
* @returns {HTMLElement} the element.
|
|
130
|
+
*/
|
|
131
|
+
retrieve() {
|
|
132
|
+
return this.getVegaModalShowConfigContainer();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* This function `getVegaModalContentWithoutScroll` determines whether vega-modal has a slot whose name is `content` or `modal-content`. If there is a component rendered in the modal, the elementAppender added to the corresponding slot attribute is added. If not, the elementAppender is not directly appended to the root directory of vega-modal.
|
|
136
|
+
*
|
|
137
|
+
* @param {Nullable<HTMLElement>} parentModal The parentModal is vega-modal element.
|
|
138
|
+
* @param {Nullable<HTMLElement>} element The parentModal is vega-modal element.
|
|
139
|
+
*/
|
|
140
|
+
setElementSlot(parentModal, element) {
|
|
141
|
+
var _a;
|
|
142
|
+
const slotName = (_a = Array.from(parentModal.children)
|
|
143
|
+
.find((item) => {
|
|
144
|
+
const slotName = item.getAttribute('slot');
|
|
145
|
+
return slotName && ['content', 'modal-content'].includes(slotName);
|
|
146
|
+
})) === null || _a === void 0 ? void 0 : _a.getAttribute('slot');
|
|
147
|
+
if (slotName) {
|
|
148
|
+
element.setAttribute('slot', slotName);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The function "getShowConfigContainer" returns the appended element container. If the modal content can be scrolled, the container is the div element that wraps the append element. Otherwise, the container is the modal dialog itself.
|
|
153
|
+
*
|
|
154
|
+
* @returns {HTMLElement} the `scrollContainer` element.
|
|
155
|
+
*/
|
|
156
|
+
getVegaModalShowConfigContainer() {
|
|
157
|
+
const parentModal = findParent(this.showConfig.target, 'vega-modal');
|
|
158
|
+
const modalContentScrollable = parentModal.shadowRoot.querySelector('.vega-modal-content-with-scroll');
|
|
159
|
+
const modalDialog = parentModal.shadowRoot.querySelector('.modal-dialog');
|
|
160
|
+
this.setElementSlot(parentModal, this.showConfig.appendableElement);
|
|
161
|
+
parentModal.append(this.showConfig.appendableElement);
|
|
162
|
+
return modalContentScrollable ? modalContentScrollable : modalDialog;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
__decorate$8([
|
|
166
|
+
MapToComponentField({ writable: true })
|
|
167
|
+
], VegaModalWrapper.prototype, "showConfig", void 0);
|
|
168
|
+
|
|
169
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
170
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
171
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
172
|
+
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;
|
|
173
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* This class is used to get the class `vega-popover` as a container and store the element appender element.
|
|
177
|
+
*
|
|
178
|
+
* @property {HTMLElement} showConfig the show config
|
|
179
|
+
*/
|
|
180
|
+
class VegaPopoverWrapper extends BodyPositionedWrapper {
|
|
181
|
+
/**
|
|
182
|
+
* The canRetrieve function just determine whether the target of showConfig has the class `vega-popover`. If not, search upwards layer by layer.
|
|
183
|
+
*
|
|
184
|
+
* @returns {boolean} the boolean type.
|
|
185
|
+
*/
|
|
186
|
+
canRetrieve() {
|
|
187
|
+
return super.canRetrieve() && !!findParent(this.showConfig.target, '.vega-popover');
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The retrieve function get the element that if the target of showConfig does not have the class vega-popover, search upwards layer by layer until this element is found.
|
|
191
|
+
*
|
|
192
|
+
* @returns {HTMLElement} the element.
|
|
193
|
+
*/
|
|
194
|
+
retrieve() {
|
|
195
|
+
const container = findParent(this.showConfig.target, '.vega-popover');
|
|
196
|
+
container.append(this.showConfig.appendableElement);
|
|
197
|
+
return container;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
__decorate$7([
|
|
201
|
+
MapToComponentField()
|
|
202
|
+
], VegaPopoverWrapper.prototype, "showConfig", void 0);
|
|
203
|
+
|
|
204
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
205
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
206
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
207
|
+
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;
|
|
208
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* This class is responsible for setting the container element for appending an element based on certain conditions.
|
|
212
|
+
*
|
|
213
|
+
* @property {HTMLElement} container the container
|
|
214
|
+
* @property {HTMLElement} showConfig the show config
|
|
215
|
+
*/
|
|
216
|
+
class ElementAppenderContainerController extends VegaSlimmer {
|
|
217
|
+
constructor() {
|
|
218
|
+
super(...arguments);
|
|
219
|
+
this.positionRelativeToWrapper = new PositionRelativeToWrapper();
|
|
220
|
+
this.vegaPopoverWrapper = new VegaPopoverWrapper();
|
|
221
|
+
this.vegaModalWrapper = new VegaModalWrapper();
|
|
222
|
+
this.defaultWrapper = new DefaultWrapper();
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The function sets the container element by iterating through a list of retrievers, defaulting to the document body.
|
|
226
|
+
*/
|
|
227
|
+
setContainer() {
|
|
228
|
+
this.setContainerRetrievers();
|
|
229
|
+
for (const retriever of this.containerRetrievers) {
|
|
230
|
+
if (retriever.canRetrieve()) {
|
|
231
|
+
this.container = retriever.retrieve();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The function sets up an array of container retrievers based on certain conditions.
|
|
238
|
+
*/
|
|
239
|
+
setContainerRetrievers() {
|
|
240
|
+
this.containerRetrievers = [
|
|
241
|
+
this.positionRelativeToWrapper,
|
|
242
|
+
this.vegaPopoverWrapper,
|
|
243
|
+
this.vegaModalWrapper,
|
|
244
|
+
this.defaultWrapper,
|
|
245
|
+
];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
__decorate$6([
|
|
249
|
+
MapToComponentField({ writable: true })
|
|
250
|
+
], ElementAppenderContainerController.prototype, "container", void 0);
|
|
251
|
+
__decorate$6([
|
|
252
|
+
MapToComponentField({ writable: true })
|
|
253
|
+
], ElementAppenderContainerController.prototype, "showConfig", void 0);
|
|
254
|
+
__decorate$6([
|
|
255
|
+
InjectVegaSlimmer()
|
|
256
|
+
], ElementAppenderContainerController.prototype, "positionRelativeToWrapper", void 0);
|
|
257
|
+
__decorate$6([
|
|
258
|
+
InjectVegaSlimmer()
|
|
259
|
+
], ElementAppenderContainerController.prototype, "vegaPopoverWrapper", void 0);
|
|
260
|
+
__decorate$6([
|
|
261
|
+
InjectVegaSlimmer()
|
|
262
|
+
], ElementAppenderContainerController.prototype, "vegaModalWrapper", void 0);
|
|
263
|
+
__decorate$6([
|
|
264
|
+
InjectVegaSlimmer()
|
|
265
|
+
], ElementAppenderContainerController.prototype, "defaultWrapper", void 0);
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* calculate position
|
|
269
|
+
*/
|
|
270
|
+
class BasePositionCalculationStrategy extends VegaSlimmer {
|
|
271
|
+
/**
|
|
272
|
+
* Get the position box.
|
|
273
|
+
*
|
|
274
|
+
* @param {PlacementType[]} placement - previous placement.
|
|
275
|
+
* @param {PositionAlignmentType[]} alignment - previous placement.
|
|
276
|
+
* @returns {ElementPositionBox} A function that takes in a container, element, target, placement, and translocation and
|
|
277
|
+
* returns an ElementPositionBox.
|
|
278
|
+
*/
|
|
279
|
+
getPositionBox(placement, alignment) {
|
|
280
|
+
const placements = placement || this.getPlacements();
|
|
281
|
+
const alignments = alignment || this.getAlignments();
|
|
282
|
+
const targetBox = this.getTargetBoundBox();
|
|
283
|
+
const elementBox = this.getElementBoundBox();
|
|
284
|
+
const containerBox = this.getElementScrollDimension();
|
|
285
|
+
const suitablePlacement = this.getSuitablePlacement(containerBox, elementBox, targetBox, placements);
|
|
286
|
+
const suitableAlignment = this.getSuitableAlignment(containerBox, elementBox, targetBox, suitablePlacement, alignments);
|
|
287
|
+
const positionBox = this.calculatePosition(elementBox, targetBox, suitablePlacement, suitableAlignment);
|
|
288
|
+
const translocationBox = this.getTranslocationBox(suitablePlacement);
|
|
289
|
+
positionBox.placement = suitablePlacement;
|
|
290
|
+
positionBox.alignment = suitableAlignment;
|
|
291
|
+
positionBox.left += translocationBox.X;
|
|
292
|
+
positionBox.top += translocationBox.Y;
|
|
293
|
+
return positionBox;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* "Get the width, height, and top position of an element."
|
|
297
|
+
*
|
|
298
|
+
* The function takes an element as an argument and returns an object with three properties: width,
|
|
299
|
+
* height, and top.
|
|
300
|
+
*
|
|
301
|
+
* Note: If element is hide, we should temporary change it to `block` to get the bounding client rect of element,
|
|
302
|
+
* After do that, this element will change to origin `hide`, if not, it will be contained in the calculate of `document.documentElement.scrollHeight`
|
|
303
|
+
*
|
|
304
|
+
* @returns {ElementBoundBox} An object with the width, height, and top properties of the element.
|
|
305
|
+
*/
|
|
306
|
+
getElementBoundBox() {
|
|
307
|
+
const element = this.showConfig.appendableElement;
|
|
308
|
+
const isElementHide = element.classList.contains('vega-force-hidden');
|
|
309
|
+
if (isElementHide)
|
|
310
|
+
element.classList.remove('vega-force-hidden');
|
|
311
|
+
const elementRect = element.getBoundingClientRect();
|
|
312
|
+
if (isElementHide)
|
|
313
|
+
element.classList.add('vega-force-hidden');
|
|
314
|
+
return {
|
|
315
|
+
width: elementRect.width,
|
|
316
|
+
height: elementRect.height,
|
|
317
|
+
left: elementRect.left,
|
|
318
|
+
top: elementRect.top,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* It takes a placement string or array of placements and returns an array of placements
|
|
323
|
+
* if given placement is single, we should completion the placements with the default {@link Placements}
|
|
324
|
+
* and make given placement as default.
|
|
325
|
+
* if given placement is array, we should use it directly, even it partial of {@link Placements}.
|
|
326
|
+
* if not placement give. we should use {@link Placements}.
|
|
327
|
+
*
|
|
328
|
+
* @returns {PlacementType[]} ordered placements.
|
|
329
|
+
*/
|
|
330
|
+
getPlacements() {
|
|
331
|
+
const placement = this.showConfig.placement;
|
|
332
|
+
if (typeof placement === 'string') {
|
|
333
|
+
const partial = Placements.filter((direction) => direction !== placement);
|
|
334
|
+
return [placement, ...partial];
|
|
335
|
+
}
|
|
336
|
+
else if (Array.isArray(placement)) {
|
|
337
|
+
return placement;
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
return [...Placements];
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* It returns acceptable alignments.
|
|
345
|
+
*
|
|
346
|
+
* @returns {PositionAlignmentType[]} acceptable alignments
|
|
347
|
+
*/
|
|
348
|
+
getAlignments() {
|
|
349
|
+
const alignment = this.showConfig.alignment;
|
|
350
|
+
if (typeof alignment === 'string') {
|
|
351
|
+
const partial = Alignments.filter((item) => item !== alignment);
|
|
352
|
+
return [alignment, ...partial];
|
|
353
|
+
}
|
|
354
|
+
else if (Array.isArray(alignment)) {
|
|
355
|
+
return alignment;
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
return [...Alignments];
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* It takes a placement, a target box, and a element box, and returns an element box
|
|
363
|
+
*
|
|
364
|
+
* @param {ElementBoundBox} elementBox - The position of the element element.
|
|
365
|
+
* @param {ElementBoundBox} targetBox - The position of the target element.
|
|
366
|
+
* @param {PlacementType} placement - The placement of the element.
|
|
367
|
+
* @param {PositionAlignmentType} alignment - The alignment of the element
|
|
368
|
+
* @returns {ElementPositionBox} An object with top and left properties.
|
|
369
|
+
*/
|
|
370
|
+
calculatePosition(elementBox, targetBox, placement, alignment) {
|
|
371
|
+
return {
|
|
372
|
+
top: this.calculateTop(elementBox, targetBox, placement, alignment),
|
|
373
|
+
left: this.calculateLeft(elementBox, targetBox, placement, alignment),
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* It returns the translocation of the element relative to the target element
|
|
378
|
+
*
|
|
379
|
+
* @param {PlacementType} placement - The suitable placement of the element.
|
|
380
|
+
* @returns {TranslocationType} A translocation object with X and Y properties.
|
|
381
|
+
*/
|
|
382
|
+
getTranslocationBox(placement) {
|
|
383
|
+
const originPlacement = Array.isArray(this.showConfig.placement)
|
|
384
|
+
? this.showConfig.placement[0]
|
|
385
|
+
: this.showConfig.placement;
|
|
386
|
+
const translocation = this.getTranslocation();
|
|
387
|
+
const result = { X: 0, Y: 0 };
|
|
388
|
+
if (isTranslocationType(translocation)) {
|
|
389
|
+
let xValue = translocation.X;
|
|
390
|
+
let yValue = translocation.Y;
|
|
391
|
+
// If originPlacement and placement is not in same axis, it should reverse axis.
|
|
392
|
+
if ((originPlacement &&
|
|
393
|
+
['left', 'right'].includes(originPlacement) &&
|
|
394
|
+
['top', 'bottom'].includes(placement)) ||
|
|
395
|
+
(originPlacement &&
|
|
396
|
+
['top', 'bottom'].includes(originPlacement) &&
|
|
397
|
+
['left', 'right'].includes(placement))) {
|
|
398
|
+
xValue = translocation.Y;
|
|
399
|
+
yValue = translocation.X;
|
|
400
|
+
}
|
|
401
|
+
if (['bottom', 'top'].includes(placement)) {
|
|
402
|
+
result.Y = placement === 'top' ? -yValue : yValue;
|
|
403
|
+
result.X = xValue;
|
|
404
|
+
}
|
|
405
|
+
if (['left', 'right'].includes(placement)) {
|
|
406
|
+
result.X = placement === 'left' ? -xValue : xValue;
|
|
407
|
+
result.Y = yValue;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return result;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Calculate the left position of the element
|
|
414
|
+
*
|
|
415
|
+
* @param {ElementBoundBox} elementBox - The position box of the element.
|
|
416
|
+
* @param {ElementBoundBox} targetBox - The position box of the target element that is attached to.
|
|
417
|
+
* @param {PlacementType} placement - The placement of the element.
|
|
418
|
+
* @param {PositionAlignmentType} alignment - The alignment of the element
|
|
419
|
+
* @returns {number} The left position of the element.
|
|
420
|
+
*/
|
|
421
|
+
calculateLeft(elementBox, targetBox, placement, alignment) {
|
|
422
|
+
switch (placement) {
|
|
423
|
+
case 'top':
|
|
424
|
+
case 'bottom': {
|
|
425
|
+
if (alignment === 'end') {
|
|
426
|
+
return targetBox.left + targetBox.width - elementBox.width;
|
|
427
|
+
}
|
|
428
|
+
else if (alignment === 'center') {
|
|
429
|
+
return targetBox.left - (elementBox.width - targetBox.width) / 2;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
return targetBox.left;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
case 'left': {
|
|
436
|
+
return targetBox.left - elementBox.width;
|
|
437
|
+
}
|
|
438
|
+
case 'right': {
|
|
439
|
+
return targetBox.left + targetBox.width;
|
|
440
|
+
}
|
|
441
|
+
/* istanbul ignore next */
|
|
442
|
+
default:
|
|
443
|
+
throw new Error(`Unexpected placement: ${placement}. Expected values are top, bottom, left, or right.`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Calculate the top position of the element
|
|
448
|
+
*
|
|
449
|
+
* @param {ElementBoundBox} elementBox - The position box of the element.
|
|
450
|
+
* @param {ElementBoundBox} targetBox - The position box of the target element that is attached to.
|
|
451
|
+
* @param {PlacementType} placement - The placement of the element.
|
|
452
|
+
* @param {PositionAlignmentType} alignment - The alignment of the element
|
|
453
|
+
* @returns {number} the top position of the element.
|
|
454
|
+
*/
|
|
455
|
+
calculateTop(elementBox, targetBox, placement, alignment) {
|
|
456
|
+
switch (placement) {
|
|
457
|
+
case 'left':
|
|
458
|
+
case 'right': {
|
|
459
|
+
if (alignment === 'end') {
|
|
460
|
+
return targetBox.top + targetBox.height - elementBox.height;
|
|
461
|
+
}
|
|
462
|
+
else if (alignment === 'center') {
|
|
463
|
+
return targetBox.top - (elementBox.height - targetBox.height) / 2;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
return targetBox.top;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
case 'top': {
|
|
470
|
+
return targetBox.top - elementBox.height;
|
|
471
|
+
}
|
|
472
|
+
case 'bottom': {
|
|
473
|
+
return targetBox.top + targetBox.height;
|
|
474
|
+
}
|
|
475
|
+
/* istanbul ignore next */
|
|
476
|
+
default:
|
|
477
|
+
throw new Error(`Unexpected placement: ${placement}. Expected values are top, bottom, left, or right.`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* It takes a list of placements and returns the first placement that has enough space to place the
|
|
482
|
+
* element
|
|
483
|
+
*
|
|
484
|
+
* @param {ElementScrollDimension} containerBox - The box of the container element.
|
|
485
|
+
* @param {ElementBoundBox} elementBox - The box of the element to be placed.
|
|
486
|
+
* @param {ElementBoundBox} targetBox - The box of the target element.
|
|
487
|
+
* @param {PlacementType[]} placements - The placements that we want to try.
|
|
488
|
+
* @returns {PlacementType} A function that takes in a containerBox, elementBox, targetBox, placements, and element.
|
|
489
|
+
*/
|
|
490
|
+
getSuitablePlacement(containerBox, elementBox, targetBox, placements) {
|
|
491
|
+
const defaultPlacement = placements[0];
|
|
492
|
+
const suitablePlacement = placements.find((placement) => this.hasEnoughSpace(containerBox, placement, targetBox, elementBox));
|
|
493
|
+
if (suitablePlacement) {
|
|
494
|
+
return suitablePlacement;
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
LogUtility.warn(`
|
|
498
|
+
No enough space found for placing element and we will keep using the defined placement:
|
|
499
|
+
${defaultPlacement}
|
|
500
|
+
`);
|
|
501
|
+
return defaultPlacement;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* It takes a list of alignments and returns the suitable one that has enough space to fit the element
|
|
506
|
+
*
|
|
507
|
+
* @param {ElementScrollDimension} containerBox - The bounding box of the container element.
|
|
508
|
+
* @param {ElementBoundBox} elementBox - The box of the element that we want to position.
|
|
509
|
+
* @param {ElementBoundBox} targetBox - The box of the element that the element to be positioned is aligned to.
|
|
510
|
+
* @param {PlacementType} placement - The placement of the element relative to the target.
|
|
511
|
+
* @param {PositionAlignmentType[]} alignments - An array of alignments to try.
|
|
512
|
+
* @returns {PositionAlignmentType} the alignment that is suitable for the element.
|
|
513
|
+
*/
|
|
514
|
+
getSuitableAlignment(containerBox, elementBox, targetBox, placement, alignments) {
|
|
515
|
+
const defaultAlignment = alignments[0];
|
|
516
|
+
const suitableAlignment = alignments.find((alignment) => this.hasEnoughAlignmentSpace(containerBox, targetBox, elementBox, placement, alignment));
|
|
517
|
+
if (suitableAlignment) {
|
|
518
|
+
return suitableAlignment;
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
LogUtility.warn(`
|
|
522
|
+
No enough space found for placing element and we will keep using the defined alignment:
|
|
523
|
+
${defaultAlignment}
|
|
524
|
+
`);
|
|
525
|
+
return defaultAlignment;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Whether the alignment space is enough
|
|
530
|
+
*
|
|
531
|
+
* @param {ElementScrollDimension} containerBox - The bounding box of the container element.
|
|
532
|
+
* @param {ElementBoundBox} targetBox - The position of the target element.
|
|
533
|
+
* @param {ElementBoundBox} elementBox - The box of the element that we're trying to position.
|
|
534
|
+
* @param {PlacementType} placement - The placement of the element relative to the target.
|
|
535
|
+
* @param {PlacementType} alignment - The alignment of the element relative to the target.
|
|
536
|
+
* @returns {boolean} return true if it has enough space, otherwise false
|
|
537
|
+
*/
|
|
538
|
+
hasEnoughAlignmentSpace(containerBox, targetBox, elementBox, placement, alignment) {
|
|
539
|
+
if (['top', 'bottom'].includes(placement)) {
|
|
540
|
+
switch (alignment) {
|
|
541
|
+
case 'start': {
|
|
542
|
+
return targetBox.left + elementBox.width <= containerBox.width;
|
|
543
|
+
}
|
|
544
|
+
case 'center': {
|
|
545
|
+
return (targetBox.left >= (elementBox.width - targetBox.width) / 2 &&
|
|
546
|
+
targetBox.left + targetBox.width / 2 + elementBox.width / 2 <= containerBox.width);
|
|
547
|
+
}
|
|
548
|
+
case 'end': {
|
|
549
|
+
return targetBox.left + targetBox.width >= elementBox.width;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (['right', 'left'].includes(placement)) {
|
|
554
|
+
switch (alignment) {
|
|
555
|
+
case 'start': {
|
|
556
|
+
return targetBox.top + elementBox.height <= containerBox.height;
|
|
557
|
+
}
|
|
558
|
+
case 'center': {
|
|
559
|
+
return (targetBox.top >= (elementBox.height - targetBox.height) / 2 &&
|
|
560
|
+
targetBox.top + targetBox.height / 2 + elementBox.height / 2 <= containerBox.height);
|
|
561
|
+
}
|
|
562
|
+
case 'end': {
|
|
563
|
+
return targetBox.top + targetBox.height >= elementBox.height;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/* istanbul ignore next */
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* If the placement is top or left, then the target's top or left position must be greater than or
|
|
572
|
+
* equal to the element's height or width. If the placement is bottom or right, then the container's
|
|
573
|
+
* height or width minus the target's top or left position minus the target's height or width must be
|
|
574
|
+
* greater than or equal to the element's height or width.
|
|
575
|
+
*
|
|
576
|
+
* @param {ElementScrollDimension} containerBox - The bounding box of the container element.
|
|
577
|
+
* @param {PlacementType} placement - The placement of the element.
|
|
578
|
+
* @param {ElementBoundBox} targetBox - The position of the target element.
|
|
579
|
+
* @param {ElementBoundBox} elementBox - The dimensions of the element to be positioned.
|
|
580
|
+
* @returns {boolean} A boolean value.
|
|
581
|
+
*/
|
|
582
|
+
hasEnoughSpace(containerBox, placement, targetBox, elementBox) {
|
|
583
|
+
switch (placement) {
|
|
584
|
+
case 'top':
|
|
585
|
+
return targetBox.top >= elementBox.height;
|
|
586
|
+
case 'bottom':
|
|
587
|
+
return containerBox.height - targetBox.top - targetBox.height >= elementBox.height;
|
|
588
|
+
case 'left':
|
|
589
|
+
return targetBox.left >= elementBox.width;
|
|
590
|
+
case 'right':
|
|
591
|
+
return containerBox.width - targetBox.left - targetBox.width >= elementBox.width;
|
|
592
|
+
/* istanbul ignore next */
|
|
593
|
+
default:
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Retrieves and formats the translocation.
|
|
599
|
+
*
|
|
600
|
+
* @returns {Nullable<TranslocationType>} current translocation.
|
|
601
|
+
*/
|
|
602
|
+
getTranslocation() {
|
|
603
|
+
const translocation = this.showConfig.translocation;
|
|
604
|
+
return translocation && responsiveFormatFacade.format(translocation, 'translocation');
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
609
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
610
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
611
|
+
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;
|
|
612
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
613
|
+
};
|
|
614
|
+
/**
|
|
615
|
+
* calculate position by body container
|
|
616
|
+
*/
|
|
617
|
+
class BodyPositionCalculationStrategy extends BasePositionCalculationStrategy {
|
|
618
|
+
/**
|
|
619
|
+
* Get the position of the element in the container according to the target element and the placement
|
|
620
|
+
* If give a translocation, it will apply the translocation to the result.
|
|
621
|
+
* Note: If you use this method to calculate the position, you should make container as relative position at first.
|
|
622
|
+
*
|
|
623
|
+
* @returns {ElementPositionBox} A function that takes in a container, element, target, placement, and translocation and
|
|
624
|
+
* returns an ElementPositionBox.
|
|
625
|
+
*/
|
|
626
|
+
getPosition() {
|
|
627
|
+
const containerStyle = window.getComputedStyle(this.container);
|
|
628
|
+
if (containerStyle.position !== 'relative') {
|
|
629
|
+
LogUtility.warn(`Calculate position should make container as 'position: relative', otherwise the result might not be accurate.`);
|
|
630
|
+
}
|
|
631
|
+
return this.getPositionBox();
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* It returns the position of an element relative to its container and also includes the scroll height of container.
|
|
635
|
+
*
|
|
636
|
+
* @returns {ElementBoundBox} An object with the properties width, height, top, and left.
|
|
637
|
+
*/
|
|
638
|
+
getTargetBoundBox() {
|
|
639
|
+
const containerRect = this.container.getBoundingClientRect();
|
|
640
|
+
const targetRect = this.showConfig.target.getBoundingClientRect();
|
|
641
|
+
const targetTop = targetRect.top - containerRect.top + this.container.scrollTop;
|
|
642
|
+
const targetLeft = targetRect.left - containerRect.left + this.container.scrollLeft;
|
|
643
|
+
return {
|
|
644
|
+
width: targetRect.width,
|
|
645
|
+
height: targetRect.height,
|
|
646
|
+
top: targetTop,
|
|
647
|
+
left: targetLeft,
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* "Get the width and height of an element."
|
|
652
|
+
*
|
|
653
|
+
* The function takes a single parameter, a container element, and returns an object with two
|
|
654
|
+
* properties: width and height
|
|
655
|
+
*
|
|
656
|
+
* @returns {ElementScrollDimension} An object with two properties: width and height.
|
|
657
|
+
*/
|
|
658
|
+
getElementScrollDimension() {
|
|
659
|
+
return {
|
|
660
|
+
width: this.container.scrollWidth,
|
|
661
|
+
height: this.container.scrollHeight,
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
__decorate$5([
|
|
666
|
+
MapToComponentField()
|
|
667
|
+
], BodyPositionCalculationStrategy.prototype, "container", void 0);
|
|
668
|
+
__decorate$5([
|
|
669
|
+
MapToComponentField()
|
|
670
|
+
], BodyPositionCalculationStrategy.prototype, "showConfig", void 0);
|
|
671
|
+
|
|
672
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
673
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
674
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
675
|
+
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;
|
|
676
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
* calculate position by screen container
|
|
680
|
+
*/
|
|
681
|
+
class ScreenPositionCalculationStrategy extends BasePositionCalculationStrategy {
|
|
682
|
+
/**
|
|
683
|
+
* Get the position of the element in the container according to the target element and the placement
|
|
684
|
+
* If give a translocation, it will apply the translocation to the result.
|
|
685
|
+
*
|
|
686
|
+
* @param {boolean} usePreviousPlacement - Should keep use previous placement and alignment.
|
|
687
|
+
* @returns {ElementPositionBox} A function that takes in a container, element, target, placement, and translocation and
|
|
688
|
+
* returns an ElementPositionBox.
|
|
689
|
+
*/
|
|
690
|
+
getPosition(usePreviousPlacement) {
|
|
691
|
+
const positionBox = usePreviousPlacement
|
|
692
|
+
? this.getPositionBox([this.previousPositionBox.placement], [this.previousPositionBox.alignment])
|
|
693
|
+
: this.getPositionBox();
|
|
694
|
+
this.previousPositionBox = positionBox;
|
|
695
|
+
return positionBox;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* It returns the position of an element relative to its container and also includes the scroll height of container.
|
|
699
|
+
*
|
|
700
|
+
* @returns {ElementBoundBox} An object with the properties width, height, top, and left.
|
|
701
|
+
*/
|
|
702
|
+
getTargetBoundBox() {
|
|
703
|
+
const targetRect = this.showConfig.target.getBoundingClientRect();
|
|
704
|
+
return {
|
|
705
|
+
width: targetRect.width,
|
|
706
|
+
height: targetRect.height,
|
|
707
|
+
top: targetRect.top,
|
|
708
|
+
left: targetRect.left,
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* "Get the width and height of an element."
|
|
713
|
+
*
|
|
714
|
+
* The function takes a single parameter, a container element, and returns an object with two
|
|
715
|
+
* properties: width and height
|
|
716
|
+
*
|
|
717
|
+
* @returns {ElementScrollDimension} An object with two properties: width and height.
|
|
718
|
+
*/
|
|
719
|
+
getElementScrollDimension() {
|
|
720
|
+
return {
|
|
721
|
+
width: window.innerWidth,
|
|
722
|
+
height: window.innerHeight,
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
__decorate$4([
|
|
727
|
+
MapToComponentField()
|
|
728
|
+
], ScreenPositionCalculationStrategy.prototype, "showConfig", void 0);
|
|
729
|
+
|
|
730
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
731
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
732
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
733
|
+
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;
|
|
734
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* Calculation and adjustment of positions for appendable elements based on target element positions.
|
|
738
|
+
*/
|
|
739
|
+
class PositionCalculationController extends VegaSlimmer {
|
|
740
|
+
constructor() {
|
|
741
|
+
super(...arguments);
|
|
742
|
+
this.bodyPositionStrategy = new BodyPositionCalculationStrategy();
|
|
743
|
+
this.screenPositionStrategy = new ScreenPositionCalculationStrategy();
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Sets the calculate postion strategy.
|
|
747
|
+
*/
|
|
748
|
+
setCalculationStrategy() {
|
|
749
|
+
this.positionStrategy = this.showConfig.isScreenPosition
|
|
750
|
+
? this.screenPositionStrategy
|
|
751
|
+
: this.bodyPositionStrategy;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Calculates the position and applies it to the appendable element.
|
|
755
|
+
*
|
|
756
|
+
* @param {boolean} [usePreviousPlacement] - Should keep use previous placement and alignment.
|
|
757
|
+
*/
|
|
758
|
+
adjustPosition(usePreviousPlacement) {
|
|
759
|
+
this.adjustWidth();
|
|
760
|
+
this.adjustHeight();
|
|
761
|
+
this.applyPosition(this.positionStrategy.getPosition(usePreviousPlacement));
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Apply the position to the appendable element.
|
|
765
|
+
*
|
|
766
|
+
* @param {ElementPositionBox} positionBox - position box
|
|
767
|
+
*/
|
|
768
|
+
applyPosition(positionBox) {
|
|
769
|
+
const appendableElement = this.showConfig.appendableElement;
|
|
770
|
+
// TODO: should control position style in element appender but in component level
|
|
771
|
+
// https://gethired.atlassian.net/browse/VD-7883
|
|
772
|
+
if (this.showConfig.isScreenPosition) {
|
|
773
|
+
appendableElement.style.position = 'fixed';
|
|
774
|
+
}
|
|
775
|
+
else {
|
|
776
|
+
if (appendableElement.classList.contains('date-picker-content-box')) {
|
|
777
|
+
appendableElement.style.position = 'absolute';
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
appendableElement.style.left = `${positionBox.left}px`;
|
|
781
|
+
appendableElement.style.top = `${positionBox.top}px`;
|
|
782
|
+
appendableElement.classList.remove('vega-placement-left', 'vega-placement-right', 'vega-placement-top', 'vega-placement-bottom');
|
|
783
|
+
appendableElement.classList.remove('vega-alignment-start', 'vega-alignment-center', 'vega-alignment-end');
|
|
784
|
+
appendableElement.classList.add(`vega-placement-${positionBox.placement}`);
|
|
785
|
+
appendableElement.classList.add(`vega-alignment-${positionBox.alignment}`);
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* It sets the width of the appendable element to the width of the target element if the
|
|
789
|
+
* matchTargetWidth property is true, otherwise it sets the width of the appendable element to the
|
|
790
|
+
* size property
|
|
791
|
+
*
|
|
792
|
+
* @returns {void}
|
|
793
|
+
*/
|
|
794
|
+
adjustWidth() {
|
|
795
|
+
if (this.showConfig.matchTargetWidth) {
|
|
796
|
+
const { width: hostWidth } = this.showConfig.target.getBoundingClientRect();
|
|
797
|
+
this.setRelatedWidth('width', hostWidth);
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
800
|
+
this.setRelatedWidth('width', this.showConfig.size);
|
|
801
|
+
this.setRelatedWidth('minWidth', this.showConfig.minWidth);
|
|
802
|
+
this.setRelatedWidth('maxWidth', this.showConfig.maxWidth);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* It takes a name and a value, formats the value, and then sets the style of the element
|
|
807
|
+
*
|
|
808
|
+
* @param {'width' | 'maxWidth' | 'minWidth'} name - 'width' | 'maxWidth' | 'minWidth'
|
|
809
|
+
* @param {ResponsiveType<SizeType>} value - ResponsiveType<SizeType>
|
|
810
|
+
* @returns {void}
|
|
811
|
+
*/
|
|
812
|
+
setRelatedWidth(name, value) {
|
|
813
|
+
if (!value)
|
|
814
|
+
return;
|
|
815
|
+
const formattedValue = responsiveFormatFacade.format(value, 'size');
|
|
816
|
+
if (formattedValue) {
|
|
817
|
+
this.showConfig.appendableElement.style[name] =
|
|
818
|
+
typeof formattedValue === 'number' ? `${formattedValue}px` : formattedValue;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* > If the `matchContainerHeight` property is set to `true`, then the maximum height of the dropdown
|
|
823
|
+
* is set to the height of the container minus the height of the target minus the top offset of the
|
|
824
|
+
* target
|
|
825
|
+
*
|
|
826
|
+
* @returns {void}
|
|
827
|
+
*/
|
|
828
|
+
adjustHeight() {
|
|
829
|
+
if (this.showConfig.matchContainerHeight && !this.showConfig.isScreenPosition) {
|
|
830
|
+
const { height: targetHeight } = this.showConfig.target.getBoundingClientRect();
|
|
831
|
+
let maxHeight = this.container.scrollHeight - this.showConfig.target.offsetTop - targetHeight;
|
|
832
|
+
if (this.showConfig.maxHeight) {
|
|
833
|
+
maxHeight = Math.min(maxHeight, this.showConfig.maxHeight);
|
|
834
|
+
}
|
|
835
|
+
this.showConfig.appendableElement.style.maxHeight = `${maxHeight}px`;
|
|
836
|
+
}
|
|
837
|
+
else if (this.showConfig.maxHeight) {
|
|
838
|
+
this.showConfig.appendableElement.style.maxHeight = `${this.showConfig.maxHeight}px`;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
__decorate$3([
|
|
843
|
+
MapToComponentField()
|
|
844
|
+
], PositionCalculationController.prototype, "container", void 0);
|
|
845
|
+
__decorate$3([
|
|
846
|
+
MapToComponentField()
|
|
847
|
+
], PositionCalculationController.prototype, "showConfig", void 0);
|
|
848
|
+
__decorate$3([
|
|
849
|
+
InjectVegaSlimmer()
|
|
850
|
+
], PositionCalculationController.prototype, "bodyPositionStrategy", void 0);
|
|
851
|
+
__decorate$3([
|
|
852
|
+
InjectVegaSlimmer()
|
|
853
|
+
], PositionCalculationController.prototype, "screenPositionStrategy", void 0);
|
|
854
|
+
|
|
855
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
856
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
857
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
858
|
+
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;
|
|
859
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* This class is responsible for attaching the appendable element to the host element and adjusting its position
|
|
863
|
+
*
|
|
864
|
+
* @property {HTMLElement} showConfigCallback This is the callback function that will be
|
|
865
|
+
* called when the user clicks on the "Configure" button.
|
|
866
|
+
* @property {HTMLElement} showConfigCallbackTarget he component that will be used as the
|
|
867
|
+
* target for the showConfigCallback.
|
|
868
|
+
* @property {HTMLElement} showConfig the show config
|
|
869
|
+
*/
|
|
870
|
+
class ElementAppender {
|
|
871
|
+
/**
|
|
872
|
+
* The `constructor` function is used to initialize the `showConfigCallback` and
|
|
873
|
+
* `showConfigCallbackTarget` properties of the class.
|
|
874
|
+
*
|
|
875
|
+
* @param {ShowConfigCallbackType} showConfigCallback - This is the callback function that will be
|
|
876
|
+
* called when the user clicks on the "Configure" button.
|
|
877
|
+
* @param {ComponentInterface} [showConfigCallbackTarget] - The component that will be used as the
|
|
878
|
+
* target for the showConfigCallback.
|
|
879
|
+
*/
|
|
880
|
+
constructor(showConfigCallback, showConfigCallbackTarget) {
|
|
881
|
+
var _a;
|
|
882
|
+
this.resizeObserverSlimmer = createDynamicSlimmer(ElementAppender, PageResizeObserverSlimmer, [], [
|
|
883
|
+
{ mapFrom: 'connectResizeObserver', mapTo: 'connectResizeObserver' },
|
|
884
|
+
{ mapFrom: 'disconnectResizeObserver', mapTo: 'disconnectResizeObserver' },
|
|
885
|
+
], [
|
|
886
|
+
{
|
|
887
|
+
/**
|
|
888
|
+
* The above code is defining a callback function. Inside the function,
|
|
889
|
+
* it checks if both the `target` and `appendableElement` are visible using the `isElementVisible` function.
|
|
890
|
+
* If both elements are visible, it calls three other functions: `adjustWidth`, `adjustHeight`, and `adjustPosition`.
|
|
891
|
+
* These functions are responsible for adjusting the width, height, and position of the elements respectively.
|
|
892
|
+
* The below method is e2e-test covered in @see{module:element-appender-helper-resize-callback-e2e }
|
|
893
|
+
*/
|
|
894
|
+
callback: /* istanbul ignore next */ () => {
|
|
895
|
+
// while target and appendableElement are both visible, we can adjust position.
|
|
896
|
+
// https://gethired.atlassian.net/browse/VD-1087
|
|
897
|
+
if (isElementVisible(this.showConfig.target) &&
|
|
898
|
+
isElementVisible(this.showConfig.appendableElement)) {
|
|
899
|
+
this.adjustPosition();
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
// eslint-disable-next-line jsdoc/require-jsdoc, no-restricted-globals
|
|
903
|
+
target: () => [document.body, this.showConfig.appendableElement, this.showConfig.target],
|
|
904
|
+
},
|
|
905
|
+
]);
|
|
906
|
+
this.elementAppenderContainerController = new ElementAppenderContainerController();
|
|
907
|
+
this.positionCalculationController = new PositionCalculationController();
|
|
908
|
+
this.showConfigCallback = showConfigCallback;
|
|
909
|
+
this.showConfigCallbackTarget = showConfigCallbackTarget;
|
|
910
|
+
const config = this.getShowConfig();
|
|
911
|
+
this.hideElementAppender(config.appendableElement);
|
|
912
|
+
(_a = config.appendableElement) === null || _a === void 0 ? void 0 : _a.classList.add('vega-element-appender-appendable');
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* It takes an element and appends it to the DOM, then adjusts its position and size to match the
|
|
916
|
+
* target element
|
|
917
|
+
*
|
|
918
|
+
* @returns {void} Nothing is being returned.
|
|
919
|
+
*/
|
|
920
|
+
show() {
|
|
921
|
+
this.setShowConfig();
|
|
922
|
+
if (!this.showConfig.target) {
|
|
923
|
+
LogUtility.error(`No target element found, please add it at new elementAppender.`);
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
if (!this.showConfig.appendableElement) {
|
|
927
|
+
LogUtility.error(`No appendable element found, please add it at new elementAppender.`);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
/* A function that takes no parameters and returns nothing. It sets the position of the appendable
|
|
931
|
+
element. */
|
|
932
|
+
this.prepareShow();
|
|
933
|
+
this.adjustPosition();
|
|
934
|
+
this.setZIndex();
|
|
935
|
+
this.toggleShow(true);
|
|
936
|
+
this.connectResizeObserver();
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* > If the appendable element exists, hide it
|
|
940
|
+
*/
|
|
941
|
+
hide() {
|
|
942
|
+
if (!this.showConfig)
|
|
943
|
+
return;
|
|
944
|
+
this.toggleShow(false);
|
|
945
|
+
this.resetContainerPosition();
|
|
946
|
+
InternalVegaZIndexManager.removeZIndex(this.showConfig.appendableElement, 'base');
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Update position while window scroll.
|
|
950
|
+
*/
|
|
951
|
+
onScroll() {
|
|
952
|
+
var _a;
|
|
953
|
+
const currentTargetRect = this.showConfig.target.getBoundingClientRect();
|
|
954
|
+
if (this.showConfig.isScreenPosition &&
|
|
955
|
+
(currentTargetRect.left !== ((_a = this.previousTargetRect) === null || _a === void 0 ? void 0 : _a.left) ||
|
|
956
|
+
currentTargetRect.top !== this.previousTargetRect.top)) {
|
|
957
|
+
this.adjustPosition(true);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
/* istanbul ignore next */
|
|
961
|
+
/**
|
|
962
|
+
* It removes the z-index from the appendable element, removes the appendable element from the DOM, and
|
|
963
|
+
* disconnects the resize observer
|
|
964
|
+
*/
|
|
965
|
+
destroy() {
|
|
966
|
+
if (!this.showConfig)
|
|
967
|
+
return;
|
|
968
|
+
this.removeVisibleAppendElement(this.showConfig.appendableElement);
|
|
969
|
+
this.resetContainerPosition();
|
|
970
|
+
InternalVegaZIndexManager.removeZIndex(this.showConfig.appendableElement, 'base');
|
|
971
|
+
this.showConfig.appendableElement.remove();
|
|
972
|
+
this.disconnectResizeObserver();
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* The function "connectResizeObserver" is used to connect a resize observer.
|
|
976
|
+
*/
|
|
977
|
+
connectResizeObserver() {
|
|
978
|
+
methodPlaceholder();
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* The function disconnects a resize observer.
|
|
982
|
+
*/
|
|
983
|
+
disconnectResizeObserver() {
|
|
984
|
+
methodPlaceholder();
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Toggle appendableElement show or hide
|
|
988
|
+
*
|
|
989
|
+
* @param {boolean} show remove hidden style if true, otherwise add it
|
|
990
|
+
*/
|
|
991
|
+
toggleShow(show) {
|
|
992
|
+
if (show) {
|
|
993
|
+
this.showElementAppender(this.showConfig.appendableElement);
|
|
994
|
+
this.saveVisibleAppendElement(this.showConfig.appendableElement);
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
this.hideElementAppender(this.showConfig.appendableElement);
|
|
998
|
+
this.removeVisibleAppendElement(this.showConfig.appendableElement);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Show the appendable element by removing hidden styles
|
|
1003
|
+
* TODO: should directly control display style. https://gethired.atlassian.net/browse/VD-7884
|
|
1004
|
+
*
|
|
1005
|
+
* @param {HTMLElement} appendableElement - Appendable element controlled by ElementAppender
|
|
1006
|
+
*/
|
|
1007
|
+
showElementAppender(appendableElement) {
|
|
1008
|
+
if (appendableElement.classList.contains('date-picker-content-box')) {
|
|
1009
|
+
appendableElement.style.display = 'block';
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
appendableElement.classList.remove('vega-force-hidden');
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Hide the appendable element by adding hidden styles.
|
|
1017
|
+
* TODO: should directly control display style. https://gethired.atlassian.net/browse/VD-7884
|
|
1018
|
+
*
|
|
1019
|
+
* @param {HTMLElement} appendableElement - Appendable element controlled by ElementAppender
|
|
1020
|
+
*/
|
|
1021
|
+
hideElementAppender(appendableElement) {
|
|
1022
|
+
if (!appendableElement)
|
|
1023
|
+
return;
|
|
1024
|
+
if (appendableElement.classList.contains('date-picker-content-box')) {
|
|
1025
|
+
appendableElement.style.display = 'none';
|
|
1026
|
+
}
|
|
1027
|
+
else {
|
|
1028
|
+
appendableElement.classList.add('vega-force-hidden');
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Save visible AppendableElement from the container state
|
|
1033
|
+
*
|
|
1034
|
+
* @param {HTMLElement} appendableElement - Appendable element controlled by ElementAppender
|
|
1035
|
+
*/
|
|
1036
|
+
saveVisibleAppendElement(appendableElement) {
|
|
1037
|
+
const containerState = ElementAppender.containerMap.get(this.container);
|
|
1038
|
+
if (containerState) {
|
|
1039
|
+
containerState.visibleAppendElements.add(appendableElement);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Remove the AppendableElement from the container state.
|
|
1044
|
+
* If the container not includes visible element, will remove the container Map.
|
|
1045
|
+
*
|
|
1046
|
+
* @param {HTMLElement} appendableElement - Appendable element controlled by ElementAppender
|
|
1047
|
+
*/
|
|
1048
|
+
removeVisibleAppendElement(appendableElement) {
|
|
1049
|
+
const containerState = ElementAppender.containerMap.get(this.container);
|
|
1050
|
+
if (containerState) {
|
|
1051
|
+
containerState.visibleAppendElements.delete(appendableElement);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* The below method is e2e-test covered in @see {module:should-not-reset-dropdown-append-container-position-style-to-origin-when-there-is-another-dropdown-need-to-show}
|
|
1056
|
+
*/
|
|
1057
|
+
resetContainerPosition() {
|
|
1058
|
+
const containerState = ElementAppender.containerMap.get(this.container);
|
|
1059
|
+
if (containerState) {
|
|
1060
|
+
const { visibleAppendElements, originPosition = 'static' } = containerState;
|
|
1061
|
+
if (visibleAppendElements.size === 0) {
|
|
1062
|
+
this.container.style.position = originPosition;
|
|
1063
|
+
ElementAppender.containerMap.delete(this.container);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* If the showConfigCallback is a function, then call it and set the showConfig to the result.
|
|
1069
|
+
* Otherwise, set the showConfig to the showConfigCallback
|
|
1070
|
+
*/
|
|
1071
|
+
setShowConfig() {
|
|
1072
|
+
this.showConfig = this.getShowConfig();
|
|
1073
|
+
this.showConfig = Object.assign({
|
|
1074
|
+
matchTargetWidth: false,
|
|
1075
|
+
matchContainerHeight: false,
|
|
1076
|
+
}, this.showConfig);
|
|
1077
|
+
if (this.showConfig.target && this.showConfig.appendableElement) {
|
|
1078
|
+
this.elementAppenderContainerController.setContainer();
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* It makes sure that the container element is positioned relatively, and that the appendable element
|
|
1083
|
+
* has box-sizing set to border-box
|
|
1084
|
+
*
|
|
1085
|
+
* @returns {void}
|
|
1086
|
+
*/
|
|
1087
|
+
prepareShow() {
|
|
1088
|
+
// Add relative position to the container while the container is static,
|
|
1089
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/position#types_of_positioning
|
|
1090
|
+
if (!this.showConfig.isScreenPosition) {
|
|
1091
|
+
this.initVisibleAppendElement();
|
|
1092
|
+
}
|
|
1093
|
+
this.showConfig.appendableElement.style.boxSizing = 'border-box';
|
|
1094
|
+
this.positionCalculationController.setCalculationStrategy();
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* init visible append element.
|
|
1098
|
+
*/
|
|
1099
|
+
initVisibleAppendElement() {
|
|
1100
|
+
const containerStyle = window.getComputedStyle(this.container);
|
|
1101
|
+
const originContainerPosition = containerStyle.position;
|
|
1102
|
+
if (!ElementAppender.containerMap.has(this.container)) {
|
|
1103
|
+
ElementAppender.containerMap.set(this.container, {
|
|
1104
|
+
visibleAppendElements: new Set(),
|
|
1105
|
+
originPosition: originContainerPosition,
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
if (originContainerPosition === 'static') {
|
|
1109
|
+
this.container.style.position = 'relative';
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* A function that takes no parameters and returns nothing. It sets the position of the appendable element.
|
|
1114
|
+
*
|
|
1115
|
+
* @param {boolean} usePreviousPlacement - Should keep use previous placement and alignment.
|
|
1116
|
+
* @returns {void}
|
|
1117
|
+
*/
|
|
1118
|
+
adjustPosition(usePreviousPlacement) {
|
|
1119
|
+
this.positionCalculationController.adjustPosition(usePreviousPlacement);
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Sets the z-index of the appendable element to 11000.
|
|
1123
|
+
*
|
|
1124
|
+
* @returns {void}
|
|
1125
|
+
*/
|
|
1126
|
+
setZIndex() {
|
|
1127
|
+
InternalVegaZIndexManager.setZIndex(this.showConfig.appendableElement, 'base');
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* If the showConfigCallback is a function, call it and return the result, otherwise return the
|
|
1131
|
+
* showConfigCallback
|
|
1132
|
+
*
|
|
1133
|
+
* @returns {ElementAppenderShowConfig} The showConfigCallback is being returned.
|
|
1134
|
+
*/
|
|
1135
|
+
getShowConfig() {
|
|
1136
|
+
if (this.showConfigCallback instanceof Function) {
|
|
1137
|
+
return this.showConfigCallback(this.showConfigCallbackTarget);
|
|
1138
|
+
}
|
|
1139
|
+
else {
|
|
1140
|
+
return this.showConfigCallback;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* To maintain the state between container and the visible dropdown within it.
|
|
1146
|
+
* Key is containerElement
|
|
1147
|
+
*/
|
|
1148
|
+
ElementAppender.containerMap = new Map();
|
|
1149
|
+
__decorate$2([
|
|
1150
|
+
InjectVegaSlimmer()
|
|
1151
|
+
], ElementAppender.prototype, "resizeObserverSlimmer", void 0);
|
|
1152
|
+
__decorate$2([
|
|
1153
|
+
InjectVegaSlimmer()
|
|
1154
|
+
], ElementAppender.prototype, "elementAppenderContainerController", void 0);
|
|
1155
|
+
__decorate$2([
|
|
1156
|
+
InjectVegaSlimmer()
|
|
1157
|
+
], ElementAppender.prototype, "positionCalculationController", void 0);
|
|
1158
|
+
|
|
1159
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1160
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1161
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1162
|
+
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;
|
|
1163
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1164
|
+
};
|
|
1165
|
+
var NestEANotifyType;
|
|
1166
|
+
(function (NestEANotifyType) {
|
|
1167
|
+
NestEANotifyType["SHOW"] = "show";
|
|
1168
|
+
NestEANotifyType["HIDE"] = "hide";
|
|
1169
|
+
})(NestEANotifyType || (NestEANotifyType = {}));
|
|
1170
|
+
/**
|
|
1171
|
+
* Dynamically add parents and children of nest element appender while it show or hide.
|
|
1172
|
+
*/
|
|
1173
|
+
class ElementAppenderHierarchyTreeManager extends VegaSlimmer {
|
|
1174
|
+
constructor(currentEA) {
|
|
1175
|
+
super();
|
|
1176
|
+
this.childrenEA = [];
|
|
1177
|
+
this.currentEA = currentEA;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Listen current element appender did load.
|
|
1181
|
+
*/
|
|
1182
|
+
componentDidLoad() {
|
|
1183
|
+
this.register();
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Listen current element appender show.
|
|
1187
|
+
*/
|
|
1188
|
+
onShow() {
|
|
1189
|
+
this.notify(NestEANotifyType.SHOW);
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Listen current element appender hide.
|
|
1193
|
+
*/
|
|
1194
|
+
onHide() {
|
|
1195
|
+
this.notify(NestEANotifyType.HIDE);
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Get current parent of element appender.
|
|
1199
|
+
*
|
|
1200
|
+
* @returns {Nullable<ElementAppenderSlimmer>} - parent.
|
|
1201
|
+
*/
|
|
1202
|
+
getParent() {
|
|
1203
|
+
return this.parentEA;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Get current children of element appender.
|
|
1207
|
+
*
|
|
1208
|
+
* @returns {ElementAppenderSlimmer[]} - children.
|
|
1209
|
+
*/
|
|
1210
|
+
getChildren() {
|
|
1211
|
+
return this.childrenEA;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* While current element appender show or hide we should notify nest element appender to add or remove chain.
|
|
1215
|
+
*
|
|
1216
|
+
* @param {NestEANotifyType} type - Notify type.
|
|
1217
|
+
*/
|
|
1218
|
+
notify(type) {
|
|
1219
|
+
const parent = findParent(this.showConfig.target, '.vega-element-appender-appendable');
|
|
1220
|
+
if (parent) {
|
|
1221
|
+
ChangeManager.notify(domNodeSubjectFactory.getSubject(parent, VegaInternalNestEAHierarchyTreeChange), {
|
|
1222
|
+
type: type,
|
|
1223
|
+
child: this.currentEA,
|
|
1224
|
+
callback:
|
|
1225
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
1226
|
+
(parentEASlimmer) => {
|
|
1227
|
+
this.parentEA = parentEASlimmer;
|
|
1228
|
+
},
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Add a change manager to observer the nest element appender show or hide.
|
|
1234
|
+
*/
|
|
1235
|
+
register() {
|
|
1236
|
+
if (this.showConfig) {
|
|
1237
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(this.showConfig.appendableElement, VegaInternalNestEAHierarchyTreeChange, (payload) => {
|
|
1238
|
+
if (payload.type === NestEANotifyType.SHOW) {
|
|
1239
|
+
this.childrenEA.push(payload.child);
|
|
1240
|
+
}
|
|
1241
|
+
else if (payload.type === NestEANotifyType.HIDE) {
|
|
1242
|
+
this.childrenEA = this.childrenEA.filter((child) => child !== payload.child);
|
|
1243
|
+
}
|
|
1244
|
+
payload.callback(this.currentEA);
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
__decorate$1([
|
|
1250
|
+
MapToComponentField()
|
|
1251
|
+
], ElementAppenderHierarchyTreeManager.prototype, "showConfig", void 0);
|
|
1252
|
+
__decorate$1([
|
|
1253
|
+
MapToComponentMethod('componentDidLoad')
|
|
1254
|
+
], ElementAppenderHierarchyTreeManager.prototype, "componentDidLoad", null);
|
|
1255
|
+
__decorate$1([
|
|
1256
|
+
MapToComponentMethod('show')
|
|
1257
|
+
], ElementAppenderHierarchyTreeManager.prototype, "onShow", null);
|
|
1258
|
+
__decorate$1([
|
|
1259
|
+
MapToComponentMethod('hide')
|
|
1260
|
+
], ElementAppenderHierarchyTreeManager.prototype, "onHide", null);
|
|
1261
|
+
|
|
1262
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
1263
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1264
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1265
|
+
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;
|
|
1266
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1267
|
+
};
|
|
1268
|
+
class ElementAppenderSlimmer extends VegaSlimmer {
|
|
1269
|
+
constructor(showConfigFactory, getTrigger, isDropdownShowName = 'isDropdownShow', disableInteractiveGetter = () => false) {
|
|
1270
|
+
super();
|
|
1271
|
+
this.hierarchyTreeManager = new ElementAppenderHierarchyTreeManager(this);
|
|
1272
|
+
/**
|
|
1273
|
+
* It adds event listeners to the target and the appendable element
|
|
1274
|
+
*/
|
|
1275
|
+
this.registerElementAppenderListener = () => {
|
|
1276
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1277
|
+
this.unRegisterElementAppenderListener();
|
|
1278
|
+
if (this.showConfig) {
|
|
1279
|
+
(_a = this.showConfig.target) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.targetClickHandler);
|
|
1280
|
+
(_b = this.showConfig.target) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseenter', this.targetMouseEnterHandler);
|
|
1281
|
+
(_c = this.showConfig.target) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', this.targetMouseLeaveHandler);
|
|
1282
|
+
(_d = this.showConfig.target) === null || _d === void 0 ? void 0 : _d.addEventListener('focusout', this.targetFocusoutHandler);
|
|
1283
|
+
(_e = this.showConfig.appendableElement) === null || _e === void 0 ? void 0 : _e.addEventListener('mouseenter', this.elementMouseEnterHandler);
|
|
1284
|
+
(_f = this.showConfig.appendableElement) === null || _f === void 0 ? void 0 : _f.addEventListener('mouseleave', this.elementMouseLeaveHandler);
|
|
1285
|
+
}
|
|
1286
|
+
window.addEventListener('mousedown', this.globalMouseDownHandler);
|
|
1287
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1288
|
+
document.addEventListener('scroll', this.globalScrollHandler, { capture: true });
|
|
1289
|
+
this.listenShadowRootElementScrolling();
|
|
1290
|
+
};
|
|
1291
|
+
/* It's a function that listens to the click event on the dropdown. It checks if the trigger
|
|
1292
|
+
property is equal to 'click'. If it is, then it toggles the dropdown. */
|
|
1293
|
+
this.targetClickHandler = () => {
|
|
1294
|
+
if (this.shouldListenerWork('click')) {
|
|
1295
|
+
this.isShowing() ? this.hide() : this.show();
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
/* It's a function that listens to the mouseenter event on the dropdown. It checks if the trigger
|
|
1299
|
+
property is equal to 'hover'. If it is, then it clears the timer. */
|
|
1300
|
+
this.targetMouseEnterHandler = () => {
|
|
1301
|
+
if (this.shouldListenerWork('hover')) {
|
|
1302
|
+
this.isShowing() === false && this.show();
|
|
1303
|
+
this.clearDelayHideTimer();
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
/* It's a function that listens to the mouseleave event on the dropdown. It checks if the trigger
|
|
1307
|
+
property is equal to 'hover'. If it is, then it creates a timer that will hide the dropdown after a
|
|
1308
|
+
certain amount of time. */
|
|
1309
|
+
this.targetMouseLeaveHandler = () => {
|
|
1310
|
+
if (this.shouldListenerWork('hover')) {
|
|
1311
|
+
this.createDelayHideTimer();
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
/* istanbul ignore next */
|
|
1315
|
+
/* While focused element is in appendable element, like search input or vega-dropdown-item, we should not hide dropdown */
|
|
1316
|
+
this.targetFocusoutHandler = (e) => {
|
|
1317
|
+
var _a;
|
|
1318
|
+
if (!isParent(e.relatedTarget, (_a = this.showConfig) === null || _a === void 0 ? void 0 : _a.appendableElement)) {
|
|
1319
|
+
this.targetMouseLeaveHandler();
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
/* It's a function that listens to the mouseenter event on the dropdown. It checks if the trigger
|
|
1323
|
+
property is equal to 'hover'. If it is, then it clears the timer. */
|
|
1324
|
+
this.elementMouseEnterHandler = () => {
|
|
1325
|
+
var _a;
|
|
1326
|
+
(_a = this.hierarchyTreeManager.getParent()) === null || _a === void 0 ? void 0 : _a.elementMouseEnterHandler();
|
|
1327
|
+
if (this.shouldListenerWork('hover') && !this.disableInteractiveGetter()) {
|
|
1328
|
+
this.clearDelayHideTimer();
|
|
1329
|
+
}
|
|
1330
|
+
};
|
|
1331
|
+
/* It's a function that listens to the mouseleave event on the dropdown. It checks if the trigger
|
|
1332
|
+
property is equal to 'hover'. If it is, then it creates a timer that will hide the dropdown after a
|
|
1333
|
+
certain amount of time. */
|
|
1334
|
+
this.elementMouseLeaveHandler = () => {
|
|
1335
|
+
var _a;
|
|
1336
|
+
(_a = this.hierarchyTreeManager.getParent()) === null || _a === void 0 ? void 0 : _a.elementMouseLeaveHandler();
|
|
1337
|
+
if (this.shouldListenerWork('hover') && !this.disableInteractiveGetter()) {
|
|
1338
|
+
this.createDelayHideTimer();
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
/* It's a function that listens to the global mousedown event. It checks if the dropdown is showing,
|
|
1342
|
+
and if the target of the event is not a child of the dropdown or the trigger. If it is, then it
|
|
1343
|
+
hides the dropdown. */
|
|
1344
|
+
this.globalMouseDownHandler = (e) => {
|
|
1345
|
+
const currentTarget = e.composedPath()[0];
|
|
1346
|
+
const hasChildShowing = this.hierarchyTreeManager
|
|
1347
|
+
.getChildren()
|
|
1348
|
+
.some((child) => child.isShowing());
|
|
1349
|
+
if (!hasChildShowing &&
|
|
1350
|
+
this.shouldListenerWork('custom') &&
|
|
1351
|
+
this.isShowing() &&
|
|
1352
|
+
this.showConfig &&
|
|
1353
|
+
!isParent(currentTarget, this.showConfig.appendableElement) &&
|
|
1354
|
+
!isParent(currentTarget, this.showConfig.target) &&
|
|
1355
|
+
(this.showConfig.isScreenPosition ||
|
|
1356
|
+
findParent(currentTarget, 'vega-modal') === findParent(this.showConfig.target, 'vega-modal'))) {
|
|
1357
|
+
this.hide();
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
/* istanbul ignore next */
|
|
1361
|
+
/* Listen global scroll event */
|
|
1362
|
+
this.globalScrollHandler = () => {
|
|
1363
|
+
var _a;
|
|
1364
|
+
if (this.showConfig && this.showConfig.isScreenPosition && this.isShowing()) {
|
|
1365
|
+
(_a = this.elementAppender) === null || _a === void 0 ? void 0 : _a.onScroll();
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
/* A timer that will hide the dropdown after a certain amount of time. */
|
|
1369
|
+
this.createDelayHideTimer = () => {
|
|
1370
|
+
this.delayHideTimer = setTimeout(() => {
|
|
1371
|
+
this.hide();
|
|
1372
|
+
clearTimeout(this.delayHideTimer);
|
|
1373
|
+
}, ElementAppenderSlimmer.DELAY_HIDE_TIME);
|
|
1374
|
+
};
|
|
1375
|
+
/* A function that clears the timer. */
|
|
1376
|
+
this.clearDelayHideTimer = () => {
|
|
1377
|
+
this.delayHideTimer && clearTimeout(this.delayHideTimer);
|
|
1378
|
+
};
|
|
1379
|
+
/* It's a function that checks if the listener should work or not. */
|
|
1380
|
+
this.shouldListenerWork = (trigger) => {
|
|
1381
|
+
const currentTrigger = this.getTrigger();
|
|
1382
|
+
switch (trigger) {
|
|
1383
|
+
case 'custom':
|
|
1384
|
+
return currentTrigger !== 'none';
|
|
1385
|
+
case 'click':
|
|
1386
|
+
return currentTrigger === 'click';
|
|
1387
|
+
case 'hover':
|
|
1388
|
+
return currentTrigger === 'hover';
|
|
1389
|
+
}
|
|
1390
|
+
/* istanbul ignore next */
|
|
1391
|
+
throw new Error(`Unexpected trigger: ${trigger}. Expected values are custom, click, or hover.`);
|
|
1392
|
+
};
|
|
1393
|
+
this.showConfigFactory = showConfigFactory;
|
|
1394
|
+
this.getTrigger = getTrigger;
|
|
1395
|
+
this.isDropdownShowName = isDropdownShowName;
|
|
1396
|
+
this.disableInteractiveGetter = disableInteractiveGetter;
|
|
1397
|
+
}
|
|
1398
|
+
connectedCallback() {
|
|
1399
|
+
if (this.elementAppender === null) {
|
|
1400
|
+
this.setElementAppender();
|
|
1401
|
+
this.registerElementAppenderListener();
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
disconnectedCallback() {
|
|
1405
|
+
this.unRegisterElementAppenderListener();
|
|
1406
|
+
this.destroyElementAppender();
|
|
1407
|
+
}
|
|
1408
|
+
componentDidLoad() {
|
|
1409
|
+
this.initElementAppender();
|
|
1410
|
+
}
|
|
1411
|
+
getElementAppender() {
|
|
1412
|
+
return this.elementAppender;
|
|
1413
|
+
}
|
|
1414
|
+
show() {
|
|
1415
|
+
this.elementAppender && this.elementAppender.show();
|
|
1416
|
+
this[this.isDropdownShowName] = true;
|
|
1417
|
+
}
|
|
1418
|
+
hide() {
|
|
1419
|
+
this.elementAppender && this.elementAppender.hide();
|
|
1420
|
+
this[this.isDropdownShowName] = false;
|
|
1421
|
+
this.hierarchyTreeManager.getChildren().map((child) => {
|
|
1422
|
+
child.hide();
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
destroy() {
|
|
1426
|
+
this.destroyElementAppender();
|
|
1427
|
+
this[this.isDropdownShowName] = false;
|
|
1428
|
+
}
|
|
1429
|
+
updateShowConfigFactory(showConfigFactory) {
|
|
1430
|
+
this.showConfigFactory = showConfigFactory;
|
|
1431
|
+
this.initElementAppender();
|
|
1432
|
+
}
|
|
1433
|
+
destroyElementAppender() {
|
|
1434
|
+
if (this.elementAppender) {
|
|
1435
|
+
this.elementAppender.destroy();
|
|
1436
|
+
this.elementAppender = null;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
initElementAppender() {
|
|
1440
|
+
this.setShowConfig();
|
|
1441
|
+
this.setElementAppender();
|
|
1442
|
+
this.registerElementAppenderListener();
|
|
1443
|
+
}
|
|
1444
|
+
setElementAppender() {
|
|
1445
|
+
this.elementAppender = new ElementAppender(this.showConfigFactory, this);
|
|
1446
|
+
}
|
|
1447
|
+
isShowing() {
|
|
1448
|
+
return this[this.isDropdownShowName];
|
|
1449
|
+
}
|
|
1450
|
+
setShowConfig() {
|
|
1451
|
+
this.showConfig = this.showConfigFactory();
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* It removes all event listeners that were added in the `register()` function
|
|
1455
|
+
*/
|
|
1456
|
+
unRegisterElementAppenderListener() {
|
|
1457
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1458
|
+
if (this.showConfig) {
|
|
1459
|
+
(_a = this.showConfig.target) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this.targetClickHandler);
|
|
1460
|
+
(_b = this.showConfig.target) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseenter', this.targetMouseEnterHandler);
|
|
1461
|
+
(_c = this.showConfig.target) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', this.targetMouseLeaveHandler);
|
|
1462
|
+
(_d = this.showConfig.target) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusout', this.targetMouseLeaveHandler);
|
|
1463
|
+
(_e = this.showConfig.appendableElement) === null || _e === void 0 ? void 0 : _e.removeEventListener('mouseenter', this.elementMouseEnterHandler);
|
|
1464
|
+
(_f = this.showConfig.appendableElement) === null || _f === void 0 ? void 0 : _f.removeEventListener('mouseleave', this.elementMouseLeaveHandler);
|
|
1465
|
+
}
|
|
1466
|
+
window.removeEventListener('mousedown', this.globalMouseDownHandler);
|
|
1467
|
+
// eslint-disable-next-line no-restricted-globals
|
|
1468
|
+
document.removeEventListener('scroll', this.globalScrollHandler);
|
|
1469
|
+
this.removeShadowRootElementScrolling();
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Sets up an observer to handle scroll events in a shadow root element.
|
|
1473
|
+
*/
|
|
1474
|
+
listenShadowRootElementScrolling() {
|
|
1475
|
+
this.shadowRootElementScrollingObserver = new Observer(this.canAcceptShadowRootScrollEvent.bind(this), this.globalScrollHandler.bind(this));
|
|
1476
|
+
ChangeManager.register(SHADOW_ROOT_ELEMENT_SCROLLING, this.shadowRootElementScrollingObserver);
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Checks if the host element is a parent of the target element.
|
|
1480
|
+
*
|
|
1481
|
+
* @param {ShadowRootElementScrollingPayload} payload - payload.
|
|
1482
|
+
* @returns {boolean} - Can accept.
|
|
1483
|
+
*/
|
|
1484
|
+
canAcceptShadowRootScrollEvent(payload) {
|
|
1485
|
+
return Boolean(this.showConfig && isParent(this.showConfig.target, payload.host));
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Remove observer for scrolling in a shadow root element.
|
|
1489
|
+
*/
|
|
1490
|
+
removeShadowRootElementScrolling() {
|
|
1491
|
+
ChangeManager.unregister(SHADOW_ROOT_ELEMENT_SCROLLING, this.shadowRootElementScrollingObserver);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
ElementAppenderSlimmer.DELAY_HIDE_TIME = 100;
|
|
1495
|
+
__decorate([
|
|
1496
|
+
InjectVegaSlimmer()
|
|
1497
|
+
], ElementAppenderSlimmer.prototype, "hierarchyTreeManager", void 0);
|
|
1498
|
+
__decorate([
|
|
1499
|
+
MapToComponentMethod('connectedCallback')
|
|
1500
|
+
], ElementAppenderSlimmer.prototype, "connectedCallback", null);
|
|
1501
|
+
__decorate([
|
|
1502
|
+
MapToComponentMethod('disconnectedCallback')
|
|
1503
|
+
], ElementAppenderSlimmer.prototype, "disconnectedCallback", null);
|
|
1504
|
+
__decorate([
|
|
1505
|
+
MapToComponentMethod('componentDidLoad')
|
|
1506
|
+
], ElementAppenderSlimmer.prototype, "componentDidLoad", null);
|
|
1507
|
+
|
|
1508
|
+
export { ElementAppenderSlimmer as E };
|