duoyun-ui 0.0.13 → 0.0.16

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.
Files changed (57) hide show
  1. package/elements/area-chart.d.ts +8 -0
  2. package/elements/area-chart.d.ts.map +1 -1
  3. package/elements/area-chart.js +76 -38
  4. package/elements/area-chart.js.map +1 -1
  5. package/elements/base/chart.d.ts +2 -1
  6. package/elements/base/chart.d.ts.map +1 -1
  7. package/elements/base/chart.js +27 -0
  8. package/elements/base/chart.js.map +1 -1
  9. package/elements/base/resize.d.ts +3 -1
  10. package/elements/base/resize.d.ts.map +1 -1
  11. package/elements/base/resize.js +15 -4
  12. package/elements/base/resize.js.map +1 -1
  13. package/elements/base/scroll.d.ts.map +1 -1
  14. package/elements/base/scroll.js +5 -4
  15. package/elements/base/scroll.js.map +1 -1
  16. package/elements/chart-tooltip.d.ts.map +1 -1
  17. package/elements/chart-tooltip.js +1 -0
  18. package/elements/chart-tooltip.js.map +1 -1
  19. package/elements/chart-zoom.js +2 -2
  20. package/elements/chart-zoom.js.map +1 -1
  21. package/elements/flow.d.ts +71 -0
  22. package/elements/flow.d.ts.map +1 -0
  23. package/elements/flow.js +596 -0
  24. package/elements/flow.js.map +1 -0
  25. package/elements/form.d.ts +17 -5
  26. package/elements/form.d.ts.map +1 -1
  27. package/elements/form.js +130 -40
  28. package/elements/form.js.map +1 -1
  29. package/elements/input.d.ts +3 -0
  30. package/elements/input.d.ts.map +1 -1
  31. package/elements/input.js +7 -1
  32. package/elements/input.js.map +1 -1
  33. package/elements/popover.d.ts.map +1 -1
  34. package/elements/popover.js +56 -12
  35. package/elements/popover.js.map +1 -1
  36. package/elements/select.js +1 -1
  37. package/elements/select.js.map +1 -1
  38. package/elements/space.d.ts.map +1 -1
  39. package/elements/space.js +1 -0
  40. package/elements/space.js.map +1 -1
  41. package/elements/table.js +1 -1
  42. package/elements/table.js.map +1 -1
  43. package/elements/toast.d.ts.map +1 -1
  44. package/elements/toast.js +5 -4
  45. package/elements/toast.js.map +1 -1
  46. package/lib/encode.d.ts +7 -0
  47. package/lib/encode.d.ts.map +1 -0
  48. package/lib/encode.js +22 -0
  49. package/lib/encode.js.map +1 -0
  50. package/lib/types.d.ts +2 -0
  51. package/lib/types.d.ts.map +1 -1
  52. package/lib/types.js.map +1 -1
  53. package/lib/utils.d.ts +5 -6
  54. package/lib/utils.d.ts.map +1 -1
  55. package/lib/utils.js +23 -19
  56. package/lib/utils.js.map +1 -1
  57. package/package.json +3 -2
