devexpress-richedit 24.1.8-build-24316-0102 → 24.2.2-beta
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/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +12 -1
- package/dist/dx.richedit.js +1174 -907
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/api/loading-panel.js +3 -3
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.d.ts +2 -2
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
- package/lib/client/client-rich-edit.d.ts +1 -0
- package/lib/client/client-rich-edit.js +15 -11
- package/lib/client/commands/commands.js +3 -0
- package/lib/client/commands/new-document-command.js +2 -1
- package/lib/client/commands/open-document-command.d.ts +1 -1
- package/lib/client/default-localization.js +2 -0
- package/lib/client/dialogs/dialog-base.js +3 -3
- package/lib/client/document-processor/public/processor.js +3 -3
- package/lib/client/formats/docx/export/data.js +5 -5
- package/lib/client/formats/docx/export/exporters/base/sections.js +4 -4
- package/lib/client/formats/docx/export/exporters/base.js +1 -1
- package/lib/client/formats/docx/export/exporters/content-types.js +4 -4
- package/lib/client/formats/docx/export/exporters/relations/relation-collection.js +1 -1
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.d.ts +1 -1
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.js +3 -3
- package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js +1 -1
- package/lib/client/formats/docx/import/data.js +2 -2
- package/lib/client/formats/docx/import/destination/character-properties/run-properties-base-destination.js +1 -1
- package/lib/client/formats/docx/import/destination/destination.d.ts +2 -2
- package/lib/client/formats/docx/import/destination/destination.js +7 -7
- package/lib/client/formats/docx/import/destination/drawing/drawing-anchor-position-destination.js +9 -9
- package/lib/client/formats/docx/import/destination/drawing/drawing-anchor-relative-size-destination.js +6 -6
- package/lib/client/formats/docx/import/destination/drawing/drawing-destination.js +38 -38
- package/lib/client/formats/docx/import/destination/drawing/non-visual-pucture-properties-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/drawing/shape-properties-destination.js +9 -9
- package/lib/client/formats/docx/import/destination/notes/note-destination.d.ts +1 -1
- package/lib/client/formats/docx/import/destination/notes/note-properties-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/numbering/numberings-destination.js +15 -15
- package/lib/client/formats/docx/import/destination/paragraph/paragraph-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-numbering-reference-destination.js +5 -5
- package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-properties-base-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-properties-destination.js +7 -7
- package/lib/client/formats/docx/import/destination/relationships/relationships-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/runs/inline-object-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/style/destinations/style-paragraph-properties-destination.js +4 -4
- package/lib/client/formats/docx/import/destination/table/cell/properties/table-cell-properties-destination-core.js +3 -3
- package/lib/client/formats/docx/import/destination/table/cell/table-cell-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/table/row/properties/table-row-properties-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/table/row/table-row-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/table/table/properties/table-cell-margins-destination.d.ts +1 -1
- package/lib/client/formats/docx/import/destination/table/table/properties/table-properties-destination-core.js +3 -3
- package/lib/client/formats/docx/import/destination/table/table/properties/table-properties-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/table/table/properties/table-properties-leaf-element-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/table/table/table-destination.js +3 -3
- package/lib/client/formats/docx/import/destination/themes/color/drawing-color-properties-destination-base.js +3 -3
- package/lib/client/formats/docx/import/destination/themes/font/office-theme-font-collection-scheme-destination.js +7 -7
- package/lib/client/formats/docx/import/destination/vml/v-mlshape-destination.js +7 -7
- package/lib/client/formats/docx/import/importers/character-importer.js +6 -6
- package/lib/client/formats/docx/import/importers/comments-importer.js +1 -1
- package/lib/client/formats/docx/import/importers/field-importer.js +2 -2
- package/lib/client/formats/docx/import/importers/table-importer.js +1 -1
- package/lib/client/formats/docx/import/list/open-xml-list-level-override.js +3 -3
- package/lib/client/formats/docx/import/list/open-xml-numbering-list-info.d.ts +1 -1
- package/lib/client/formats/docx/utils/constants.js +6 -6
- package/lib/client/formats/docx/zip/xml-reader.js +10 -10
- package/lib/client/i-rich-constructor-settings.d.ts +2 -1
- package/lib/client/model-api/api-utils/parameter-checker.d.ts +1 -1
- package/lib/client/model-api/collections/drawing-object-collection.js +1 -1
- package/lib/client/model-api/fonts/control-font.js +4 -4
- package/lib/client/model-api/images/image-iterator.js +3 -3
- package/lib/client/model-api/interval.js +1 -1
- package/lib/client/public/api/authentication-options.js +3 -3
- package/lib/client/public/api/range-permission-options.js +3 -3
- package/lib/client/public/client-events.d.ts +2 -1
- package/lib/client/public/client-events.js +3 -1
- package/lib/client/public/commands/enum.d.ts +2 -1
- package/lib/client/public/commands/enum.js +1 -0
- package/lib/client/public/context-menu/menu.js +5 -5
- package/lib/client/public/events.d.ts +6 -0
- package/lib/client/public/events.js +8 -0
- package/lib/client/public/nusa/external-types.d.ts +2 -2
- package/lib/client/public/nusa/settings.js +1 -1
- package/lib/client/public/options.d.ts +1 -0
- package/lib/client/public/ribbon/item-ids.d.ts +2 -1
- package/lib/client/public/ribbon/item-ids.js +1 -0
- package/lib/client/public/ribbon/tab.d.ts +4 -4
- package/lib/client/public/ribbon/tab.js +2 -2
- package/lib/client/public/rich-edit.js +2 -2
- package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -1
- package/lib/client/ribbon/ribbon.d.ts +3 -3
- package/lib/client/ribbon/ribbon.js +1 -1
- package/lib/client/ribbon/toolbar-items/toolbar-interactive-item.d.ts +2 -2
- package/lib/client/settings.js +2 -0
- package/lib/client/utils/devextreme/devextreme-types.d.ts +17 -17
- package/lib/client/utils/devextreme/dxt-utils.d.ts +1 -1
- package/lib/common/auto-correct/auto-correct-providers.js +1 -1
- package/lib/common/bars/base.js +1 -1
- package/lib/common/canvas/canvas-manager.js +3 -3
- package/lib/common/canvas/canvas-scroll-manager.js +2 -2
- package/lib/common/canvas/listeners/anchor-listener.js +3 -3
- package/lib/common/canvas/listeners/resize-box-listener.js +5 -5
- package/lib/common/canvas/renderes/canvas-listener/canvas-listener.js +1 -1
- package/lib/common/canvas/renderes/change-active-sub-document/renderer.js +10 -10
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/common/document-renderer.js +1 -1
- package/lib/common/canvas/renderes/view-manager.js +3 -3
- package/lib/common/client-side-events.d.ts +1 -0
- package/lib/common/client-side-events.js +3 -0
- package/lib/common/commands/client-command.d.ts +2 -1
- package/lib/common/commands/client-command.js +1 -0
- package/lib/common/commands/command-base.js +10 -10
- package/lib/common/commands/command-manager.js +2 -1
- package/lib/common/commands/command-states.js +3 -3
- package/lib/common/commands/dialogs/dialog-spell-checker-command.js +3 -3
- package/lib/common/commands/document/print-document-on-client-command.js +4 -4
- package/lib/common/commands/fields/create-field-command.d.ts +4 -0
- package/lib/common/commands/fields/create-field-command.js +8 -0
- package/lib/common/commands/fields/open-hyperlink-command.js +3 -2
- package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +1 -1
- package/lib/common/commands/floating-objects/insert-anchored-text-box-command.js +1 -1
- package/lib/common/commands/ruler/toggle-show-horizontal-ruler-command.js +3 -1
- package/lib/common/commands/text/change-text-case-commands.d.ts +1 -1
- package/lib/common/event-manager.js +4 -4
- package/lib/common/formats/html/export/html-document-exporter.js +1 -1
- package/lib/common/formats/html/export/html-export.d.ts +7 -1
- package/lib/common/formats/html/export/html-export.js +38 -38
- package/lib/common/formats/html/import/html-importer.d.ts +1 -1
- package/lib/common/formats/html/import/html-importer.js +12 -12
- package/lib/common/formats/html/import/html-model-inserter.js +4 -4
- package/lib/common/formats/html/import/importers/base.js +1 -1
- package/lib/common/formats/html/import/importers/list-base.js +4 -4
- package/lib/common/formats/html/import/utils/character-properties-utils.js +4 -4
- package/lib/common/formats/i-document-importer.d.ts +2 -2
- package/lib/common/formats/pdf/exporter.js +3 -3
- package/lib/common/formats/pdf/interfaces.d.ts +2 -2
- package/lib/common/formats/rtf/export/exporter.js +1 -1
- package/lib/common/formats/rtf/export/exporters/rtf-anchored-picture-run-exporter.js +5 -5
- package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.d.ts +1 -1
- package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.js +2 -2
- package/lib/common/formats/rtf/export/rtf-builder.d.ts +2 -2
- package/lib/common/formats/rtf/import/destination/base/destination.d.ts +4 -4
- package/lib/common/formats/rtf/import/destination/base/destination.js +1 -1
- package/lib/common/formats/rtf/import/destination/base/skip-destination.js +3 -3
- package/lib/common/formats/rtf/import/destination/base/string-property-base-destination.js +2 -2
- package/lib/common/formats/rtf/import/destination/base/string-property-destination.js +2 -2
- package/lib/common/formats/rtf/import/destination/base/unicode-destination.js +2 -2
- package/lib/common/formats/rtf/import/destination/fields/field-sub-destination.js +1 -1
- package/lib/common/formats/rtf/import/destination/fields/table-content-field-destination.js +1 -1
- package/lib/common/formats/rtf/import/destination/font-table-destination.js +3 -3
- package/lib/common/formats/rtf/import/destination/numbering-list/destination-old-paragraph-numbering.js +1 -1
- package/lib/common/formats/rtf/import/destination/numbering-list/destination-old-section-numbering-level.js +1 -1
- package/lib/common/formats/rtf/import/destination/picture/picture-destination.js +4 -4
- package/lib/common/formats/rtf/import/destination/shape/shape-properties-destination-base.js +2 -2
- package/lib/common/formats/rtf/import/destination/shape/shape-property-destination.js +2 -2
- package/lib/common/formats/rtf/import/destination/shape/shape-property-hsv-value-destination.js +2 -2
- package/lib/common/formats/rtf/import/destination/styles/character-style-destination.js +5 -5
- package/lib/common/formats/rtf/import/destination/styles/style-sheet-destination.js +3 -3
- package/lib/common/formats/rtf/import/destination/styles/table-style-destination.js +7 -7
- package/lib/common/formats/rtf/import/destination/sub-document/destination-sub-document.js +2 -2
- package/lib/common/formats/rtf/import/destination/sub-document/section-header-footer-destination-base.js +1 -1
- package/lib/common/formats/rtf/import/importers/character-importer.js +1 -1
- package/lib/common/formats/rtf/import/importers/field-importer.js +2 -2
- package/lib/common/formats/rtf/import/importers/paragraph-importer.js +4 -4
- package/lib/common/formats/rtf/import/importers/range-permission-importer.js +1 -1
- package/lib/common/formats/rtf/import/importers/section-importer.js +4 -4
- package/lib/common/formats/rtf/import/importers/styles/paragraph-style-importer.js +4 -4
- package/lib/common/formats/rtf/import/model/numbering-lists/rtf-old-list-level-info.js +10 -10
- package/lib/common/formats/rtf/import/rtf-import-data.js +13 -13
- package/lib/common/formats/txt/txt-exporter.js +1 -1
- package/lib/common/global-event-dispatcher.d.ts +1 -1
- package/lib/common/input-controller.d.ts +14 -1
- package/lib/common/input-controller.js +58 -20
- package/lib/common/interfaces/i-control-owner.d.ts +1 -0
- package/lib/common/layout/document-layout.js +1 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-anchored-object-box.d.ts +1 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-dash-box.js +1 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-line-break-box.js +4 -4
- package/lib/common/layout/main-structures/layout-boxes/layout-numbering-list-box.js +10 -10
- package/lib/common/layout/main-structures/layout-boxes/layout-page-break-box.js +4 -4
- package/lib/common/layout/main-structures/layout-boxes/layout-space-box.js +1 -1
- package/lib/common/layout/main-structures/layout-row.js +1 -1
- package/lib/common/layout/table/table-cell-iterator.js +6 -6
- package/lib/common/layout-engine/hit-test-manager/hit-test-result.d.ts +1 -1
- package/lib/common/layout-engine/selection/selection-formatter.js +1 -1
- package/lib/common/layout-formatter/box/generator/box-infos-generator.js +3 -3
- package/lib/common/layout-formatter/changes/changes/layout-change-base.js +12 -12
- package/lib/common/layout-formatter/invalidator/layout-invalidator.js +3 -3
- package/lib/common/layout-formatter/managers/formatter-manager.d.ts +1 -1
- package/lib/common/layout-formatter/managers/formatter-manager.js +2 -2
- package/lib/common/layout-formatter/row/result.js +3 -3
- package/lib/common/layout-formatter/row/size-engine/row-formatting-info.js +2 -2
- package/lib/common/layout-formatter/row/size-engine/row-height-calculator.js +3 -3
- package/lib/common/layout-formatter/row/tab-info.js +8 -8
- package/lib/common/layout-formatter/table/borders/border-helper.d.ts +1 -1
- package/lib/common/layout-formatter/table/borders/border-helper.js +5 -5
- package/lib/common/layout-formatter/table/formatter.js +12 -12
- package/lib/common/layout-formatter/table/grid-engine/calculators/column-interval.js +3 -3
- package/lib/common/layout-formatter/table/grid-engine/calculators/grid-calculator.js +3 -3
- package/lib/common/layout-formatter/table/grid-engine/calculators/table-properties-cache.js +7 -7
- package/lib/common/layout-formatter/table/info/cell-info.js +8 -8
- package/lib/common/layout-formatter/table/info/row-info.js +1 -1
- package/lib/common/layout-formatter/table/info/table-info.js +17 -17
- package/lib/common/model/bookmarks.js +7 -7
- package/lib/common/model/borders/border-base.js +3 -3
- package/lib/common/model/caches/hash-based-cache.d.ts +1 -1
- package/lib/common/model/caches/hash-based-cache.js +2 -2
- package/lib/common/model/caches/images.js +11 -11
- package/lib/common/model/changes/change.d.ts +1 -1
- package/lib/common/model/changes/sub-document/list/paragraph-numbering-list-changed.js +1 -1
- package/lib/common/model/changes/sub-document/table/cell-property-changed.js +1 -1
- package/lib/common/model/changes/sub-document/table/property-changed.js +1 -1
- package/lib/common/model/changes/sub-document/table/row-property-changed.js +1 -1
- package/lib/common/model/character/character-property-descriptor.d.ts +1 -1
- package/lib/common/model/color/color-model-info.js +6 -6
- package/lib/common/model/creator/font-corrector.js +5 -5
- package/lib/common/model/document-model.js +10 -10
- package/lib/common/model/fields/field-request-manager.d.ts +1 -1
- package/lib/common/model/fields/field-request-manager.js +2 -2
- package/lib/common/model/fields/names.d.ts +2 -1
- package/lib/common/model/fields/names.js +1 -0
- package/lib/common/model/fields/parsers/field-code-parser-client-updating-base.js +1 -1
- package/lib/common/model/fields/parsers/field-code-parser-doc-variable.js +1 -1
- package/lib/common/model/fields/parsers/field-code-parser-hyperlink.js +1 -1
- package/lib/common/model/fields/parsers/field-code-parser-if.d.ts +39 -0
- package/lib/common/model/fields/parsers/field-code-parser-if.js +138 -0
- package/lib/common/model/fields/parsers/field-code-parser-merge-field.js +1 -1
- package/lib/common/model/fields/parsers/field-code-parser.d.ts +5 -4
- package/lib/common/model/fields/parsers/field-code-parser.js +6 -12
- package/lib/common/model/fields/tree-creator.js +3 -1
- package/lib/common/model/floating-objects/sizes.js +2 -2
- package/lib/common/model/fonts/control-font.js +9 -9
- package/lib/common/model/fonts/loader.js +1 -1
- package/lib/common/model/footnotes/footnote.d.ts +1 -1
- package/lib/common/model/history/base/history-item.js +6 -6
- package/lib/common/model/history/base/interval-based-history-item.js +2 -2
- package/lib/common/model/history/base/position-based-history-item.js +2 -2
- package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js +1 -0
- package/lib/common/model/history/items/insert-text-history-item.js +3 -3
- package/lib/common/model/history/items/switch-text-box-sub-documents-state-history-item.js +0 -1
- package/lib/common/model/history/selection/scroll-history-item.js +3 -3
- package/lib/common/model/history/selection/selection-history-item.js +3 -3
- package/lib/common/model/json/importers/sub-document/run-importers.d.ts +2 -2
- package/lib/common/model/manipulators/base-manipulator.js +2 -2
- package/lib/common/model/manipulators/document/sub-document-inserter.js +6 -6
- package/lib/common/model/manipulators/model-manipulator.js +1 -1
- package/lib/common/model/manipulators/picture-manipulator/insert-picture-manipulator-params.js +1 -1
- package/lib/common/model/manipulators/picture-manipulator/loader/image-loading-options.d.ts +1 -1
- package/lib/common/model/manipulators/picture-manipulator/loader/picture-loader.d.ts +1 -1
- package/lib/common/model/manipulators/picture-manipulator/loader/picture-loader.js +1 -1
- package/lib/common/model/manipulators/range/create-range-copy-operation.js +3 -3
- package/lib/common/model/manipulators/range/remove-interval-operation.js +8 -2
- package/lib/common/model/manipulators/tables/insert-table-cell-operation.js +1 -1
- package/lib/common/model/manipulators/tables/insert-table-row-operation.js +1 -1
- package/lib/common/model/manipulators/tables/merge-table-cells-operation.js +1 -1
- package/lib/common/model/manipulators/tables/table-normalizator.d.ts +2 -2
- package/lib/common/model/manipulators/text-box-manipulator.d.ts +1 -1
- package/lib/common/model/manipulators/text-box-manipulator.js +2 -1
- package/lib/common/model/options/fields.d.ts +1 -0
- package/lib/common/model/options/fields.js +3 -1
- package/lib/common/model/options/pdf.d.ts +2 -2
- package/lib/common/model/options/rich-options.js +3 -3
- package/lib/common/model/paragraph/paragraph-property-descriptors.d.ts +1 -1
- package/lib/common/model/paragraph/paragraph.js +1 -1
- package/lib/common/model/position/linked-interval.js +4 -4
- package/lib/common/model/range-permissions.js +3 -3
- package/lib/common/model/runs/anchored-picture-run.js +4 -4
- package/lib/common/model/runs/inline-picture-run.d.ts +1 -1
- package/lib/common/model/runs/inline-picture-run.js +1 -1
- package/lib/common/model/runs/run-base.js +4 -4
- package/lib/common/model/section/section-property-descriptor.d.ts +1 -1
- package/lib/common/model/shadings/shading-info.js +3 -3
- package/lib/common/model/styles-manager.d.ts +1 -1
- package/lib/common/model/tables/main-structures/table-row.js +1 -1
- package/lib/common/mouse-handler/base/manipulator-handler-state-base.js +2 -2
- package/lib/common/mouse-handler/mouse-handler/mouse-handler-drag-column-or-row-state.d.ts +1 -1
- package/lib/common/rich-edit-core.js +11 -11
- package/lib/common/rich-utils/debug/runtime-template-model-creator.js +6 -6
- package/lib/common/scroll/model-states.d.ts +1 -1
- package/lib/common/scroll/model-states.js +4 -4
- package/lib/common/selection/selected-cells-engine.js +12 -12
- package/lib/common/selection/selection-intervals-info.js +7 -7
- package/lib/common/selection/selection-state.js +5 -5
- package/lib/common/selection/selection.js +15 -14
- package/lib/common/ui/quick-search-panel.js +1 -1
- package/lib/common/ui/ruler/controls/base.js +1 -1
- package/lib/common/ui/ruler/controls/column.js +1 -1
- package/lib/common/ui/ruler/controls/divisions.js +1 -1
- package/lib/common/ui/ruler/controls/indent/first-line.js +7 -7
- package/lib/common/ui/ruler/controls/indent/left.js +6 -6
- package/lib/common/ui/ruler/controls/indent/right.js +7 -7
- package/lib/common/ui/ruler/controls/margin/left.js +4 -4
- package/lib/common/ui/ruler/controls/margin/right.js +1 -1
- package/lib/common/ui/ruler/controls/owner.js +1 -1
- package/lib/common/ui/ruler/controls/ruler.js +5 -5
- package/lib/common/ui/ruler/controls/tab/tab-type.js +5 -5
- package/lib/common/ui/ruler/controls/tab/tab.js +7 -7
- package/lib/common/ui/ruler/controls/tab/utils.d.ts +2 -2
- package/lib/common/ui/ruler/controls/tab/utils.js +5 -5
- package/lib/common/ui/ruler/controls/table.js +1 -1
- package/lib/common/ui/ruler/controls/vertical-line.d.ts +1 -2
- package/lib/common/ui/ruler/controls/vertical-line.js +2 -2
- package/lib/common/ui/ruler/controls/wrapper.js +1 -1
- package/lib/common/ui/ruler/manager.js +19 -19
- package/lib/common/ui/ruler/model-data.d.ts +8 -2
- package/lib/common/ui/ruler/model-data.js +10 -4
- package/lib/common/ui/ruler/ruler.js +4 -3
- package/lib/common/utils/utils.d.ts +8 -1
- package/lib/common/utils/utils.js +39 -8
- package/lib/common/view-settings/views-settings.js +6 -6
- package/package.json +3 -3
@@ -0,0 +1,138 @@
|
|
1
|
+
import { FieldName } from '../names';
|
2
|
+
import { FieldCodeParserClientUpdatingBase } from './field-code-parser-client-updating-base';
|
3
|
+
export class FieldCodeParserIf extends FieldCodeParserClientUpdatingBase {
|
4
|
+
get name() { return FieldName.If; }
|
5
|
+
fillResult() {
|
6
|
+
this.setInputPositionState();
|
7
|
+
let result = null;
|
8
|
+
try {
|
9
|
+
const expression = this.parseParameters(this.parameterInfoList);
|
10
|
+
result = expression.evaluate();
|
11
|
+
}
|
12
|
+
catch (err) {
|
13
|
+
if (err instanceof IfExpressionError) {
|
14
|
+
result = err.message;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
finally {
|
18
|
+
if (result) {
|
19
|
+
this.replaceTextByInterval(this.getTopField().getResultInterval(), result);
|
20
|
+
}
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
parseParameters(parameters) {
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
26
|
+
if (parameters.length > 5)
|
27
|
+
throw new IfExpressionTooManyParametersError();
|
28
|
+
if (parameters.length === 0)
|
29
|
+
throw new IfExpressionMissingParametersError();
|
30
|
+
let leftExpression;
|
31
|
+
let operator;
|
32
|
+
let rightExpression;
|
33
|
+
let trueText;
|
34
|
+
let falseText;
|
35
|
+
if (parameters.length <= 3 && !IfExpression.isOperator((_a = parameters[1]) === null || _a === void 0 ? void 0 : _a.text)) {
|
36
|
+
leftExpression = new IfExpressionParameter((_b = parameters[0]) === null || _b === void 0 ? void 0 : _b.text, (_c = parameters[0]) === null || _c === void 0 ? void 0 : _c.quoted);
|
37
|
+
trueText = (_d = parameters[1]) === null || _d === void 0 ? void 0 : _d.text;
|
38
|
+
falseText = (_e = parameters[2]) === null || _e === void 0 ? void 0 : _e.text;
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
leftExpression = new IfExpressionParameter((_f = parameters[0]) === null || _f === void 0 ? void 0 : _f.text, (_g = parameters[0]) === null || _g === void 0 ? void 0 : _g.quoted);
|
42
|
+
operator = (_h = parameters[1]) === null || _h === void 0 ? void 0 : _h.text;
|
43
|
+
rightExpression = new IfExpressionParameter((_j = parameters[2]) === null || _j === void 0 ? void 0 : _j.text, (_k = parameters[2]) === null || _k === void 0 ? void 0 : _k.quoted);
|
44
|
+
trueText = (_l = parameters[3]) === null || _l === void 0 ? void 0 : _l.text;
|
45
|
+
falseText = (_m = parameters[4]) === null || _m === void 0 ? void 0 : _m.text;
|
46
|
+
}
|
47
|
+
return new IfExpression(operator, leftExpression, rightExpression, trueText, falseText);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
export class IfExpression {
|
51
|
+
constructor(operator, leftExpression, rightExpression, trueText = undefined, falseText = undefined) {
|
52
|
+
this.operator = operator;
|
53
|
+
this.leftExpression = leftExpression;
|
54
|
+
this.rightExpression = rightExpression;
|
55
|
+
this.trueText = trueText;
|
56
|
+
this.falseText = falseText;
|
57
|
+
}
|
58
|
+
static isOperator(operator) {
|
59
|
+
return IfExpression.operators.includes(operator);
|
60
|
+
}
|
61
|
+
evaluate() {
|
62
|
+
if (!this.operator && !this.leftExpression.isNumber) {
|
63
|
+
return this.leftExpression.text ? this.trueText : this.falseText;
|
64
|
+
}
|
65
|
+
if (!IfExpression.isOperator(this.operator)) {
|
66
|
+
throw new IfExpressionInvalidOperatorError();
|
67
|
+
}
|
68
|
+
let difference;
|
69
|
+
if (this.leftExpression.isNumber && this.rightExpression.isNumber) {
|
70
|
+
difference = this.leftExpression.number - this.rightExpression.number;
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
const isEqualityOperator = this.operator === "=" || this.operator === "<>";
|
74
|
+
const compareFunction = isEqualityOperator ? IfExpression.compareStringsWithWildcards : IfExpression.compareStrings;
|
75
|
+
difference = compareFunction(this.leftExpression.text, this.rightExpression.text);
|
76
|
+
}
|
77
|
+
return this.evaluateComparison(difference) ? this.trueText : this.falseText;
|
78
|
+
}
|
79
|
+
evaluateComparison(comparisonResult) {
|
80
|
+
switch (this.operator) {
|
81
|
+
case "<":
|
82
|
+
return comparisonResult < 0;
|
83
|
+
case ">":
|
84
|
+
return comparisonResult > 0;
|
85
|
+
case "=":
|
86
|
+
return comparisonResult === 0;
|
87
|
+
case "<=":
|
88
|
+
return comparisonResult <= 0;
|
89
|
+
case ">=":
|
90
|
+
return comparisonResult >= 0;
|
91
|
+
case "<>":
|
92
|
+
return comparisonResult != 0;
|
93
|
+
default:
|
94
|
+
return false;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
static compareStrings(leftValue, rightValue) {
|
98
|
+
return leftValue.localeCompare(rightValue);
|
99
|
+
}
|
100
|
+
static compareStringsWithWildcards(leftValue, rightValue) {
|
101
|
+
const escapedPattern = rightValue.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
102
|
+
const regexPattern = escapedPattern.replace(/\*/g, '.*').replace(/\?/g, '.');
|
103
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
104
|
+
return regex.test(leftValue) ? 0 : 1;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
IfExpression.operators = ["<", ">", "=", "<=", ">=", "<>"];
|
108
|
+
export class IfExpressionParameter {
|
109
|
+
constructor(text, isQuoted = false) {
|
110
|
+
this.text = text;
|
111
|
+
this.number = parseFloat(text);
|
112
|
+
this.isNumber = !isQuoted && !Number.isNaN(this.number);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
export class IfExpressionError extends Error {
|
116
|
+
constructor(message) {
|
117
|
+
super(message);
|
118
|
+
Object.setPrototypeOf(this, IfExpressionError.prototype);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
export class IfExpressionInvalidOperatorError extends IfExpressionError {
|
122
|
+
constructor(message) {
|
123
|
+
super(message !== null && message !== void 0 ? message : "IF field error: Invalid comparison operator");
|
124
|
+
Object.setPrototypeOf(this, IfExpressionInvalidOperatorError.prototype);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
export class IfExpressionTooManyParametersError extends IfExpressionError {
|
128
|
+
constructor(message) {
|
129
|
+
super(message !== null && message !== void 0 ? message : "IF field error: Too many parameters");
|
130
|
+
Object.setPrototypeOf(this, IfExpressionTooManyParametersError.prototype);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
export class IfExpressionMissingParametersError extends IfExpressionError {
|
134
|
+
constructor(message) {
|
135
|
+
super(message !== null && message !== void 0 ? message : "IF field error: Missing parameter(s)");
|
136
|
+
Object.setPrototypeOf(this, IfExpressionMissingParametersError.prototype);
|
137
|
+
}
|
138
|
+
}
|
@@ -25,7 +25,7 @@ export class FieldCodeParserMailMerge extends FieldCodeParserDocVariable {
|
|
25
25
|
}
|
26
26
|
getMergeFieldName() {
|
27
27
|
if (this.parameterInfoList.length == 0)
|
28
|
-
this.parseSwitchesAndArgs(
|
28
|
+
this.parseSwitchesAndArgs();
|
29
29
|
return this.parameterInfoList[0] ? this.parameterInfoList[0].text : '';
|
30
30
|
}
|
31
31
|
applyResponse(response) {
|
@@ -38,7 +38,8 @@ export declare class FieldSwitch {
|
|
38
38
|
export declare class FieldParameter {
|
39
39
|
interval: FixedInterval;
|
40
40
|
text: string;
|
41
|
-
|
41
|
+
quoted: boolean;
|
42
|
+
constructor(interval: FixedInterval, textRepresentation: string, quoted?: boolean);
|
42
43
|
clone(): FieldParameter;
|
43
44
|
}
|
44
45
|
export declare class FieldCodeParserHelper {
|
@@ -46,7 +47,7 @@ export declare class FieldCodeParserHelper {
|
|
46
47
|
static isBackslesh(char: string): boolean;
|
47
48
|
static isQuote(char: string): boolean;
|
48
49
|
}
|
49
|
-
export
|
50
|
+
export type FieldParserConstructorArguments = {
|
50
51
|
modelManager: IModelManager;
|
51
52
|
layoutFormatterManager: FormatterManager;
|
52
53
|
requestManager: FieldRequestManager;
|
@@ -55,7 +56,7 @@ export declare type FieldParserConstructorArguments = {
|
|
55
56
|
modelIterator: ModelIterator;
|
56
57
|
fieldNameFirstLetterPosition: number;
|
57
58
|
};
|
58
|
-
export
|
59
|
+
export type FieldParserConstructor = (args: FieldParserConstructorArguments) => FieldCodeParser;
|
59
60
|
export declare abstract class FieldCodeParser {
|
60
61
|
protected readonly switchInfoList: FieldSwitch[];
|
61
62
|
protected readonly parameterInfoList: FieldParameter[];
|
@@ -97,7 +98,7 @@ export declare abstract class FieldCodeParser {
|
|
97
98
|
updateInfo(): boolean;
|
98
99
|
protected needUpdateInfo(): boolean;
|
99
100
|
protected updateInfoCore(): void;
|
100
|
-
parseSwitchesAndArgs(
|
101
|
+
parseSwitchesAndArgs(): boolean;
|
101
102
|
private skipWhitespaces;
|
102
103
|
private getFieldParameterInfo;
|
103
104
|
private getSwitchInfo;
|
@@ -43,12 +43,13 @@ export class FieldSwitch {
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
export class FieldParameter {
|
46
|
-
constructor(interval, textRepresentation) {
|
46
|
+
constructor(interval, textRepresentation, quoted = false) {
|
47
47
|
this.text = textRepresentation;
|
48
48
|
this.interval = interval;
|
49
|
+
this.quoted = quoted;
|
49
50
|
}
|
50
51
|
clone() {
|
51
|
-
return new FieldParameter(this.interval.clone(), this.text);
|
52
|
+
return new FieldParameter(this.interval.clone(), this.text, this.quoted);
|
52
53
|
}
|
53
54
|
}
|
54
55
|
export class FieldCodeParserHelper {
|
@@ -313,7 +314,7 @@ export class FieldCodeParser {
|
|
313
314
|
updateInfo() {
|
314
315
|
if (!this.needUpdateInfo())
|
315
316
|
return false;
|
316
|
-
this.parseSwitchesAndArgs(
|
317
|
+
this.parseSwitchesAndArgs();
|
317
318
|
this.updateInfoCore();
|
318
319
|
return true;
|
319
320
|
}
|
@@ -321,14 +322,7 @@ export class FieldCodeParser {
|
|
321
322
|
return false;
|
322
323
|
}
|
323
324
|
updateInfoCore() { }
|
324
|
-
parseSwitchesAndArgs(
|
325
|
-
if (needAtLestOneSpaceAfterFieldName) {
|
326
|
-
var prevPos = this.modelIterator.getAbsolutePosition();
|
327
|
-
if (this.skipWhitespaces())
|
328
|
-
this.modelIterator.setPosition(prevPos);
|
329
|
-
else
|
330
|
-
return this.modelIterator.run.getType() == RunType.FieldCodeEndRun;
|
331
|
-
}
|
325
|
+
parseSwitchesAndArgs() {
|
332
326
|
while (this.skipWhitespaces() && this.modelIterator.run.getType() != RunType.FieldCodeEndRun) {
|
333
327
|
var currChar = this.modelIterator.getCurrentChar();
|
334
328
|
if (FieldCodeParserHelper.isBackslesh(currChar)) {
|
@@ -364,7 +358,7 @@ export class FieldCodeParser {
|
|
364
358
|
var argInterval = parseResult.quoted ?
|
365
359
|
FixedInterval.fromPositions(startPosition + 1, this.modelIterator.getAbsolutePosition() - 1) :
|
366
360
|
FixedInterval.fromPositions(startPosition, this.modelIterator.getAbsolutePosition());
|
367
|
-
return new FieldParameter(argInterval, parseResult.argListChars.join(""));
|
361
|
+
return new FieldParameter(argInterval, parseResult.argListChars.join(""), parseResult.quoted);
|
368
362
|
}
|
369
363
|
getSwitchInfo() {
|
370
364
|
if (!this.moveIteratorToNextChar() || this.modelIterator.run.getType() != RunType.TextRun)
|
@@ -18,6 +18,7 @@ import { FieldCodeParserTc } from './parsers/field-code-parser-tc';
|
|
18
18
|
import { FieldCodeParserTime } from './parsers/field-code-parser-time';
|
19
19
|
import { FieldCodeParserToc } from './parsers/field-code-parser-toc';
|
20
20
|
import { FieldCodeParserFillIn } from './parsers/fill-in';
|
21
|
+
import { FieldCodeParserIf } from './parsers/field-code-parser-if';
|
21
22
|
class FieldParsersAndIntervals {
|
22
23
|
constructor(interval) {
|
23
24
|
this.interval = interval;
|
@@ -40,6 +41,7 @@ export class UpdateFieldsOptions {
|
|
40
41
|
}
|
41
42
|
}
|
42
43
|
export class FieldsWaitingForUpdate {
|
44
|
+
get fields() { return this.subDocument.fields; }
|
43
45
|
constructor(modelManager, layoutFormatterManager, requestManager, subDocumentIntervals, options, callback) {
|
44
46
|
this.infoForFutureUpdate = [];
|
45
47
|
this.savedSelectionIntervals = [];
|
@@ -52,7 +54,6 @@ export class FieldsWaitingForUpdate {
|
|
52
54
|
this.infoForFutureUpdate = ListUtils.map(subDocumentIntervals.intervals, (interval) => new FieldParsersAndIntervals(new LinkedInterval(this.subDocument.positionManager, interval)));
|
53
55
|
this.savedSelectionIntervals = ListUtils.map(subDocumentIntervals.intervals, (interval) => new LinkedInterval(this.subDocument.positionManager, interval));
|
54
56
|
}
|
55
|
-
get fields() { return this.subDocument.fields; }
|
56
57
|
update(response, immediateSendRequest = true) {
|
57
58
|
if (this.fields.length == 0) {
|
58
59
|
this.endAction();
|
@@ -182,6 +183,7 @@ export class FieldsWaitingForUpdate {
|
|
182
183
|
}
|
183
184
|
FieldsWaitingForUpdate.TOC_NAME = "TOC";
|
184
185
|
FieldsWaitingForUpdate.parsersMap = {
|
186
|
+
["IF"]: (args) => new FieldCodeParserIf(args),
|
185
187
|
["DATE"]: (args) => new FieldCodeParserDate(args),
|
186
188
|
["TIME"]: (args) => new FieldCodeParserTime(args),
|
187
189
|
["DOCVARIABLE"]: (args) => new FieldCodeParserDocVariable(args),
|
@@ -16,13 +16,13 @@ export class AnchorInlineBaseSize {
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
export class PictureSize extends AnchorInlineBaseSize {
|
19
|
+
get originalSize() { return this.cacheInfo.size; }
|
20
|
+
;
|
19
21
|
constructor(lockAspectRatio, rotation, cacheInfo, scale) {
|
20
22
|
super(lockAspectRatio, rotation);
|
21
23
|
this.cacheInfo = cacheInfo;
|
22
24
|
this.scale = scale;
|
23
25
|
}
|
24
|
-
get originalSize() { return this.cacheInfo.size; }
|
25
|
-
;
|
26
26
|
get actualSize() {
|
27
27
|
return Size.initByCommonAction(adp => adp(this.cacheInfo.size) * adp(this.scale) / 100);
|
28
28
|
}
|
@@ -12,15 +12,6 @@ export var FontLoadStatus;
|
|
12
12
|
FontLoadStatus[FontLoadStatus["Error"] = 3] = "Error";
|
13
13
|
})(FontLoadStatus || (FontLoadStatus = {}));
|
14
14
|
export class ControlFont {
|
15
|
-
constructor(fontFamily, descriptors, key) {
|
16
|
-
this.isFontCollection = false;
|
17
|
-
this.status = FontLoadStatus.Unloaded;
|
18
|
-
this.sourceUrls = [];
|
19
|
-
this._unicodeRanges = null;
|
20
|
-
this.fontFamily = fontFamily;
|
21
|
-
this.descriptors = descriptors;
|
22
|
-
this.cacheKey = key ? key : [this.fontFamily, this.descriptors.cacheKey].join('/');
|
23
|
-
}
|
24
15
|
get loaded() { return this.status == FontLoadStatus.Loaded; }
|
25
16
|
get unicodeRanges() {
|
26
17
|
if (!this._unicodeRanges)
|
@@ -33,6 +24,15 @@ export class ControlFont {
|
|
33
24
|
controlFontType.set(ControlFontType.Italic, this.descriptors.msWordItalic());
|
34
25
|
return controlFontType.getValue();
|
35
26
|
}
|
27
|
+
constructor(fontFamily, descriptors, key) {
|
28
|
+
this.isFontCollection = false;
|
29
|
+
this.status = FontLoadStatus.Unloaded;
|
30
|
+
this.sourceUrls = [];
|
31
|
+
this._unicodeRanges = null;
|
32
|
+
this.fontFamily = fontFamily;
|
33
|
+
this.descriptors = descriptors;
|
34
|
+
this.cacheKey = key ? key : [this.fontFamily, this.descriptors.cacheKey].join('/');
|
35
|
+
}
|
36
36
|
applySource(data, callback) {
|
37
37
|
if (!this.data)
|
38
38
|
this.data = data;
|
@@ -67,13 +67,13 @@ export class ControlFontsLoader {
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
class FontToLoad {
|
70
|
+
get currentPath() { return this.sourceUrls[this.ind]; }
|
70
71
|
constructor(font, fontsSettings) {
|
71
72
|
this.sourceUrls = [];
|
72
73
|
this.ind = 0;
|
73
74
|
this.font = font;
|
74
75
|
this.sourceUrls = font.allSourceUrls(fontsSettings.defaultFolder);
|
75
76
|
}
|
76
|
-
get currentPath() { return this.sourceUrls[this.ind]; }
|
77
77
|
next() {
|
78
78
|
return ++this.ind < this.sourceUrls.length;
|
79
79
|
}
|
@@ -14,7 +14,7 @@ export declare enum NoteType {
|
|
14
14
|
ContinuationNotice = 2,
|
15
15
|
Normal = 3
|
16
16
|
}
|
17
|
-
export
|
17
|
+
export type NoteSeparatorTypes = NoteType.Separator | NoteType.ContinuationSeparator | NoteType.ContinuationNotice;
|
18
18
|
export declare enum NoteNumberingRestartType {
|
19
19
|
Continuous = 0,
|
20
20
|
NewPage = 1,
|
@@ -1,24 +1,24 @@
|
|
1
1
|
import { Errors } from '@devexpress/utils/lib/errors';
|
2
2
|
export class HistoryItem {
|
3
|
+
canBeMerged() {
|
4
|
+
return false;
|
5
|
+
}
|
3
6
|
constructor(modelManipulator) {
|
4
7
|
this.uniqueId = -1;
|
5
8
|
this.modelManipulator = modelManipulator;
|
6
9
|
}
|
7
|
-
canBeMerged() {
|
8
|
-
return false;
|
9
|
-
}
|
10
10
|
changeModified() {
|
11
11
|
return true;
|
12
12
|
}
|
13
13
|
}
|
14
14
|
export class CompositionHistoryItem extends HistoryItem {
|
15
|
+
canBeMerged() {
|
16
|
+
return true;
|
17
|
+
}
|
15
18
|
constructor() {
|
16
19
|
super(null);
|
17
20
|
this.historyItems = [];
|
18
21
|
}
|
19
|
-
canBeMerged() {
|
20
|
-
return true;
|
21
|
-
}
|
22
22
|
changeModified() {
|
23
23
|
var item;
|
24
24
|
for (var i = 0; item = this.historyItems[i]; i++) {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { HistoryItem } from './history-item';
|
2
2
|
export class IntervalBasedHistoryItem extends HistoryItem {
|
3
|
+
get boundSubDocument() { return this.subDocInterval.subDocument; }
|
4
|
+
get interval() { return this.subDocInterval.interval; }
|
3
5
|
constructor(modelManipulator, subDocInterval) {
|
4
6
|
super(modelManipulator);
|
5
7
|
this.subDocInterval = subDocInterval;
|
6
8
|
}
|
7
|
-
get boundSubDocument() { return this.subDocInterval.subDocument; }
|
8
|
-
get interval() { return this.subDocInterval.interval; }
|
9
9
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { HistoryItem } from './history-item';
|
2
2
|
export class PositionBasedHistoryItem extends HistoryItem {
|
3
|
+
get boundSubDocument() { return this.subDocPos.subDocument; }
|
4
|
+
get position() { return this.subDocPos.position; }
|
3
5
|
constructor(modelManipulator, subDocPos) {
|
4
6
|
super(modelManipulator);
|
5
7
|
this.subDocPos = subDocPos;
|
6
8
|
}
|
7
|
-
get boundSubDocument() { return this.subDocPos.subDocument; }
|
8
|
-
get position() { return this.subDocPos.position; }
|
9
9
|
}
|
package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js
CHANGED
@@ -23,6 +23,7 @@ export class InsertAnchoredTextBoxHistoryItem extends PositionBasedHistoryItem {
|
|
23
23
|
}
|
24
24
|
redo() {
|
25
25
|
this.modelManipulator.textBox.insertAnchoredTextBox(this.subDocPos, this.charPropsBundle, this.textBoxInfo);
|
26
|
+
this.modelManipulator.model.subDocumentsCollection.restore(this.textBoxInfo.innerSubDocument.id);
|
26
27
|
}
|
27
28
|
undo() {
|
28
29
|
this.modelManipulator.range.removeIntervalWithoutHistory(this.boundSubDocument, new FixedInterval(this.position, 1), false);
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
2
2
|
import { HistoryItem } from '../base/history-item';
|
3
3
|
export class InsertTextHistoryItem extends HistoryItem {
|
4
|
+
canBeMerged() {
|
5
|
+
return true;
|
6
|
+
}
|
4
7
|
constructor(modelManipulator, params) {
|
5
8
|
super(modelManipulator);
|
6
9
|
this.params = params.clone();
|
7
10
|
}
|
8
|
-
canBeMerged() {
|
9
|
-
return true;
|
10
|
-
}
|
11
11
|
redo() {
|
12
12
|
this.modelManipulator.text.insertTextInner(this.params);
|
13
13
|
}
|
@@ -7,7 +7,6 @@ export class SwitchTextBoxSubDocumentsStateHistoryItem extends HistoryItem {
|
|
7
7
|
this.position = position;
|
8
8
|
}
|
9
9
|
redo() {
|
10
|
-
this.oldSubDocument = this.oldSubDocument.getActualSubDocument();
|
11
10
|
const newRun = this.textBoxParentSubDocument.getRunAndIndexesByPosition(this.position).run;
|
12
11
|
this.newSubDocument = this.modelManipulator.model.subDocuments[newRun.subDocId];
|
13
12
|
this.modelManipulator.model.subDocumentsCollection.replace(this.oldSubDocument.id, this.newSubDocument.id);
|
@@ -2,6 +2,9 @@ import { HistoryItem } from '../base/history-item';
|
|
2
2
|
import { Flag } from '@devexpress/utils/lib/class/flag';
|
3
3
|
import { HistoryItemDirection } from './history-item-direction';
|
4
4
|
export class ScrollHistoryItem extends HistoryItem {
|
5
|
+
canBeMerged() {
|
6
|
+
return true;
|
7
|
+
}
|
5
8
|
constructor(modelManipulator, selection, oldState, newState, directionValue = HistoryItemDirection.OnRedoAndUndo) {
|
6
9
|
super(modelManipulator);
|
7
10
|
this.selection = selection;
|
@@ -9,9 +12,6 @@ export class ScrollHistoryItem extends HistoryItem {
|
|
9
12
|
this.oldState = oldState;
|
10
13
|
this.directionFlag = new Flag(directionValue);
|
11
14
|
}
|
12
|
-
canBeMerged() {
|
13
|
-
return true;
|
14
|
-
}
|
15
15
|
redo() {
|
16
16
|
if (this.directionFlag.get(HistoryItemDirection.OnRedo))
|
17
17
|
this.selection.scrollManager.setScroll(this.newState);
|
@@ -2,6 +2,9 @@ import { HistoryItem } from '../base/history-item';
|
|
2
2
|
import { Flag } from '@devexpress/utils/lib/class/flag';
|
3
3
|
import { HistoryItemDirection } from './history-item-direction';
|
4
4
|
export class SelectionHistoryItem extends HistoryItem {
|
5
|
+
canBeMerged() {
|
6
|
+
return true;
|
7
|
+
}
|
5
8
|
constructor(modelManipulator, selection, oldState, newState, directionValue = HistoryItemDirection.OnRedoAndUndo) {
|
6
9
|
super(modelManipulator);
|
7
10
|
this.selection = selection;
|
@@ -9,9 +12,6 @@ export class SelectionHistoryItem extends HistoryItem {
|
|
9
12
|
this.newState = newState;
|
10
13
|
this.directionFlag = new Flag(directionValue);
|
11
14
|
}
|
12
|
-
canBeMerged() {
|
13
|
-
return true;
|
14
|
-
}
|
15
15
|
redo() {
|
16
16
|
if (this.directionFlag.get(HistoryItemDirection.OnRedo))
|
17
17
|
this.selection.setState(this.newState);
|
@@ -4,8 +4,8 @@ import { ImageCache } from '../../../caches/images';
|
|
4
4
|
import { CharacterStyle } from '../../../character/character-style';
|
5
5
|
import { Paragraph } from '../../../paragraph/paragraph';
|
6
6
|
import { RunBase } from '../../../runs/run-base';
|
7
|
-
export
|
8
|
-
export
|
7
|
+
export type SimpleRunConstructor = new (startOffset: number, paragraph: Paragraph, charPropsBundle: MaskedCharacterPropertiesBundle) => RunBase;
|
8
|
+
export type NoteRunConstructor = new (startOffset: number, paragraph: Paragraph, charPropsBundle: MaskedCharacterPropertiesBundle, noteDocumentId: number) => RunBase;
|
9
9
|
export declare abstract class BaseRunImporter {
|
10
10
|
private maskedCharacterPropertiesCache;
|
11
11
|
private charStyles;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export class BaseManipulator {
|
2
|
+
get history() { return this.modelManipulator.modelManager.history; }
|
3
|
+
get model() { return this.modelManipulator.modelManager.model; }
|
2
4
|
constructor(manipulator) {
|
3
5
|
this.modelManipulator = manipulator;
|
4
6
|
}
|
5
|
-
get history() { return this.modelManipulator.modelManager.history; }
|
6
|
-
get model() { return this.modelManipulator.modelManager.model; }
|
7
7
|
}
|
@@ -31,6 +31,12 @@ export class SubDocumentInserterOptions extends Initializer {
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
export class SubDocumentInserter {
|
34
|
+
get history() { return this.targetModelManipulator.modelManager.history; }
|
35
|
+
get modelsConstOffset() { return this.targetStartPosition - this.sourceInterval.start; }
|
36
|
+
get sameModel() { return this.sourceDocumentModel === this.targetDocumentModel; }
|
37
|
+
get currInsertSubDocumentPosition() {
|
38
|
+
return new SubDocumentPosition(this.targetSubDocument, this.currentTargetPosition);
|
39
|
+
}
|
34
40
|
constructor(targetModelManipulator, options, targetSubDocPos, sourceSubDocInterval) {
|
35
41
|
this.numberingListCache = {};
|
36
42
|
this.abstractNumberingListIndexesMap = {};
|
@@ -66,12 +72,6 @@ export class SubDocumentInserter {
|
|
66
72
|
[RunType.NoteContinuationSeparatorRun]: this.notSupportedRunHandler.bind(this),
|
67
73
|
};
|
68
74
|
}
|
69
|
-
get history() { return this.targetModelManipulator.modelManager.history; }
|
70
|
-
get modelsConstOffset() { return this.targetStartPosition - this.sourceInterval.start; }
|
71
|
-
get sameModel() { return this.sourceDocumentModel === this.targetDocumentModel; }
|
72
|
-
get currInsertSubDocumentPosition() {
|
73
|
-
return new SubDocumentPosition(this.targetSubDocument, this.currentTargetPosition);
|
74
|
-
}
|
75
75
|
insert() {
|
76
76
|
this.sourceSubDocument = this.sourceSubDocInterval.subDocument;
|
77
77
|
this.sourceInterval = this.sourceSubDocInterval.interval;
|
@@ -25,6 +25,7 @@ import { TextBoxManipulator } from './text-box-manipulator';
|
|
25
25
|
import { TextCaseManipulator } from './text-case-manipulator';
|
26
26
|
import { TextManipulator } from './text-manipulator/text-manipulator';
|
27
27
|
export class ModelManipulator {
|
28
|
+
get model() { return this.modelManager.model; }
|
28
29
|
constructor(modelManager, batchUpdatableObject) {
|
29
30
|
this.modelListeners = [];
|
30
31
|
this.onFontsChanged = new EventDispatcher();
|
@@ -57,7 +58,6 @@ export class ModelManipulator {
|
|
57
58
|
this.section = new SectionManipulator(this);
|
58
59
|
this.documentMerger = new DocumentMerger(this);
|
59
60
|
}
|
60
|
-
get model() { return this.modelManager.model; }
|
61
61
|
notifyModelChanged(change) {
|
62
62
|
this.modelListeners.forEach(listener => listener.modelChanged(change));
|
63
63
|
}
|
package/lib/common/model/manipulators/picture-manipulator/insert-picture-manipulator-params.js
CHANGED
@@ -4,13 +4,13 @@ import { PictureSize } from '../../floating-objects/sizes';
|
|
4
4
|
import { Shape } from '../../shapes/shape';
|
5
5
|
import { NonVisualDrawingObjectInfo } from './non-visual-drawing-object-info';
|
6
6
|
export class BasePictureInfo {
|
7
|
+
get cacheInfo() { return this.size.cacheInfo; }
|
7
8
|
constructor(size, shape, containerProperties, drawingProperties) {
|
8
9
|
this.size = size;
|
9
10
|
this.shape = shape;
|
10
11
|
this.containerProperties = containerProperties;
|
11
12
|
this.nonVisualDrawingProperties = drawingProperties;
|
12
13
|
}
|
13
|
-
get cacheInfo() { return this.size.cacheInfo; }
|
14
14
|
}
|
15
15
|
export class InlinePictureInfo extends BasePictureInfo {
|
16
16
|
constructor(size, shape, publicAPIID, containerProperties, drawingProperties) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Size } from '@devexpress/utils/lib/geometry/size';
|
2
2
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
3
3
|
import { CacheImageInfo } from '../../../caches/images';
|
4
|
-
export
|
4
|
+
export type ImageLoadingOptionsCallback = (picInterval: FixedInterval, cacheInfo: CacheImageInfo) => void;
|
5
5
|
export declare class ImageLoadingOptions {
|
6
6
|
imageLoadedEvent: ImageLoadingOptionsCallback[];
|
7
7
|
actualSize?: Size;
|
@@ -16,7 +16,7 @@ export declare class PicSizeUpdaterData {
|
|
16
16
|
interface IPictureLoadedListener {
|
17
17
|
notifyPictureLoaded(): void;
|
18
18
|
}
|
19
|
-
export
|
19
|
+
export type AllPicturesLoaded = (isLoaded: boolean) => void;
|
20
20
|
export interface ISizeUpdater {
|
21
21
|
getImageLoadingOptions(run: PictureRunType): ImageLoadingOptions;
|
22
22
|
}
|
@@ -128,12 +128,12 @@ class CallbacksInfo {
|
|
128
128
|
}
|
129
129
|
}
|
130
130
|
export class PictureLoader {
|
131
|
+
get imageCache() { return this.modelManipulator.model.cache.imageCache; }
|
131
132
|
constructor(modelManipulator) {
|
132
133
|
this.callbacksInfo = [];
|
133
134
|
this.modelManipulator = modelManipulator;
|
134
135
|
this.sizeUpdater = new PicSizeUpdater(modelManipulator, this);
|
135
136
|
}
|
136
|
-
get imageCache() { return this.modelManipulator.model.cache.imageCache; }
|
137
137
|
notifyPictureLoaded() {
|
138
138
|
if (this.sizeUpdater.allPicturesLoaded()) {
|
139
139
|
const clbs = this.callbacksInfo;
|
@@ -25,6 +25,9 @@ import { TablesManipulator } from '../tables/tables-manipulator';
|
|
25
25
|
import { isDefined } from '@devexpress/utils/lib/utils/common';
|
26
26
|
import { SubDocumentInserterOptions } from '../document/sub-document-inserter';
|
27
27
|
export class CreateRangeCopyOperation {
|
28
|
+
get documentModel() {
|
29
|
+
return this.subDocument.documentModel;
|
30
|
+
}
|
28
31
|
constructor(subDocument, abstractNumberingListCache, numberingListCache) {
|
29
32
|
this.newOffsetAtStartChunk = 0;
|
30
33
|
this.additionalParagraphRunPositions = {};
|
@@ -32,9 +35,6 @@ export class CreateRangeCopyOperation {
|
|
32
35
|
this.numberingListCache = numberingListCache;
|
33
36
|
this.abstractNumberingListCache = abstractNumberingListCache;
|
34
37
|
}
|
35
|
-
get documentModel() {
|
36
|
-
return this.subDocument.documentModel;
|
37
|
-
}
|
38
38
|
copyStyles(newDocumentModel) {
|
39
39
|
newDocumentModel.characterStyles = ListUtils.deepCopy(this.documentModel.characterStyles);
|
40
40
|
newDocumentModel.paragraphStyles = ListUtils.deepCopy(this.documentModel.paragraphStyles);
|
@@ -54,8 +54,14 @@ export class RemoveIntervalOperation {
|
|
54
54
|
var accumulatedInterval = new FixedInterval(this.position, 0);
|
55
55
|
let removedTextList = [];
|
56
56
|
while (iterator.moveNext()) {
|
57
|
-
if (EnumUtils.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun))
|
58
|
-
|
57
|
+
if (EnumUtils.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun)) {
|
58
|
+
const currentRun = iterator.currentRun;
|
59
|
+
const position = iterator.currentInterval().start;
|
60
|
+
const change = new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, currentRun.anchoredObjectID, position);
|
61
|
+
if (currentRun instanceof AnchoredTextBoxRun)
|
62
|
+
this.modelManipulator.model.subDocumentsCollection.replace(currentRun.subDocId, subDocument.id);
|
63
|
+
this.modelManipulator.notifyModelChanged(change);
|
64
|
+
}
|
59
65
|
if (iterator.currentChunk !== subDocument.chunks[this.currentChunkIndex]) {
|
60
66
|
this.removeAccumulatedInterval(accumulatedInterval, this.position, 0, removedTextList);
|
61
67
|
this.currentChunkIndex++;
|
@@ -7,11 +7,11 @@ import { TableCellMergingState } from '../../tables/secondary-structures/table-b
|
|
7
7
|
import { TableCellUtils } from '../../tables/table-utils';
|
8
8
|
import { InsertParagraphManipulatorParams } from '../paragraph-manipulator/insert-paragraph-manipulator-params';
|
9
9
|
export class InsertTableCellOperationBase {
|
10
|
+
get modelManipulator() { return this.modelManager.modelManipulator; }
|
10
11
|
constructor(modelManager, subDocument) {
|
11
12
|
this.subDocument = subDocument;
|
12
13
|
this.modelManager = modelManager;
|
13
14
|
}
|
14
|
-
get modelManipulator() { return this.modelManager.modelManipulator; }
|
15
15
|
execute(table, rowIndex, cellIndex, inpPos, options) {
|
16
16
|
let row = table.rows[rowIndex];
|
17
17
|
let cell = row.cells[cellIndex];
|