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
@@ -10,13 +10,13 @@ export class RulerModelState {
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
export class RulerBase {
|
13
|
+
get visible() { return this._visible; }
|
13
14
|
constructor(modelData, controls) {
|
14
15
|
this._visible = true;
|
15
16
|
this.modelData = modelData;
|
16
17
|
this.controls = controls;
|
17
18
|
this.rootElement = DocumentRenderer.renderContainer(this.getRootClassName());
|
18
19
|
}
|
19
|
-
get visible() { return this._visible; }
|
20
20
|
dispose() {
|
21
21
|
DomUtils.hideNode(this.rootElement);
|
22
22
|
this.rootElement = null;
|
@@ -33,12 +33,12 @@ export var ColumnAction;
|
|
33
33
|
ColumnAction[ColumnAction["ColumnWidth"] = 3] = "ColumnWidth";
|
34
34
|
})(ColumnAction || (ColumnAction = {}));
|
35
35
|
export class RulerColumnModelState {
|
36
|
+
get rightPos() { return this.leftPos + this.width; }
|
36
37
|
constructor(leftPos, width, space) {
|
37
38
|
this.leftPos = leftPos;
|
38
39
|
this.width = width;
|
39
40
|
this.space = space;
|
40
41
|
}
|
41
|
-
get rightPos() { return this.leftPos + this.width; }
|
42
42
|
clone() {
|
43
43
|
return new RulerColumnModelState(this.leftPos, this.width, this.space);
|
44
44
|
}
|
@@ -13,6 +13,7 @@ export const DIVISION_MINOR_CLASS_NAME = RULER_CLASS_NAME + "Minor" + DIVISION_C
|
|
13
13
|
export const DIVISION_MAJOR_CLASS_NAME = RULER_CLASS_NAME + "Major" + DIVISION_CLASS_NAME;
|
14
14
|
export const DIVISION_NUMBER_CLASS_NAME = RULER_CLASS_NAME + "Number" + DIVISION_CLASS_NAME;
|
15
15
|
export class RulerDivisionsControl extends RulerBase {
|
16
|
+
getRootClassName() { return DIVISION_CONTAINER_CLASS_NAME; }
|
16
17
|
constructor(modelData, controls, divisionInfo, maxPageWidth) {
|
17
18
|
super(modelData, controls);
|
18
19
|
this.height = 0;
|
@@ -25,7 +26,6 @@ export class RulerDivisionsControl extends RulerBase {
|
|
25
26
|
createDivisionElements(this.rootElement, unitCount, divisionInfo, this.height);
|
26
27
|
this.initialLeft = -(unitCount * divisionInfo.unitSize - RULLER_NUMBER_CORRECTION);
|
27
28
|
}
|
28
|
-
getRootClassName() { return DIVISION_CONTAINER_CLASS_NAME; }
|
29
29
|
update() {
|
30
30
|
this.updateModelState();
|
31
31
|
this.updateView();
|
@@ -7,22 +7,22 @@ import { RulerTemplateManager } from '../template-manager';
|
|
7
7
|
import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
|
8
8
|
import { SizeUtils } from '../../../../../common/utils/size-utils';
|
9
9
|
export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
10
|
+
get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
11
|
+
getRootClassName() {
|
12
|
+
return this.modelData.styles.firstLineIndentImage.spriteCssClass + " " +
|
13
|
+
this.modelData.styles.firstLineIndent.className;
|
14
|
+
}
|
10
15
|
constructor(modelData, controls) {
|
11
16
|
super(modelData, controls);
|
12
17
|
const template = RulerTemplateManager.getFirstLineIndentElementTemplate();
|
13
18
|
if (template)
|
14
19
|
this.rootElement.innerHTML = template;
|
15
|
-
this.rootElement.title = this.modelData.
|
20
|
+
this.rootElement.title = this.modelData.titles.firstLineIndent;
|
16
21
|
this.controls.ruler.rootElement.appendChild(this.rootElement);
|
17
22
|
this.adjustByTop();
|
18
23
|
this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
|
19
24
|
this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
|
20
25
|
}
|
21
|
-
get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
22
|
-
getRootClassName() {
|
23
|
-
return this.modelData.settings.styles.firstLineIndentImage.spriteCssClass + " " +
|
24
|
-
this.modelData.settings.styles.firstLineIndent.className;
|
25
|
-
}
|
26
26
|
adjustByTop() {
|
27
27
|
const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
|
28
28
|
const divisionsControlHeight = this.controls.divisions.height;
|
@@ -36,7 +36,7 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
36
36
|
const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
|
37
37
|
if (newViewState != this.viewState) {
|
38
38
|
this.viewState = newViewState;
|
39
|
-
if (this.modelData.
|
39
|
+
if (this.modelData.showLeftIndent)
|
40
40
|
this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
|
41
41
|
else
|
42
42
|
this.setVisible(false);
|
@@ -9,10 +9,12 @@ import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
|
|
9
9
|
import { SizeUtils } from '../../../../../common/utils/size-utils';
|
10
10
|
const LEFT_INDENT_DRAG_HANDLE_BODY = RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
|
11
11
|
export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
12
|
+
get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
13
|
+
getRootClassName() { return this.modelData.styles.leftIndent.className; }
|
12
14
|
constructor(modelData, controls) {
|
13
15
|
super(modelData, controls);
|
14
16
|
this.isActionLeftIndent = false;
|
15
|
-
this.topElement = DocumentRenderer.renderContainer(this.modelData.
|
17
|
+
this.topElement = DocumentRenderer.renderContainer(this.modelData.styles.leftIndentImage.spriteCssClass);
|
16
18
|
this.bodyElement = DocumentRenderer.renderContainer(LEFT_INDENT_DRAG_HANDLE_BODY);
|
17
19
|
const topElementTemplate = RulerTemplateManager.getLeftIndentTopElementTemplate();
|
18
20
|
if (topElementTemplate)
|
@@ -30,13 +32,11 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
|
30
32
|
style.height = SizeUtils.getOffsetHeight(this.topElement) + SizeUtils.getOffsetHeight(this.bodyElement) + "px";
|
31
33
|
style.width = mainElementWidth + "px";
|
32
34
|
style.marginTop = this.controls.divisions.height / 2 + "px";
|
33
|
-
this.bodyElement.title = this.modelData.
|
34
|
-
this.topElement.title = this.modelData.
|
35
|
+
this.bodyElement.title = this.modelData.titles.leftIndent;
|
36
|
+
this.topElement.title = this.modelData.titles.hangingIndent;
|
35
37
|
this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
|
36
38
|
this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
|
37
39
|
}
|
38
|
-
get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
|
39
|
-
getRootClassName() { return this.modelData.settings.styles.leftIndent.className; }
|
40
40
|
adjustByTop() {
|
41
41
|
const mainElementHeight = SizeUtils.getOffsetHeight(this.rootElement);
|
42
42
|
const divisionsControlHeight = this.controls.divisions.height;
|
@@ -50,7 +50,7 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
|
50
50
|
const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
|
51
51
|
if (newViewState != this.viewState) {
|
52
52
|
this.viewState = newViewState;
|
53
|
-
if (this.modelData.
|
53
|
+
if (this.modelData.showLeftIndent)
|
54
54
|
this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
|
55
55
|
else
|
56
56
|
this.setVisible(false);
|
@@ -7,21 +7,21 @@ import { SnapTo } from '../vertical-line';
|
|
7
7
|
import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
|
8
8
|
const RulerMinDistanceBetweenIndentsOnView = 5;
|
9
9
|
export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
|
10
|
+
get viewStateRelativeLeft() { return this.controls.ruler.pageWidth - this.viewState; }
|
11
|
+
getRootClassName() {
|
12
|
+
return this.modelData.styles.rightIndentImage.spriteCssClass + " " +
|
13
|
+
this.modelData.styles.rightIndent.className;
|
14
|
+
}
|
10
15
|
constructor(modelData, controls) {
|
11
16
|
super(modelData, controls);
|
12
17
|
const template = RulerTemplateManager.getRightIndentElementTemplate();
|
13
18
|
if (template)
|
14
19
|
this.rootElement.innerHTML = template;
|
15
|
-
this.rootElement.title = this.modelData.
|
20
|
+
this.rootElement.title = this.modelData.titles.rightIndent;
|
16
21
|
this.controls.ruler.rootElement.appendChild(this.rootElement);
|
17
22
|
this.adjustByTop();
|
18
23
|
this.leftCorrection = Math.round(this.rootElement.offsetWidth / 2);
|
19
24
|
}
|
20
|
-
get viewStateRelativeLeft() { return this.controls.ruler.pageWidth - this.viewState; }
|
21
|
-
getRootClassName() {
|
22
|
-
return this.modelData.settings.styles.rightIndentImage.spriteCssClass + " " +
|
23
|
-
this.modelData.settings.styles.rightIndent.className;
|
24
|
-
}
|
25
25
|
adjustByTop() {
|
26
26
|
const divisionsControlHeight = this.controls.divisions.height;
|
27
27
|
this.rootElement.style.marginTop = divisionsControlHeight / 2 + "px";
|
@@ -35,7 +35,7 @@ export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
|
|
35
35
|
const newViewState = this.correctRelativeLeftIndents(this.controls.ruler.pageWidth - this.controls.paragraphRightPosition + this.currModelState.modelValue);
|
36
36
|
if (newViewState != this.viewState) {
|
37
37
|
this.viewState = newViewState;
|
38
|
-
if (this.modelData.
|
38
|
+
if (this.modelData.showRightIndent)
|
39
39
|
this.rootElement.style.right = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
|
40
40
|
else
|
41
41
|
this.setVisible(false);
|
@@ -8,6 +8,9 @@ export const RulerMinDistanceBetweenMargins = 50;
|
|
8
8
|
const DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME = RULER_CLASS_NAME + "MarginLeftHandlePanel";
|
9
9
|
const DIVISION_MARGIN_LEFT_CLASS_NAME = RULER_CLASS_NAME + "MarginLeftPanel";
|
10
10
|
export class RulerLeftMarginDragHandle extends RulerBaseMarginControl {
|
11
|
+
getRootClassName() { return ''; }
|
12
|
+
;
|
13
|
+
get commandType() { return RichEditClientCommand.RulerSectionMarginLeft; }
|
11
14
|
constructor(modelData, controls, maxPageWidth) {
|
12
15
|
super(modelData, controls);
|
13
16
|
this.initialLeft = -(Math.ceil(maxPageWidth) - RULLER_NUMBER_CORRECTION);
|
@@ -15,13 +18,10 @@ export class RulerLeftMarginDragHandle extends RulerBaseMarginControl {
|
|
15
18
|
this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME);
|
16
19
|
this.marginPanelElement.style.width = maxPageWidth + "px";
|
17
20
|
this.handlePanelElement.style.width = maxPageWidth + "px";
|
18
|
-
this.handlePanelElement.title = this.modelData.
|
21
|
+
this.handlePanelElement.title = this.modelData.titles.marginLeft;
|
19
22
|
this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
|
20
23
|
this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
|
21
24
|
}
|
22
|
-
getRootClassName() { return ''; }
|
23
|
-
;
|
24
|
-
get commandType() { return RichEditClientCommand.RulerSectionMarginLeft; }
|
25
25
|
setViewStateToElement(element) {
|
26
26
|
element.style.left = this.viewState + this.initialLeft + "px";
|
27
27
|
}
|
@@ -19,7 +19,7 @@ export class RulerRightMarginDragHandle extends RulerBaseMarginControl {
|
|
19
19
|
this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_RIGHT_CURSOR_CLASS_NAME);
|
20
20
|
this.marginPanelElement.style.width = maxPageWidth + "px";
|
21
21
|
this.handlePanelElement.style.width = maxPageWidth + "px";
|
22
|
-
this.handlePanelElement.title = this.modelData.
|
22
|
+
this.handlePanelElement.title = this.modelData.titles.marginRight;
|
23
23
|
this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
|
24
24
|
this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
|
25
25
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export class RulerMultiControl {
|
2
|
+
get activeSubControl() { return this.subControls[this.handleControlIndex]; }
|
2
3
|
constructor(modelData, controls) {
|
3
4
|
this.subControls = [];
|
4
5
|
this.handleControlIndex = -1;
|
@@ -6,7 +7,6 @@ export class RulerMultiControl {
|
|
6
7
|
this.modelData = modelData;
|
7
8
|
this.controls = controls;
|
8
9
|
}
|
9
|
-
get activeSubControl() { return this.subControls[this.handleControlIndex]; }
|
10
10
|
dispose() {
|
11
11
|
for (let elem of this.subControls)
|
12
12
|
elem.dispose();
|
@@ -6,21 +6,21 @@ import { RULLER_NUMBER_CORRECTION } from '../settings';
|
|
6
6
|
import { RulerBase } from './base';
|
7
7
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
8
8
|
export class RulerControl extends RulerBase {
|
9
|
+
getRootClassName() { return this.modelData.styles.control.className; }
|
10
|
+
;
|
11
|
+
get pageWidth() { return this.currPageWidth; }
|
12
|
+
;
|
9
13
|
constructor(modelData, controls) {
|
10
14
|
super(modelData, controls);
|
11
15
|
this.canHandleScroll = false;
|
12
16
|
this.initialMarginLeftElement = 0;
|
13
17
|
this.currPageWidth = 0;
|
14
18
|
this.prevPageWidth = 0;
|
15
|
-
this.rootElement = DocumentRenderer.renderContainer(this.modelData.
|
19
|
+
this.rootElement = DocumentRenderer.renderContainer(this.modelData.styles.control.className);
|
16
20
|
if (Browser.MSTouchUI)
|
17
21
|
DomUtils.addClassName(this.rootElement, TouchUtils.msTouchDraggableClassName);
|
18
22
|
this.controls.wrapper.rootElement.appendChild(this.rootElement);
|
19
23
|
}
|
20
|
-
getRootClassName() { return this.modelData.settings.styles.control.className; }
|
21
|
-
;
|
22
|
-
get pageWidth() { return this.currPageWidth; }
|
23
|
-
;
|
24
24
|
init() {
|
25
25
|
this.rootElement.style.height = this.controls.divisions.height + "px";
|
26
26
|
this.setPaddings();
|
@@ -8,20 +8,20 @@ import { RulerBase } from '../base';
|
|
8
8
|
import { RulerTabUtils } from './utils';
|
9
9
|
const TAB_ALIGN_BOX_PART_HANDLE_CLASS_NAME = RICH_EDIT_CLASS_NAME_PREFIX + "rulertabAlignBox";
|
10
10
|
export class RulerTabTypeControl extends RulerBase {
|
11
|
+
getRootClassName() { return TAB_ALIGN_BOX_PART_HANDLE_CLASS_NAME; }
|
12
|
+
;
|
11
13
|
constructor(modelData, controls) {
|
12
14
|
super(modelData, controls);
|
13
15
|
this.evtHandlersHolder = new DomEventHandlersHolder();
|
14
16
|
this.align = TabAlign.Left;
|
15
17
|
this.innerSquareElement = DocumentRenderer.renderContainer("");
|
16
|
-
this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.
|
18
|
+
this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles));
|
17
19
|
this.applyTemplate();
|
18
20
|
this.innerSquareElement.appendChild(this.alignElement);
|
19
21
|
this.rootElement.appendChild(this.innerSquareElement);
|
20
22
|
this.controls.wrapper.rootElement.appendChild(this.rootElement);
|
21
23
|
this.evtHandlersHolder.addListener(this.innerSquareElement, TouchUtils.touchMouseDownEventName, this.onMouseDown.bind(this));
|
22
24
|
}
|
23
|
-
getRootClassName() { return TAB_ALIGN_BOX_PART_HANDLE_CLASS_NAME; }
|
24
|
-
;
|
25
25
|
init() {
|
26
26
|
this.adjust();
|
27
27
|
}
|
@@ -46,14 +46,14 @@ export class RulerTabTypeControl extends RulerBase {
|
|
46
46
|
const size = this.innerSquareElement.offsetWidth;
|
47
47
|
this.alignElement.style.top = (size - this.alignElement.offsetHeight) / 2 + "px";
|
48
48
|
this.alignElement.style.left = (size - this.alignElement.offsetWidth) / 2 + "px";
|
49
|
-
this.alignElement.title = this.modelData.
|
49
|
+
this.alignElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.align)];
|
50
50
|
}
|
51
51
|
onMouseDown(evt) {
|
52
52
|
if (!this.modelData.isReadOnly) {
|
53
53
|
this.align++;
|
54
54
|
if (this.align > TabAlign.Decimal)
|
55
55
|
this.align = TabAlign.Left;
|
56
|
-
this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.
|
56
|
+
this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles);
|
57
57
|
this.applyTemplate();
|
58
58
|
this.adjustAlignElement();
|
59
59
|
EvtUtils.preventEvent(evt);
|
@@ -50,8 +50,8 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
50
50
|
this.deleteTab = false;
|
51
51
|
}
|
52
52
|
getModelState() {
|
53
|
-
this.modelData.
|
54
|
-
if (this.modelData.
|
53
|
+
this.modelData.showTabs = this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler).getState().enabled;
|
54
|
+
if (this.modelData.showTabs) {
|
55
55
|
const paragraph = this.modelData.selection.activeSubDocument.getParagraphByPosition(this.modelData.selection.intervalsInfo.interval.start);
|
56
56
|
const tabs = ListUtils.map(paragraph.getTabs().positions, tab => {
|
57
57
|
const newTab = tab.clone();
|
@@ -195,7 +195,7 @@ class RulerTabControl {
|
|
195
195
|
this.shadow = null;
|
196
196
|
this.controls = controls;
|
197
197
|
this.modelData = modelData;
|
198
|
-
this.rootElement = DocumentRenderer.renderContainer(modelData.
|
198
|
+
this.rootElement = DocumentRenderer.renderContainer(modelData.styles.tab.className + " " + RulerTabUtils.getSpriteClassName(this.viewState.align, modelData.styles));
|
199
199
|
this.applyTemplate();
|
200
200
|
controls.ruler.rootElement.appendChild(this.rootElement);
|
201
201
|
this.rootElement.style.marginTop = (controls.divisions.height - this.rootElement.offsetHeight) + "px";
|
@@ -209,7 +209,7 @@ class RulerTabControl {
|
|
209
209
|
setVisible(visible) {
|
210
210
|
this.rootElement.style.display = visible ? 'block' : 'none';
|
211
211
|
}
|
212
|
-
canHandle(source) { return source == this.rootElement && this.modelData.
|
212
|
+
canHandle(source) { return source == this.rootElement && this.modelData.showTabs; }
|
213
213
|
showShadow() {
|
214
214
|
this.shadow = new RulerShadow(this.rootElement);
|
215
215
|
}
|
@@ -244,10 +244,10 @@ class RulerTabControl {
|
|
244
244
|
}
|
245
245
|
}
|
246
246
|
changeAlign() {
|
247
|
-
this.rootElement.className = this.modelData.
|
248
|
-
RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.
|
247
|
+
this.rootElement.className = this.modelData.styles.tab.className + " " +
|
248
|
+
RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.styles);
|
249
249
|
this.applyTemplate();
|
250
|
-
this.rootElement.title = this.modelData.
|
250
|
+
this.rootElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.viewState.align)];
|
251
251
|
this.setCorrection();
|
252
252
|
}
|
253
253
|
applyTemplate() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { TabAlign } from '../../../../model/paragraph/paragraph';
|
2
|
-
import {
|
2
|
+
import { RulerStyles } from '../../settings';
|
3
3
|
export declare class RulerTabUtils {
|
4
4
|
static getTabTitlePropertyName(align: TabAlign): string;
|
5
|
-
static getSpriteClassName(tabAlign: TabAlign,
|
5
|
+
static getSpriteClassName(tabAlign: TabAlign, styles: RulerStyles): string;
|
6
6
|
static getTemplate(tabAlign: TabAlign): string | undefined;
|
7
7
|
}
|
@@ -19,16 +19,16 @@ export class RulerTabUtils {
|
|
19
19
|
}
|
20
20
|
return "tab" + alignString;
|
21
21
|
}
|
22
|
-
static getSpriteClassName(tabAlign,
|
22
|
+
static getSpriteClassName(tabAlign, styles) {
|
23
23
|
switch (tabAlign) {
|
24
24
|
case TabAlign.Left:
|
25
|
-
return
|
25
|
+
return styles.tabImages.left.spriteCssClass;
|
26
26
|
case TabAlign.Right:
|
27
|
-
return
|
27
|
+
return styles.tabImages.right.spriteCssClass;
|
28
28
|
case TabAlign.Center:
|
29
|
-
return
|
29
|
+
return styles.tabImages.center.spriteCssClass;
|
30
30
|
case TabAlign.Decimal:
|
31
|
-
return
|
31
|
+
return styles.tabImages.decimal.spriteCssClass;
|
32
32
|
}
|
33
33
|
return "";
|
34
34
|
}
|
@@ -95,7 +95,7 @@ class RulerTableColumnState {
|
|
95
95
|
constructor(modelData, controls) {
|
96
96
|
this.controls = controls;
|
97
97
|
this.rootElement = DocumentRenderer.renderContainer(TABLE_COLUMN_SEPARATOR_HANDLE_CLASS_NAME);
|
98
|
-
this.separatorElement = DocumentRenderer.renderContainer(modelData.
|
98
|
+
this.separatorElement = DocumentRenderer.renderContainer(modelData.styles.columnSeparatorImage.spriteCssClass);
|
99
99
|
const template = RulerTemplateManager.getTableColumnDragElementTemplate();
|
100
100
|
if (template)
|
101
101
|
this.separatorElement.innerHTML = template;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { RulerSettings } from '../settings';
|
2
1
|
export declare const TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME: string;
|
3
2
|
export declare enum SnapTo {
|
4
3
|
LeftSide = 0,
|
@@ -16,7 +15,7 @@ export declare class RulerVerticalLineControl {
|
|
16
15
|
private rulerControlWidth;
|
17
16
|
private viewElementLeft;
|
18
17
|
private rulerControlElement;
|
19
|
-
constructor(canvas: HTMLDivElement,
|
18
|
+
constructor(canvas: HTMLDivElement, className: string, rulerControlElement: HTMLElement);
|
20
19
|
dispose(): void;
|
21
20
|
show(type: RulerLineDisplayType): void;
|
22
21
|
hide(): void;
|
@@ -13,14 +13,14 @@ export var RulerLineDisplayType;
|
|
13
13
|
RulerLineDisplayType[RulerLineDisplayType["TableColumn"] = 1] = "TableColumn";
|
14
14
|
})(RulerLineDisplayType || (RulerLineDisplayType = {}));
|
15
15
|
export class RulerVerticalLineControl {
|
16
|
-
constructor(canvas,
|
16
|
+
constructor(canvas, className, rulerControlElement) {
|
17
17
|
this.borderWidth = 0;
|
18
18
|
this.rulerControlLeft = 0;
|
19
19
|
this.rulerControlWidth = 0;
|
20
20
|
this.viewElementLeft = 0;
|
21
21
|
this.canvas = canvas;
|
22
22
|
this.rulerControlElement = rulerControlElement;
|
23
|
-
this.rootElement = DocumentRenderer.renderContainer(
|
23
|
+
this.rootElement = DocumentRenderer.renderContainer(className);
|
24
24
|
this.rootElement.style.display = "block";
|
25
25
|
this.borderWidth = DomUtils.getHorizontalBordersWidth(this.rootElement);
|
26
26
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RulerBase } from './base';
|
2
2
|
export class RulerWrapper extends RulerBase {
|
3
|
-
getRootClassName() { return this.modelData.
|
3
|
+
getRootClassName() { return this.modelData.styles.wrapper.className; }
|
4
4
|
;
|
5
5
|
constructor(modelData, controls) {
|
6
6
|
super(modelData, controls);
|
@@ -20,6 +20,24 @@ import { RulerMouseEventsManager } from './events/mouse';
|
|
20
20
|
import { RulerViewElementScrollManager } from './events/scroll';
|
21
21
|
import { RulerMouseHandler } from './mouse-handler';
|
22
22
|
export class RulerControls {
|
23
|
+
get paragraphLeftPosition() {
|
24
|
+
let pos = this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.leftPos;
|
25
|
+
if (this.tables.currModelState.columnSeparators.hasItems) {
|
26
|
+
const item = this.tables.currModelState.columnSeparators.currItem;
|
27
|
+
pos += this.tables.currModelState.columnSeparators.cellSpacing + item.leftMargin + item.position;
|
28
|
+
}
|
29
|
+
return pos;
|
30
|
+
}
|
31
|
+
get paragraphRightPosition() {
|
32
|
+
const colSeps = this.tables.currModelState.columnSeparators;
|
33
|
+
if (colSeps.hasItems) {
|
34
|
+
const nextSeparatorItem = colSeps.items[colSeps.index + 1];
|
35
|
+
return this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.leftPos +
|
36
|
+
(nextSeparatorItem.position - colSeps.cellSpacing - colSeps.currItem.rightMargin);
|
37
|
+
}
|
38
|
+
else
|
39
|
+
return this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.rightPos;
|
40
|
+
}
|
23
41
|
constructor(canvas, modelData) {
|
24
42
|
this.mouseEventsManager = new RulerMouseEventsManager();
|
25
43
|
this.viewElementScrollManager = new RulerViewElementScrollManager();
|
@@ -41,29 +59,11 @@ export class RulerControls {
|
|
41
59
|
this.tabs = new RulerTabsControl(modelData, this);
|
42
60
|
this.ruler.init();
|
43
61
|
this.tabTypeBox.init();
|
44
|
-
this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.
|
62
|
+
this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.styles.line.className, this.ruler.rootElement);
|
45
63
|
this.mouseHandler = new RulerMouseHandler(modelData, this);
|
46
64
|
this.mouseEventsManager.addListener(this.mouseHandler);
|
47
65
|
this.viewElementScrollManager.addListener(this.ruler, this.canvas);
|
48
66
|
}
|
49
|
-
get paragraphLeftPosition() {
|
50
|
-
let pos = this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.leftPos;
|
51
|
-
if (this.tables.currModelState.columnSeparators.hasItems) {
|
52
|
-
const item = this.tables.currModelState.columnSeparators.currItem;
|
53
|
-
pos += this.tables.currModelState.columnSeparators.cellSpacing + item.leftMargin + item.position;
|
54
|
-
}
|
55
|
-
return pos;
|
56
|
-
}
|
57
|
-
get paragraphRightPosition() {
|
58
|
-
const colSeps = this.tables.currModelState.columnSeparators;
|
59
|
-
if (colSeps.hasItems) {
|
60
|
-
const nextSeparatorItem = colSeps.items[colSeps.index + 1];
|
61
|
-
return this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.leftPos +
|
62
|
-
(nextSeparatorItem.position - colSeps.cellSpacing - colSeps.currItem.rightMargin);
|
63
|
-
}
|
64
|
-
else
|
65
|
-
return this.leftMargin.currModelState.modelValue + this.columns.currModelState.activeColumn.rightPos;
|
66
|
-
}
|
67
67
|
dispose() {
|
68
68
|
this.lineControl.dispose();
|
69
69
|
this.wrapper.dispose();
|
@@ -4,10 +4,16 @@ import { CommandManager } from '../../commands/command-manager';
|
|
4
4
|
import { RichEditCore } from '../../rich-edit-core';
|
5
5
|
import { InputPosition } from '../../selection/input-position';
|
6
6
|
import { Selection } from '../../selection/selection';
|
7
|
-
import { RulerSettings } from './settings';
|
7
|
+
import { RulerSettings, RulerStyles, RulerTitles, RulerVisibility } from './settings';
|
8
8
|
export declare class RulerModelData {
|
9
9
|
private core;
|
10
|
-
readonly settings
|
10
|
+
private readonly settings;
|
11
|
+
visibility: RulerVisibility;
|
12
|
+
showTabs: boolean;
|
13
|
+
get showLeftIndent(): boolean;
|
14
|
+
get showRightIndent(): boolean;
|
15
|
+
get titles(): RulerTitles;
|
16
|
+
get styles(): RulerStyles;
|
11
17
|
get inputPosition(): InputPosition;
|
12
18
|
get commandManager(): CommandManager;
|
13
19
|
get isClosed(): boolean;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { ReadOnlyMode } from '../../interfaces/i-rich-edit-core';
|
2
2
|
import { RulerStyleInfo } from './settings';
|
3
3
|
export class RulerModelData {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
4
|
+
get showLeftIndent() { return this.settings.showLeftIndent; }
|
5
|
+
get showRightIndent() { return this.settings.showRightIndent; }
|
6
|
+
get titles() { return this.settings.titles; }
|
7
|
+
get styles() { return this.settings.styles; }
|
8
8
|
get inputPosition() { return this.core.inputPosition; }
|
9
9
|
;
|
10
10
|
get commandManager() { return this.core.commandManager; }
|
@@ -13,6 +13,12 @@ export class RulerModelData {
|
|
13
13
|
get isReadOnly() { return this.core.readOnly != ReadOnlyMode.None; }
|
14
14
|
get unitType() { return this.core.uiUnitConverter.getUnits(); }
|
15
15
|
get selection() { return this.core.selection; }
|
16
|
+
constructor(core, settings) {
|
17
|
+
this.core = core;
|
18
|
+
this.settings = this.fixSettings(settings);
|
19
|
+
this.visibility = this.settings.visibility;
|
20
|
+
this.showTabs = this.settings.showTabs;
|
21
|
+
}
|
16
22
|
fixSettings(settings) {
|
17
23
|
if (!settings.styles.firstLineIndent)
|
18
24
|
settings.styles.firstLineIndent = this.getDefaultStyle('dxreFirstLineIndentDragHandle');
|
@@ -12,6 +12,8 @@ var HorizontalRulerEventType;
|
|
12
12
|
HorizontalRulerEventType[HorizontalRulerEventType["CheckSelectionChange"] = 2] = "CheckSelectionChange";
|
13
13
|
})(HorizontalRulerEventType || (HorizontalRulerEventType = {}));
|
14
14
|
export class HorizontalRulerControl extends BatchUpdatableObject {
|
15
|
+
get initialized() { return !!this.controls; }
|
16
|
+
;
|
15
17
|
constructor(core, settings, canvas) {
|
16
18
|
super();
|
17
19
|
this.controls = null;
|
@@ -23,8 +25,6 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
|
|
23
25
|
this.modelData = new RulerModelData(core, settings);
|
24
26
|
this.canvas = canvas;
|
25
27
|
}
|
26
|
-
get initialized() { return !!this.controls; }
|
27
|
-
;
|
28
28
|
dispose() {
|
29
29
|
if (this.initialized)
|
30
30
|
this.controls.dispose();
|
@@ -175,6 +175,7 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
|
|
175
175
|
}
|
176
176
|
setVisible(visible) {
|
177
177
|
if (visible != this._innerVisible || visible != this._visible) {
|
178
|
+
this.modelData.visibility = visible ? RulerVisibility.Visible : RulerVisibility.Hidden;
|
178
179
|
this._visible = visible;
|
179
180
|
this.innerSetVisible(visible);
|
180
181
|
}
|
@@ -201,7 +202,7 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
|
|
201
202
|
return;
|
202
203
|
if (!this.initialized && this.canvas.offsetWidth)
|
203
204
|
this.controls = new RulerControls(this.canvas, this.modelData);
|
204
|
-
this.setVisible(this.modelData.
|
205
|
+
this.setVisible(this.modelData.visibility != RulerVisibility.Hidden);
|
205
206
|
this.onViewTypeChanged();
|
206
207
|
}
|
207
208
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Point } from '@devexpress/utils/lib/geometry/point';
|
2
|
+
import { IModelManager } from '../model-manager';
|
2
3
|
export declare function rotatePoint(point: Point, angle: number, center: Point): Point;
|
3
4
|
export declare class SearchTreeItemResult<T> {
|
4
5
|
readonly parentList: T[];
|
@@ -11,8 +12,14 @@ export declare function searchTreeItem<T extends {
|
|
11
12
|
}>(items: T[], comparer: (item: T) => boolean): SearchTreeItemResult<T> | null;
|
12
13
|
export declare function convertToFunction(func: any): any | null;
|
13
14
|
export declare function splitByLines(text: string): string[];
|
15
|
+
export interface IUrlValidationOptions {
|
16
|
+
allowedSchemes?: string[];
|
17
|
+
}
|
18
|
+
export declare function createUrlValidationOptions(modelManager: IModelManager): IUrlValidationOptions;
|
14
19
|
export declare class UrlUtils {
|
15
20
|
static EmptyPage: string;
|
16
|
-
static isValid(url: string): boolean;
|
21
|
+
static isValid(url: string, options?: IUrlValidationOptions): boolean;
|
22
|
+
static isRelative(url: string): boolean;
|
23
|
+
static convertToAbsolute(url: string): URL | null;
|
17
24
|
static splitUrlByAnchor(url: string): [url: string, anchor: string];
|
18
25
|
}
|
@@ -56,20 +56,51 @@ export function convertToFunction(func) {
|
|
56
56
|
export function splitByLines(text) {
|
57
57
|
return text ? text.split(/\r\n|\r|\n/) : [''];
|
58
58
|
}
|
59
|
+
export function createUrlValidationOptions(modelManager) {
|
60
|
+
const fieldSettings = modelManager.richOptions.fields;
|
61
|
+
return {
|
62
|
+
allowedSchemes: fieldSettings.allowedHyperlinkUriSchemes
|
63
|
+
};
|
64
|
+
}
|
65
|
+
const defaultAllowedProtocols = [
|
66
|
+
'http',
|
67
|
+
'https',
|
68
|
+
'mailto',
|
69
|
+
'tel'
|
70
|
+
];
|
59
71
|
const disallowedProtocols = [
|
60
|
-
'
|
61
|
-
'
|
72
|
+
'javascript',
|
73
|
+
'data'
|
62
74
|
];
|
63
75
|
export class UrlUtils {
|
64
|
-
static isValid(url) {
|
76
|
+
static isValid(url, options) {
|
77
|
+
var _a;
|
78
|
+
const resultUrl = this.convertToAbsolute(url);
|
79
|
+
if (!resultUrl)
|
80
|
+
return false;
|
81
|
+
const protocol = resultUrl.protocol.slice(0, -1);
|
82
|
+
if (disallowedProtocols.includes(protocol))
|
83
|
+
return false;
|
84
|
+
const allowedProtocols = (_a = options === null || options === void 0 ? void 0 : options.allowedSchemes) !== null && _a !== void 0 ? _a : defaultAllowedProtocols;
|
85
|
+
return allowedProtocols.includes(protocol);
|
86
|
+
}
|
87
|
+
static isRelative(url) {
|
88
|
+
try {
|
89
|
+
new URL(url);
|
90
|
+
return false;
|
91
|
+
}
|
92
|
+
catch (_a) {
|
93
|
+
return true;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
static convertToAbsolute(url) {
|
65
97
|
const currentLocation = window.location.href;
|
66
98
|
try {
|
67
|
-
|
68
|
-
|
69
|
-
|
99
|
+
return new URL(url, currentLocation);
|
100
|
+
}
|
101
|
+
catch (_a) {
|
102
|
+
return null;
|
70
103
|
}
|
71
|
-
catch (_a) { }
|
72
|
-
return false;
|
73
104
|
}
|
74
105
|
static splitUrlByAnchor(url) {
|
75
106
|
const hashTagPosition = url.indexOf("#");
|