Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagram: arrange "commands" props types (T1227506) #3215

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React, { useCallback, useRef, useState } from 'react';
import Diagram, {
CustomShape, ContextToolbox, PropertiesPanel, Group, Tab, Toolbox, Nodes, AutoLayout, DiagramTypes,
import {
Diagram,
AutoLayout,
ContextToolbox,
CustomShape,
Group,
Nodes,
PropertiesPanel,
Tab,
Toolbox,
DiagramTypes,
} from 'devextreme-react/diagram';
import { Popup } from 'devextreme-react/popup';
import TextBox from 'devextreme-react/text-box';
Expand All @@ -10,7 +19,7 @@ import CustomShapeTemplate from './CustomShapeTemplate.tsx';
import CustomShapeToolboxTemplate from './CustomShapeToolboxTemplate.tsx';
import service, { Employee } from './data.ts';

const pageCommands = ['pageSize', 'pageOrientation', 'pageColor'];
const pageCommands: DiagramTypes.Command[] = ['pageSize', 'pageOrientation', 'pageColor'];

const nameLabel = { 'aria-label': 'Name' };
const emailLabel = { 'aria-label': 'Email' };
Expand Down Expand Up @@ -217,7 +226,7 @@ export default function App() {
</Toolbox>
<PropertiesPanel>
<Tab>
<Group title="Page Properties" commands={pageCommands as any} />
<Group title="Page Properties" commands={pageCommands} />
</Tab>
</PropertiesPanel>
</Diagram>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useCallback, useRef, useState } from 'react';
import Diagram, {
CustomShape,
import {
Diagram,
AutoLayout,
ContextToolbox,
PropertiesPanel,
CustomShape,
Group,
Nodes,
PropertiesPanel,
Tab,
Toolbox,
Nodes,
AutoLayout,
} from 'devextreme-react/diagram';
import { Popup } from 'devextreme-react/popup';
import TextBox from 'devextreme-react/text-box';
Expand Down
19 changes: 10 additions & 9 deletions JSDemos/Demos/Diagram/UICustomization/React/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import React, { useEffect, useRef } from 'react';
import Diagram, {
import {
Diagram,
Command,
ContextMenu,
ContextToolbox,
PropertiesPanel,
Group,
Tab,
HistoryToolbar,
ViewToolbar,
MainToolbar,
Command,
PropertiesPanel,
Tab,
Toolbox,
ViewToolbar,
DiagramTypes,
} from 'devextreme-react/diagram';
import { confirm } from 'devextreme/ui/dialog';
import 'whatwg-fetch';

const pageCommands = ['pageSize', 'pageOrientation', 'pageColor'];
const menuCommands = ['bringToFront', 'sendToBack', 'lock', 'unlock'];
const pageCommands: DiagramTypes.Command[] = ['pageSize', 'pageOrientation', 'pageColor'];
const menuCommands: DiagramTypes.Command[] = ['bringToFront', 'sendToBack', 'lock', 'unlock'];

function onCustomCommand(e: DiagramTypes.CustomCommandEvent) {
if (e.name === 'clear') {
Expand Down Expand Up @@ -54,7 +55,7 @@ export default function App() {
>
<ContextMenu
enabled={true}
commands={menuCommands as any}
commands={menuCommands}
/>
<ContextToolbox
enabled={true}
Expand All @@ -64,7 +65,7 @@ export default function App() {
/>
<PropertiesPanel visibility="visible">
<Tab>
<Group title="Page Properties" commands={pageCommands as any} />
<Group title="Page Properties" commands={pageCommands} />
</Tab>
</PropertiesPanel>
<HistoryToolbar visible={false} />
Expand Down
11 changes: 6 additions & 5 deletions JSDemos/Demos/Diagram/UICustomization/ReactJs/App.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React, { useEffect, useRef } from 'react';
import Diagram, {
import {
Diagram,
Command,
ContextMenu,
ContextToolbox,
PropertiesPanel,
Group,
Tab,
HistoryToolbar,
ViewToolbar,
MainToolbar,
Command,
PropertiesPanel,
Tab,
Toolbox,
ViewToolbar,
} from 'devextreme-react/diagram';
import { confirm } from 'devextreme/ui/dialog';
import 'whatwg-fetch';
Expand Down
Loading