@next-bricks/diagram 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +4 -2
- package/dist/chunks/4922.4558c07b.js +2 -0
- package/dist/chunks/4922.4558c07b.js.map +1 -0
- package/dist/chunks/7312.94667cd0.js +3 -0
- package/dist/chunks/7312.94667cd0.js.map +1 -0
- package/dist/chunks/editable-label.e741e544.js +3 -0
- package/dist/chunks/editable-label.e741e544.js.LICENSE.txt +5 -0
- package/dist/chunks/editable-label.e741e544.js.map +1 -0
- package/dist/chunks/eo-diagram.ae269315.js +2 -0
- package/dist/chunks/eo-diagram.ae269315.js.map +1 -0
- package/dist/chunks/main.20df2b07.js +2 -0
- package/dist/chunks/main.20df2b07.js.map +1 -0
- package/dist/examples.json +4 -1
- package/dist/index.23374df2.js +2 -0
- package/dist/index.23374df2.js.map +1 -0
- package/dist/manifest.json +57 -1
- package/dist/types.json +270 -1
- package/dist-types/bootstrap.d.ts +1 -0
- package/dist-types/diagram/LineLabelComponent.d.ts +22 -0
- package/dist-types/diagram/constants.d.ts +1 -0
- package/dist-types/diagram/index.d.ts +16 -5
- package/dist-types/diagram/interfaces.d.ts +47 -3
- package/dist-types/editable-label/index.d.ts +26 -0
- package/dist-types/editable-label/index.spec.d.ts +1 -0
- package/docs/editable-label.md +17 -0
- package/docs/eo-diagram.md +12 -0
- package/package.json +2 -2
- package/dist/chunks/3166.ddb1e0c3.js +0 -3
- package/dist/chunks/3166.ddb1e0c3.js.map +0 -1
- package/dist/chunks/8279.35fe958f.js +0 -2
- package/dist/chunks/8279.35fe958f.js.map +0 -1
- package/dist/chunks/eo-diagram.1dc0255a.js +0 -2
- package/dist/chunks/eo-diagram.1dc0255a.js.map +0 -1
- package/dist/chunks/main.b9560e26.js +0 -2
- package/dist/chunks/main.b9560e26.js.map +0 -1
- package/dist/index.7d701fa7.js +0 -2
- package/dist/index.7d701fa7.js.map +0 -1
- /package/dist/chunks/{3166.ddb1e0c3.js.LICENSE.txt → 7312.94667cd0.js.LICENSE.txt} +0 -0
package/dist/types.json
CHANGED
|
@@ -1,4 +1,62 @@
|
|
|
1
1
|
{
|
|
2
|
+
"diagram.editable-label": {
|
|
3
|
+
"properties": [
|
|
4
|
+
{
|
|
5
|
+
"name": "label",
|
|
6
|
+
"annotation": {
|
|
7
|
+
"type": "keyword",
|
|
8
|
+
"value": "string"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "type",
|
|
13
|
+
"annotation": {
|
|
14
|
+
"type": "reference",
|
|
15
|
+
"typeName": {
|
|
16
|
+
"type": "identifier",
|
|
17
|
+
"name": "LabelType"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"events": [
|
|
23
|
+
{
|
|
24
|
+
"name": "label.change",
|
|
25
|
+
"detail": {
|
|
26
|
+
"annotation": {
|
|
27
|
+
"type": "keyword",
|
|
28
|
+
"value": "string"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"methods": [
|
|
34
|
+
{
|
|
35
|
+
"name": "enableEditing",
|
|
36
|
+
"params": [],
|
|
37
|
+
"returns": {}
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"types": [
|
|
41
|
+
{
|
|
42
|
+
"type": "typeAlias",
|
|
43
|
+
"name": "LabelType",
|
|
44
|
+
"annotation": {
|
|
45
|
+
"type": "union",
|
|
46
|
+
"types": [
|
|
47
|
+
{
|
|
48
|
+
"type": "jsLiteral",
|
|
49
|
+
"value": "line"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "jsLiteral",
|
|
53
|
+
"value": "default"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
2
60
|
"eo-diagram": {
|
|
3
61
|
"properties": [
|
|
4
62
|
{
|
|
@@ -118,9 +176,52 @@
|
|
|
118
176
|
}
|
|
119
177
|
}
|
|
120
178
|
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "line.dblclick",
|
|
182
|
+
"detail": {
|
|
183
|
+
"annotation": {
|
|
184
|
+
"type": "reference",
|
|
185
|
+
"typeName": {
|
|
186
|
+
"type": "identifier",
|
|
187
|
+
"name": "LineTarget"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"methods": [
|
|
194
|
+
{
|
|
195
|
+
"name": "callOnLineLabel",
|
|
196
|
+
"params": [
|
|
197
|
+
{
|
|
198
|
+
"name": "id",
|
|
199
|
+
"annotation": {
|
|
200
|
+
"type": "keyword",
|
|
201
|
+
"value": "string"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "method",
|
|
206
|
+
"annotation": {
|
|
207
|
+
"type": "keyword",
|
|
208
|
+
"value": "string"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "param_3",
|
|
213
|
+
"annotation": {
|
|
214
|
+
"type": "array",
|
|
215
|
+
"elementType": {
|
|
216
|
+
"type": "keyword",
|
|
217
|
+
"value": "unknown"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"returns": {}
|
|
121
223
|
}
|
|
122
224
|
],
|
|
123
|
-
"methods": [],
|
|
124
225
|
"types": [
|
|
125
226
|
{
|
|
126
227
|
"type": "interface",
|
|
@@ -416,6 +517,32 @@
|
|
|
416
517
|
"optional": true,
|
|
417
518
|
"computed": false
|
|
418
519
|
},
|
|
520
|
+
{
|
|
521
|
+
"type": "propertySignature",
|
|
522
|
+
"key": {
|
|
523
|
+
"type": "identifier",
|
|
524
|
+
"name": "interactable"
|
|
525
|
+
},
|
|
526
|
+
"annotation": {
|
|
527
|
+
"type": "keyword",
|
|
528
|
+
"value": "boolean"
|
|
529
|
+
},
|
|
530
|
+
"optional": true,
|
|
531
|
+
"computed": false
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"type": "propertySignature",
|
|
535
|
+
"key": {
|
|
536
|
+
"type": "identifier",
|
|
537
|
+
"name": "interactStrokeWidth"
|
|
538
|
+
},
|
|
539
|
+
"annotation": {
|
|
540
|
+
"type": "keyword",
|
|
541
|
+
"value": "number"
|
|
542
|
+
},
|
|
543
|
+
"optional": true,
|
|
544
|
+
"computed": false
|
|
545
|
+
},
|
|
419
546
|
{
|
|
420
547
|
"type": "propertySignature",
|
|
421
548
|
"key": {
|
|
@@ -441,6 +568,115 @@
|
|
|
441
568
|
},
|
|
442
569
|
"optional": true,
|
|
443
570
|
"computed": false
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"type": "propertySignature",
|
|
574
|
+
"key": {
|
|
575
|
+
"type": "identifier",
|
|
576
|
+
"name": "text"
|
|
577
|
+
},
|
|
578
|
+
"annotation": {
|
|
579
|
+
"type": "reference",
|
|
580
|
+
"typeName": {
|
|
581
|
+
"type": "identifier",
|
|
582
|
+
"name": "TextOptions"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"optional": true,
|
|
586
|
+
"computed": false
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"type": "propertySignature",
|
|
590
|
+
"key": {
|
|
591
|
+
"type": "identifier",
|
|
592
|
+
"name": "label"
|
|
593
|
+
},
|
|
594
|
+
"annotation": {
|
|
595
|
+
"type": "reference",
|
|
596
|
+
"typeName": {
|
|
597
|
+
"type": "identifier",
|
|
598
|
+
"name": "LineLabelConf"
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
"optional": true,
|
|
602
|
+
"computed": false
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"type": "interface",
|
|
608
|
+
"name": "TextOptions",
|
|
609
|
+
"body": [
|
|
610
|
+
{
|
|
611
|
+
"type": "propertySignature",
|
|
612
|
+
"key": {
|
|
613
|
+
"type": "identifier",
|
|
614
|
+
"name": "content"
|
|
615
|
+
},
|
|
616
|
+
"annotation": {
|
|
617
|
+
"type": "keyword",
|
|
618
|
+
"value": "string"
|
|
619
|
+
},
|
|
620
|
+
"computed": false
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"type": "propertySignature",
|
|
624
|
+
"key": {
|
|
625
|
+
"type": "identifier",
|
|
626
|
+
"name": "style"
|
|
627
|
+
},
|
|
628
|
+
"annotation": {
|
|
629
|
+
"type": "reference",
|
|
630
|
+
"typeName": {
|
|
631
|
+
"type": "identifier",
|
|
632
|
+
"name": "CSSProperties"
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
"optional": true,
|
|
636
|
+
"computed": false
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"type": "interface",
|
|
642
|
+
"name": "LineLabelConf",
|
|
643
|
+
"body": [
|
|
644
|
+
{
|
|
645
|
+
"type": "propertySignature",
|
|
646
|
+
"key": {
|
|
647
|
+
"type": "identifier",
|
|
648
|
+
"name": "if"
|
|
649
|
+
},
|
|
650
|
+
"annotation": {
|
|
651
|
+
"type": "union",
|
|
652
|
+
"types": [
|
|
653
|
+
{
|
|
654
|
+
"type": "keyword",
|
|
655
|
+
"value": "string"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"type": "keyword",
|
|
659
|
+
"value": "boolean"
|
|
660
|
+
}
|
|
661
|
+
]
|
|
662
|
+
},
|
|
663
|
+
"optional": true,
|
|
664
|
+
"computed": false
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"type": "propertySignature",
|
|
668
|
+
"key": {
|
|
669
|
+
"type": "identifier",
|
|
670
|
+
"name": "useBrick"
|
|
671
|
+
},
|
|
672
|
+
"annotation": {
|
|
673
|
+
"type": "reference",
|
|
674
|
+
"typeName": {
|
|
675
|
+
"type": "identifier",
|
|
676
|
+
"name": "UseSingleBrickConf"
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
"computed": false
|
|
444
680
|
}
|
|
445
681
|
]
|
|
446
682
|
},
|
|
@@ -561,6 +797,39 @@
|
|
|
561
797
|
"computed": false
|
|
562
798
|
}
|
|
563
799
|
]
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"type": "interface",
|
|
803
|
+
"name": "LineTarget",
|
|
804
|
+
"body": [
|
|
805
|
+
{
|
|
806
|
+
"type": "propertySignature",
|
|
807
|
+
"key": {
|
|
808
|
+
"type": "identifier",
|
|
809
|
+
"name": "id"
|
|
810
|
+
},
|
|
811
|
+
"annotation": {
|
|
812
|
+
"type": "keyword",
|
|
813
|
+
"value": "string"
|
|
814
|
+
},
|
|
815
|
+
"computed": false
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"type": "propertySignature",
|
|
819
|
+
"key": {
|
|
820
|
+
"type": "identifier",
|
|
821
|
+
"name": "edge"
|
|
822
|
+
},
|
|
823
|
+
"annotation": {
|
|
824
|
+
"type": "reference",
|
|
825
|
+
"typeName": {
|
|
826
|
+
"type": "identifier",
|
|
827
|
+
"name": "DiagramEdge"
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"computed": false
|
|
831
|
+
}
|
|
832
|
+
]
|
|
564
833
|
}
|
|
565
834
|
]
|
|
566
835
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DiagramEdge, LineLabelConf, PositionTuple, RefRepository, RenderedLineLabel, TextOptions } from "./interfaces";
|
|
3
|
+
export interface LineLabelComponentGroupProps {
|
|
4
|
+
labels?: RenderedLineLabel[];
|
|
5
|
+
onRendered?: (refRepository: RefRepository | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function LineLabelComponentGroup({ labels, onRendered, }: LineLabelComponentGroupProps): JSX.Element;
|
|
8
|
+
export interface LineTextComponentProps {
|
|
9
|
+
id: string;
|
|
10
|
+
text: TextOptions;
|
|
11
|
+
position: PositionTuple;
|
|
12
|
+
onRendered?: (id: string, element: HTMLElement | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function LineTextComponent({ id, text, position, onRendered, }: LineTextComponentProps): JSX.Element;
|
|
15
|
+
export interface LineLabelComponentProps {
|
|
16
|
+
id: string;
|
|
17
|
+
edge: DiagramEdge;
|
|
18
|
+
label: LineLabelConf;
|
|
19
|
+
onRendered?: (id: string, element: HTMLElement | null) => void;
|
|
20
|
+
onUnmount?: (id: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function LineLabelComponent({ id, edge, label, onRendered, onUnmount, }: LineLabelComponentProps): JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
|
-
import type { DiagramEdge, DiagramNode, LayoutOptionsDagre, LineConf, NodeBrickConf } from "./interfaces";
|
|
4
|
+
import type { DiagramEdge, DiagramNode, LayoutOptionsDagre, LineConf, NodeBrickConf, LineTarget } from "./interfaces";
|
|
5
5
|
export interface EoDiagramProps {
|
|
6
6
|
layout?: "dagre";
|
|
7
7
|
nodes?: DiagramNode[];
|
|
@@ -11,18 +11,22 @@ export interface EoDiagramProps {
|
|
|
11
11
|
layoutOptions?: LayoutOptionsDagre;
|
|
12
12
|
activeNodeId?: string;
|
|
13
13
|
disableKeyboardAction?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
}
|
|
15
|
+
export interface DiagramRef {
|
|
16
|
+
callOnLineLabel(id: string, method: string, ...args: unknown[]): void;
|
|
17
17
|
}
|
|
18
18
|
export interface DiagramHandler {
|
|
19
19
|
moveIntoView(id: string): void;
|
|
20
20
|
}
|
|
21
|
+
export declare const EoDiagramComponent: React.ForwardRefExoticComponent<EoDiagramComponentProps & React.RefAttributes<DiagramRef>>;
|
|
21
22
|
/**
|
|
22
23
|
* 构件 `eo-diagram`
|
|
23
24
|
*/
|
|
24
25
|
export declare class EoDiagram extends ReactNextElement implements EoDiagramProps {
|
|
25
26
|
#private;
|
|
27
|
+
/**
|
|
28
|
+
* @required
|
|
29
|
+
*/
|
|
26
30
|
accessor layout: "dagre" | undefined;
|
|
27
31
|
accessor nodes: DiagramNode[] | undefined;
|
|
28
32
|
accessor edges: DiagramEdge[] | undefined;
|
|
@@ -31,6 +35,13 @@ export declare class EoDiagram extends ReactNextElement implements EoDiagramProp
|
|
|
31
35
|
accessor layoutOptions: LayoutOptionsDagre | undefined;
|
|
32
36
|
accessor activeNodeId: string | undefined;
|
|
33
37
|
accessor disableKeyboardAction: boolean | undefined;
|
|
38
|
+
callOnLineLabel(id: string, method: string, ...args: unknown[]): void;
|
|
34
39
|
render(): React.JSX.Element;
|
|
35
40
|
}
|
|
36
|
-
export
|
|
41
|
+
export interface EoDiagramComponentProps extends EoDiagramProps {
|
|
42
|
+
onActiveNodeChange?(node: DiagramNode | undefined): void;
|
|
43
|
+
onSwitchActiveNode?(id: string | undefined): void;
|
|
44
|
+
onNodeDelete?(node: DiagramNode): void;
|
|
45
|
+
onLineDoubleClick?(line: LineTarget): void;
|
|
46
|
+
}
|
|
47
|
+
export declare function LegacyEoDiagramComponent({ layout, nodes, edges, nodeBricks, lines, layoutOptions, activeNodeId, disableKeyboardAction, onActiveNodeChange, onSwitchActiveNode, onNodeDelete, onLineDoubleClick, }: EoDiagramComponentProps, ref: React.Ref<DiagramRef>): React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { UseSingleBrickConf } from "@next-core/react-runtime";
|
|
2
3
|
export interface DiagramNode {
|
|
3
4
|
id: DiagramNodeId;
|
|
4
5
|
type?: string;
|
|
@@ -26,14 +27,32 @@ export interface RenderedEdge {
|
|
|
26
27
|
points: NodePosition[];
|
|
27
28
|
data: DiagramEdge;
|
|
28
29
|
}
|
|
29
|
-
export interface RenderedLine
|
|
30
|
+
export interface RenderedLine {
|
|
30
31
|
line: LineConf & {
|
|
31
32
|
strokeColor: string;
|
|
32
33
|
strokeWidth: number;
|
|
33
|
-
|
|
34
|
+
interactStrokeWidth: number;
|
|
35
|
+
curveType: string;
|
|
36
|
+
$id: string;
|
|
34
37
|
};
|
|
38
|
+
d: string;
|
|
35
39
|
markerIndex: number | undefined;
|
|
40
|
+
edge: DiagramEdge;
|
|
36
41
|
}
|
|
42
|
+
export interface RenderedLineLabel {
|
|
43
|
+
text?: TextOptions;
|
|
44
|
+
label?: LineLabelConf;
|
|
45
|
+
edge: DiagramEdge;
|
|
46
|
+
position: PositionTuple;
|
|
47
|
+
lineRect: {
|
|
48
|
+
left: number;
|
|
49
|
+
top: number;
|
|
50
|
+
right: number;
|
|
51
|
+
bottom: number;
|
|
52
|
+
};
|
|
53
|
+
id: string;
|
|
54
|
+
}
|
|
55
|
+
export type PositionTuple = [x: number, y: number];
|
|
37
56
|
export interface LineMarker {
|
|
38
57
|
strokeColor: string;
|
|
39
58
|
}
|
|
@@ -56,8 +75,20 @@ export interface LineConf {
|
|
|
56
75
|
type?: "auto";
|
|
57
76
|
strokeColor?: string;
|
|
58
77
|
strokeWidth?: number;
|
|
78
|
+
interactable?: boolean;
|
|
79
|
+
interactStrokeWidth?: number;
|
|
59
80
|
curveType?: "curveBasis";
|
|
60
81
|
arrow?: boolean;
|
|
82
|
+
text?: TextOptions;
|
|
83
|
+
label?: LineLabelConf;
|
|
84
|
+
}
|
|
85
|
+
export interface LineLabelConf {
|
|
86
|
+
if?: string | boolean;
|
|
87
|
+
useBrick: UseSingleBrickConf;
|
|
88
|
+
}
|
|
89
|
+
export interface TextOptions {
|
|
90
|
+
content: string;
|
|
91
|
+
style?: CSSProperties;
|
|
61
92
|
}
|
|
62
93
|
export interface TransformLiteral {
|
|
63
94
|
k: number;
|
|
@@ -72,3 +103,16 @@ export interface LayoutOptionsDagre {
|
|
|
72
103
|
nodesep?: number;
|
|
73
104
|
align?: "UL" | "UR" | "DL" | "DR";
|
|
74
105
|
}
|
|
106
|
+
export interface LineTextClipPath extends SimpleRect {
|
|
107
|
+
id: string;
|
|
108
|
+
}
|
|
109
|
+
export interface SimpleRect {
|
|
110
|
+
x0: number;
|
|
111
|
+
y0: number;
|
|
112
|
+
w: number;
|
|
113
|
+
h: number;
|
|
114
|
+
}
|
|
115
|
+
export interface LineTarget {
|
|
116
|
+
id: string;
|
|
117
|
+
edge: DiagramEdge;
|
|
118
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactNextElement } from "@next-core/react-element";
|
|
3
|
+
import "@next-core/theme";
|
|
4
|
+
export interface EditableLabelProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
type?: LabelType;
|
|
7
|
+
}
|
|
8
|
+
export type LabelType = "line" | "default";
|
|
9
|
+
export interface EditableLabelRef {
|
|
10
|
+
enableEditing(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const EditableLabelComponent: React.ForwardRefExoticComponent<EditableLabelComponentProps & React.RefAttributes<EditableLabelRef>>;
|
|
13
|
+
/**
|
|
14
|
+
* 构件 `diagram.editable-label`
|
|
15
|
+
*/
|
|
16
|
+
export declare class EditableLabel extends ReactNextElement implements EditableLabelProps {
|
|
17
|
+
#private;
|
|
18
|
+
accessor label: string | undefined;
|
|
19
|
+
accessor type: LabelType | undefined;
|
|
20
|
+
enableEditing(): void;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export interface EditableLabelComponentProps extends EditableLabelProps {
|
|
24
|
+
onLabelChange?(value: string): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function LegacyEditableLabelComponent({ label: _label, onLabelChange }: EditableLabelComponentProps, ref: React.Ref<EditableLabelRef>): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
构件 `diagram.editable-label`
|
|
2
|
+
|
|
3
|
+
## Examples
|
|
4
|
+
|
|
5
|
+
### Basic
|
|
6
|
+
|
|
7
|
+
```yaml preview
|
|
8
|
+
brick: diagram.editable-label
|
|
9
|
+
properties:
|
|
10
|
+
type: line
|
|
11
|
+
label: Relation
|
|
12
|
+
events:
|
|
13
|
+
label.change:
|
|
14
|
+
action: message.success
|
|
15
|
+
args:
|
|
16
|
+
- "<% `Label changed to: ${EVENT.detail}` %>"
|
|
17
|
+
```
|
package/docs/eo-diagram.md
CHANGED
|
@@ -244,6 +244,18 @@ children:
|
|
|
244
244
|
- edgeType: link
|
|
245
245
|
strokeColor: var(--theme-blue-color)
|
|
246
246
|
arrow: true
|
|
247
|
+
text: |-
|
|
248
|
+
<%
|
|
249
|
+
DATA.edge.description
|
|
250
|
+
? {
|
|
251
|
+
content: DATA.edge.description,
|
|
252
|
+
style: {
|
|
253
|
+
color: "var(--color-secondary-text)",
|
|
254
|
+
fontSize: "11px",
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
: null
|
|
258
|
+
%>
|
|
247
259
|
- edgeType: menu
|
|
248
260
|
strokeColor: var(--palette-gray-5)
|
|
249
261
|
arrow: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/diagram",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/diagram",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@next-bricks/icons": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "ba424e87dba0c379675570df481406dfc3b97a03"
|
|
44
44
|
}
|