From ee307730e909499ee2aa333a363ba28892d2d50c Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov Date: Mon, 20 May 2024 20:31:34 +0300 Subject: [PATCH] dxDiagramCustomCommand -> CustomCommand after @public --- .../src/ui/diagram/index.ts | 32 +++++----- .../ui/nested/base/button-group-item-dxi.ts | 6 +- ...m-command-dxi.ts => custom-command-dxi.ts} | 8 +-- .../nested/base/file-manager-context-menu.ts | 6 +- .../html-editor-image-upload-tab-item-dxi.ts | 10 +-- .../src/ui/nested/base/index.ts | 2 +- .../src/ui/nested/command-dxi.ts | 4 +- .../src/ui/nested/group-dxi.ts | 6 +- .../src/ui/nested/history-toolbar.ts | 6 +- .../src/ui/nested/main-toolbar.ts | 6 +- .../src/ui/nested/properties-panel.ts | 6 +- .../src/ui/nested/view-toolbar.ts | 6 +- packages/devextreme-react/src/diagram.ts | 28 ++++---- packages/devextreme/js/ui/diagram.d.ts | 26 +++++--- packages/devextreme/js/ui/diagram_types.d.ts | 2 +- packages/devextreme/ts/dx.all.d.ts | 64 ++++++++++--------- 16 files changed, 113 insertions(+), 105 deletions(-) rename packages/devextreme-angular/src/ui/nested/base/{diagram-custom-command-dxi.ts => custom-command-dxi.ts} (78%) diff --git a/packages/devextreme-angular/src/ui/diagram/index.ts b/packages/devextreme-angular/src/ui/diagram/index.ts index c565efc8acab..d2ad7472f29f 100644 --- a/packages/devextreme-angular/src/ui/diagram/index.ts +++ b/packages/devextreme-angular/src/ui/diagram/index.ts @@ -26,7 +26,7 @@ import { import { Orientation, PageOrientation } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { AutoZoomMode, Command, ConnectorLineEnd, ConnectorLineType, ContentReadyEvent, CustomCommandEvent, DataLayoutType, DisposingEvent, dxDiagramCustomCommand, InitializedEvent, ItemClickEvent, ItemDblClickEvent, OptionChangedEvent, PanelVisibility, RequestEditOperationEvent, RequestLayoutUpdateEvent, SelectionChangedEvent, ShapeCategory, ShapeType, ToolboxDisplayMode, Units } from 'devextreme/ui/diagram'; +import { AutoZoomMode, Command, ConnectorLineEnd, ConnectorLineType, ContentReadyEvent, CustomCommand, CustomCommandEvent, DataLayoutType, DisposingEvent, InitializedEvent, ItemClickEvent, ItemDblClickEvent, OptionChangedEvent, PanelVisibility, RequestEditOperationEvent, RequestLayoutUpdateEvent, SelectionChangedEvent, ShapeCategory, ShapeType, ToolboxDisplayMode, Units } from 'devextreme/ui/diagram'; import DxDiagram from 'devextreme/ui/diagram'; @@ -103,10 +103,10 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan */ @Input() - get contextMenu(): { commands?: Array, enabled?: boolean } { + get contextMenu(): { commands?: Array, enabled?: boolean } { return this._getOption('contextMenu'); } - set contextMenu(value: { commands?: Array, enabled?: boolean }) { + set contextMenu(value: { commands?: Array, enabled?: boolean }) { this._setOption('contextMenu', value); } @@ -298,10 +298,10 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan */ @Input() - get historyToolbar(): { commands?: Array, visible?: boolean } { + get historyToolbar(): { commands?: Array, visible?: boolean } { return this._getOption('historyToolbar'); } - set historyToolbar(value: { commands?: Array, visible?: boolean }) { + set historyToolbar(value: { commands?: Array, visible?: boolean }) { this._setOption('historyToolbar', value); } @@ -311,10 +311,10 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan */ @Input() - get mainToolbar(): { commands?: Array, visible?: boolean } { + get mainToolbar(): { commands?: Array, visible?: boolean } { return this._getOption('mainToolbar'); } - set mainToolbar(value: { commands?: Array, visible?: boolean }) { + set mainToolbar(value: { commands?: Array, visible?: boolean }) { this._setOption('mainToolbar', value); } @@ -376,10 +376,10 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan */ @Input() - get propertiesPanel(): { tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility } { + get propertiesPanel(): { tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility } { return this._getOption('propertiesPanel'); } - set propertiesPanel(value: { tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility }) { + set propertiesPanel(value: { tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility }) { this._setOption('propertiesPanel', value); } @@ -493,10 +493,10 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan */ @Input() - get viewToolbar(): { commands?: Array, visible?: boolean } { + get viewToolbar(): { commands?: Array, visible?: boolean } { return this._getOption('viewToolbar'); } - set viewToolbar(value: { commands?: Array, visible?: boolean }) { + set viewToolbar(value: { commands?: Array, visible?: boolean }) { this._setOption('viewToolbar', value); } @@ -644,7 +644,7 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() contextMenuChange: EventEmitter<{ commands?: Array, enabled?: boolean }>; + @Output() contextMenuChange: EventEmitter<{ commands?: Array, enabled?: boolean }>; /** @@ -749,14 +749,14 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() historyToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; + @Output() historyToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() mainToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; + @Output() mainToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; /** @@ -791,7 +791,7 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() propertiesPanelChange: EventEmitter<{ tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility }>; + @Output() propertiesPanelChange: EventEmitter<{ tabs?: Array, groups?: Array, title?: string }>, title?: string }>, visibility?: PanelVisibility }>; /** @@ -854,7 +854,7 @@ export class DxDiagramComponent extends DxComponent implements OnDestroy, OnChan * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() viewToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; + @Output() viewToolbarChange: EventEmitter<{ commands?: Array, visible?: boolean }>; /** diff --git a/packages/devextreme-angular/src/ui/nested/base/button-group-item-dxi.ts b/packages/devextreme-angular/src/ui/nested/base/button-group-item-dxi.ts index a72f4458615b..5fc390a746f0 100644 --- a/packages/devextreme-angular/src/ui/nested/base/button-group-item-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/base/button-group-item-dxi.ts @@ -10,7 +10,7 @@ import { Properties as dxBoxOptions } from 'devextreme/ui/box'; import { Properties as dxButtonOptions } from 'devextreme/ui/button'; import { dxContextMenuItem } from 'devextreme/ui/context_menu'; import { DataGridPredefinedToolbarItem } from 'devextreme/ui/data_grid'; -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { ItemClickEvent } from 'devextreme/ui/drop_down_button'; import { dxFileManagerContextMenuItem, FileManagerPredefinedContextMenuItem, FileManagerPredefinedToolbarItem } from 'devextreme/ui/file_manager'; import { ButtonItem, EmptyItem, FormItemComponent, FormItemType, GroupItem, LabelLocation, SimpleItem, TabbedItem } from 'devextreme/ui/form'; @@ -160,10 +160,10 @@ export abstract class DxiButtonGroupItem extends CollectionNestedOption { this._setOption('closeMenuOnClick', value); } - get items(): Array { + get items(): Array { return this._getOption('items'); } - set items(value: Array) { + set items(value: Array) { this._setOption('items', value); } diff --git a/packages/devextreme-angular/src/ui/nested/base/diagram-custom-command-dxi.ts b/packages/devextreme-angular/src/ui/nested/base/custom-command-dxi.ts similarity index 78% rename from packages/devextreme-angular/src/ui/nested/base/diagram-custom-command-dxi.ts rename to packages/devextreme-angular/src/ui/nested/base/custom-command-dxi.ts index 4d21098a3923..60e386771df1 100644 --- a/packages/devextreme-angular/src/ui/nested/base/diagram-custom-command-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/base/custom-command-dxi.ts @@ -6,12 +6,12 @@ import { } from '@angular/core'; import { ToolbarItemLocation } from 'devextreme/common'; -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; @Component({ template: '' }) -export abstract class DxiDiagramCustomCommand extends CollectionNestedOption { +export abstract class DxiCustomCommand extends CollectionNestedOption { get icon(): string { return this._getOption('icon'); } @@ -19,10 +19,10 @@ export abstract class DxiDiagramCustomCommand extends CollectionNestedOption { this._setOption('icon', value); } - get items(): Array { + get items(): Array { return this._getOption('items'); } - set items(value: Array) { + set items(value: Array) { this._setOption('items', value); } diff --git a/packages/devextreme-angular/src/ui/nested/base/file-manager-context-menu.ts b/packages/devextreme-angular/src/ui/nested/base/file-manager-context-menu.ts index 3cba38b8b555..2f8ab7d35165 100644 --- a/packages/devextreme-angular/src/ui/nested/base/file-manager-context-menu.ts +++ b/packages/devextreme-angular/src/ui/nested/base/file-manager-context-menu.ts @@ -6,7 +6,7 @@ import { } from '@angular/core'; import { dxContextMenuItem } from 'devextreme/ui/context_menu'; -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { dxFileManagerContextMenuItem, FileManagerPredefinedContextMenuItem } from 'devextreme/ui/file_manager'; import { GanttPredefinedContextMenuItem } from 'devextreme/ui/gantt'; @@ -14,10 +14,10 @@ import { GanttPredefinedContextMenuItem } from 'devextreme/ui/gantt'; template: '' }) export abstract class DxoFileManagerContextMenu extends NestedOption { - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } diff --git a/packages/devextreme-angular/src/ui/nested/base/html-editor-image-upload-tab-item-dxi.ts b/packages/devextreme-angular/src/ui/nested/base/html-editor-image-upload-tab-item-dxi.ts index 5af96c89b3e4..316eccd251f6 100644 --- a/packages/devextreme-angular/src/ui/nested/base/html-editor-image-upload-tab-item-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/base/html-editor-image-upload-tab-item-dxi.ts @@ -5,7 +5,7 @@ import { Component, } from '@angular/core'; -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { ButtonItem, EmptyItem, GroupItem, SimpleItem, TabbedItem } from 'devextreme/ui/form'; import { HtmlEditorImageUploadTab } from 'devextreme/ui/html_editor'; @@ -83,17 +83,17 @@ export abstract class DxiHtmlEditorImageUploadTabItem extends CollectionNestedOp this._setOption('title', value); } - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } - get groups(): Array, title?: string }> { + get groups(): Array, title?: string }> { return this._getOption('groups'); } - set groups(value: Array, title?: string }>) { + set groups(value: Array, title?: string }>) { this._setOption('groups', value); } diff --git a/packages/devextreme-angular/src/ui/nested/base/index.ts b/packages/devextreme-angular/src/ui/nested/base/index.ts index 43537b1457d1..bbcb2e4bf6d4 100644 --- a/packages/devextreme-angular/src/ui/nested/base/index.ts +++ b/packages/devextreme-angular/src/ui/nested/base/index.ts @@ -11,10 +11,10 @@ export * from './chart-series-dxi'; export * from './charts-color'; export * from './column-chooser-search-config'; export * from './column-chooser-selection-config'; +export * from './custom-command-dxi'; export * from './data-change-dxi'; export * from './data-grid-column-dxi'; export * from './data-grid-toolbar'; -export * from './diagram-custom-command-dxi'; export * from './file-manager-context-menu'; export * from './file-manager-toolbar-item-dxi'; export * from './file-uploader-options'; diff --git a/packages/devextreme-angular/src/ui/nested/command-dxi.ts b/packages/devextreme-angular/src/ui/nested/command-dxi.ts index af4ea521f05e..20317172f2b5 100644 --- a/packages/devextreme-angular/src/ui/nested/command-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/command-dxi.ts @@ -19,7 +19,7 @@ import { import { NestedOptionHost, } from 'devextreme-angular/core'; -import { DxiDiagramCustomCommand } from './base/diagram-custom-command-dxi'; +import { DxiCustomCommand } from './base/custom-command-dxi'; import { DxiItemComponent } from './item-dxi'; @@ -36,7 +36,7 @@ import { DxiItemComponent } from './item-dxi'; 'text' ] }) -export class DxiCommandComponent extends DxiDiagramCustomCommand { +export class DxiCommandComponent extends DxiCustomCommand { protected get _optionPath() { return 'commands'; diff --git a/packages/devextreme-angular/src/ui/nested/group-dxi.ts b/packages/devextreme-angular/src/ui/nested/group-dxi.ts index f3f99be95c12..c76840dd6ded 100644 --- a/packages/devextreme-angular/src/ui/nested/group-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/group-dxi.ts @@ -15,7 +15,7 @@ import { -import { Command, dxDiagramCustomCommand, ShapeCategory, ShapeType, ToolboxDisplayMode } from 'devextreme/ui/diagram'; +import { Command, CustomCommand, ShapeCategory, ShapeType, ToolboxDisplayMode } from 'devextreme/ui/diagram'; import { NestedOptionHost, @@ -32,10 +32,10 @@ import { DxiCommandComponent } from './command-dxi'; }) export class DxiGroupComponent extends CollectionNestedOption { @Input() - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } diff --git a/packages/devextreme-angular/src/ui/nested/history-toolbar.ts b/packages/devextreme-angular/src/ui/nested/history-toolbar.ts index 5b756e1bb09f..98f89def3b8d 100644 --- a/packages/devextreme-angular/src/ui/nested/history-toolbar.ts +++ b/packages/devextreme-angular/src/ui/nested/history-toolbar.ts @@ -17,7 +17,7 @@ import { -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { NestedOptionHost, @@ -34,10 +34,10 @@ import { DxiCommandComponent } from './command-dxi'; }) export class DxoHistoryToolbarComponent extends NestedOption implements OnDestroy, OnInit { @Input() - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } diff --git a/packages/devextreme-angular/src/ui/nested/main-toolbar.ts b/packages/devextreme-angular/src/ui/nested/main-toolbar.ts index 8865be030d4f..123de6415239 100644 --- a/packages/devextreme-angular/src/ui/nested/main-toolbar.ts +++ b/packages/devextreme-angular/src/ui/nested/main-toolbar.ts @@ -17,7 +17,7 @@ import { -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { NestedOptionHost, @@ -34,10 +34,10 @@ import { DxiCommandComponent } from './command-dxi'; }) export class DxoMainToolbarComponent extends NestedOption implements OnDestroy, OnInit { @Input() - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } diff --git a/packages/devextreme-angular/src/ui/nested/properties-panel.ts b/packages/devextreme-angular/src/ui/nested/properties-panel.ts index 6fe598dca3f9..f903748e7d45 100644 --- a/packages/devextreme-angular/src/ui/nested/properties-panel.ts +++ b/packages/devextreme-angular/src/ui/nested/properties-panel.ts @@ -17,7 +17,7 @@ import { -import { Command, dxDiagramCustomCommand, PanelVisibility } from 'devextreme/ui/diagram'; +import { Command, CustomCommand, PanelVisibility } from 'devextreme/ui/diagram'; import { NestedOptionHost, @@ -34,10 +34,10 @@ import { DxiTabComponent } from './tab-dxi'; }) export class DxoPropertiesPanelComponent extends NestedOption implements OnDestroy, OnInit { @Input() - get tabs(): Array, groups?: Array, title?: string }>, title?: string }> { + get tabs(): Array, groups?: Array, title?: string }>, title?: string }> { return this._getOption('tabs'); } - set tabs(value: Array, groups?: Array, title?: string }>, title?: string }>) { + set tabs(value: Array, groups?: Array, title?: string }>, title?: string }>) { this._setOption('tabs', value); } diff --git a/packages/devextreme-angular/src/ui/nested/view-toolbar.ts b/packages/devextreme-angular/src/ui/nested/view-toolbar.ts index f394a81dbc34..a9ed4e9db3a5 100644 --- a/packages/devextreme-angular/src/ui/nested/view-toolbar.ts +++ b/packages/devextreme-angular/src/ui/nested/view-toolbar.ts @@ -17,7 +17,7 @@ import { -import { Command, dxDiagramCustomCommand } from 'devextreme/ui/diagram'; +import { Command, CustomCommand } from 'devextreme/ui/diagram'; import { NestedOptionHost, @@ -34,10 +34,10 @@ import { DxiCommandComponent } from './command-dxi'; }) export class DxoViewToolbarComponent extends NestedOption implements OnDestroy, OnInit { @Input() - get commands(): Array { + get commands(): Array { return this._getOption('commands'); } - set commands(value: Array) { + set commands(value: Array) { this._setOption('commands', value); } diff --git a/packages/devextreme-react/src/diagram.ts b/packages/devextreme-react/src/diagram.ts index 3ddeef27d4b3..adf42efc6e7d 100644 --- a/packages/devextreme-react/src/diagram.ts +++ b/packages/devextreme-react/src/diagram.ts @@ -8,7 +8,7 @@ import dxDiagram, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { ContentReadyEvent, CustomCommandEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemDblClickEvent, RequestEditOperationEvent, RequestLayoutUpdateEvent, dxDiagramCustomCommand, dxDiagramShape } from "devextreme/ui/diagram"; +import type { ContentReadyEvent, CustomCommandEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemDblClickEvent, RequestEditOperationEvent, RequestLayoutUpdateEvent, CustomCommand, dxDiagramShape } from "devextreme/ui/diagram"; import type { dxSVGElement } from "devextreme/core/element"; import type { template } from "devextreme/core/templates/template"; import type { DataSourceOptions } from "devextreme/data/data_source"; @@ -144,7 +144,7 @@ const AutoLayout: typeof _componentAutoLayout & IElementDescriptor = Object.assi // ViewToolbar type ICommandProps = React.PropsWithChildren<{ icon?: string; - items?: Array; + items?: Array; location?: "after" | "before" | "center"; name?: "separator" | "exportSvg" | "exportPng" | "exportJpg" | "undo" | "redo" | "cut" | "copy" | "paste" | "selectAll" | "delete" | "fontName" | "fontSize" | "bold" | "italic" | "underline" | "fontColor" | "lineStyle" | "lineWidth" | "lineColor" | "fillColor" | "textAlignLeft" | "textAlignCenter" | "textAlignRight" | "lock" | "unlock" | "sendToBack" | "bringToFront" | "insertShapeImage" | "editShapeImage" | "deleteShapeImage" | "connectorLineType" | "connectorLineStart" | "connectorLineEnd" | "layoutTreeTopToBottom" | "layoutTreeBottomToTop" | "layoutTreeLeftToRight" | "layoutTreeRightToLeft" | "layoutLayeredTopToBottom" | "layoutLayeredBottomToTop" | "layoutLayeredLeftToRight" | "layoutLayeredRightToLeft" | "fullScreen" | "zoomLevel" | "showGrid" | "snapToGrid" | "gridSize" | "units" | "pageSize" | "pageOrientation" | "pageColor" | "simpleView" | "toolbox"; text?: string; @@ -164,7 +164,7 @@ const Command: typeof _componentCommand & IElementDescriptor = Object.assign(_co // Command type ICommandItemProps = React.PropsWithChildren<{ icon?: string; - items?: Array; + items?: Array; location?: "after" | "before" | "center"; name?: "separator" | "exportSvg" | "exportPng" | "exportJpg" | "undo" | "redo" | "cut" | "copy" | "paste" | "selectAll" | "delete" | "fontName" | "fontSize" | "bold" | "italic" | "underline" | "fontColor" | "lineStyle" | "lineWidth" | "lineColor" | "fillColor" | "textAlignLeft" | "textAlignCenter" | "textAlignRight" | "lock" | "unlock" | "sendToBack" | "bringToFront" | "insertShapeImage" | "editShapeImage" | "deleteShapeImage" | "connectorLineType" | "connectorLineStart" | "connectorLineEnd" | "layoutTreeTopToBottom" | "layoutTreeBottomToTop" | "layoutTreeLeftToRight" | "layoutTreeRightToLeft" | "layoutLayeredTopToBottom" | "layoutLayeredBottomToTop" | "layoutLayeredLeftToRight" | "layoutLayeredRightToLeft" | "fullScreen" | "zoomLevel" | "showGrid" | "snapToGrid" | "gridSize" | "units" | "pageSize" | "pageOrientation" | "pageColor" | "simpleView" | "toolbox"; text?: string; @@ -200,7 +200,7 @@ const ConnectionPoint: typeof _componentConnectionPoint & IElementDescriptor = O // owners: // Diagram type IContextMenuProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; enabled?: boolean; }> const _componentContextMenu = memo( @@ -424,7 +424,7 @@ const GridSize: typeof _componentGridSize & IElementDescriptor = Object.assign(_ // Tab // Toolbox type IGroupProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; title?: string; category?: "general" | "flowchart" | "orgChart" | "containers" | "custom"; displayMode?: "icons" | "texts"; @@ -445,7 +445,7 @@ const Group: typeof _componentGroup & IElementDescriptor = Object.assign(_compon // owners: // Diagram type IHistoryToolbarProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; visible?: boolean; }> const _componentHistoryToolbar = memo( @@ -466,7 +466,7 @@ const HistoryToolbar: typeof _componentHistoryToolbar & IElementDescriptor = Obj // PageSize type IItemProps = React.PropsWithChildren<{ icon?: string; - items?: Array; + items?: Array; location?: "after" | "before" | "center"; name?: "separator" | "exportSvg" | "exportPng" | "exportJpg" | "undo" | "redo" | "cut" | "copy" | "paste" | "selectAll" | "delete" | "fontName" | "fontSize" | "bold" | "italic" | "underline" | "fontColor" | "lineStyle" | "lineWidth" | "lineColor" | "fillColor" | "textAlignLeft" | "textAlignCenter" | "textAlignRight" | "lock" | "unlock" | "sendToBack" | "bringToFront" | "insertShapeImage" | "editShapeImage" | "deleteShapeImage" | "connectorLineType" | "connectorLineStart" | "connectorLineEnd" | "layoutTreeTopToBottom" | "layoutTreeBottomToTop" | "layoutTreeLeftToRight" | "layoutTreeRightToLeft" | "layoutLayeredTopToBottom" | "layoutLayeredBottomToTop" | "layoutLayeredLeftToRight" | "layoutLayeredRightToLeft" | "fullScreen" | "zoomLevel" | "showGrid" | "snapToGrid" | "gridSize" | "units" | "pageSize" | "pageOrientation" | "pageColor" | "simpleView" | "toolbox"; text?: string; @@ -487,7 +487,7 @@ const Item: typeof _componentItem & IElementDescriptor = Object.assign(_componen // owners: // Diagram type IMainToolbarProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; visible?: boolean; }> const _componentMainToolbar = memo( @@ -598,9 +598,9 @@ const PageSizeItem: typeof _componentPageSizeItem & IElementDescriptor = Object. // Diagram type IPropertiesPanelProps = React.PropsWithChildren<{ tabs?: Array> | { - commands?: Array; + commands?: Array; groups?: Array> | { - commands?: Array; + commands?: Array; title?: string; }[]; title?: string; @@ -623,9 +623,9 @@ const PropertiesPanel: typeof _componentPropertiesPanel & IElementDescriptor = O // owners: // PropertiesPanel type ITabProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; groups?: Array> | { - commands?: Array; + commands?: Array; title?: string; }[]; title?: string; @@ -649,7 +649,7 @@ const Tab: typeof _componentTab & IElementDescriptor = Object.assign(_componentT // owners: // Tab type ITabGroupProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; title?: string; }> const _componentTabGroup = memo( @@ -718,7 +718,7 @@ const ToolboxGroup: typeof _componentToolboxGroup & IElementDescriptor = Object. // owners: // Diagram type IViewToolbarProps = React.PropsWithChildren<{ - commands?: Array; + commands?: Array; visible?: boolean; }> const _componentViewToolbar = memo( diff --git a/packages/devextreme/js/ui/diagram.d.ts b/packages/devextreme/js/ui/diagram.d.ts index f70e8f691773..5943fc9a5abe 100644 --- a/packages/devextreme/js/ui/diagram.d.ts +++ b/packages/devextreme/js/ui/diagram.d.ts @@ -256,7 +256,7 @@ export interface dxDiagramOptions extends WidgetOptions { * @docid * @default undefined */ - commands?: Array; + commands?: Array; /** * @docid * @default true @@ -938,7 +938,7 @@ export interface dxDiagramOptions extends WidgetOptions { /** * @docid */ - commands?: Array; + commands?: Array; /** * @docid */ @@ -946,7 +946,7 @@ export interface dxDiagramOptions extends WidgetOptions { /** * @docid */ - commands?: Array; + commands?: Array; /** * @docid */ @@ -1004,7 +1004,7 @@ export interface dxDiagramOptions extends WidgetOptions { * @docid * @default undefined */ - commands?: Array; + commands?: Array; /** * @docid * @default false @@ -1021,7 +1021,7 @@ export interface dxDiagramOptions extends WidgetOptions { * @docid * @default undefined */ - commands?: Array; + commands?: Array; /** * @docid * @default true @@ -1038,7 +1038,7 @@ export interface dxDiagramOptions extends WidgetOptions { * @docid * @default undefined */ - commands?: Array; + commands?: Array; /** * @docid * @default true @@ -1389,12 +1389,18 @@ export interface dxDiagramShape extends Item { containerExpanded?: boolean; } +/** + * @deprecated Use CustomCommand instead + * @namespace DevExpress.ui + */ +export type dxDiagramCustomCommand = CustomCommand; + /** * @docid * @public - * @namespace DevExpress.ui + * @namespace DevExpress.ui.dxDiagram */ -export type dxDiagramCustomCommand = { +export type CustomCommand = { /** * @docid * @public @@ -1414,14 +1420,14 @@ export type dxDiagramCustomCommand = { * @docid * @public */ - items?: Array; + items?: Array; /** * @docid * @default "before" * @public */ location?: ToolbarItemLocation; -}; +} /** * @docid diff --git a/packages/devextreme/js/ui/diagram_types.d.ts b/packages/devextreme/js/ui/diagram_types.d.ts index 4a452ab07973..d1907036d065 100644 --- a/packages/devextreme/js/ui/diagram_types.d.ts +++ b/packages/devextreme/js/ui/diagram_types.d.ts @@ -27,6 +27,6 @@ export { CustomShapeTemplateData, CustomShapeToolboxTemplateData, Item, - dxDiagramCustomCommand, + CustomCommand, Properties, } from './diagram'; diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index d25849664b9a..8612e6dc2351 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -13018,31 +13018,6 @@ declare module DevExpress.ui { */ toPointIndex?: number; } - /** - * [descr:dxDiagramCustomCommand] - */ - export type dxDiagramCustomCommand = { - /** - * [descr:dxDiagramCustomCommand.name] - */ - name?: string | DevExpress.ui.dxDiagram.Command; - /** - * [descr:dxDiagramCustomCommand.text] - */ - text?: string; - /** - * [descr:dxDiagramCustomCommand.icon] - */ - icon?: string; - /** - * [descr:dxDiagramCustomCommand.items] - */ - items?: Array; - /** - * [descr:dxDiagramCustomCommand.location] - */ - location?: DevExpress.common.ToolbarItemLocation; - }; /** * [descr:dxDiagramDeleteConnectorArgs] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -13139,7 +13114,7 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.contextMenu.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + DevExpress.ui.dxDiagram.CustomCommand | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.contextMenu.enabled] @@ -13728,7 +13703,8 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.propertiesPanel.tabs.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + | DevExpress.ui.dxDiagram.CustomCommand + | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.propertiesPanel.tabs.groups] @@ -13738,7 +13714,8 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.propertiesPanel.tabs.groups.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + | DevExpress.ui.dxDiagram.CustomCommand + | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.propertiesPanel.tabs.groups.title] @@ -13783,7 +13760,7 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.mainToolbar.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + DevExpress.ui.dxDiagram.CustomCommand | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.mainToolbar.visible] @@ -13798,7 +13775,7 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.historyToolbar.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + DevExpress.ui.dxDiagram.CustomCommand | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.historyToolbar.visible] @@ -13813,7 +13790,7 @@ declare module DevExpress.ui { * [descr:dxDiagramOptions.viewToolbar.commands] */ commands?: Array< - dxDiagramCustomCommand | DevExpress.ui.dxDiagram.Command + DevExpress.ui.dxDiagram.CustomCommand | DevExpress.ui.dxDiagram.Command >; /** * [descr:dxDiagramOptions.viewToolbar.visible] @@ -30545,6 +30522,31 @@ declare module DevExpress.ui.dxDiagram { | 'filledTriangle'; export type ConnectorLineType = 'straight' | 'orthogonal'; export type ConnectorPosition = 'start' | 'end'; + /** + * [descr:CustomCommand] + */ + export type CustomCommand = { + /** + * [descr:CustomCommand.name] + */ + name?: string | Command; + /** + * [descr:CustomCommand.text] + */ + text?: string; + /** + * [descr:CustomCommand.icon] + */ + icon?: string; + /** + * [descr:CustomCommand.items] + */ + items?: Array; + /** + * [descr:CustomCommand.location] + */ + location?: DevExpress.common.ToolbarItemLocation; + }; export type DataLayoutType = 'auto' | 'off' | 'tree' | 'layered'; export type DiagramExportFormat = 'svg' | 'png' | 'jpg'; /**