@@ -0,0 +1,596 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _DuoyunFlowCanvasElement_instances, _DuoyunFlowCanvasElement_isReady_get, _DuoyunFlowCanvasElement_renderNode, _DuoyunFlowCanvasElement_renderNodeLabel, _DuoyunFlowCanvasElement_renderEdge, _DuoyunFlowCanvasElement_renderEdgeLabel, _DuoyunFlowCanvasElement_renderEndMarker, _DuoyunFlowCanvasElement_renderStartMarker, _DuoyunFlowCanvasElement_genId, _DuoyunFlowCanvasElement_genLabelId, _DuoyunFlowCanvasElement_initShape, _DuoyunFlowCanvasElement_updateSize, _DuoyunFlowCanvasElement_calcPath, _DuoyunFlowCanvasElement_layout, _DuoyunFlowCanvasElement_renderWrap, _DuoyunFlowCanvasElement_renderChildren, _DuoyunFlowCanvasElement_renderChildrenEdge, _DuoyunFlowElement_onCanvasResize, _DuoyunFlowElement_normalizeGraph;
13
+ var DuoyunFlowCanvasElement_1;
14
+ import { adoptedStyle, customElement, property, part } from '@mantou/gem/lib/decorators';
15
+ import { GemElement, html, svg } from '@mantou/gem/lib/element';
16
+ import { createCSSSheet, css, styleMap, exportPartsMap } from '@mantou/gem/lib/utils';
17
+ import { isNullish, isNotNullish } from '../lib/types';
18
+ import { formatToPrecision } from '../lib/number';
19
+ import { theme } from '../lib/theme';
20
+ import { utf8ToB64 } from '../lib/encode';
21
+ import { DuoyunResizeBaseElement } from './base/resize';
22
+ window.g = null;
23
+ // https://github.com/reaviz/reaflow/blob/master/src/layout/elkLayout.ts
24
+ const defaultLayout = {
25
+ /**
26
+ * Select a specific layout algorithm.
27
+ *
28
+ * Uses "layered" strategy.
29
+ * It emphasizes the direction of edges by pointing as many edges as possible into the same direction.
30
+ * The nodes are arranged in layers, which are sometimes called “hierarchies”,
31
+ * and then reordered such that the number of edge crossings is minimized.
32
+ * Afterwards, concrete coordinates are computed for the nodes and edge bend points.
33
+ *
34
+ * @see https://www.eclipse.org/elk/reference/algorithms.html
35
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-algorithm.html
36
+ * @see https://www.eclipse.org/elk/reference/algorithms/org-eclipse-elk-layered.html
37
+ */
38
+ 'elk.algorithm': 'org.eclipse.elk.layered',
39
+ /**
40
+ * Hints for where node labels are to be placed; if empty, the node label’s position is not modified.
41
+ *
42
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-nodeLabels-placement.html
43
+ */
44
+ 'elk.nodeLabels.placement': 'OUTSIDE V_TOP H_LEFT',
45
+ /**
46
+ * The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the ‘edgelabels.placement’ option.
47
+ *
48
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-spacing-edgeLabel.html
49
+ */
50
+ 'org.eclipse.elk.spacing.edgeLabel': '8',
51
+ /**
52
+ * Method to decide on edge label sides.
53
+ *
54
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-edgeLabels-sideSelection.html
55
+ */
56
+ 'org.eclipse.elk.layered.edgeLabels.sideSelection': 'ALWAYS_UP',
57
+ /**
58
+ * Overall direction of edges: horizontal (right / left) or vertical (down / up).
59
+ *
60
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-direction.html
61
+ */
62
+ 'elk.direction': 'DOWN',
63
+ /**
64
+ * Strategy for node layering.
65
+ *
66
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-layering-strategy.html
67
+ */
68
+ 'org.eclipse.elk.layered.layering.strategy': 'INTERACTIVE',
69
+ /**
70
+ * What kind of edge routing style should be applied for the content of a parent node.
71
+ * Algorithms may also set this option to single edges in order to mark them as splines.
72
+ * The bend point list of edges with this option set to SPLINES
73
+ * must be interpreted as control points for a piecewise cubic spline.
74
+ *
75
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-edgeRouting.html
76
+ */
77
+ 'org.eclipse.elk.edgeRouting': 'SPLINES',
78
+ /**
79
+ * Adds bend points even if an edge does not change direction.
80
+ * If true, each long edge dummy will contribute a bend point to its edges
81
+ * and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries.
82
+ * By default, bend points are only added where an edge changes direction.
83
+ *
84
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-unnecessaryBendpoints.html
85
+ */
86
+ 'elk.layered.unnecessaryBendpoints': 'true',
87
+ /**
88
+ * The spacing to be preserved between nodes and edges that are routed next to the node’s layer.
89
+ * For the spacing between nodes and edges that cross the node’s layer ‘spacing.edgeNode’ is used.
90
+ *
91
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-spacing-edgeNodeBetweenLayers.html
92
+ */
93
+ 'elk.layered.spacing.edgeNodeBetweenLayers': '50',
94
+ /**
95
+ * Tells the BK node placer to use a certain alignment (out of its four)
96
+ * instead of the one producing the smallest height, or the combination of all four.
97
+ *
98
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-nodePlacement-bk-fixedAlignment.html
99
+ */
100
+ 'org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment': 'BALANCED',
101
+ /**
102
+ * Strategy for cycle breaking.
103
+ *
104
+ * Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles.
105
+ * Reversed edges will end up pointing to the opposite direction of regular edges
106
+ * (that is, reversed edges will point left if edges usually point right).
107
+ *
108
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-cycleBreaking-strategy.html
109
+ */
110
+ 'org.eclipse.elk.layered.cycleBreaking.strategy': 'DEPTH_FIRST',
111
+ /**
112
+ * Whether this node allows to route self loops inside of it instead of around it.
113
+ *
114
+ * If set to true, this will make the node a compound node if it isn’t already,
115
+ * and will require the layout algorithm to support compound nodes with hierarchical ports.
116
+ *
117
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-insideSelfLoops-activate.html
118
+ */
119
+ 'org.eclipse.elk.insideSelfLoops.activate': 'true',
120
+ /**
121
+ * Whether each connected component should be processed separately.
122
+ *
123
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-separateConnectedComponents.html
124
+ */
125
+ separateConnectedComponents: 'false',
126
+ /**
127
+ * Spacing to be preserved between pairs of connected components.
128
+ * This option is only relevant if ‘separateConnectedComponents’ is activated.
129
+ *
130
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-spacing-componentComponent.html
131
+ */
132
+ 'spacing.componentComponent': '70',
133
+ /**
134
+ * TODO: Should be spacing.baseValue?
135
+ * An optional base value for all other layout options of the ‘spacing’ group.
136
+ * It can be used to conveniently alter the overall ‘spaciousness’ of the drawing.
137
+ * Whenever an explicit value is set for the other layout options, this base value will have no effect.
138
+ * The base value is not inherited, i.e. it must be set for each hierarchical node.
139
+ *
140
+ * @see https://www.eclipse.org/elk/reference/groups/org-eclipse-elk-layered-spacing.html
141
+ */
142
+ spacing: '75',
143
+ /**
144
+ * The spacing to be preserved between any pair of nodes of two adjacent layers.
145
+ * Note that ‘spacing.nodeNode’ is used for the spacing between nodes within the layer itself.
146
+ *
147
+ * @see https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-spacing-nodeNodeBetweenLayers.html
148
+ */
149
+ 'spacing.nodeNodeBetweenLayers': '70',
150
+ };
151
+ const canvasStyle = createCSSSheet(css `
152
+ :host {
153
+ display: block;
154
+ position: relative;
155
+ flex-shrink: 0;
156
+ }
157
+ .node {
158
+ height: 100%;
159
+ border: 1px solid;
160
+ box-sizing: border-box;
161
+ padding: 0.5em 1em;
162
+ border-radius: ${theme.normalRound};
163
+ }
164
+ .node-label,
165
+ .edge-label {
166
+ font-size: 0.875em;
167
+ color: ${theme.describeColor};
168
+ }
169
+ .edge-label {
170
+ background: ${theme.backgroundColor};
171
+ }
172
+ .edge {
173
+ stroke: currentColor;
174
+ stroke-width: 1;
175
+ fill: none;
176
+ }
177
+ svg {
178
+ position: relative;
179
+ }
180
+ `);
181
+ /**
182
+ * @customElement dy-flow-canvas
183
+ */
184
+ let DuoyunFlowCanvasElement = DuoyunFlowCanvasElement_1 = class DuoyunFlowCanvasElement extends DuoyunResizeBaseElement {
185
+ constructor() {
186
+ super({ throttle: false });
187
+ _DuoyunFlowCanvasElement_instances.add(this);
188
+ _DuoyunFlowCanvasElement_renderNode.set(this, (data, node) => {
189
+ return this.renderNode
190
+ ? this.renderNode(data, node)
191
+ : html `<div class="node" part=${DuoyunFlowCanvasElement_1.node}>${data}</div>`;
192
+ });
193
+ _DuoyunFlowCanvasElement_renderNodeLabel.set(this, (label, edge) => {
194
+ return this.renderNodeLabel
195
+ ? this.renderNodeLabel(label, edge)
196
+ : html `<div class="node-label" part=${DuoyunFlowCanvasElement_1.nodeLabel}>${label}</div>`;
197
+ });
198
+ _DuoyunFlowCanvasElement_renderEdge.set(this, (section, edge) => {
199
+ return this.renderEdge
200
+ ? this.renderEdge(section, edge)
201
+ : svg `
202
+ <path
203
+ class="edge"
204
+ part=${DuoyunFlowCanvasElement_1.edge}
205
+ d=${section.d || ''}
206
+ marker-start="url(#startmarker)"
207
+ marker-end="url(#endmarker)">
208
+ </path>
209
+ `;
210
+ });
211
+ _DuoyunFlowCanvasElement_renderEdgeLabel.set(this, (label, edge) => {
212
+ return this.renderEdgeLabel
213
+ ? this.renderEdgeLabel(label, edge)
214
+ : html `<div class="edge-label" part=${DuoyunFlowCanvasElement_1.edgeLabel}>${label}</div>`;
215
+ });
216
+ _DuoyunFlowCanvasElement_renderEndMarker.set(this, () => {
217
+ return this.renderEndMarker
218
+ ? this.renderEndMarker()
219
+ : svg `
220
+ <marker id="endmarker" viewBox="0 0 10 10"
221
+ refX="10" refY="5"
222
+ markerUnits="strokeWidth"
223
+ markerWidth="10" markerHeight="10"
224
+ orient="auto">
225
+ <path d="M 0 1 L 10 5 L 0 9 z" fill="currentColor"/>
226
+ </marker>
227
+ `;
228
+ });
229
+ _DuoyunFlowCanvasElement_renderStartMarker.set(this, () => {
230
+ return this.renderStartMarker ? this.renderStartMarker() : undefined;
231
+ });
232
+ _DuoyunFlowCanvasElement_genId.set(this, (str) => utf8ToB64(str || '.').replaceAll('=', ''));
233
+ _DuoyunFlowCanvasElement_genLabelId.set(this, (parentId, id) => __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genId, "f").call(this, `label-${parentId}-${id}`));
234
+ _DuoyunFlowCanvasElement_initShape.set(this, (id, node) => {
235
+ var _a;
236
+ const ele = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#' + id);
237
+ if (ele) {
238
+ const { width, height } = ele.getBoundingClientRect();
239
+ node.width = width;
240
+ node.height = height;
241
+ }
242
+ });
243
+ _DuoyunFlowCanvasElement_updateSize.set(this, () => {
244
+ const { children, edges } = this.graph || {};
245
+ children === null || children === void 0 ? void 0 : children.forEach((node) => {
246
+ var _a;
247
+ __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_initShape, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genId, "f").call(this, node.id), node);
248
+ (_a = node.labels) === null || _a === void 0 ? void 0 : _a.forEach((label, index) => {
249
+ __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_initShape, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genLabelId, "f").call(this, node.id, index), label);
250
+ });
251
+ });
252
+ edges === null || edges === void 0 ? void 0 : edges.forEach((edge) => {
253
+ __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_initShape, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genId, "f").call(this, edge.id), edge);
254
+ });
255
+ this.update();
256
+ });
257
+ _DuoyunFlowCanvasElement_calcPath.set(this, (node) => {
258
+ var _a, _b;
259
+ (_a = node === null || node === void 0 ? void 0 : node.edges) === null || _a === void 0 ? void 0 : _a.forEach((edge) => {
260
+ var _a;
261
+ (_a = edge.sections) === null || _a === void 0 ? void 0 : _a.forEach((section) => {
262
+ var _a;
263
+ const { startPoint, bendPoints, endPoint } = section;
264
+ const joinPoint = (point) => `${point.x + node.x},${point.y + node.y}`;
265
+ if (!bendPoints) {
266
+ section.d = `M${joinPoint(startPoint)}L${joinPoint(endPoint)}`;
267
+ return;
268
+ }
269
+ switch ((_a = node.layoutOptions) === null || _a === void 0 ? void 0 : _a['org.eclipse.elk.edgeRouting']) {
270
+ case 'ORTHOGONAL': {
271
+ const bend = bendPoints.map((point) => `L${joinPoint(point)}`).join('');
272
+ section.d = `M${joinPoint(startPoint)}${bend || ''}L${joinPoint(endPoint)}`;
273
+ break;
274
+ }
275
+ default: {
276
+ const points = [startPoint, ...bendPoints, endPoint]
277
+ .map((e) => ({ x: formatToPrecision(e.x, 1), y: formatToPrecision(e.y, 1) }))
278
+ .filter((e, i, arr) => {
279
+ if (i === arr.length - 1)
280
+ return true;
281
+ const nextPoint = arr[i + 1];
282
+ const isEqNextPoint = joinPoint(e) === joinPoint(nextPoint);
283
+ if (isEqNextPoint)
284
+ return false;
285
+ if (i === 0)
286
+ return true;
287
+ const prevPoint = arr[i - 1];
288
+ const nextDiffY = nextPoint.y - e.y;
289
+ const nextDiffX = nextPoint.x - e.x;
290
+ const prevDiffY = e.y - prevPoint.y;
291
+ const prevDiffX = e.x - prevPoint.x;
292
+ const isPointInLine = nextDiffY / nextDiffX === prevDiffY / prevDiffX;
293
+ const isSomeDirection = Math.sign(nextDiffY) === Math.sign(prevDiffY) && Math.sign(nextDiffX) === Math.sign(prevDiffX);
294
+ return !isSomeDirection || !isPointInLine;
295
+ });
296
+ if (points.length === 3) {
297
+ const controlPoint = joinPoint(points[1]);
298
+ section.d = `M${joinPoint(points[0])}C${controlPoint} ${controlPoint} ${joinPoint(points[2])}`;
299
+ }
300
+ else if (points.length > 3 && (points.length - 5) % 3 === 0) {
301
+ const start = points.shift();
302
+ const end = points.pop();
303
+ let c = '';
304
+ for (let i = 0; i < points.length; i += 3) {
305
+ const [f, center] = Math.abs(points[i].x - points[i + 2].x) > Math.abs(points[i + 1].x - points[i + 2].x)
306
+ ? [points[i], points[i + 1]]
307
+ : [points[i + 1], points[i]];
308
+ c += ` ${joinPoint(f)} ${joinPoint(center)}C${joinPoint(points[i + 2])} `;
309
+ }
310
+ section.d = `M${joinPoint(start)}C${joinPoint(start)}${c}${joinPoint(end)} ${joinPoint(end)}`;
311
+ }
312
+ else {
313
+ section.d = 'M' + points.map(joinPoint).join('L');
314
+ }
315
+ }
316
+ }
317
+ });
318
+ });
319
+ (_b = node === null || node === void 0 ? void 0 : node.children) === null || _b === void 0 ? void 0 : _b.forEach(__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_calcPath, "f"));
320
+ });
321
+ _DuoyunFlowCanvasElement_layout.set(this, async () => {
322
+ var _a;
323
+ try {
324
+ await ((_a = this.elk) === null || _a === void 0 ? void 0 : _a.layout(this.graph, { layoutOptions: { ...defaultLayout, ...(this.layout || {}) } }));
325
+ }
326
+ catch (err) {
327
+ //
328
+ }
329
+ __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_calcPath, "f").call(this, this.graph);
330
+ this.update();
331
+ });
332
+ _DuoyunFlowCanvasElement_renderWrap.set(this, (id, { width, height, x = 0, y = 0 }, children) => {
333
+ return html `
334
+ <div
335
+ id=${id}
336
+ style=${styleMap({
337
+ position: 'absolute',
338
+ width: width ? `${width}px` : 'auto',
339
+ height: height ? `${height}px` : 'auto',
340
+ left: `${x}px`,
341
+ top: `${y}px`,
342
+ })}
343
+ >
344
+ ${children}
345
+ </div>
346
+ `;
347
+ });
348
+ _DuoyunFlowCanvasElement_renderChildren.set(this, (node) => {
349
+ var _a, _b;
350
+ return html `
351
+ ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderWrap, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genId, "f").call(this, node.id), node, html `
352
+ <!-- children -->
353
+ ${(_a = node.children) === null || _a === void 0 ? void 0 : _a.map(__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderChildren, "f"))}
354
+ <!-- node -->
355
+ ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderNode, "f").call(this, node.data || node.id, node)}
356
+ <!-- label -->
357
+ ${(_b = node.labels) === null || _b === void 0 ? void 0 : _b.map((label, index) => __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderWrap, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genLabelId, "f").call(this, node.id, index), label, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderNodeLabel, "f").call(this, label.text, node)))}
358
+ `)}
359
+ `;
360
+ });
361
+ _DuoyunFlowCanvasElement_renderChildrenEdge.set(this, (node) => {
362
+ var _a, _b;
363
+ return html `
364
+ <!-- parent -->
365
+ ${(_a = node.edges) === null || _a === void 0 ? void 0 : _a.map((edge) => { var _a; return (_a = edge.sections) === null || _a === void 0 ? void 0 : _a.map((section) => __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderEdge, "f").call(this, section, edge)); })}
366
+ <!-- children -->
367
+ ${(_b = node.children) === null || _b === void 0 ? void 0 : _b.map((node) => __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderChildrenEdge, "f").call(this, node))}
368
+ `;
369
+ });
370
+ this.mounted = () => {
371
+ this.effect(async () => {
372
+ var _a, _b, _c;
373
+ if (__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_instances, "a", _DuoyunFlowCanvasElement_isReady_get))
374
+ return;
375
+ if (isNullish((_c = (_b = (_a = this.graph) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.width)) {
376
+ __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_updateSize, "f").call(this);
377
+ }
378
+ else if (this.elk) {
379
+ await __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_layout, "f").call(this);
380
+ }
381
+ });
382
+ };
383
+ this.render = () => {
384
+ if (!this.graph)
385
+ return html ``;
386
+ const { children, edges, width, height } = this.graph;
387
+ return html `
388
+ <style>
389
+ :host {
390
+ opacity: ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_instances, "a", _DuoyunFlowCanvasElement_isReady_get) ? 1 : 0};
391
+ width: ${width ? `${width}px` : '100%'};
392
+ height: ${height ? `${height}px` : '100%'};
393
+ }
394
+ </style>
395
+ <!-- node -->
396
+ ${children === null || children === void 0 ? void 0 : children.map(__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderChildren, "f"))}
397
+ <!-- edge -->
398
+ ${width && height
399
+ ? svg `
400
+ <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">
401
+ <defs>
402
+ ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderEndMarker, "f").call(this)}
403
+ ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderStartMarker, "f").call(this)}
404
+ </defs>
405
+ ${__classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderChildrenEdge, "f").call(this, this.graph)}
406
+ </svg>
407
+ `
408
+ : ''}
409
+ <!-- edge labels -->
410
+ ${edges === null || edges === void 0 ? void 0 : edges.map((edge) => {
411
+ var _a;
412
+ return html `${(_a = edge.labels) === null || _a === void 0 ? void 0 : _a.map((label, index) => __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderWrap, "f").call(this, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_genLabelId, "f").call(this, edge.id, index), label, __classPrivateFieldGet(this, _DuoyunFlowCanvasElement_renderEdgeLabel, "f").call(this, label.text, edge)))}`;
413
+ })}
414
+ `;
415
+ };
416
+ }
417
+ };
418
+ _DuoyunFlowCanvasElement_renderNode = new WeakMap(), _DuoyunFlowCanvasElement_renderNodeLabel = new WeakMap(), _DuoyunFlowCanvasElement_renderEdge = new WeakMap(), _DuoyunFlowCanvasElement_renderEdgeLabel = new WeakMap(), _DuoyunFlowCanvasElement_renderEndMarker = new WeakMap(), _DuoyunFlowCanvasElement_renderStartMarker = new WeakMap(), _DuoyunFlowCanvasElement_genId = new WeakMap(), _DuoyunFlowCanvasElement_genLabelId = new WeakMap(), _DuoyunFlowCanvasElement_initShape = new WeakMap(), _DuoyunFlowCanvasElement_updateSize = new WeakMap(), _DuoyunFlowCanvasElement_calcPath = new WeakMap(), _DuoyunFlowCanvasElement_layout = new WeakMap(), _DuoyunFlowCanvasElement_renderWrap = new WeakMap(), _DuoyunFlowCanvasElement_renderChildren = new WeakMap(), _DuoyunFlowCanvasElement_renderChildrenEdge = new WeakMap(), _DuoyunFlowCanvasElement_instances = new WeakSet(), _DuoyunFlowCanvasElement_isReady_get = function _DuoyunFlowCanvasElement_isReady_get() {
419
+ var _a, _b, _c;
420
+ const node = (_b = (_a = this.graph) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b[0];
421
+ if (!node)
422
+ return true;
423
+ return !!node.width && !!((_c = this.graph) === null || _c === void 0 ? void 0 : _c.width);
424
+ };
425
+ __decorate([
426
+ property
427
+ ], DuoyunFlowCanvasElement.prototype, "elk", void 0);
428
+ __decorate([
429
+ property
430
+ ], DuoyunFlowCanvasElement.prototype, "graph", void 0);
431
+ __decorate([
432
+ property
433
+ ], DuoyunFlowCanvasElement.prototype, "layout", void 0);
434
+ __decorate([
435
+ property
436
+ ], DuoyunFlowCanvasElement.prototype, "renderEdge", void 0);
437
+ __decorate([
438
+ property
439
+ ], DuoyunFlowCanvasElement.prototype, "renderEdgeLabel", void 0);
440
+ __decorate([
441
+ property
442
+ ], DuoyunFlowCanvasElement.prototype, "renderNode", void 0);
443
+ __decorate([
444
+ property
445
+ ], DuoyunFlowCanvasElement.prototype, "renderNodeLabel", void 0);
446
+ __decorate([
447
+ property
448
+ ], DuoyunFlowCanvasElement.prototype, "renderEndMarker", void 0);
449
+ __decorate([
450
+ property
451
+ ], DuoyunFlowCanvasElement.prototype, "renderStartMarker", void 0);
452
+ __decorate([
453
+ part
454
+ ], DuoyunFlowCanvasElement, "node", void 0);
455
+ __decorate([
456
+ part
457
+ ], DuoyunFlowCanvasElement, "nodeLabel", void 0);
458
+ __decorate([
459
+ part
460
+ ], DuoyunFlowCanvasElement, "edge", void 0);
461
+ __decorate([
462
+ part
463
+ ], DuoyunFlowCanvasElement, "edgeLabel", void 0);
464
+ DuoyunFlowCanvasElement = DuoyunFlowCanvasElement_1 = __decorate([
465
+ customElement('dy-flow-canvas'),
466
+ adoptedStyle(canvasStyle)
467
+ ], DuoyunFlowCanvasElement);
468
+ export { DuoyunFlowCanvasElement };
469
+ const style = createCSSSheet(css `
470
+ :host {
471
+ display: flex;
472
+ align-items: center;
473
+ justify-content: center;
474
+ }
475
+ `);
476
+ /**
477
+ * @customElement dy-flow
478
+ */
479
+ let DuoyunFlowElement = class DuoyunFlowElement extends GemElement {
480
+ constructor() {
481
+ super(...arguments);
482
+ this.state = {};
483
+ _DuoyunFlowElement_onCanvasResize.set(this, (evt) => {
484
+ const { width, height } = evt.detail.contentRect;
485
+ if (width && height) {
486
+ const rect = this.getBoundingClientRect();
487
+ const scale = Math.min(formatToPrecision(rect.width / width), 1);
488
+ this.setState({
489
+ scale,
490
+ marginBlock: ((scale - 1) / 2) * rect.height,
491
+ });
492
+ }
493
+ });
494
+ _DuoyunFlowElement_normalizeGraph.set(this, (graph) => {
495
+ var _a, _b;
496
+ if (!graph)
497
+ return;
498
+ const setLabels = (e) => {
499
+ if (e.label)
500
+ e.labels = [{ text: e.label }];
501
+ };
502
+ (_a = graph.children) === null || _a === void 0 ? void 0 : _a.forEach((e) => setLabels(e));
503
+ (_b = graph.edges) === null || _b === void 0 ? void 0 : _b.forEach((e) => {
504
+ setLabels(e);
505
+ if (isNotNullish(e.source))
506
+ e.sources = [e.source];
507
+ if (isNotNullish(e.target))
508
+ e.targets = [e.target];
509
+ if (!e.sources)
510
+ throw new Error('must have `source` or `sources`');
511
+ if (!e.targets)
512
+ throw new Error('must have `target` or `targets`');
513
+ });
514
+ });
515
+ this.willMount = () => {
516
+ this.memo(() => {
517
+ this.setState({ scale: undefined, marginBlock: undefined });
518
+ __classPrivateFieldGet(this, _DuoyunFlowElement_normalizeGraph, "f").call(this, this.graph);
519
+ }, () => [this.graph]);
520
+ };
521
+ this.mounted = () => {
522
+ const url = 'https://cdn.skypack.dev/elkjs@0.7.1';
523
+ import(/* @vite-ignore */ /* webpackIgnore: true */ `${url}?min`).then((module) => {
524
+ const elk = new module.default();
525
+ this.setState({ elk });
526
+ });
527
+ };
528
+ this.render = () => {
529
+ const { elk, scale, marginBlock } = this.state;
530
+ return html `
531
+ <dy-flow-canvas
532
+ exportparts=${exportPartsMap({
533
+ [DuoyunFlowCanvasElement.node]: DuoyunFlowCanvasElement.node,
534
+ [DuoyunFlowCanvasElement.nodeLabel]: DuoyunFlowCanvasElement.nodeLabel,
535
+ [DuoyunFlowCanvasElement.edge]: DuoyunFlowCanvasElement.edge,
536
+ [DuoyunFlowCanvasElement.edgeLabel]: DuoyunFlowCanvasElement.edgeLabel,
537
+ })}
538
+ @resize=${__classPrivateFieldGet(this, _DuoyunFlowElement_onCanvasResize, "f")}
539
+ style=${styleMap({
540
+ transform: scale && `scale(${scale})`,
541
+ marginBlock: scale && `${marginBlock}px`,
542
+ opacity: scale ? 1 : 0,
543
+ })}
544
+ .renderEdge=${this.renderEdge}
545
+ .renderEdgeLabel=${this.renderEdgeLabel}
546
+ .renderNode=${this.renderNode}
547
+ .renderNodeLabel=${this.renderNodeLabel}
548
+ .renderEndMarker=${this.renderEndMarker}
549
+ .elk=${elk}
550
+ .graph=${this.graph}
551
+ .layout=${this.layout}
552
+ ></dy-flow-canvas>
553
+ `;
554
+ };
555
+ }
556
+ };
557
+ _DuoyunFlowElement_onCanvasResize = new WeakMap(), _DuoyunFlowElement_normalizeGraph = new WeakMap();
558
+ __decorate([
559
+ property
560
+ ], DuoyunFlowElement.prototype, "graph", void 0);
561
+ __decorate([
562
+ property
563
+ ], DuoyunFlowElement.prototype, "layout", void 0);
564
+ __decorate([
565
+ property
566
+ ], DuoyunFlowElement.prototype, "renderEdge", void 0);
567
+ __decorate([
568
+ property
569
+ ], DuoyunFlowElement.prototype, "renderEdgeLabel", void 0);
570
+ __decorate([
571
+ property
572
+ ], DuoyunFlowElement.prototype, "renderNode", void 0);
573
+ __decorate([
574
+ property
575
+ ], DuoyunFlowElement.prototype, "renderNodeLabel", void 0);
576
+ __decorate([
577
+ property
578
+ ], DuoyunFlowElement.prototype, "renderEndMarker", void 0);
579
+ __decorate([
580
+ part
581
+ ], DuoyunFlowElement, "node", void 0);
582
+ __decorate([
583
+ part
584
+ ], DuoyunFlowElement, "nodeLabel", void 0);
585
+ __decorate([
586
+ part
587
+ ], DuoyunFlowElement, "edge", void 0);
588
+ __decorate([
589
+ part
590
+ ], DuoyunFlowElement, "edgeLabel", void 0);
591
+ DuoyunFlowElement = __decorate([
592
+ customElement('dy-flow'),
593
+ adoptedStyle(style)
594
+ ], DuoyunFlowElement);
595
+ export { DuoyunFlowElement };
596
+ //# sourceMappingURL=flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.js","sourceRoot":"","sources":["../src/elements/flow.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtF,OAAO,EAAU,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAc,CAAC,CAAC,GAAG,IAAI,CAAC;AAEzB,wEAAwE;AACxE,MAAM,aAAa,GAAkB;IACnC;;;;;;;;;;;;OAYG;IACH,eAAe,EAAE,yBAAyB;IAE1C;;;;OAIG;IACH,0BAA0B,EAAE,sBAAsB;IAClD;;;;OAIG;IACH,mCAAmC,EAAE,GAAG;IACxC;;;;OAIG;IACH,kDAAkD,EAAE,WAAW;IAE/D;;;;OAIG;IACH,eAAe,EAAE,MAAM;IAEvB;;;;OAIG;IACH,2CAA2C,EAAE,aAAa;IAE1D;;;;;;;OAOG;IACH,6BAA6B,EAAE,SAAS;IAExC;;;;;;;OAOG;IACH,mCAAmC,EAAE,MAAM;IAE3C;;;;;OAKG;IACH,2CAA2C,EAAE,IAAI;IAEjD;;;;;OAK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