@heartlandone/vega 2.71.0 → 2.72.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/{app-globals-837be7a6.js → app-globals-4d077e56.js} +19 -17
- package/dist/cjs/{child-nodes-event-prevent-slimmer-f8840f1b.js → child-nodes-event-prevent-slimmer-871855df.js} +1 -1
- package/dist/cjs/{code-block-bb4cbafa.js → code-block-bf3642ef.js} +29 -67
- package/dist/cjs/column-operation-1cac8386.js +1325 -0
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-cf7b4bda.js → component-value-history-controller-slimmer.abstract-ebecb74a.js} +28 -7
- package/dist/cjs/{date-required-rule-4e1f84fd.js → date-required-rule-99cca681.js} +3 -3
- package/dist/cjs/{design-token-00fe8d2f.js → design-token-ac429fe9.js} +6 -7
- package/dist/cjs/{dom-node-subject-observer-factory-f040608b.js → dom-node-subject-observer-factory-1c8f7880.js} +5 -1
- package/dist/cjs/{dto-renderer-manager-c917dade.js → dto-renderer-manager-04428a77.js} +6 -4
- package/dist/cjs/{element-appender-slimmer-f8e89f37.js → element-appender-slimmer-1b062054.js} +52 -14
- package/dist/cjs/{event-emit-slimmer-7afe8d78.js → event-emit-slimmer-f7255138.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-f865d397.js → form-field-controller-slimmer-57525f26.js} +3 -3
- package/dist/cjs/{image-annotation-action-8843adbf.js → image-annotation-action-7fa5d30d.js} +3 -3
- package/dist/cjs/index-58ea899e.js +12 -8
- package/dist/cjs/{index-4b896e76.js → index-c7fbf32b.js} +2 -2
- package/dist/cjs/index.cjs.js +37 -36
- package/dist/cjs/{inject-keyboard-manager-13c66257.js → inject-keyboard-manager-a6101379.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-45d451de.js → internal-vega-event-manager-0e1ba774.js} +3 -2
- package/dist/cjs/{keyboard-manager-af0d08a6.js → keyboard-manager-d8adb0ed.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-62f072cd.js → keyboard-manager-slimmer-15e65357.js} +1 -1
- package/dist/cjs/{language-extension-99c6fb40.js → language-extension-6ad0b5a0.js} +4 -4
- package/dist/cjs/loader.cjs.js +15 -13
- package/dist/cjs/month-view-generator-706c5477.js +102 -0
- package/dist/cjs/{public-rules-759c745b.js → public-rules-76bcf49c.js} +15 -15
- package/dist/cjs/{range-0b597850.js → range-449bcdd0.js} +1 -1
- package/dist/cjs/{responsive-format-facade-1d9c13a9.js → responsive-format-facade-e61c7f7e.js} +4 -4
- package/dist/cjs/{rich-text-editor-required-rule-92d0640e.js → rich-text-editor-required-rule-40216fee.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-07a95352.js → string-format-strategy.abstract-a8264fca.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-8236b5e1.js → string-input-formatter-slimmer-4332d1c7.js} +4 -4
- package/dist/cjs/{string-mask-strategy-6bdad95e.js → string-mask-strategy-4e7d3780.js} +2 -2
- package/dist/cjs/{style-formatter-1daa8371.js → style-formatter-e2a0ad27.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-78682046.js → sub-state-notify-slimmer-9fe1ab65.js} +2 -2
- package/dist/cjs/{sub-state-observer-slimmer-73aecfff.js → sub-state-observer-slimmer-2f6f4d28.js} +2 -2
- package/dist/cjs/{function-extension-28a4d781.js → table-extension-1f162c4c.js} +1950 -20
- package/dist/cjs/{time-required-rule-ccf178e7.js → time-required-rule-9d39a620.js} +3 -3
- package/dist/cjs/{type-guard-f12b5bae.js → type-guard-69d2cf01.js} +1224 -1
- package/dist/cjs/{valid-credit-card-number-rule-ce5c9147.js → valid-credit-card-number-rule-9f40d1d9.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +13 -12
- package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -17
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +17 -16
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +17 -16
- package/dist/cjs/vega-button-group_2.cjs.entry.js +60 -10
- package/dist/cjs/vega-button-link.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +17 -15
- package/dist/cjs/vega-calendar_4.cjs.entry.js +87 -909
- package/dist/cjs/vega-card.cjs.entry.js +16 -15
- package/dist/cjs/vega-carousel.cjs.entry.js +16 -14
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-chip.cjs.entry.js +18 -17
- package/dist/cjs/vega-code-block.cjs.entry.js +13 -13
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -6
- package/dist/cjs/vega-combo-box.cjs.entry.js +13 -13
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1759 -1568
- package/dist/cjs/vega-dialog_2.cjs.entry.js +22 -21
- package/dist/cjs/vega-divider.cjs.entry.js +12 -11
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +21 -31
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-flag-icon.cjs.entry.js +12 -11
- package/dist/cjs/vega-flex.cjs.entry.js +17 -16
- package/dist/cjs/vega-font.cjs.entry.js +16 -15
- package/dist/cjs/vega-form.cjs.entry.js +9 -9
- package/dist/cjs/vega-grid.cjs.entry.js +16 -15
- package/dist/cjs/vega-icon.cjs.entry.js +16 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -16
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +14 -14
- package/dist/cjs/vega-input-numeric.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-passcode.cjs.entry.js +12 -12
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +19 -18
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +16 -15
- package/dist/cjs/vega-input.cjs.entry.js +11 -11
- package/dist/cjs/{vega-internal-event-id-6d4a2c53.js → vega-internal-event-id-a5ef414b.js} +6 -4
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +20 -19
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +13 -11
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +15 -13
- package/dist/cjs/vega-popover_2.cjs.entry.js +24 -23
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +905 -0
- package/dist/cjs/vega-radio_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +9 -8
- package/dist/cjs/{vega-rich-text-editor_4.cjs.entry.js → vega-rich-text-editor_5.cjs.entry.js} +766 -279
- package/dist/cjs/vega-rich-text-table-selection-widget.cjs.entry.js +184 -0
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -16
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +18 -16
- package/dist/cjs/vega-signature-capture.cjs.entry.js +15 -14
- package/dist/cjs/vega-stepper.cjs.entry.js +7 -7
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +39 -38
- package/dist/cjs/vega-textarea.cjs.entry.js +7 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +40 -39
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +6 -6
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +16 -14
- package/dist/cjs/vega.cjs.js +15 -13
- package/dist/collection/collection-manifest.json +23 -13
- package/dist/collection/components/vega-button/vega-button.css +4 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.js +7 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.js +25 -2
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +31 -2
- package/dist/collection/components/vega-button-group/vega-button-group.js +37 -0
- package/dist/collection/components/vega-button-link/vega-button-link.css +4 -0
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +149 -0
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-format-controller.js +3 -1
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-keyboard-controller.js +1 -1
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-value-controller.js +10 -26
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +107 -445
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.js +5 -1
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.js +24 -17
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.js +15 -20
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.js +6 -17
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/constants.js +14 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/dto/calendar-selection.js +126 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-allow-repick-controller.js +70 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.js +204 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-min-max-date-controller.js +56 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-selection-controller.js +191 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-state-base.abstract.js +54 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-today-controller.js +37 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.js +76 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +192 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +168 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +669 -278
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +667 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker.css +0 -11
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +23 -40
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +3 -15
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-popover/vega-popover.js +14 -4
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +75 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.js +88 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.js +153 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +125 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.js +40 -0
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +94 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.js +43 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.css +79 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +84 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +69 -153
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +88 -85
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +11 -63
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +15 -1
- 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 +8 -0
- 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 +25 -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/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/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/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 +120 -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/dto/table-block.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +63 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +59 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +59 -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 +99 -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 +103 -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 +145 -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/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/table-extension.js +118 -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 +348 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +229 -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-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 +166 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.js +5 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +12 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +16 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +1 -1
- 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 +20 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +23 -2
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-style.test.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +9 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +15 -15
- 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-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/constants/regex.js +1 -0
- package/dist/collection/constants/ui.js +3 -0
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/calendar/calendar-date.js +273 -1
- package/dist/collection/helpers/calendar/calendar-period/calendar-period.abstract.js +9 -0
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +16 -4
- package/dist/collection/helpers/calendar/test/calendar-date.test.js +73 -0
- package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +9 -0
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +41 -0
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +11 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +3 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +3 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +5 -2
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +2 -1
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +7 -0
- package/dist/collection/helpers/ui/element-appender.js +35 -5
- package/dist/collection/types/type-guard.js +10 -0
- package/dist/collection/utils/date.js +14 -3
- package/dist/collection/utils/e2e-utils.js +8 -2
- package/dist/collection/utils/spec-utils.js +4 -3
- package/dist/collection/utils/test/date.test.js +2 -0
- package/dist/esm/{app-globals-fd4b7d97.js → app-globals-e7a8d0cc.js} +9 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-76331524.js → child-nodes-event-prevent-slimmer-9ae34332.js} +1 -1
- package/dist/esm/{code-block-ecb4491b.js → code-block-3d3a9030.js} +30 -68
- package/dist/esm/column-operation-4a93bf52.js +1300 -0
- package/dist/esm/{component-value-history-controller-slimmer.abstract-5d618b88.js → component-value-history-controller-slimmer.abstract-d84e7bab.js} +28 -7
- package/dist/esm/{date-required-rule-8944f3bf.js → date-required-rule-a9980386.js} +1 -1
- package/dist/esm/{design-token-2d77e8f5.js → design-token-1575f6d9.js} +4 -5
- package/dist/esm/{dom-node-subject-observer-factory-dca87b70.js → dom-node-subject-observer-factory-f81f215f.js} +4 -2
- package/dist/esm/{dto-renderer-manager-d862ae78.js → dto-renderer-manager-23784148.js} +5 -5
- package/dist/esm/{element-appender-slimmer-6791c332.js → element-appender-slimmer-1a50e184.js} +51 -13
- package/dist/esm/{event-emit-slimmer-4e28e9f8.js → event-emit-slimmer-966716fa.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-bf071b75.js → form-field-controller-slimmer-0020997d.js} +4 -4
- package/dist/esm/{image-annotation-action-d0af138c.js → image-annotation-action-dba16587.js} +3 -3
- package/dist/esm/index-090d31ca.js +12 -8
- package/dist/esm/{index-c943d263.js → index-d72e7fb3.js} +2 -2
- package/dist/esm/index.js +21 -21
- package/dist/esm/{inject-keyboard-manager-ffd351b9.js → inject-keyboard-manager-9241968c.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-516aa721.js → internal-vega-event-manager-4f51b17c.js} +3 -2
- package/dist/esm/{keyboard-manager-5d8f3582.js → keyboard-manager-89acac79.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f39214e4.js → keyboard-manager-slimmer-e303cb7d.js} +1 -1
- package/dist/esm/{language-extension-8f51f5ff.js → language-extension-710fe56d.js} +2 -2
- package/dist/esm/loader.js +17 -15
- package/dist/esm/month-view-generator-4bec99fd.js +98 -0
- package/dist/esm/{page-resize-observer-slimmer-0bf7fbf3.js → page-resize-observer-slimmer-8744cb44.js} +1 -1
- 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-d10e76f4.js → public-rules-522ba4b1.js} +15 -15
- package/dist/esm/{range-f7b9e2fb.js → range-cdd85d30.js} +1 -1
- package/dist/esm/{responsive-format-facade-267935ae.js → responsive-format-facade-405f90d2.js} +6 -6
- package/dist/esm/{rich-text-editor-required-rule-774b822b.js → rich-text-editor-required-rule-7d2d9615.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-452f4398.js → string-format-strategy.abstract-75540c16.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-3acd240c.js → string-input-formatter-slimmer-96ccc8cf.js} +4 -4
- package/dist/esm/{string-mask-strategy-6232a1c1.js → string-mask-strategy-4a18ed1a.js} +2 -2
- package/dist/esm/{style-formatter-3f88c491.js → style-formatter-52cd20f7.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-56380f02.js → sub-state-notify-slimmer-97953a87.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-3504e2f2.js → sub-state-observer-slimmer-3f2b954f.js} +2 -2
- package/dist/esm/{function-extension-8d39db56.js → table-extension-164b0d6c.js} +1952 -23
- package/dist/esm/{time-required-rule-a01163b5.js → time-required-rule-8ec1faf5.js} +1 -1
- package/dist/esm/{type-guard-12f7654b.js → type-guard-b48aec98.js} +1204 -2
- package/dist/esm/{ui-8424715a.js → ui-28fd4193.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-81443274.js → valid-credit-card-number-rule-96eaf9b1.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +15 -14
- package/dist/esm/vega-app-header-button.entry.js +20 -19
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +19 -18
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +19 -18
- package/dist/esm/vega-button-group_2.entry.js +60 -10
- package/dist/esm/vega-button-link.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +19 -17
- package/dist/esm/vega-calendar_4.entry.js +46 -868
- package/dist/esm/vega-card.entry.js +18 -17
- package/dist/esm/vega-carousel.entry.js +18 -16
- package/dist/esm/vega-checkbox_2.entry.js +9 -9
- package/dist/esm/vega-chip.entry.js +20 -19
- package/dist/esm/vega-code-block.entry.js +14 -14
- package/dist/esm/vega-color-picker.entry.js +8 -8
- package/dist/esm/vega-combo-box.entry.js +15 -15
- package/dist/esm/vega-date-picker_2.entry.js +1746 -1555
- package/dist/esm/vega-dialog_2.entry.js +18 -17
- package/dist/esm/vega-divider.entry.js +14 -13
- package/dist/esm/vega-dropdown_5.entry.js +21 -31
- 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 +8 -8
- package/dist/esm/vega-flag-icon.entry.js +14 -13
- package/dist/esm/vega-flex.entry.js +19 -18
- package/dist/esm/vega-font.entry.js +18 -17
- package/dist/esm/vega-form.entry.js +11 -11
- package/dist/esm/vega-grid.entry.js +18 -17
- package/dist/esm/vega-icon.entry.js +18 -17
- package/dist/esm/vega-image-uploader.entry.js +19 -17
- package/dist/esm/vega-input-credit-card.entry.js +16 -16
- package/dist/esm/vega-input-numeric.entry.js +15 -15
- package/dist/esm/vega-input-passcode.entry.js +14 -14
- package/dist/esm/vega-input-phone-number.entry.js +18 -17
- package/dist/esm/vega-input-range.entry.js +9 -9
- package/dist/esm/vega-input-select.entry.js +17 -16
- package/dist/esm/vega-input.entry.js +13 -13
- package/dist/esm/{vega-internal-event-id-5c3e5f7f.js → vega-internal-event-id-54ce7562.js} +4 -3
- package/dist/esm/vega-item-toggle.entry.js +4 -4
- package/dist/esm/vega-left-nav_5.entry.js +18 -17
- package/dist/esm/vega-loader-wrapper_2.entry.js +13 -11
- 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 +17 -15
- package/dist/esm/vega-popover_2.entry.js +24 -23
- package/dist/esm/vega-progress-tracker_2.entry.js +900 -0
- package/dist/esm/vega-radio_2.entry.js +12 -12
- package/dist/esm/vega-rich-text-content.entry.js +10 -9
- package/dist/esm/{vega-rich-text-editor_4.entry.js → vega-rich-text-editor_5.entry.js} +767 -281
- package/dist/esm/vega-rich-text-table-selection-widget.entry.js +180 -0
- package/dist/esm/vega-segment-control.entry.js +5 -5
- package/dist/esm/vega-selection-chip_2.entry.js +20 -18
- package/dist/esm/vega-selection-tile_2.entry.js +10 -10
- package/dist/esm/vega-sidenav_3.entry.js +16 -14
- package/dist/esm/vega-signature-capture.entry.js +17 -16
- package/dist/esm/vega-stepper.entry.js +9 -9
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_11.entry.js +16 -15
- package/dist/esm/vega-text.entry.js +2 -2
- package/dist/esm/vega-textarea.entry.js +9 -9
- package/dist/esm/vega-time-picker_2.entry.js +21 -20
- package/dist/esm/vega-toggle-switch.entry.js +8 -8
- package/dist/esm/vega-tooltip_2.entry.js +18 -16
- package/dist/esm/vega.js +17 -15
- package/dist/sri/vega-sri-manifest.json +342 -346
- package/dist/types/components/vega-button-group/types.d.ts +2 -1
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.d.ts +1 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.d.ts +11 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/vega-button-group-item.d.ts +7 -0
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +8 -0
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.d.ts +60 -0
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-value-controller.d.ts +3 -4
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +29 -124
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.d.ts +1 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.d.ts +5 -5
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.d.ts +2 -3
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.d.ts +1 -4
- package/dist/types/components/vega-date-picker/types.d.ts +9 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/constants.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/dto/calendar-selection.d.ts +62 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-allow-repick-controller.d.ts +31 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.d.ts +78 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-min-max-date-controller.d.ts +20 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-selection-controller.d.ts +75 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-state-base.abstract.d.ts +29 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-today-controller.d.ts +15 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +18 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +40 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +32 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +182 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +6 -14
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +0 -4
- package/dist/types/components/vega-popover/vega-popover.d.ts +2 -1
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +55 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.d.ts +27 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.d.ts +63 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.d.ts +39 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-render-mode-controller.d.ts +21 -0
- package/dist/types/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.d.ts +21 -0
- package/dist/types/components/vega-progress-tracker/type.d.ts +1 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/slimmers/controllers/vega-progress-tracker-step-state-controller.d.ts +12 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +22 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +24 -10
- 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/annotations/text-style-annotation.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -6
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +5 -0
- 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/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 +16 -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/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 +66 -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/dto/table-block.d.ts +78 -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 +30 -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/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 +51 -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 +39 -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 +65 -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/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 +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +31 -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 +142 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.d.ts +85 -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-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 +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +26 -3
- 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/selection-controller.d.ts +19 -6
- 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-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 +286 -6
- package/dist/types/constants/regex.d.ts +1 -0
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/calendar/calendar-date.d.ts +86 -2
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +7 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +3 -1
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +5 -2
- package/dist/types/helpers/ui/element-appender.d.ts +14 -0
- package/dist/types/types/components.type.d.ts +5 -0
- package/dist/types/types/type-guard.d.ts +8 -0
- package/dist/types/utils/date.d.ts +11 -2
- package/dist/types/utils/e2e-utils.d.ts +7 -0
- package/dist/types/utils/spec-utils.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-09561e90.entry.js +1 -0
- package/dist/vega/p-095c778c.entry.js +1 -0
- package/dist/vega/{p-e6351dab.entry.js → p-0bca50ab.entry.js} +1 -1
- package/dist/vega/{p-7d9cd9c8.js → p-10ac8b57.js} +1 -1
- package/dist/vega/{p-dde03224.entry.js → p-11a7daad.entry.js} +1 -1
- package/dist/vega/{p-447c7590.js → p-1282b67e.js} +1 -1
- package/dist/vega/{p-7b42da4f.entry.js → p-137e5c70.entry.js} +1 -1
- package/dist/vega/p-161b9c5b.js +1 -0
- package/dist/vega/p-174db33b.js +1 -0
- package/dist/vega/p-1815e753.entry.js +1 -0
- package/dist/vega/{p-1bb0c934.js → p-18bcfd7a.js} +1 -1
- package/dist/vega/p-194722fe.entry.js +1 -0
- package/dist/vega/{p-de97c6d9.js → p-1be7c6c4.js} +1 -1
- package/dist/vega/p-1c33d25e.entry.js +1 -0
- package/dist/vega/p-1dd07d64.entry.js +1 -0
- package/dist/vega/{p-a6010b93.entry.js → p-1e0d8228.entry.js} +1 -1
- package/dist/vega/p-207cfa6a.js +1 -0
- package/dist/vega/p-218e29c2.js +1 -0
- package/dist/vega/{p-75b5894f.entry.js → p-2249b040.entry.js} +1 -1
- package/dist/vega/p-23183d4d.js +1 -0
- package/dist/vega/p-238ec2b9.entry.js +1 -0
- package/dist/vega/p-2428457e.entry.js +1 -0
- package/dist/vega/p-263ad7b6.js +1 -0
- package/dist/vega/{p-ea96635b.entry.js → p-2688bc6f.entry.js} +1 -1
- package/dist/vega/{p-8350506e.js → p-26a43b4c.js} +1 -1
- package/dist/vega/p-285815b5.entry.js +1 -0
- package/dist/vega/{p-cac6239b.entry.js → p-2c07b213.entry.js} +1 -1
- package/dist/vega/{p-c0223a17.entry.js → p-31a65402.entry.js} +1 -1
- package/dist/vega/p-34a1a0c5.entry.js +1 -0
- package/dist/vega/{p-19522949.js → p-3d85411d.js} +1 -1
- package/dist/vega/p-3f561dd5.entry.js +1 -0
- package/dist/vega/{p-74168615.js → p-40f39194.js} +1 -1
- package/dist/vega/p-475f7bda.js +1 -0
- package/dist/vega/p-4785203e.entry.js +1 -0
- package/dist/vega/p-5051f0c1.entry.js +1 -0
- package/dist/vega/p-529daab4.entry.js +1 -0
- package/dist/vega/p-53c6ce54.entry.js +1 -0
- package/dist/vega/{p-db57dddc.js → p-5504ebdf.js} +1 -1
- package/dist/vega/p-5585d2b5.js +1 -0
- package/dist/vega/{p-98fb9eaa.entry.js → p-56ce0c4b.entry.js} +1 -1
- package/dist/vega/p-58f5da43.js +1 -0
- package/dist/vega/{p-2f09c6aa.js → p-596895ec.js} +1 -1
- package/dist/vega/{p-fde50319.js → p-5b472921.js} +1 -1
- package/dist/vega/p-5d7e908a.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-a0467b83.js → p-5fb6a3b5.js} +1 -1
- package/dist/vega/p-63c84ff6.entry.js +1 -0
- package/dist/vega/p-6961fac0.entry.js +1 -0
- package/dist/vega/{p-35cd469a.entry.js → p-699e46d1.entry.js} +1 -1
- package/dist/vega/p-6aa7ace9.js +1 -0
- package/dist/vega/p-6b631ff1.entry.js +1 -0
- package/dist/vega/{p-71f9c4d4.js → p-6c1ef2ed.js} +1 -1
- package/dist/vega/p-6ee3b103.js +1 -0
- package/dist/vega/{p-4a467973.js → p-71f2235e.js} +1 -1
- package/dist/vega/p-776b2f3d.entry.js +1 -0
- package/dist/vega/p-7ac32e71.js +1 -0
- package/dist/vega/p-7e6c5eb8.entry.js +1 -0
- package/dist/vega/{p-61d9cdf9.entry.js → p-7eaa8ac0.entry.js} +1 -1
- package/dist/vega/p-8014cb45.entry.js +1 -0
- package/dist/vega/p-877b36ae.entry.js +1 -0
- package/dist/vega/{p-18e8c54a.entry.js → p-883c5174.entry.js} +1 -1
- package/dist/vega/{p-58769a72.entry.js → p-8b969a71.entry.js} +1 -1
- package/dist/vega/p-8f6d42b0.entry.js +1 -0
- package/dist/vega/{p-7c1d08db.entry.js → p-8feb1298.entry.js} +1 -1
- package/dist/vega/p-95188267.entry.js +1 -0
- package/dist/vega/p-96aa0f3b.js +1 -0
- package/dist/vega/p-9a83a6b0.js +1 -0
- package/dist/vega/{p-52efaadb.entry.js → p-9e2cf904.entry.js} +1 -1
- package/dist/vega/p-9e545fde.entry.js +1 -0
- package/dist/vega/p-9f4364ec.entry.js +1 -0
- package/dist/vega/p-a33dc7eb.entry.js +1 -0
- package/dist/vega/p-a3a80712.js +1 -0
- package/dist/vega/{p-924b4e24.js → p-a4ec6575.js} +1 -1
- package/dist/vega/{p-3925c16b.js → p-a8dad05d.js} +1 -1
- package/dist/vega/{p-b9798158.js → p-b47df664.js} +1 -1
- package/dist/vega/{p-652626b6.entry.js → p-b737b93a.entry.js} +1 -1
- package/dist/vega/p-baa44cf5.entry.js +1 -0
- package/dist/vega/p-badc14cc.entry.js +1 -0
- package/dist/vega/{p-3c865f86.entry.js → p-bc2451f7.entry.js} +1 -1
- package/dist/vega/p-bdb5362c.entry.js +1 -0
- package/dist/vega/p-be33db7b.js +1 -0
- package/dist/vega/p-bfe01850.js +1 -0
- package/dist/vega/p-c141b10e.entry.js +1 -0
- package/dist/vega/p-c465b6dd.entry.js +1 -0
- package/dist/vega/{p-8fae8f9e.js → p-d1d0f08a.js} +1 -1
- package/dist/vega/{p-ad65f65f.entry.js → p-d6032515.entry.js} +1 -1
- package/dist/vega/{p-91d71ae9.entry.js → p-d69a6454.entry.js} +1 -1
- package/dist/vega/p-d6cc786a.entry.js +1 -0
- package/dist/vega/p-d85d7862.entry.js +1 -0
- package/dist/vega/p-d991fb11.js +1 -0
- package/dist/vega/{p-c2f21426.entry.js → p-da77d71f.entry.js} +1 -1
- package/dist/vega/{p-9ce249a9.js → p-de70aac1.js} +1 -1
- package/dist/vega/p-e47ae7bc.entry.js +1 -0
- package/dist/vega/p-e8495b6c.entry.js +1 -0
- package/dist/vega/{p-0f7dec29.entry.js → p-e8654ab5.entry.js} +1 -1
- package/dist/vega/p-e94701e2.entry.js +1 -0
- package/dist/vega/{p-3e040167.entry.js → p-e9e1293a.entry.js} +1 -1
- package/dist/vega/p-ef48178e.entry.js +1 -0
- package/dist/vega/{p-8c6b6ad7.entry.js → p-f729743c.entry.js} +1 -1
- package/dist/vega/{p-1f26de89.js → p-fb6b3b98.js} +1 -1
- package/dist/vega/p-fca7c998.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -3
- package/style/vega-icons.css +17266 -0
- package/dist/cjs/date-0a6bb035.js +0 -95
- package/dist/cjs/mobilefriendly-aa2e50e9.js +0 -13
- package/dist/cjs/remote-invocation-registry-fc22fdd0.js +0 -65
- package/dist/cjs/state-background-color-formatter-aa5570f6.js +0 -85
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +0 -252
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.js +0 -282
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-element-appender-controller.js +0 -35
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-mobile-controller.js +0 -53
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-month-year-change-event-controller.js +0 -139
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-zindex-controller.js +0 -49
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.js +0 -341
- package/dist/esm/date-c55b97f0.js +0 -87
- package/dist/esm/mobilefriendly-c5d0573d.js +0 -11
- package/dist/esm/remote-invocation-registry-d69245c2.js +0 -63
- package/dist/esm/state-background-color-formatter-0f01d27a.js +0 -82
- package/dist/esm/vega-progress-tracker.entry.js +0 -248
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.d.ts +0 -96
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-element-appender-controller.d.ts +0 -12
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-mobile-controller.d.ts +0 -18
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-month-year-change-event-controller.d.ts +0 -46
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-zindex-controller.d.ts +0 -15
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.d.ts +0 -97
- package/dist/vega/p-08835909.js +0 -1
- package/dist/vega/p-0cdb38d3.js +0 -1
- package/dist/vega/p-0e5297b9.entry.js +0 -1
- package/dist/vega/p-0feceaac.entry.js +0 -1
- package/dist/vega/p-115b42e6.entry.js +0 -1
- package/dist/vega/p-1372b984.js +0 -1
- package/dist/vega/p-1739a877.entry.js +0 -1
- package/dist/vega/p-1a59703b.entry.js +0 -1
- package/dist/vega/p-1e92737c.entry.js +0 -1
- package/dist/vega/p-235bf01b.entry.js +0 -1
- package/dist/vega/p-257ff60b.entry.js +0 -1
- package/dist/vega/p-25a3fad7.entry.js +0 -1
- package/dist/vega/p-2622f0a8.entry.js +0 -1
- package/dist/vega/p-26c4f07c.entry.js +0 -1
- package/dist/vega/p-2ec7e020.entry.js +0 -1
- package/dist/vega/p-308aa2e3.js +0 -1
- package/dist/vega/p-330c224f.entry.js +0 -1
- package/dist/vega/p-33f3f306.js +0 -1
- package/dist/vega/p-35252108.js +0 -1
- package/dist/vega/p-37020002.entry.js +0 -1
- package/dist/vega/p-379f1b40.entry.js +0 -1
- package/dist/vega/p-38cb2b40.js +0 -1
- package/dist/vega/p-4e13a26f.js +0 -1
- package/dist/vega/p-54e56f0d.entry.js +0 -1
- package/dist/vega/p-5972c101.entry.js +0 -1
- package/dist/vega/p-5d827fe5.js +0 -1
- package/dist/vega/p-5e708ad5.entry.js +0 -1
- package/dist/vega/p-65a9af84.entry.js +0 -1
- package/dist/vega/p-67eb405d.entry.js +0 -1
- package/dist/vega/p-67f159c3.js +0 -1
- package/dist/vega/p-69aec6af.entry.js +0 -1
- package/dist/vega/p-71ddccf2.entry.js +0 -1
- package/dist/vega/p-77e64f26.js +0 -1
- package/dist/vega/p-785d9ac3.entry.js +0 -1
- package/dist/vega/p-796d840c.entry.js +0 -1
- package/dist/vega/p-7a590741.entry.js +0 -1
- package/dist/vega/p-824a06ba.js +0 -1
- package/dist/vega/p-85f9a980.js +0 -1
- package/dist/vega/p-867a4970.js +0 -1
- package/dist/vega/p-880569ec.entry.js +0 -1
- package/dist/vega/p-8ac2f43f.entry.js +0 -1
- package/dist/vega/p-8ff96b8c.entry.js +0 -13
- package/dist/vega/p-9794fd88.entry.js +0 -1
- package/dist/vega/p-9e59345f.entry.js +0 -1
- package/dist/vega/p-a10b9f2e.js +0 -12
- package/dist/vega/p-a630ce73.entry.js +0 -1
- package/dist/vega/p-b1faebe0.js +0 -1
- package/dist/vega/p-b27fcac4.entry.js +0 -1
- package/dist/vega/p-b5ba0c11.js +0 -1
- package/dist/vega/p-b8b9ed2c.js +0 -1
- package/dist/vega/p-b9b81702.entry.js +0 -1
- package/dist/vega/p-bcc396c2.entry.js +0 -1
- package/dist/vega/p-bccee21e.js +0 -1
- package/dist/vega/p-bfb86c3e.entry.js +0 -1
- package/dist/vega/p-c224b44c.js +0 -1
- package/dist/vega/p-c6ae78f2.entry.js +0 -1
- package/dist/vega/p-cbabb07a.entry.js +0 -1
- package/dist/vega/p-fb320b50.entry.js +0 -1
- package/dist/vega/p-ff470366.entry.js +0 -1
|
@@ -0,0 +1,1325 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const changeManager = require('./change-manager-a297e4d2.js');
|
|
4
|
+
const observer = require('./observer-f49483e8.js');
|
|
5
|
+
const codeBlock = require('./code-block-bf3642ef.js');
|
|
6
|
+
const object = require('./object-e2e28e3d.js');
|
|
7
|
+
const typeGuard = require('./type-guard-69d2cf01.js');
|
|
8
|
+
const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-e2e274e1.js');
|
|
9
|
+
const dtoRendererManager = require('./dto-renderer-manager-04428a77.js');
|
|
10
|
+
|
|
11
|
+
exports.RTETableExtensionAnnotationTypeEnum = void 0;
|
|
12
|
+
(function (RTETableExtensionAnnotationTypeEnum) {
|
|
13
|
+
RTETableExtensionAnnotationTypeEnum["TABLE"] = "EXTENSION_TABLE";
|
|
14
|
+
RTETableExtensionAnnotationTypeEnum["CELL"] = "EXTENSION_TABLE_CELL";
|
|
15
|
+
RTETableExtensionAnnotationTypeEnum["CAPTION"] = "EXTENSION_TABLE_CAPTION";
|
|
16
|
+
})(exports.RTETableExtensionAnnotationTypeEnum || (exports.RTETableExtensionAnnotationTypeEnum = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Class representing a table annotation in the rich text editor.
|
|
19
|
+
*/
|
|
20
|
+
class RTETableAnnotation extends codeBlock.BlockAnnotation {
|
|
21
|
+
constructor({ backgroundColor, border, width, height, alignment = 'center', } = {}) {
|
|
22
|
+
super();
|
|
23
|
+
this.type = exports.RTETableExtensionAnnotationTypeEnum.TABLE;
|
|
24
|
+
this.backgroundColor = backgroundColor;
|
|
25
|
+
this.border = border;
|
|
26
|
+
this.width = width;
|
|
27
|
+
this.height = height;
|
|
28
|
+
this.alignment = alignment;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static from(value) {
|
|
34
|
+
return [exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value)];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generates the CSS border string from the border properties.
|
|
38
|
+
*
|
|
39
|
+
* @returns {Nullable<string>} The CSS border string.
|
|
40
|
+
*/
|
|
41
|
+
get borderStr() {
|
|
42
|
+
if (!this.border) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return `${this.border.style} ${this.border.width} ${this.border.color}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
clone() {
|
|
51
|
+
return new RTETableAnnotation({
|
|
52
|
+
backgroundColor: this.backgroundColor,
|
|
53
|
+
border: this.border,
|
|
54
|
+
width: this.width,
|
|
55
|
+
height: this.height,
|
|
56
|
+
alignment: this.alignment,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @inheritDoc
|
|
61
|
+
*/
|
|
62
|
+
toJSON() {
|
|
63
|
+
return {
|
|
64
|
+
table: object.cleanObject({
|
|
65
|
+
backgroundColor: this.backgroundColor,
|
|
66
|
+
border: this.border,
|
|
67
|
+
width: this.width,
|
|
68
|
+
height: this.height,
|
|
69
|
+
alignment: this.alignment,
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @inheritDoc
|
|
75
|
+
*/
|
|
76
|
+
renderStyle() {
|
|
77
|
+
const defaultStyles = {
|
|
78
|
+
borderCollapse: 'collapse',
|
|
79
|
+
};
|
|
80
|
+
const tableStyles = Object.assign({ backgroundColor: this.backgroundColor, border: this.borderStr, width: this.width, height: this.height }, this.renderAlignmentStyle());
|
|
81
|
+
return object.cleanObject(Object.assign(Object.assign({}, defaultStyles), tableStyles));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @inheritDoc
|
|
85
|
+
*/
|
|
86
|
+
renderClass() {
|
|
87
|
+
return 'v-rte--extension-table';
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Generates the alignment styles for the table.
|
|
91
|
+
*
|
|
92
|
+
* @returns {Record<string, string>} The alignment styles.
|
|
93
|
+
*/
|
|
94
|
+
renderAlignmentStyle() {
|
|
95
|
+
return {
|
|
96
|
+
margin: this.alignment === 'center' ? '0 auto' : this.alignment === 'left' ? '0' : '0 0 0 auto',
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Class representing a table block in the rich text editor.
|
|
103
|
+
*/
|
|
104
|
+
class RTETableBlock extends codeBlock.RTEBlock {
|
|
105
|
+
constructor(id) {
|
|
106
|
+
super(id);
|
|
107
|
+
this.type = 'table-block';
|
|
108
|
+
this.children = [];
|
|
109
|
+
this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation());
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @inheritDoc
|
|
113
|
+
*/
|
|
114
|
+
static from(block, options) {
|
|
115
|
+
var _a;
|
|
116
|
+
const tableBlock = new RTETableBlock(block.id);
|
|
117
|
+
super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
|
|
118
|
+
tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
|
|
119
|
+
if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.table) {
|
|
120
|
+
tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table));
|
|
121
|
+
}
|
|
122
|
+
return tableBlock;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @inheritDoc
|
|
126
|
+
*/
|
|
127
|
+
clone(parent) {
|
|
128
|
+
const clonedBlock = new RTETableBlock(this.id);
|
|
129
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
130
|
+
clonedBlock.parent = parent;
|
|
131
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
132
|
+
return clonedBlock;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @inheritDoc
|
|
136
|
+
*/
|
|
137
|
+
getLastNode() {
|
|
138
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get the first node of the table block.
|
|
142
|
+
*
|
|
143
|
+
* @returns {RTENode} The first node of the table block.
|
|
144
|
+
*/
|
|
145
|
+
getFirstNode() {
|
|
146
|
+
if (this.hasCaption()) {
|
|
147
|
+
return this.children[0].children[0].getLastNode();
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const childNode = this.children[0].children[0]
|
|
151
|
+
.children[0];
|
|
152
|
+
return childNode.getLastNode();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @inheritDoc
|
|
157
|
+
*/
|
|
158
|
+
isNotEmpty() {
|
|
159
|
+
return this.children.length > 0;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @inheritDoc
|
|
163
|
+
*/
|
|
164
|
+
toHtml() {
|
|
165
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
166
|
+
const attrStr = super.generateAttributeString();
|
|
167
|
+
const classes = super.getClasses();
|
|
168
|
+
return `<table class='${classes}' ${attrStr}>${childrenHtml}</table>`;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @inheritDoc
|
|
172
|
+
*/
|
|
173
|
+
toJSON() {
|
|
174
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Retrieves the caption block from the children collection, if present.
|
|
178
|
+
*
|
|
179
|
+
* @returns {Nullable<RTETableCaptionBlock>} The caption block or `null`.
|
|
180
|
+
*/
|
|
181
|
+
getCaption() {
|
|
182
|
+
const caption = this.children.find((child) => child.type === 'table-caption');
|
|
183
|
+
return caption !== null && caption !== void 0 ? caption : null;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Inserts, replaces, or removes the caption block within the children.
|
|
187
|
+
*
|
|
188
|
+
* @param {Nullable<RTETableCaptionBlock>} caption - The caption block to set, or `null` to remove.
|
|
189
|
+
*/
|
|
190
|
+
setCaption(caption) {
|
|
191
|
+
const index = this.children.findIndex((child) => child.type === 'table-caption');
|
|
192
|
+
if (!caption) {
|
|
193
|
+
if (index >= 0) {
|
|
194
|
+
this.children.splice(index, 1);
|
|
195
|
+
}
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
caption.parent = this;
|
|
199
|
+
if (index >= 0) {
|
|
200
|
+
this.children[index] = caption;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this.children.unshift(caption);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Checks whether the table currently stores a caption block reference.
|
|
208
|
+
*
|
|
209
|
+
* @returns {boolean} `true` when a caption DTO is attached; otherwise `false`.
|
|
210
|
+
*/
|
|
211
|
+
hasCaption() {
|
|
212
|
+
return typeGuard.isNonNullable(this.getCaption());
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The `RemoteInvocationRegistry` provides methods for performing remote invocation calls
|
|
218
|
+
* and registering remote invocation handlers.
|
|
219
|
+
*/
|
|
220
|
+
class RemoteInvocationRegistry {
|
|
221
|
+
/**
|
|
222
|
+
* This function performs a remote invocation call and returning the result.
|
|
223
|
+
*
|
|
224
|
+
* @typedef T generic type
|
|
225
|
+
* @param {HTMLElement} subject the dom node subject
|
|
226
|
+
* @param {unknown[]} args - The `args` parameter of specific method.
|
|
227
|
+
* @returns {Nullable<T>} The result of call `remoteInvocation`.
|
|
228
|
+
*/
|
|
229
|
+
call(subject, ...args) {
|
|
230
|
+
let result = null;
|
|
231
|
+
changeManager.ChangeManager.notify(subject, {
|
|
232
|
+
args,
|
|
233
|
+
resultCallback:
|
|
234
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
235
|
+
(response) => {
|
|
236
|
+
result = response;
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
return result;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The function registers a remote invocation handler.
|
|
243
|
+
*
|
|
244
|
+
* @param {HTMLElement} subject the dom node subject
|
|
245
|
+
* @param {Function}remoteInvocationHandler - The method that is ultimately called.
|
|
246
|
+
*/
|
|
247
|
+
register(subject, remoteInvocationHandler) {
|
|
248
|
+
const observer$1 = new observer.Observer(this.isAcceptableObserver.bind(this), (payload) => {
|
|
249
|
+
const result = remoteInvocationHandler(...payload.args);
|
|
250
|
+
payload.resultCallback(result);
|
|
251
|
+
});
|
|
252
|
+
changeManager.ChangeManager.register(subject, observer$1);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The function un-registers a remote invocation call handler.
|
|
256
|
+
*
|
|
257
|
+
* @param {HTMLElement} subject the dom node subject
|
|
258
|
+
*/
|
|
259
|
+
unRegister(subject) {
|
|
260
|
+
changeManager.ChangeManager.clearObserversBySubject(subject);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* The function isAcceptableObserver checks if the input matches a specified type T.
|
|
264
|
+
*
|
|
265
|
+
* @param {unknown} _input - The `_input` parameter is of type `unknown`, which means it can hold any
|
|
266
|
+
* value.
|
|
267
|
+
* @returns {boolean} The `isAcceptableObserver` function is returning `true`.
|
|
268
|
+
*/
|
|
269
|
+
isAcceptableObserver(_input) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
const remoteInvocationRegistry = new RemoteInvocationRegistry();
|
|
274
|
+
|
|
275
|
+
exports.TableSettingType = void 0;
|
|
276
|
+
(function (TableSettingType) {
|
|
277
|
+
TableSettingType["ROW"] = "ROW";
|
|
278
|
+
TableSettingType["CAPTION"] = "CAPTION";
|
|
279
|
+
TableSettingType["COLUMN"] = "COLUMN";
|
|
280
|
+
TableSettingType["MERGE_CELLS"] = "MERGE_CELLS";
|
|
281
|
+
TableSettingType["TABLE_PROPERTIES"] = "TABLE_PROPERTIES";
|
|
282
|
+
TableSettingType["CELL_PROPERTIES"] = "CELL_PROPERTIES";
|
|
283
|
+
})(exports.TableSettingType || (exports.TableSettingType = {}));
|
|
284
|
+
/**
|
|
285
|
+
* Abstract class for setting event handlers.
|
|
286
|
+
*/
|
|
287
|
+
class SettingEventHandler {
|
|
288
|
+
/**
|
|
289
|
+
* Applies a cursor update action so the editor focuses on the resolved node.
|
|
290
|
+
*
|
|
291
|
+
* @param {RTETableBlock} block - Table block currently being toggled.
|
|
292
|
+
* @param {Nullable<RTENode>} focusNode - Target node that should receive the caret.
|
|
293
|
+
*/
|
|
294
|
+
syncCursorPosition(block, focusNode) {
|
|
295
|
+
const rootContent = this.findRootContent(block);
|
|
296
|
+
if (focusNode && rootContent) {
|
|
297
|
+
const offset = focusNode.getRangeEndOffset();
|
|
298
|
+
rootContent.apply(new dtoRendererManager.UpdateCursorPositionAction(focusNode, offset));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Walks up the parent chain to locate the nearest VegaRTEContent root.
|
|
303
|
+
*
|
|
304
|
+
* @param {RTETableBlock} block - Table block used as the starting point.
|
|
305
|
+
* @returns {Nullable<VegaRTEContent>} Content root containing the table, if found.
|
|
306
|
+
*/
|
|
307
|
+
findRootContent(block) {
|
|
308
|
+
let currentParent = block.parent;
|
|
309
|
+
while (currentParent) {
|
|
310
|
+
if (currentParent instanceof dtoRendererManager.VegaRTEContent) {
|
|
311
|
+
return currentParent;
|
|
312
|
+
}
|
|
313
|
+
currentParent = currentParent.parent;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const DELETE_TABLE_ROW = 'DELETE_TABLE_ROW';
|
|
319
|
+
/**
|
|
320
|
+
* Action class for deleting a specific table row.
|
|
321
|
+
*/
|
|
322
|
+
class DeleteTableRowAction extends codeBlock.ModifyContentAction {
|
|
323
|
+
/**
|
|
324
|
+
* Constructs an InsertTableRowAction.
|
|
325
|
+
*
|
|
326
|
+
* @param {RTETableRowBlock[]} rowsToBeRemoved - The rows to be removed from the table.
|
|
327
|
+
*/
|
|
328
|
+
constructor(rowsToBeRemoved) {
|
|
329
|
+
super();
|
|
330
|
+
this.isFlushable = true;
|
|
331
|
+
this.type = DELETE_TABLE_ROW;
|
|
332
|
+
this.rowsToBeRemoved = rowsToBeRemoved;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const INSERT_TABLE_ROW = 'INSERT_TABLE_ROW';
|
|
337
|
+
exports.InsertTableRowDirection = void 0;
|
|
338
|
+
(function (InsertTableRowDirection) {
|
|
339
|
+
InsertTableRowDirection["ABOVE"] = "ABOVE";
|
|
340
|
+
InsertTableRowDirection["BELOW"] = "BELOW";
|
|
341
|
+
})(exports.InsertTableRowDirection || (exports.InsertTableRowDirection = {}));
|
|
342
|
+
/**
|
|
343
|
+
* Action class for inserting a new row into a table within the rich text editor.
|
|
344
|
+
*/
|
|
345
|
+
class InsertTableRowAction extends codeBlock.ModifyContentAction {
|
|
346
|
+
/**
|
|
347
|
+
* Constructs an InsertTableRowAction.
|
|
348
|
+
*
|
|
349
|
+
* @param {InsertTableRowDirection} insertDirection - The direction to insert the new row (above or below the current row).
|
|
350
|
+
* @param {RTETableRowBlock[]} selectedRows - The currently selected rows in the table.
|
|
351
|
+
*/
|
|
352
|
+
constructor(insertDirection, selectedRows = []) {
|
|
353
|
+
super();
|
|
354
|
+
this.isFlushable = true;
|
|
355
|
+
this.type = INSERT_TABLE_ROW;
|
|
356
|
+
this.selectedRows = [];
|
|
357
|
+
this.insertDirection = insertDirection;
|
|
358
|
+
this.selectedRows = selectedRows;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
const TOGGLE_HEADER_ROW = 'TOGGLE_HEADER_ROW';
|
|
363
|
+
/**
|
|
364
|
+
* Action to convert selected rows to header rows or revert them back to normal rows.
|
|
365
|
+
*/
|
|
366
|
+
class ToggleHeaderRowAction extends codeBlock.ModifyContentAction {
|
|
367
|
+
constructor(selectedRows) {
|
|
368
|
+
super();
|
|
369
|
+
this.isFlushable = true;
|
|
370
|
+
this.type = TOGGLE_HEADER_ROW;
|
|
371
|
+
this.selectedRows = selectedRows;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Class representing a table row block in the rich text editor.
|
|
377
|
+
*/
|
|
378
|
+
class RTETableRowBlock extends codeBlock.RTEBlock {
|
|
379
|
+
constructor(id) {
|
|
380
|
+
super(id);
|
|
381
|
+
this.type = 'table-row';
|
|
382
|
+
this.children = [];
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* @inheritDoc
|
|
386
|
+
*/
|
|
387
|
+
static from(block, options) {
|
|
388
|
+
const tableBlock = new RTETableRowBlock(block.id);
|
|
389
|
+
super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
|
|
390
|
+
tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
|
|
391
|
+
return tableBlock;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @inheritDoc
|
|
395
|
+
*/
|
|
396
|
+
clone(parent) {
|
|
397
|
+
const clonedBlock = new RTETableRowBlock(this.id);
|
|
398
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
399
|
+
clonedBlock.parent = parent;
|
|
400
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
401
|
+
return clonedBlock;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* @inheritDoc
|
|
405
|
+
*/
|
|
406
|
+
getLastNode() {
|
|
407
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* @inheritDoc
|
|
411
|
+
*/
|
|
412
|
+
isNotEmpty() {
|
|
413
|
+
return this.children.length > 0;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @inheritDoc
|
|
417
|
+
*/
|
|
418
|
+
toHtml() {
|
|
419
|
+
const childrenHtml = this.children
|
|
420
|
+
.map((child) => {
|
|
421
|
+
return child.toHtml();
|
|
422
|
+
})
|
|
423
|
+
.join('');
|
|
424
|
+
return `<tr>${childrenHtml}</tr>`;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* @inheritDoc
|
|
428
|
+
*/
|
|
429
|
+
toJSON() {
|
|
430
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Class representing a table body block in the rich text editor.
|
|
436
|
+
*/
|
|
437
|
+
class RTETableBodyBlock extends codeBlock.RTEBlock {
|
|
438
|
+
constructor(id) {
|
|
439
|
+
super(id);
|
|
440
|
+
this.type = 'table-body';
|
|
441
|
+
this.children = [];
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* @inheritDoc
|
|
445
|
+
*/
|
|
446
|
+
static from(block, options) {
|
|
447
|
+
const tableBodyBlock = new RTETableBodyBlock(block.id);
|
|
448
|
+
super.convertAnnotationsToMap(tableBodyBlock.annotationMap, Object.assign({}, block.annotations));
|
|
449
|
+
tableBodyBlock.children = super.generateBlockChildren(block.children, options, tableBodyBlock);
|
|
450
|
+
return tableBodyBlock;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @inheritDoc
|
|
454
|
+
*/
|
|
455
|
+
clone(parent) {
|
|
456
|
+
const clonedBlock = new RTETableBodyBlock(this.id);
|
|
457
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
458
|
+
clonedBlock.parent = parent;
|
|
459
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
460
|
+
return clonedBlock;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* @inheritDoc
|
|
464
|
+
*/
|
|
465
|
+
getLastNode() {
|
|
466
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* @inheritDoc
|
|
470
|
+
*/
|
|
471
|
+
isNotEmpty() {
|
|
472
|
+
return this.children.length > 0;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @inheritDoc
|
|
476
|
+
*/
|
|
477
|
+
toHtml() {
|
|
478
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
479
|
+
return `<tbody>${childrenHtml}</tbody>`;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* @inheritDoc
|
|
483
|
+
*/
|
|
484
|
+
toJSON() {
|
|
485
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Class representing a table head block in the rich text editor.
|
|
491
|
+
*/
|
|
492
|
+
class RTETableHeadBlock extends codeBlock.RTEBlock {
|
|
493
|
+
constructor(id) {
|
|
494
|
+
super(id);
|
|
495
|
+
this.type = 'table-head';
|
|
496
|
+
this.children = [];
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* @inheritDoc
|
|
500
|
+
*/
|
|
501
|
+
static from(block, options) {
|
|
502
|
+
const tableBlock = new RTETableHeadBlock(block.id);
|
|
503
|
+
super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
|
|
504
|
+
tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
|
|
505
|
+
return tableBlock;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @inheritDoc
|
|
509
|
+
*/
|
|
510
|
+
clone(parent) {
|
|
511
|
+
const clonedBlock = new RTETableHeadBlock(this.id);
|
|
512
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
513
|
+
clonedBlock.parent = parent;
|
|
514
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
515
|
+
return clonedBlock;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* @inheritDoc
|
|
519
|
+
*/
|
|
520
|
+
getLastNode() {
|
|
521
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @inheritDoc
|
|
525
|
+
*/
|
|
526
|
+
isNotEmpty() {
|
|
527
|
+
return this.children.length > 0;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* @inheritDoc
|
|
531
|
+
*/
|
|
532
|
+
toHtml() {
|
|
533
|
+
const childrenHtml = this.children
|
|
534
|
+
.map((child) => {
|
|
535
|
+
return child.toHtml();
|
|
536
|
+
})
|
|
537
|
+
.join('');
|
|
538
|
+
return `<thead>${childrenHtml}</thead>`;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* @inheritDoc
|
|
542
|
+
*/
|
|
543
|
+
toJSON() {
|
|
544
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Recursively searches for a parent block of a specific type.
|
|
550
|
+
*
|
|
551
|
+
* @typedef T - Generic type extending RTEBlock.
|
|
552
|
+
* @param {RTEBlock} block - The starting block to search from.
|
|
553
|
+
* @param {ClassType<unknown>} dtoClass - The class type to match the parent block against.
|
|
554
|
+
* @returns {T | null} - The found parent block of the specified type, or null if not found.
|
|
555
|
+
*/
|
|
556
|
+
function getParentBlockByType(block, dtoClass) {
|
|
557
|
+
if (block) {
|
|
558
|
+
if (block instanceof dtoClass) {
|
|
559
|
+
return block;
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
return getParentBlockByType(block.parent, dtoClass);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Generate the table body with the specified number of rows and columns.
|
|
569
|
+
*
|
|
570
|
+
* @param {number} rowCount - The number of rows in the table body.
|
|
571
|
+
* @param {number} columnCount - The number of columns in the table body.
|
|
572
|
+
* @returns {VegaRTETableBodyBlock} The generated table body block.
|
|
573
|
+
*/
|
|
574
|
+
function generateTableBody(rowCount, columnCount) {
|
|
575
|
+
return {
|
|
576
|
+
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
577
|
+
type: 'table-body',
|
|
578
|
+
children: Array.from({ length: rowCount }, () => generateTableRow(columnCount)),
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Create a table row block with the specified number of columns and cell type.
|
|
583
|
+
*
|
|
584
|
+
* @param {number} columnCount - The number of columns in the row.
|
|
585
|
+
* @returns {VegaRTETableRowBlock} The created table row block.
|
|
586
|
+
*/
|
|
587
|
+
function generateTableRow(columnCount) {
|
|
588
|
+
return {
|
|
589
|
+
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
590
|
+
type: 'table-row',
|
|
591
|
+
children: Array.from({ length: columnCount }, () => getDefaultCellBlockTemplate('table-cell')),
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Get all table rows from a table block (including rows from all table bodies and headers).
|
|
596
|
+
*
|
|
597
|
+
* @param {RTETableBlock} tableBlock - The table block.
|
|
598
|
+
* @returns {RTETableRowBlock[]} Array of all table row blocks.
|
|
599
|
+
*/
|
|
600
|
+
function getAllTableRows(tableBlock) {
|
|
601
|
+
return tableBlock.children
|
|
602
|
+
.filter((child) => child instanceof RTETableBodyBlock || child instanceof RTETableHeadBlock)
|
|
603
|
+
.flatMap((body) => body.children);
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Find the first node within a block recursively.
|
|
607
|
+
*
|
|
608
|
+
* @param {Nullable<RTEBlock>} block - The block to find the first node in.
|
|
609
|
+
* @returns {Nullable<RTENode>} The focusable node within the block.
|
|
610
|
+
*/
|
|
611
|
+
function getFirstNode(block) {
|
|
612
|
+
if (!block || !block.children || !block.children[0])
|
|
613
|
+
return null;
|
|
614
|
+
const firstNode = block.children[0];
|
|
615
|
+
if (firstNode instanceof codeBlock.RTENode) {
|
|
616
|
+
return firstNode;
|
|
617
|
+
}
|
|
618
|
+
return getFirstNode(firstNode);
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Get the default cell block template.
|
|
622
|
+
*
|
|
623
|
+
* @param {string} cellType - The type of the cell block.
|
|
624
|
+
* @returns {VegaRTETableCellBlock} The default cell block template.
|
|
625
|
+
*/
|
|
626
|
+
function getDefaultCellBlockTemplate(cellType) {
|
|
627
|
+
const id = createPublicApiRuntimeMetricsSlimmer.generateUUID();
|
|
628
|
+
return {
|
|
629
|
+
id,
|
|
630
|
+
type: cellType,
|
|
631
|
+
children: [
|
|
632
|
+
{
|
|
633
|
+
id: `${id}-p`,
|
|
634
|
+
type: 'paragraph',
|
|
635
|
+
nodes: [
|
|
636
|
+
{
|
|
637
|
+
id: `${id}-p-t`,
|
|
638
|
+
type: 'text',
|
|
639
|
+
text: '',
|
|
640
|
+
},
|
|
641
|
+
],
|
|
642
|
+
},
|
|
643
|
+
],
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
exports.RowOperationType = void 0;
|
|
648
|
+
(function (RowOperationType) {
|
|
649
|
+
RowOperationType["HEADER_ROW"] = "HEADER_ROW";
|
|
650
|
+
RowOperationType["ADD_ROW_ABOVE"] = "ADD_ROW_ABOVE";
|
|
651
|
+
RowOperationType["ADD_ROW_BELOW"] = "ADD_ROW_BELOW";
|
|
652
|
+
RowOperationType["DELETE_ROW"] = "DELETE_ROW";
|
|
653
|
+
RowOperationType["SELECT_ROW"] = "SELECT_ROW";
|
|
654
|
+
})(exports.RowOperationType || (exports.RowOperationType = {}));
|
|
655
|
+
/**
|
|
656
|
+
* Event handler for row operations in a table.
|
|
657
|
+
*/
|
|
658
|
+
class RowOperationEventHandler extends SettingEventHandler {
|
|
659
|
+
/**
|
|
660
|
+
* @inheritDoc
|
|
661
|
+
*/
|
|
662
|
+
canHandle(action) {
|
|
663
|
+
return action[0] === exports.TableSettingType.ROW;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* @inheritDoc
|
|
667
|
+
*/
|
|
668
|
+
execute(action, extensionContext) {
|
|
669
|
+
const operation = action[1];
|
|
670
|
+
switch (operation) {
|
|
671
|
+
case exports.RowOperationType.ADD_ROW_ABOVE:
|
|
672
|
+
case exports.RowOperationType.ADD_ROW_BELOW:
|
|
673
|
+
this.handleInsertRow(operation, extensionContext);
|
|
674
|
+
break;
|
|
675
|
+
case exports.RowOperationType.DELETE_ROW:
|
|
676
|
+
this.handleDeleteRow(extensionContext);
|
|
677
|
+
break;
|
|
678
|
+
case exports.RowOperationType.HEADER_ROW:
|
|
679
|
+
this.handleToggleHeader(extensionContext);
|
|
680
|
+
break;
|
|
681
|
+
case exports.RowOperationType.SELECT_ROW:
|
|
682
|
+
this.handleSelectRow(extensionContext);
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Adds a new row to the table at the specified position.
|
|
688
|
+
*
|
|
689
|
+
* @param {RowOperationType} direction - The position to insert the new row (above or below).
|
|
690
|
+
* @param {RTETableExtensionContext} extensionContext - The extension context.
|
|
691
|
+
*/
|
|
692
|
+
handleInsertRow(direction, extensionContext) {
|
|
693
|
+
const selectedRows = this.getAllSelectedRows(extensionContext);
|
|
694
|
+
if (selectedRows.length > 0) {
|
|
695
|
+
const action = new InsertTableRowAction(direction === exports.RowOperationType.ADD_ROW_ABOVE
|
|
696
|
+
? exports.InsertTableRowDirection.ABOVE
|
|
697
|
+
: exports.InsertTableRowDirection.BELOW, selectedRows);
|
|
698
|
+
this.applyActionToTable(selectedRows[0], action);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Deletes the selected row(s) from the table.
|
|
703
|
+
*
|
|
704
|
+
* @param {RTETableExtensionContext} extensionContext - The extension context.
|
|
705
|
+
*/
|
|
706
|
+
handleDeleteRow(extensionContext) {
|
|
707
|
+
const selectedRows = this.getAllSelectedRows(extensionContext);
|
|
708
|
+
if (selectedRows.length) {
|
|
709
|
+
const action = new DeleteTableRowAction(selectedRows);
|
|
710
|
+
this.applyActionToTable(selectedRows[0], action);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Converts selected rows to header rows or reverts them back to normal rows.
|
|
715
|
+
*
|
|
716
|
+
* @param {RTETableExtensionContext} extensionContext - The extension context.
|
|
717
|
+
*/
|
|
718
|
+
handleToggleHeader(extensionContext) {
|
|
719
|
+
const selectedRows = this.getAllSelectedRows(extensionContext);
|
|
720
|
+
if (selectedRows.length > 0) {
|
|
721
|
+
const action = new ToggleHeaderRowAction(selectedRows);
|
|
722
|
+
this.applyActionToTable(selectedRows[0], action);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Selects the focus row(s) in the table.
|
|
727
|
+
*
|
|
728
|
+
* @param {RTETableExtensionContext} extensionContext - The extension context.
|
|
729
|
+
*/
|
|
730
|
+
handleSelectRow(extensionContext) {
|
|
731
|
+
const selectedRows = this.getAllSelectedRows(extensionContext);
|
|
732
|
+
if (selectedRows.length > 0 && extensionContext && extensionContext.tableSelection) {
|
|
733
|
+
const allCells = selectedRows.flatMap((row) => row.children);
|
|
734
|
+
extensionContext.tableSelection.setSelectedCells(allCells);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Get all selected table rows.
|
|
739
|
+
*
|
|
740
|
+
* @param {RTETableExtensionContext} extensionContext - The extension context.
|
|
741
|
+
* @returns {RTETableRowBlock[]} The selected table row blocks.
|
|
742
|
+
*/
|
|
743
|
+
getAllSelectedRows(extensionContext) {
|
|
744
|
+
const selectedRows = new Set();
|
|
745
|
+
if (extensionContext && extensionContext.tableSelection) {
|
|
746
|
+
const { tableSelection } = extensionContext;
|
|
747
|
+
const selectedCells = tableSelection.getSelectedCells();
|
|
748
|
+
selectedCells.forEach((cell) => {
|
|
749
|
+
const rowBlock = getParentBlockByType(cell, RTETableRowBlock);
|
|
750
|
+
if (rowBlock) {
|
|
751
|
+
selectedRows.add(rowBlock);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
return Array.from(selectedRows);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Applies the given action to the table containing the reference block.
|
|
759
|
+
*
|
|
760
|
+
* @param {RTEBlock} refBlock - The reference block within the table.
|
|
761
|
+
* @param {ModifyContentAction} action - The action to apply to the table.
|
|
762
|
+
*/
|
|
763
|
+
applyActionToTable(refBlock, action) {
|
|
764
|
+
const table = getParentBlockByType(refBlock, RTETableBlock);
|
|
765
|
+
if (table) {
|
|
766
|
+
table.apply(action);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Class representing a table cell annotation in the rich text editor.
|
|
773
|
+
*/
|
|
774
|
+
class RTETableCellAnnotation extends codeBlock.BlockAnnotation {
|
|
775
|
+
constructor({ backgroundColor, padding = RTETableCellAnnotation.DEFAULT_PADDING, border = RTETableCellAnnotation.DEFAULT_BORDER, width, height, textAlign = RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN, verticalAlign = RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN, } = {}) {
|
|
776
|
+
super();
|
|
777
|
+
this.type = exports.RTETableExtensionAnnotationTypeEnum.CELL;
|
|
778
|
+
this.backgroundColor = backgroundColor;
|
|
779
|
+
this.padding = padding;
|
|
780
|
+
this.border = border;
|
|
781
|
+
this.width = width;
|
|
782
|
+
this.height = height;
|
|
783
|
+
this.textAlign = textAlign;
|
|
784
|
+
this.verticalAlign = verticalAlign;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* @inheritDoc
|
|
788
|
+
*/
|
|
789
|
+
static from(cellAnnotation) {
|
|
790
|
+
return [exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation(cellAnnotation)];
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Generates the CSS border string from the border properties.
|
|
794
|
+
*
|
|
795
|
+
* @returns {Nullable<string>} The CSS border string.
|
|
796
|
+
*/
|
|
797
|
+
get borderStr() {
|
|
798
|
+
if (!this.border)
|
|
799
|
+
return null;
|
|
800
|
+
return `${this.border.style} ${this.border.width} ${this.border.color}`;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* @inheritDoc
|
|
804
|
+
*/
|
|
805
|
+
clone() {
|
|
806
|
+
return new RTETableCellAnnotation({
|
|
807
|
+
backgroundColor: this.backgroundColor,
|
|
808
|
+
padding: this.padding,
|
|
809
|
+
border: this.border,
|
|
810
|
+
width: this.width,
|
|
811
|
+
height: this.height,
|
|
812
|
+
textAlign: this.textAlign,
|
|
813
|
+
verticalAlign: this.verticalAlign,
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* @inheritDoc
|
|
818
|
+
*/
|
|
819
|
+
toJSON() {
|
|
820
|
+
return {
|
|
821
|
+
tableCell: object.cleanObject({
|
|
822
|
+
backgroundColor: this.backgroundColor,
|
|
823
|
+
padding: this.padding,
|
|
824
|
+
border: this.border,
|
|
825
|
+
width: this.width,
|
|
826
|
+
height: this.height,
|
|
827
|
+
textAlign: this.textAlign,
|
|
828
|
+
verticalAlign: this.verticalAlign,
|
|
829
|
+
}),
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* @inheritDoc
|
|
834
|
+
*/
|
|
835
|
+
renderStyle(options) {
|
|
836
|
+
const style = {
|
|
837
|
+
backgroundColor: this.backgroundColor,
|
|
838
|
+
padding: this.padding,
|
|
839
|
+
border: this.borderStr,
|
|
840
|
+
width: this.width,
|
|
841
|
+
height: this.height,
|
|
842
|
+
textAlign: this.textAlign,
|
|
843
|
+
verticalAlign: this.verticalAlign,
|
|
844
|
+
};
|
|
845
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone)) {
|
|
846
|
+
return object.cleanObject(this.removeDefaultValues(style));
|
|
847
|
+
}
|
|
848
|
+
return object.cleanObject(style);
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* @inheritDoc
|
|
852
|
+
*/
|
|
853
|
+
renderClass() {
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Removes default values from the style object to avoid redundancy.
|
|
858
|
+
*
|
|
859
|
+
* @param {Record<string, Nullable<string>>} style - The style object to clean.
|
|
860
|
+
* @returns {Record<string, Nullable<string>>} The cleaned style object.
|
|
861
|
+
*/
|
|
862
|
+
removeDefaultValues(style) {
|
|
863
|
+
const cleanedStyle = Object.assign({}, style);
|
|
864
|
+
if (cleanedStyle.padding === RTETableCellAnnotation.DEFAULT_PADDING) {
|
|
865
|
+
delete cleanedStyle.padding;
|
|
866
|
+
}
|
|
867
|
+
if (cleanedStyle.border ===
|
|
868
|
+
`${RTETableCellAnnotation.DEFAULT_BORDER.style} ${RTETableCellAnnotation.DEFAULT_BORDER.width} ${RTETableCellAnnotation.DEFAULT_BORDER.color}`) {
|
|
869
|
+
delete cleanedStyle.border;
|
|
870
|
+
}
|
|
871
|
+
if (cleanedStyle.textAlign === RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN) {
|
|
872
|
+
delete cleanedStyle.textAlign;
|
|
873
|
+
}
|
|
874
|
+
if (cleanedStyle.verticalAlign === RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN) {
|
|
875
|
+
delete cleanedStyle.verticalAlign;
|
|
876
|
+
}
|
|
877
|
+
return cleanedStyle;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
RTETableCellAnnotation.DEFAULT_PADDING = '12px';
|
|
881
|
+
RTETableCellAnnotation.DEFAULT_BORDER = {
|
|
882
|
+
style: 'solid',
|
|
883
|
+
width: '1px',
|
|
884
|
+
color: '#ddd',
|
|
885
|
+
};
|
|
886
|
+
RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN = 'left';
|
|
887
|
+
RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN = 'middle';
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Class representing a table cell block in the rich text editor.
|
|
891
|
+
*/
|
|
892
|
+
class RTETableCellBlock extends codeBlock.RTEBlock {
|
|
893
|
+
constructor(id) {
|
|
894
|
+
super(id);
|
|
895
|
+
this.type = 'table-cell';
|
|
896
|
+
this.children = [];
|
|
897
|
+
this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation());
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* @inheritDoc
|
|
901
|
+
*/
|
|
902
|
+
static from(block, options) {
|
|
903
|
+
var _a;
|
|
904
|
+
const tableCellBlock = new RTETableCellBlock(block.id);
|
|
905
|
+
super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
|
|
906
|
+
if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
|
|
907
|
+
tableCellBlock.annotationMap.set(...RTETableCellAnnotation.from(block.annotations.tableCell));
|
|
908
|
+
}
|
|
909
|
+
tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
|
|
910
|
+
return tableCellBlock;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* @inheritDoc
|
|
914
|
+
*/
|
|
915
|
+
clone(parent) {
|
|
916
|
+
const clonedBlock = new RTETableCellBlock(this.id);
|
|
917
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
918
|
+
clonedBlock.parent = parent;
|
|
919
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
920
|
+
return clonedBlock;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @inheritDoc
|
|
924
|
+
*/
|
|
925
|
+
getLastNode() {
|
|
926
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* @inheritDoc
|
|
930
|
+
*/
|
|
931
|
+
isNotEmpty() {
|
|
932
|
+
return this.children.length > 0;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* @inheritDoc
|
|
936
|
+
*/
|
|
937
|
+
toHtml() {
|
|
938
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
939
|
+
const attrStr = super.generateAttributeString();
|
|
940
|
+
return `<td${attrStr}>${childrenHtml}</td>`;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* @inheritDoc
|
|
944
|
+
*/
|
|
945
|
+
toJSON() {
|
|
946
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Class representing a table head cell annotation in the rich text editor.
|
|
952
|
+
*/
|
|
953
|
+
class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
|
|
954
|
+
constructor(annotation = {}) {
|
|
955
|
+
super(annotation);
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* @inheritDoc
|
|
959
|
+
*/
|
|
960
|
+
static from(cellAnnotation) {
|
|
961
|
+
return [exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation(cellAnnotation)];
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* @inheritDoc
|
|
965
|
+
*/
|
|
966
|
+
clone() {
|
|
967
|
+
return new RTETableHeadCellAnnotation({
|
|
968
|
+
backgroundColor: this.backgroundColor,
|
|
969
|
+
padding: this.padding,
|
|
970
|
+
border: this.border,
|
|
971
|
+
width: this.width,
|
|
972
|
+
height: this.height,
|
|
973
|
+
textAlign: this.textAlign,
|
|
974
|
+
verticalAlign: this.verticalAlign,
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* @inheritDoc
|
|
979
|
+
*/
|
|
980
|
+
renderStyle(options) {
|
|
981
|
+
var _a;
|
|
982
|
+
const styles = super.renderStyle(options);
|
|
983
|
+
return object.cleanObject(Object.assign(Object.assign({}, styles), { backgroundColor: (_a = this.backgroundColor) !== null && _a !== void 0 ? _a : RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR }));
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR = '#f2f2f2';
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Class representing a table head block in the rich text editor.
|
|
990
|
+
*/
|
|
991
|
+
class RTETableHeadCellBlock extends RTETableCellBlock {
|
|
992
|
+
constructor(id) {
|
|
993
|
+
super(id);
|
|
994
|
+
this.type = 'table-head-cell';
|
|
995
|
+
this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation());
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* @inheritDoc
|
|
999
|
+
*/
|
|
1000
|
+
static from(block, options) {
|
|
1001
|
+
const tableCellBlock = new RTETableHeadCellBlock(block.id);
|
|
1002
|
+
super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
|
|
1003
|
+
tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
|
|
1004
|
+
return tableCellBlock;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* @inheritDoc
|
|
1008
|
+
*/
|
|
1009
|
+
clone(parent) {
|
|
1010
|
+
const clonedBlock = new RTETableHeadCellBlock(this.id);
|
|
1011
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
1012
|
+
clonedBlock.parent = parent;
|
|
1013
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
1014
|
+
return clonedBlock;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* @inheritDoc
|
|
1018
|
+
*/
|
|
1019
|
+
toHtml() {
|
|
1020
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
1021
|
+
const attrStr = super.generateAttributeString();
|
|
1022
|
+
return `<th${attrStr}>${childrenHtml}</th>`;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* @inheritDoc
|
|
1026
|
+
*/
|
|
1027
|
+
toJSON() {
|
|
1028
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* Abstract base strategy for handling table column operations.
|
|
1034
|
+
* Provides common functionality for all column-related strategies.
|
|
1035
|
+
*/
|
|
1036
|
+
class TableColumnStrategy extends codeBlock.ActionHandleStrategy {
|
|
1037
|
+
/**
|
|
1038
|
+
* Finds the index range of cells within a table row.
|
|
1039
|
+
* Returns the start and end indices of the given cell range.
|
|
1040
|
+
*
|
|
1041
|
+
* @param {(RTETableCellBlock | RTETableHeadCellBlock)[]} cellRange - The range of table cells to find indices for.
|
|
1042
|
+
* @returns {[number, number]} A tuple containing the start and end indices.
|
|
1043
|
+
*/
|
|
1044
|
+
getBoundaryCellIndexOfRow(cellRange) {
|
|
1045
|
+
const firstCell = cellRange[0];
|
|
1046
|
+
const lastCell = cellRange[cellRange.length - 1];
|
|
1047
|
+
return [firstCell.parent.children.indexOf(firstCell), lastCell.parent.children.indexOf(lastCell)];
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Strategy to handle the toggle of header state of a table column.
|
|
1053
|
+
*/
|
|
1054
|
+
class ToggleHeaderTableColumnStrategy extends TableColumnStrategy {
|
|
1055
|
+
/**
|
|
1056
|
+
* Check if all selected cells are header cells.
|
|
1057
|
+
*
|
|
1058
|
+
* @param {(RTETableCellBlock | RTETableHeadCellBlock)[]} selectedCellRange - The range of selected table cell blocks.
|
|
1059
|
+
* @returns {boolean} True if all selected cells are header cells, false otherwise.
|
|
1060
|
+
*/
|
|
1061
|
+
static isFullHeaderSelection(selectedCellRange) {
|
|
1062
|
+
if (selectedCellRange.length === 0) {
|
|
1063
|
+
return false;
|
|
1064
|
+
}
|
|
1065
|
+
const endSelectedCell = selectedCellRange[selectedCellRange.length - 1];
|
|
1066
|
+
const endSelectedCellIndex = endSelectedCell.parent.children.findIndex((child) => child === endSelectedCell);
|
|
1067
|
+
const table = getParentBlockByType(endSelectedCell, RTETableBlock);
|
|
1068
|
+
if (table) {
|
|
1069
|
+
const allTableRows = getAllTableRows(table);
|
|
1070
|
+
return allTableRows.every((row) => {
|
|
1071
|
+
const cell = row.children[endSelectedCellIndex];
|
|
1072
|
+
return cell instanceof RTETableHeadCellBlock;
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
return false;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* @inheritDoc
|
|
1079
|
+
*/
|
|
1080
|
+
handleAction(action, target) {
|
|
1081
|
+
var _a;
|
|
1082
|
+
const headerOn = action.headerOn;
|
|
1083
|
+
const [startCellIndex, endCellIndex] = this.getBoundaryCellIndexOfRow(action.tableCellHeaderRange);
|
|
1084
|
+
const allTableBodyRows = ((_a = target.children.find((body) => body instanceof RTETableBodyBlock)) === null || _a === void 0 ? void 0 : _a.children) || [];
|
|
1085
|
+
allTableBodyRows.forEach((row) => {
|
|
1086
|
+
const firstTableCellIndex = row.children.findIndex((cell) => !(cell instanceof RTETableHeadCellBlock));
|
|
1087
|
+
if (headerOn) {
|
|
1088
|
+
this.toggleCellsToHeader(firstTableCellIndex, endCellIndex, row);
|
|
1089
|
+
}
|
|
1090
|
+
else {
|
|
1091
|
+
this.toggleHeaderCellsToCells(firstTableCellIndex, row, startCellIndex);
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
const root = this.getRootContent(target);
|
|
1095
|
+
if (root && action.tableCellHeaderRange[0].parent) {
|
|
1096
|
+
const focusNode = action.tableCellHeaderRange[0].parent.getFirstNode();
|
|
1097
|
+
focusNode && root.apply(new dtoRendererManager.UpdateCursorPositionAction(focusNode, 0));
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Toggles the specified header cells in a row to cells.
|
|
1102
|
+
*
|
|
1103
|
+
* @param {number} firstTableCellIndex - The index of the first table cell in the row.
|
|
1104
|
+
* @param {RTETableRowBlock} row - The table row block containing the cells to toggle.
|
|
1105
|
+
* @param {number} startCellIndex - The index of the first cell to toggle.
|
|
1106
|
+
*/
|
|
1107
|
+
toggleHeaderCellsToCells(firstTableCellIndex, row, startCellIndex) {
|
|
1108
|
+
const lastTableHeaderCellIndex = firstTableCellIndex >= 0 ? firstTableCellIndex - 1 : row.children.length - 1;
|
|
1109
|
+
for (let cellIndex = startCellIndex; cellIndex <= lastTableHeaderCellIndex; cellIndex++) {
|
|
1110
|
+
const cellToToggle = row.children[cellIndex];
|
|
1111
|
+
const newCell = RTETableCellBlock.from(cellToToggle.toJSON());
|
|
1112
|
+
this.replaceCellInRow(row, cellToToggle, newCell);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Toggles the specified cells in a row to header cells.
|
|
1117
|
+
*
|
|
1118
|
+
* @param {number} firstTableCellIndex - The index of the first table cell in the row.
|
|
1119
|
+
* @param {number} endCellIndex - The index of the last cell to toggle.
|
|
1120
|
+
* @param {RTETableRowBlock} row - The table row block containing the cells to toggle.
|
|
1121
|
+
*/
|
|
1122
|
+
toggleCellsToHeader(firstTableCellIndex, endCellIndex, row) {
|
|
1123
|
+
for (let tableCellIndex = firstTableCellIndex; tableCellIndex <= endCellIndex; tableCellIndex++) {
|
|
1124
|
+
const cellToToggle = row.children[tableCellIndex];
|
|
1125
|
+
const newHeaderCell = RTETableHeadCellBlock.from(cellToToggle.toJSON());
|
|
1126
|
+
this.replaceCellInRow(row, cellToToggle, newHeaderCell);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Replaces a cell in a given row at the specified index with a new cell.
|
|
1131
|
+
*
|
|
1132
|
+
* @param {RTETableRowBlock} row - The table row block containing the cell to replace.
|
|
1133
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} oldCell - The cell to replace.
|
|
1134
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} newCell - The new cell to insert.
|
|
1135
|
+
*/
|
|
1136
|
+
replaceCellInRow(row, oldCell, newCell) {
|
|
1137
|
+
row.apply(new codeBlock.InsertChildrenBeforeAction(oldCell, newCell));
|
|
1138
|
+
row.apply(new codeBlock.RemoveChildrenAction(oldCell));
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
const DELETE_TABLE_COLUMN = 'DELETE_TABLE_COLUMN';
|
|
1143
|
+
/**
|
|
1144
|
+
* Action to delete a table column
|
|
1145
|
+
*/
|
|
1146
|
+
class DeleteTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1147
|
+
constructor(target) {
|
|
1148
|
+
super();
|
|
1149
|
+
this.isFlushable = true;
|
|
1150
|
+
this.type = DELETE_TABLE_COLUMN;
|
|
1151
|
+
this.tableCellDeleteRange = target;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
const INSERT_TABLE_COLUMN = 'INSERT_TABLE_COLUMN';
|
|
1156
|
+
exports.InsertTableColumnDirection = void 0;
|
|
1157
|
+
(function (InsertTableColumnDirection) {
|
|
1158
|
+
InsertTableColumnDirection["LEFT"] = "LEFT";
|
|
1159
|
+
InsertTableColumnDirection["RIGHT"] = "RIGHT";
|
|
1160
|
+
})(exports.InsertTableColumnDirection || (exports.InsertTableColumnDirection = {}));
|
|
1161
|
+
/**
|
|
1162
|
+
* Action to insert a table column into the RTETable.
|
|
1163
|
+
*/
|
|
1164
|
+
class InsertTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1165
|
+
constructor(insertDirection, tableCellInsertRange) {
|
|
1166
|
+
super();
|
|
1167
|
+
this.isFlushable = true;
|
|
1168
|
+
this.type = INSERT_TABLE_COLUMN;
|
|
1169
|
+
this.tableCellInsertRange = tableCellInsertRange;
|
|
1170
|
+
this.insertDirection = insertDirection;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
const SELECT_TABLE_COLUMN = 'SELECT_TABLE_COLUMN';
|
|
1175
|
+
/**
|
|
1176
|
+
* Action to select a table column into the RTETable.
|
|
1177
|
+
*/
|
|
1178
|
+
class SelectTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1179
|
+
constructor(tableCellSelectRange, selectCellCallback) {
|
|
1180
|
+
super();
|
|
1181
|
+
this.type = SELECT_TABLE_COLUMN;
|
|
1182
|
+
this.tableCellSelectRange = tableCellSelectRange;
|
|
1183
|
+
this.selectCellCallback = selectCellCallback;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
const TOGGLE_HEADER_TABLE_COLUMN = 'TOGGLE_HEADER_TABLE_COLUMN';
|
|
1188
|
+
/**
|
|
1189
|
+
* Action to toggle header state of a table column in the RTETable.
|
|
1190
|
+
*/
|
|
1191
|
+
class ToggleHeaderTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1192
|
+
constructor(tableCellHeaderRange, headerOn) {
|
|
1193
|
+
super();
|
|
1194
|
+
this.isFlushable = true;
|
|
1195
|
+
this.type = TOGGLE_HEADER_TABLE_COLUMN;
|
|
1196
|
+
this.headerOn = false;
|
|
1197
|
+
this.tableCellHeaderRange = tableCellHeaderRange;
|
|
1198
|
+
this.headerOn = headerOn;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
exports.ColumnOperationType = void 0;
|
|
1203
|
+
(function (ColumnOperationType) {
|
|
1204
|
+
ColumnOperationType["HEADER_COLUMN"] = "HEADER_COLUMN";
|
|
1205
|
+
ColumnOperationType["ADD_COLUMN_LEFT"] = "ADD_COLUMN_LEFT";
|
|
1206
|
+
ColumnOperationType["ADD_COLUMN_RIGHT"] = "ADD_COLUMN_RIGHT";
|
|
1207
|
+
ColumnOperationType["DELETE_COLUMN"] = "DELETE_COLUMN";
|
|
1208
|
+
ColumnOperationType["SELECT_COLUMN"] = "SELECT_COLUMN";
|
|
1209
|
+
})(exports.ColumnOperationType || (exports.ColumnOperationType = {}));
|
|
1210
|
+
/**
|
|
1211
|
+
* Event handler for column operations in a table.
|
|
1212
|
+
*/
|
|
1213
|
+
class ColumnOperationEventHandler extends SettingEventHandler {
|
|
1214
|
+
/**
|
|
1215
|
+
* @inheritDoc
|
|
1216
|
+
*/
|
|
1217
|
+
canHandle(action) {
|
|
1218
|
+
return action[0] === exports.TableSettingType.COLUMN;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* @inheritDoc
|
|
1222
|
+
*/
|
|
1223
|
+
execute(action, extensionContext) {
|
|
1224
|
+
const selectedCells = extensionContext.tableSelection.getSelectedCells();
|
|
1225
|
+
if (!selectedCells || selectedCells.length === 0) {
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
const operation = action[1];
|
|
1229
|
+
switch (operation) {
|
|
1230
|
+
case exports.ColumnOperationType.ADD_COLUMN_LEFT:
|
|
1231
|
+
case exports.ColumnOperationType.ADD_COLUMN_RIGHT:
|
|
1232
|
+
this.handleInsertColumn(operation, selectedCells);
|
|
1233
|
+
break;
|
|
1234
|
+
case exports.ColumnOperationType.DELETE_COLUMN:
|
|
1235
|
+
this.handleDeleteColumn(selectedCells);
|
|
1236
|
+
break;
|
|
1237
|
+
case exports.ColumnOperationType.SELECT_COLUMN:
|
|
1238
|
+
this.handleSelectColumn(selectedCells, extensionContext);
|
|
1239
|
+
break;
|
|
1240
|
+
case exports.ColumnOperationType.HEADER_COLUMN:
|
|
1241
|
+
this.handleToggleHeaderColumn(selectedCells);
|
|
1242
|
+
break;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Adds a new column to the table at the specified position.
|
|
1247
|
+
*
|
|
1248
|
+
* @param {ColumnOperationType} direction - The position to insert the new column (left or right).
|
|
1249
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1250
|
+
*/
|
|
1251
|
+
handleInsertColumn(direction, selectedCells) {
|
|
1252
|
+
const action = new InsertTableColumnAction(direction === exports.ColumnOperationType.ADD_COLUMN_LEFT
|
|
1253
|
+
? exports.InsertTableColumnDirection.LEFT
|
|
1254
|
+
: exports.InsertTableColumnDirection.RIGHT, selectedCells);
|
|
1255
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Deletes the selected column from the table.
|
|
1259
|
+
*
|
|
1260
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1261
|
+
*/
|
|
1262
|
+
handleDeleteColumn(selectedCells) {
|
|
1263
|
+
const action = new DeleteTableColumnAction(selectedCells);
|
|
1264
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Selects the entire column in the table.
|
|
1268
|
+
*
|
|
1269
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1270
|
+
* @param {RTETableExtensionContext} extensionContext - The table extension context.
|
|
1271
|
+
*/
|
|
1272
|
+
handleSelectColumn(selectedCells, extensionContext) {
|
|
1273
|
+
const action = new SelectTableColumnAction(selectedCells, (allSelectedCells) => {
|
|
1274
|
+
extensionContext.tableSelection.setSelectedCells(allSelectedCells);
|
|
1275
|
+
});
|
|
1276
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Toggles the header state of the selected column in the table.
|
|
1280
|
+
*
|
|
1281
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1282
|
+
*/
|
|
1283
|
+
handleToggleHeaderColumn(selectedCells) {
|
|
1284
|
+
const headerOn = !ToggleHeaderTableColumnStrategy.isFullHeaderSelection(selectedCells);
|
|
1285
|
+
const action = new ToggleHeaderTableColumnAction(selectedCells, headerOn);
|
|
1286
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Apply the specified action on the table containing the selected cell.
|
|
1290
|
+
*
|
|
1291
|
+
* @param {DeleteTableColumnAction | InsertTableColumnAction} action - The action to apply.
|
|
1292
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The selected table cell.
|
|
1293
|
+
*/
|
|
1294
|
+
applyActionOnTable(action, selectedCell) {
|
|
1295
|
+
const table = getParentBlockByType(selectedCell, RTETableBlock);
|
|
1296
|
+
if (table) {
|
|
1297
|
+
table.apply(action);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
exports.ColumnOperationEventHandler = ColumnOperationEventHandler;
|
|
1303
|
+
exports.DELETE_TABLE_COLUMN = DELETE_TABLE_COLUMN;
|
|
1304
|
+
exports.DELETE_TABLE_ROW = DELETE_TABLE_ROW;
|
|
1305
|
+
exports.INSERT_TABLE_COLUMN = INSERT_TABLE_COLUMN;
|
|
1306
|
+
exports.INSERT_TABLE_ROW = INSERT_TABLE_ROW;
|
|
1307
|
+
exports.RTETableBlock = RTETableBlock;
|
|
1308
|
+
exports.RTETableBodyBlock = RTETableBodyBlock;
|
|
1309
|
+
exports.RTETableCellBlock = RTETableCellBlock;
|
|
1310
|
+
exports.RTETableHeadBlock = RTETableHeadBlock;
|
|
1311
|
+
exports.RTETableHeadCellBlock = RTETableHeadCellBlock;
|
|
1312
|
+
exports.RTETableRowBlock = RTETableRowBlock;
|
|
1313
|
+
exports.RowOperationEventHandler = RowOperationEventHandler;
|
|
1314
|
+
exports.SELECT_TABLE_COLUMN = SELECT_TABLE_COLUMN;
|
|
1315
|
+
exports.SettingEventHandler = SettingEventHandler;
|
|
1316
|
+
exports.TOGGLE_HEADER_ROW = TOGGLE_HEADER_ROW;
|
|
1317
|
+
exports.TOGGLE_HEADER_TABLE_COLUMN = TOGGLE_HEADER_TABLE_COLUMN;
|
|
1318
|
+
exports.TableColumnStrategy = TableColumnStrategy;
|
|
1319
|
+
exports.ToggleHeaderTableColumnStrategy = ToggleHeaderTableColumnStrategy;
|
|
1320
|
+
exports.generateTableBody = generateTableBody;
|
|
1321
|
+
exports.getAllTableRows = getAllTableRows;
|
|
1322
|
+
exports.getDefaultCellBlockTemplate = getDefaultCellBlockTemplate;
|
|
1323
|
+
exports.getFirstNode = getFirstNode;
|
|
1324
|
+
exports.getParentBlockByType = getParentBlockByType;
|
|
1325
|
+
exports.remoteInvocationRegistry = remoteInvocationRegistry;
|