ngx-axis-appforge 0.0.94 → 1.0.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/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +138 -209
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dropdown.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-menu-design.mjs +5 -5
- package/fesm2022/ngx-axis-appforge-axis-components-menu-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tabs-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tabs-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-time-line-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-time-line-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs +3 -3
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +6 -15
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +3 -3
- package/types/ngx-axis-appforge-axis-components-design.d.ts +20 -37
- package/types/ngx-axis-appforge-core.d.ts +2 -16
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed,
|
|
2
|
+
import { effect, untracked, input, output, computed, inject, signal, ViewChild, ChangeDetectionStrategy, Component, model, ElementRef, ChangeDetectorRef, Injector, ViewContainerRef, HostListener } from '@angular/core';
|
|
3
3
|
import * as i1$3 from 'ng-zorro-antd/splitter';
|
|
4
4
|
import { NzSplitterModule } from 'ng-zorro-antd/splitter';
|
|
5
5
|
import * as i2$3 from 'ng-zorro-antd/tabs';
|
|
6
6
|
import { NzTabsModule } from 'ng-zorro-antd/tabs';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
8
8
|
import { FormsModule } from '@angular/forms';
|
|
9
|
-
import { NzHighlightPipe } from 'ng-zorro-antd/core/highlight';
|
|
10
9
|
import * as i3 from 'ng-zorro-antd/icon';
|
|
11
10
|
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
12
11
|
import * as i2 from 'ng-zorro-antd/input';
|
|
13
12
|
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
14
|
-
import
|
|
15
|
-
import { NzTreeFlattener, NzTreeViewFlatDataSource, NzTreeViewModule, NzTreeViewComponent } from 'ng-zorro-antd/tree-view';
|
|
16
|
-
import { BehaviorSubject, combineLatest, auditTime, tap, map, filter, take, debounceTime, Subject, switchMap, merge, Observable, NEVER, from, of } from 'rxjs';
|
|
13
|
+
import { of, BehaviorSubject, debounceTime, auditTime, map, Subject, filter, switchMap, merge, Observable, NEVER, take, from } from 'rxjs';
|
|
17
14
|
import * as i3$1 from 'ng-zorro-antd/flex';
|
|
18
15
|
import { NzFlexModule } from 'ng-zorro-antd/flex';
|
|
19
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
20
|
-
import { FilteredTreeResult, AXIS_FILE_BASE_URL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_COMPONENTS_LOADER_TOKEN, ScopeDirective, DynamicDirective, DesignBuilder, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, isEquals, ValueAccessOptions, copy, HowLongPipe, ValueAccess, AXIS_DESIGN_CAN_LOOP_TOKEN, AXIS_DESIGN_SCOPE_INFOS_REFRESH_TOKEN, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_COMPONENT_REF_FOR_SETTING_TOKEN, AXIS_DESIGN_COMPONENT_REF_GETTER_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, OptionsNode } from 'ngx-axis-appforge/core';
|
|
21
16
|
import * as i6 from 'ng-zorro-antd/button';
|
|
22
17
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
23
|
-
import * as
|
|
18
|
+
import * as i5 from 'ng-zorro-antd/tooltip';
|
|
24
19
|
import { NzTooltipModule } from 'ng-zorro-antd/tooltip';
|
|
25
|
-
import * as
|
|
20
|
+
import * as i9 from 'ng-zorro-antd/empty';
|
|
26
21
|
import { NzEmptyModule } from 'ng-zorro-antd/empty';
|
|
22
|
+
import * as i4 from 'ng-zorro-antd/tree';
|
|
23
|
+
import { NzTreeModule, NzTreeComponent } from 'ng-zorro-antd/tree';
|
|
24
|
+
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
27
25
|
import * as i7 from 'ng-zorro-antd/core/transition-patch';
|
|
28
26
|
import * as i8 from 'ng-zorro-antd/core/wave';
|
|
27
|
+
import { AXIS_FILE_BASE_URL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_COMPONENTS_LOADER_TOKEN, ScopeDirective, DynamicDirective, DesignBuilder, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, isEquals, ValueAccessOptions, copy, HowLongPipe, ValueAccess, AXIS_DESIGN_CAN_LOOP_TOKEN, AXIS_DESIGN_SCOPE_INFOS_REFRESH_TOKEN, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_COMPONENT_REF_FOR_SETTING_TOKEN, AXIS_DESIGN_COMPONENT_REF_GETTER_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, OptionsNode } from 'ngx-axis-appforge/core';
|
|
29
28
|
import { CommonModule } from '@angular/common';
|
|
30
29
|
import * as i1$1 from 'ng-zorro-antd/collapse';
|
|
31
30
|
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
@@ -34,8 +33,7 @@ import { NzCardModule } from 'ng-zorro-antd/card';
|
|
|
34
33
|
import * as i3$2 from 'ng-zorro-antd/grid';
|
|
35
34
|
import { NzGridModule } from 'ng-zorro-antd/grid';
|
|
36
35
|
import * as i7$1 from 'ng-zorro-antd/dropdown';
|
|
37
|
-
import {
|
|
38
|
-
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
36
|
+
import { NzDropdownModule } from 'ng-zorro-antd/dropdown';
|
|
39
37
|
import * as i12 from 'ng-zorro-antd/select';
|
|
40
38
|
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
41
39
|
import * as i6$1 from 'ng-zorro-antd/menu';
|
|
@@ -50,52 +48,54 @@ import { NzPopoverModule } from 'ng-zorro-antd/popover';
|
|
|
50
48
|
import { ClipboardService } from 'ngx-clipboard';
|
|
51
49
|
|
|
52
50
|
class DragDrop {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
onChange;
|
|
57
|
-
constructor(optionsNodes, optionIdflatNodes, treeControl, onChange) {
|
|
58
|
-
this.optionsNodes = optionsNodes;
|
|
59
|
-
this.optionIdflatNodes = optionIdflatNodes;
|
|
60
|
-
this.treeControl = treeControl;
|
|
61
|
-
this.onChange = onChange;
|
|
51
|
+
tree;
|
|
52
|
+
constructor(tree) {
|
|
53
|
+
this.tree = tree;
|
|
62
54
|
}
|
|
63
55
|
dragNode;
|
|
64
56
|
dropNode;
|
|
65
57
|
targetIndex;
|
|
66
58
|
element;
|
|
67
59
|
pos;
|
|
68
|
-
|
|
69
|
-
const node =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
beforeDrop = (confirm) => {
|
|
61
|
+
const node = confirm.node.origin['options'];
|
|
62
|
+
const dragNode = confirm.dragNode.origin['options'];
|
|
63
|
+
return of(dragNode.canDrag && node.canDrop && dragNode.dragType == node.dropType);
|
|
64
|
+
};
|
|
65
|
+
onDragStart(e) {
|
|
66
|
+
this.dragNode = e.dragNode.origin['options'];
|
|
67
|
+
if (this.dragNode?.children?.length) {
|
|
68
|
+
e.dragNode.setExpanded(false);
|
|
69
|
+
this.tree.expandedNodeids.update(ids => {
|
|
70
|
+
const index = ids.indexOf(this.dragNode.id);
|
|
71
|
+
if (index != -1) {
|
|
72
|
+
ids.splice(index, 1);
|
|
73
|
+
}
|
|
74
|
+
return ids;
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
e.target.style.display = 'none';
|
|
79
|
-
});
|
|
80
77
|
}
|
|
81
|
-
onDragOver(e
|
|
82
|
-
const node =
|
|
83
|
-
const parent = node.parentId ? this.optionsNodes.get(node.parentId) : undefined;
|
|
78
|
+
onDragOver(e) {
|
|
79
|
+
const node = e.node.origin['options'];
|
|
80
|
+
const parent = node.parentId ? this.tree.optionsNodes().get(node.parentId) : undefined;
|
|
84
81
|
let canDropIn = this.canDrop(node);
|
|
85
82
|
let canDropSide = !!parent && this.canDrop(parent);
|
|
86
83
|
if (!canDropIn && !canDropSide) {
|
|
87
|
-
e.preventDefault();
|
|
84
|
+
e.event?.preventDefault();
|
|
88
85
|
return;
|
|
89
86
|
}
|
|
90
|
-
const pos = this.getPos(e, canDropIn, canDropSide);
|
|
91
|
-
const element = e.currentTarget;
|
|
87
|
+
const pos = this.getPos(e.event, canDropIn, canDropSide);
|
|
88
|
+
const element = e.event?.currentTarget;
|
|
92
89
|
this.updateElementStyle(element, pos);
|
|
93
90
|
if (pos == 0) {
|
|
94
91
|
this.targetIndex = node?.defaultDropIndex;
|
|
95
92
|
this.dropNode = node;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
this.tree.expandedNodeids.update(ids => {
|
|
94
|
+
if (!ids.includes(node.id)) {
|
|
95
|
+
ids.push(node.id);
|
|
96
|
+
}
|
|
97
|
+
return ids;
|
|
98
|
+
});
|
|
99
99
|
}
|
|
100
100
|
else if (pos == -1) {
|
|
101
101
|
this.targetIndex = node.indexOfParentObj;
|
|
@@ -126,8 +126,7 @@ class DragDrop {
|
|
|
126
126
|
this.pos = pos;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
onDragEnd(e
|
|
130
|
-
e.target.style.display = 'flex';
|
|
129
|
+
onDragEnd(e) {
|
|
131
130
|
if (this.dropNode) {
|
|
132
131
|
if (this.dropNode.dropObj == this.dragNode.parentObj && this.dragNode.indexOfParentObj == this.targetIndex) {
|
|
133
132
|
this.updateElementStyle();
|
|
@@ -151,7 +150,7 @@ class DragDrop {
|
|
|
151
150
|
else {
|
|
152
151
|
this.dropNode.dropObj[this.targetIndex] = dragObj;
|
|
153
152
|
}
|
|
154
|
-
this.onChange({ historyDesc: `拖拽${this.dragNode?.name}` });
|
|
153
|
+
this.tree.onChange.emit({ historyDesc: `拖拽${this.dragNode?.name}` });
|
|
155
154
|
}
|
|
156
155
|
this.dragNode = undefined;
|
|
157
156
|
this.updateElementStyle();
|
|
@@ -180,194 +179,145 @@ class DragDrop {
|
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
class Tree {
|
|
183
|
-
|
|
182
|
+
constructor() {
|
|
183
|
+
effect(() => {
|
|
184
|
+
this.treeNode();
|
|
185
|
+
untracked(() => {
|
|
186
|
+
this.selectedNodeids.set(this.selectedNodeids().filter(nodeid => this.optionsNodes().has(nodeid)));
|
|
187
|
+
this.expandedNodeids.set(this.expandedNodeids().filter(nodeid => this.optionsNodes().has(nodeid)));
|
|
188
|
+
if (this.selectedNodeids().length == 0 && this.node()) {
|
|
189
|
+
this.selectOne(this.node().id, { sendEvent: true });
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}
|
|
184
194
|
node = input.required(...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
185
195
|
optionsNodes = input.required(...(ngDevMode ? [{ debugName: "optionsNodes" }] : /* istanbul ignore next */ []));
|
|
186
196
|
onChange = output();
|
|
187
197
|
onSelect = output();
|
|
188
198
|
onContextMenu = output();
|
|
189
|
-
dragdrop = computed(() => new DragDrop(this
|
|
190
|
-
optionIdflatNodes = new Map();
|
|
191
|
-
flatNodeMap = new Map();
|
|
192
|
-
nestedNodeMap = new Map();
|
|
193
|
-
expandedNodeIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedNodeIds" }] : /* istanbul ignore next */ []));
|
|
194
|
-
searchValue = signal('', ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
|
|
195
|
-
originData$ = new BehaviorSubject([]);
|
|
199
|
+
dragdrop = computed(() => new DragDrop(this), ...(ngDevMode ? [{ debugName: "dragdrop" }] : /* istanbul ignore next */ []));
|
|
196
200
|
searchValue$ = new BehaviorSubject('');
|
|
197
|
-
|
|
201
|
+
searchValue = toSignal(this.searchValue$.pipe(debounceTime(300)));
|
|
198
202
|
design = inject(Design);
|
|
199
203
|
subs = [];
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (existingNode?.id == currentNode.id && existingNode.expandable == currentNode.expandable && existingNode.level == currentNode.level) {
|
|
212
|
-
flatNode = Object.assign(existingNode, currentNode);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
flatNode = currentNode;
|
|
204
|
+
tree;
|
|
205
|
+
treeNode = computed(() => {
|
|
206
|
+
function mapTreeNode(node) {
|
|
207
|
+
return {
|
|
208
|
+
title: node.name ?? '',
|
|
209
|
+
key: node.id,
|
|
210
|
+
icon: node.icon,
|
|
211
|
+
isLeaf: (node.children?.length ?? 0) == 0,
|
|
212
|
+
children: node.children?.map(mapTreeNode),
|
|
213
|
+
options: node
|
|
214
|
+
};
|
|
216
215
|
}
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
dataSource = new NzTreeViewFlatDataSource(this.treeView, this.treeFlattener);
|
|
225
|
-
get treeControl() {
|
|
226
|
-
return this.treeView?.treeControl;
|
|
227
|
-
}
|
|
228
|
-
filteredData$ = combineLatest([
|
|
229
|
-
this.originData$,
|
|
230
|
-
this.searchValue$.pipe(auditTime(300), tap(value => this.searchValue.set(value)))
|
|
231
|
-
]).pipe(map(([data, value]) => (value ? filterTreeData(data, value) : new FilteredTreeResult(data, [...this.expandedNodeIds()].filter(id => this.optionsNodes().has(id))))));
|
|
232
|
-
constructor(cdRef) {
|
|
233
|
-
this.cdRef = cdRef;
|
|
234
|
-
effect(() => {
|
|
235
|
-
if (this.node()) {
|
|
236
|
-
this.originData$.next([this.node()]);
|
|
237
|
-
}
|
|
238
|
-
const oldlength = this.selectListSelection.selected.length;
|
|
239
|
-
this.selectListSelection.deselect(...this.selectListSelection.selected.filter(nodeid => !this.optionsNodes().has(nodeid)));
|
|
240
|
-
if (this.treeView) {
|
|
241
|
-
this.treeView.collapseAll();
|
|
242
|
-
}
|
|
243
|
-
if (oldlength != this.selectListSelection.selected.length) {
|
|
244
|
-
this.sendSelectEvent();
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
this.subs.push(this.filteredData$.subscribe(result => {
|
|
248
|
-
this.dataSource.setData(result.treeData);
|
|
249
|
-
const newExpandedIds = new Set();
|
|
250
|
-
if (this.treeView) {
|
|
251
|
-
for (const nodeId of result.needsToExpanded) {
|
|
252
|
-
const flatNode = this.optionIdflatNodes.get(nodeId);
|
|
253
|
-
if (flatNode) {
|
|
254
|
-
this.treeView.expand(flatNode);
|
|
255
|
-
newExpandedIds.add(nodeId);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
this.expandedNodeIds.set(newExpandedIds);
|
|
260
|
-
}));
|
|
261
|
-
this.subs.push(this.filteredData$.pipe(filter(r => r.treeData.length > 0), take(1)).subscribe(result => {
|
|
262
|
-
this.selectOne(result.treeData[0].id, { sendEvent: true });
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
hasChild = (_, node) => node.expandable;
|
|
266
|
-
getLevel = (node) => node.level;
|
|
267
|
-
getChildren = (node) => {
|
|
268
|
-
const children = node.children ?? [];
|
|
269
|
-
return children.map(childId => this.optionIdflatNodes.get(childId.id)).filter((n) => !!n);
|
|
270
|
-
};
|
|
216
|
+
return this.node() ? [mapTreeNode(this.node())] : [];
|
|
217
|
+
}, ...(ngDevMode ? [{ debugName: "treeNode" }] : /* istanbul ignore next */ []));
|
|
218
|
+
selectedNodeids = signal([], ...(ngDevMode ? [{ debugName: "selectedNodeids" }] : /* istanbul ignore next */ []));
|
|
219
|
+
expandedNodeids = signal([], ...(ngDevMode ? [{ debugName: "expandedNodeids" }] : /* istanbul ignore next */ []));
|
|
220
|
+
expandChange(e) {
|
|
221
|
+
this.expandedNodeids.set(e.keys ?? []);
|
|
222
|
+
}
|
|
271
223
|
get hasExpanded() {
|
|
272
|
-
|
|
273
|
-
return false;
|
|
274
|
-
for (const flatNode of this.optionIdflatNodes.values()) {
|
|
275
|
-
if (this.treeView.isExpanded(flatNode)) {
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return false;
|
|
224
|
+
return !!this.node() && this.expandedNodeids().includes(this.node().id);
|
|
280
225
|
}
|
|
281
|
-
onNodeClick(e
|
|
282
|
-
e.
|
|
283
|
-
|
|
284
|
-
this.toggleSelect(nodeId, { sendEvent: true });
|
|
226
|
+
onNodeClick(e) {
|
|
227
|
+
if (e.event?.ctrlKey || e.event?.metaKey) {
|
|
228
|
+
this.toggleSelect(e.node.key, { sendEvent: true });
|
|
285
229
|
}
|
|
286
230
|
else {
|
|
287
|
-
this.selectOne(
|
|
231
|
+
this.selectOne(e.node.key, { sendEvent: true });
|
|
288
232
|
}
|
|
289
233
|
}
|
|
290
234
|
select(nodeId, opt) {
|
|
291
|
-
this.
|
|
235
|
+
this.selectedNodeids.update(ids => {
|
|
236
|
+
if (!ids.includes(nodeId)) {
|
|
237
|
+
ids.push(nodeId);
|
|
238
|
+
}
|
|
239
|
+
return ids;
|
|
240
|
+
});
|
|
292
241
|
if (opt?.sendEvent) {
|
|
293
242
|
this.sendSelectEvent();
|
|
294
243
|
}
|
|
295
244
|
}
|
|
296
245
|
selectOne(nodeId, opt) {
|
|
297
246
|
this.unSelectAll();
|
|
298
|
-
this.
|
|
247
|
+
this.selectedNodeids.update(ids => {
|
|
248
|
+
if (!ids.includes(nodeId)) {
|
|
249
|
+
ids.push(nodeId);
|
|
250
|
+
}
|
|
251
|
+
return ids;
|
|
252
|
+
});
|
|
299
253
|
if (opt?.sendEvent) {
|
|
300
254
|
this.sendSelectEvent();
|
|
301
255
|
}
|
|
302
256
|
}
|
|
303
257
|
toggleSelect(nodeId, opt) {
|
|
304
|
-
this.
|
|
258
|
+
this.selectedNodeids.update(ids => {
|
|
259
|
+
const index = ids.indexOf(nodeId);
|
|
260
|
+
if (index >= 0) {
|
|
261
|
+
ids.splice(index, 1);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
ids.push(nodeId);
|
|
265
|
+
}
|
|
266
|
+
return ids;
|
|
267
|
+
});
|
|
305
268
|
if (opt?.sendEvent) {
|
|
306
269
|
this.sendSelectEvent();
|
|
307
270
|
}
|
|
308
271
|
}
|
|
309
272
|
unSelect(nodeId, opt) {
|
|
310
|
-
this.
|
|
273
|
+
this.selectedNodeids.update(ids => {
|
|
274
|
+
const index = ids.indexOf(nodeId);
|
|
275
|
+
if (index >= 0) {
|
|
276
|
+
ids.splice(index, 1);
|
|
277
|
+
}
|
|
278
|
+
return ids;
|
|
279
|
+
});
|
|
311
280
|
if (opt?.sendEvent) {
|
|
312
281
|
this.sendSelectEvent();
|
|
313
282
|
}
|
|
314
283
|
}
|
|
315
284
|
unSelectAll(opt) {
|
|
316
|
-
this.
|
|
285
|
+
this.selectedNodeids.set([]);
|
|
317
286
|
if (opt?.sendEvent) {
|
|
318
287
|
this.sendSelectEvent();
|
|
319
288
|
}
|
|
320
289
|
}
|
|
321
290
|
sendSelectEvent() {
|
|
322
|
-
this.onSelect.emit(this.
|
|
291
|
+
this.onSelect.emit(Array.from(this.selectedNodeids()));
|
|
323
292
|
}
|
|
324
293
|
selectByNodeIds(nodeIds) {
|
|
325
|
-
this.
|
|
326
|
-
for (const nodeId of nodeIds) {
|
|
327
|
-
this.select(nodeId);
|
|
328
|
-
const node = this.optionsNodes().get(nodeId);
|
|
329
|
-
if (node?.parentId && this.treeView) {
|
|
330
|
-
const flatNode = this.optionIdflatNodes.get(node.parentId);
|
|
331
|
-
if (flatNode) {
|
|
332
|
-
this.treeView.expand(flatNode);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
this.cdRef.markForCheck();
|
|
294
|
+
this.selectedNodeids.set(nodeIds.filter(nodeid => this.optionsNodes().has(nodeid)));
|
|
337
295
|
}
|
|
338
296
|
expandByNodeIds(nodeIds) {
|
|
339
|
-
|
|
340
|
-
return;
|
|
341
|
-
for (const nodeId of nodeIds) {
|
|
342
|
-
const node = this.optionIdflatNodes.get(nodeId);
|
|
343
|
-
if (node) {
|
|
344
|
-
this.treeView.expand(node);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
297
|
+
this.expandedNodeids.set(nodeIds.filter(nodeid => this.optionsNodes().has(nodeid)));
|
|
347
298
|
}
|
|
348
299
|
toggleExpanded() {
|
|
349
|
-
if (!this.treeView)
|
|
350
|
-
return;
|
|
351
300
|
if (this.hasExpanded) {
|
|
352
|
-
this.
|
|
301
|
+
this.expandedNodeids.set([]);
|
|
302
|
+
this.tree?.getExpandedNodeList().forEach(node => {
|
|
303
|
+
node.setExpanded(false);
|
|
304
|
+
});
|
|
353
305
|
}
|
|
354
306
|
else {
|
|
355
|
-
this.
|
|
307
|
+
this.expandedNodeids.set(Array.from(this.optionsNodes().keys()));
|
|
356
308
|
}
|
|
357
309
|
}
|
|
358
310
|
reset() {
|
|
359
|
-
this.optionIdflatNodes.clear();
|
|
360
|
-
this.flatNodeMap.clear();
|
|
361
311
|
}
|
|
362
|
-
contextMenu(e
|
|
363
|
-
this.onNodeClick(e
|
|
364
|
-
this.onContextMenu.emit({ event: e, nodeId });
|
|
312
|
+
contextMenu(e) {
|
|
313
|
+
this.onNodeClick(e);
|
|
314
|
+
this.onContextMenu.emit({ event: e.event, nodeId: e.node.key });
|
|
365
315
|
}
|
|
366
316
|
removeSelected() {
|
|
367
317
|
let changed = false;
|
|
368
318
|
let next = undefined;
|
|
369
319
|
let nextNodeId;
|
|
370
|
-
for (const nodeId of this.
|
|
320
|
+
for (const nodeId of this.selectedNodeids()) {
|
|
371
321
|
const node = this.optionsNodes().get(nodeId);
|
|
372
322
|
if (node?.canSetting) {
|
|
373
323
|
changed = true;
|
|
@@ -389,12 +339,12 @@ class Tree {
|
|
|
389
339
|
}
|
|
390
340
|
}
|
|
391
341
|
if (changed) {
|
|
392
|
-
this.onChange.emit({ value: next, nextNodeId: nextNodeId, historyDesc: `删除${this.
|
|
342
|
+
this.onChange.emit({ value: next, nextNodeId: nextNodeId, historyDesc: `删除${this.selectedNodeids().length}个组件` });
|
|
393
343
|
}
|
|
394
344
|
}
|
|
395
345
|
addNodeForSelected(nodes, deleteSuccess = false, historyDesc) {
|
|
396
|
-
if (nodes.length && this.
|
|
397
|
-
for (const nodeId of this.
|
|
346
|
+
if (nodes.length && this.selectedNodeids().length) {
|
|
347
|
+
for (const nodeId of this.selectedNodeids()) {
|
|
398
348
|
const parentNode = this.optionsNodes().get(nodeId);
|
|
399
349
|
if (parentNode && parentNode.canDrop) {
|
|
400
350
|
if (parentNode.dropType == "component") {
|
|
@@ -445,36 +395,16 @@ class Tree {
|
|
|
445
395
|
sub.unsubscribe();
|
|
446
396
|
}
|
|
447
397
|
}
|
|
448
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Tree, deps: [
|
|
449
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Tree, isStandalone: true, selector: "axis-design-tree", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, optionsNodes: { classPropertyName: "optionsNodes", publicName: "optionsNodes", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onChange: "onChange", onSelect: "onSelect", onContextMenu: "onContextMenu" }, viewQueries: [{ propertyName: "
|
|
398
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Tree, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
399
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Tree, isStandalone: true, selector: "axis-design-tree", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, optionsNodes: { classPropertyName: "optionsNodes", publicName: "optionsNodes", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onChange: "onChange", onSelect: "onSelect", onContextMenu: "onContextMenu" }, viewQueries: [{ propertyName: "tree", first: true, predicate: NzTreeComponent, descendants: true }], ngImport: i0, template: "<div nz-flex [nzVertical]=\"true\" style=\"height: 100%;\">\n <div nz-flex style=\"padding-right: 8px;\" nzGap=\"4px\" nzAlign=\"center\">\n <input style=\"flex:1;\" type=\"text\" nz-input placeholder=\"\u641C\u7D22\" nzVariant=\"borderless\" ngModel\n (ngModelChange)=\"searchValue$.next($event)\" />\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" (click)=\"toggleExpanded()\">\n <nz-icon [nzType]=\"hasExpanded?'shrink':'arrows-alt'\" nzTheme=\"outline\" />\n </button>\n </div>\n @if (node() === null) {\n <nz-empty [nzNotFoundContent]=\"contentTpl\" [nzNotFoundFooter]=\"footerTpl\">\n <ng-template #contentTpl>\n \u6CA1\u6709\u7EC4\u4EF6\n </ng-template>\n <ng-template #footerTpl>\n <button nz-button nzType=\"dashed\" (click)=\"addRootComponent()\">\n <nz-icon nzType=\"plus\"></nz-icon>\n \u6DFB\u52A0\u7EC4\u4EF6\n </button>\n </ng-template>\n </nz-empty>\n }@else {\n <nz-tree nzMultiple nzDraggable [nzSearchValue]=\"searchValue()??''\" [nzData]=\"treeNode()\"\n [(nzExpandedKeys)]=\"expandedNodeids\" (nzExpandChange)=\"expandChange($event)\"\n [(nzSelectedKeys)]=\"selectedNodeids\" nzBlockNode nzShowIcon (nzClick)=\"onNodeClick($event)\"\n (nzContextMenu)=\"contextMenu($event)\" [nzBeforeDrop]=\"dragdrop().beforeDrop\"\n (nzOnDragStart)=\"dragdrop().onDragStart($event)\" (nzOnDragOver)=\"dragdrop().onDragOver($event)\"\n (nzOnDragEnd)=\"dragdrop().onDragEnd($event)\" />\n <!-- <nz-tree-view nzDirectoryTree [nzTreeControl]=\"treeControl\" [nzDataSource]=\"dataSource\">\n <nz-tree-node *nzTreeNodeDef=\"let node\" nzTreeNodePadding [nzTreeNodePaddingIndent]=\"8\"\n (contextmenu)=\"contextMenu($event, node.id)\" [draggable]=\"dragdrop().canDrag(node.id)\"\n (dragstart)=\"dragdrop().onDragStart($event, node.id)\" (dragover)=\"dragdrop().onDragOver($event, node.id)\"\n (dragend)=\"dragdrop().onDragEnd($event,node.id)\">\n <nz-tree-node-toggle nzTreeNodeNoopToggle></nz-tree-node-toggle>\n <nz-tree-node-option [nzDisabled]=\"node.disabled\" [nzSelected]=\"selectListSelection.isSelected(node.id)\"\n (nzClick)=\"onNodeClick($event,node.id)\" [nz-tooltip]=\"node.id\" [nzTooltipMouseEnterDelay]=\"0.6\">\n <i nz-icon [nzType]=\"node.icon\" style=\"margin: 4px;\"></i>\n <span [innerHTML]=\"node.title | nzHighlight: searchValue() : 'i' : 'highlight'\"></span>\n </nz-tree-node-option>\n </nz-tree-node>\n <nz-tree-node *nzTreeNodeDef=\"let node; when: hasChild\" nzTreeNodePadding [nzTreeNodePaddingIndent]=\"8\"\n (contextmenu)=\"contextMenu($event, node.id)\" [draggable]=\"dragdrop().canDrag(node.id)\"\n (dragstart)=\"dragdrop().onDragStart($event, node.id)\" (dragover)=\"dragdrop().onDragOver($event, node.id)\"\n (dragend)=\"dragdrop().onDragEnd($event,node.id)\">\n <nz-tree-node-toggle>\n <nz-icon nzType=\"caret-down\" nzTreeNodeToggleRotateIcon />\n </nz-tree-node-toggle>\n <nz-tree-node-option [nzDisabled]=\"node.disabled\" [nzSelected]=\"selectListSelection.isSelected(node.id)\"\n (nzClick)=\"onNodeClick($event,node.id)\" [nz-tooltip]=\"node.id\" [nzTooltipMouseEnterDelay]=\"0.6\">\n <i nz-icon [nzType]=\"node.icon\" style=\"margin: 4px;\"></i>\n <span [innerHTML]=\"node.title | nzHighlight: searchValue() : 'i' : 'highlight'\"></span>\n </nz-tree-node-option>\n </nz-tree-node>\n </nz-tree-view> -->\n }\n</div>", styles: ["nz-tree{overflow:auto;flex:1}nz-tree ::ng-deep nz-tree-node{position:relative}nz-tree ::ng-deep .drop_in{outline:1px solid var(--ant-primary-color)}nz-tree ::ng-deep .drop_up:after{content:\"\";position:absolute;top:-1px;width:100%;height:2px;background-color:var(--ant-primary-color)}nz-tree ::ng-deep .drop_down:after{content:\"\";position:absolute;bottom:-1px;width:100%;height:2px;background-color:var(--ant-primary-color)}nz-tree ::ng-deep .ant-tree-list-holder{margin-bottom:300px}nz-tree ::ng-deep nz-tree-drop-indicator{display:none}nz-tree ::ng-deep .dragging{opacity:.4!important}nz-tree ::ng-deep .dragging:after{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i2.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled", "readonly"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTreeModule }, { kind: "component", type: i4.NzTreeComponent, selector: "nz-tree", inputs: ["nzShowIcon", "nzHideUnMatched", "nzBlockNode", "nzExpandAll", "nzSelectMode", "nzCheckStrictly", "nzShowExpand", "nzShowLine", "nzCheckable", "nzAsyncData", "nzDraggable", "nzMultiple", "nzExpandedIcon", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzTreeTemplate", "nzBeforeDrop", "nzData", "nzExpandedKeys", "nzSelectedKeys", "nzCheckedKeys", "nzSearchValue", "nzSearchFunc"], outputs: ["nzExpandedKeysChange", "nzSelectedKeysChange", "nzCheckedKeysChange", "nzSearchValueChange", "nzClick", "nzDblClick", "nzContextMenu", "nzCheckboxChange", "nzExpandChange", "nzOnDragStart", "nzOnDragEnter", "nzOnDragOver", "nzOnDragLeave", "nzOnDrop", "nzOnDragEnd"], exportAs: ["nzTree"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type: i9.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
450
400
|
}
|
|
451
401
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Tree, decorators: [{
|
|
452
402
|
type: Component,
|
|
453
|
-
args: [{ selector: 'axis-design-tree', imports: [FormsModule, NzInputModule, NzIconModule,
|
|
454
|
-
}], ctorParameters: () => [
|
|
403
|
+
args: [{ selector: 'axis-design-tree', imports: [FormsModule, NzInputModule, NzIconModule, NzTreeModule, NzFlexModule, NzButtonModule, NzTooltipModule, NzEmptyModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div nz-flex [nzVertical]=\"true\" style=\"height: 100%;\">\n <div nz-flex style=\"padding-right: 8px;\" nzGap=\"4px\" nzAlign=\"center\">\n <input style=\"flex:1;\" type=\"text\" nz-input placeholder=\"\u641C\u7D22\" nzVariant=\"borderless\" ngModel\n (ngModelChange)=\"searchValue$.next($event)\" />\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" (click)=\"toggleExpanded()\">\n <nz-icon [nzType]=\"hasExpanded?'shrink':'arrows-alt'\" nzTheme=\"outline\" />\n </button>\n </div>\n @if (node() === null) {\n <nz-empty [nzNotFoundContent]=\"contentTpl\" [nzNotFoundFooter]=\"footerTpl\">\n <ng-template #contentTpl>\n \u6CA1\u6709\u7EC4\u4EF6\n </ng-template>\n <ng-template #footerTpl>\n <button nz-button nzType=\"dashed\" (click)=\"addRootComponent()\">\n <nz-icon nzType=\"plus\"></nz-icon>\n \u6DFB\u52A0\u7EC4\u4EF6\n </button>\n </ng-template>\n </nz-empty>\n }@else {\n <nz-tree nzMultiple nzDraggable [nzSearchValue]=\"searchValue()??''\" [nzData]=\"treeNode()\"\n [(nzExpandedKeys)]=\"expandedNodeids\" (nzExpandChange)=\"expandChange($event)\"\n [(nzSelectedKeys)]=\"selectedNodeids\" nzBlockNode nzShowIcon (nzClick)=\"onNodeClick($event)\"\n (nzContextMenu)=\"contextMenu($event)\" [nzBeforeDrop]=\"dragdrop().beforeDrop\"\n (nzOnDragStart)=\"dragdrop().onDragStart($event)\" (nzOnDragOver)=\"dragdrop().onDragOver($event)\"\n (nzOnDragEnd)=\"dragdrop().onDragEnd($event)\" />\n <!-- <nz-tree-view nzDirectoryTree [nzTreeControl]=\"treeControl\" [nzDataSource]=\"dataSource\">\n <nz-tree-node *nzTreeNodeDef=\"let node\" nzTreeNodePadding [nzTreeNodePaddingIndent]=\"8\"\n (contextmenu)=\"contextMenu($event, node.id)\" [draggable]=\"dragdrop().canDrag(node.id)\"\n (dragstart)=\"dragdrop().onDragStart($event, node.id)\" (dragover)=\"dragdrop().onDragOver($event, node.id)\"\n (dragend)=\"dragdrop().onDragEnd($event,node.id)\">\n <nz-tree-node-toggle nzTreeNodeNoopToggle></nz-tree-node-toggle>\n <nz-tree-node-option [nzDisabled]=\"node.disabled\" [nzSelected]=\"selectListSelection.isSelected(node.id)\"\n (nzClick)=\"onNodeClick($event,node.id)\" [nz-tooltip]=\"node.id\" [nzTooltipMouseEnterDelay]=\"0.6\">\n <i nz-icon [nzType]=\"node.icon\" style=\"margin: 4px;\"></i>\n <span [innerHTML]=\"node.title | nzHighlight: searchValue() : 'i' : 'highlight'\"></span>\n </nz-tree-node-option>\n </nz-tree-node>\n <nz-tree-node *nzTreeNodeDef=\"let node; when: hasChild\" nzTreeNodePadding [nzTreeNodePaddingIndent]=\"8\"\n (contextmenu)=\"contextMenu($event, node.id)\" [draggable]=\"dragdrop().canDrag(node.id)\"\n (dragstart)=\"dragdrop().onDragStart($event, node.id)\" (dragover)=\"dragdrop().onDragOver($event, node.id)\"\n (dragend)=\"dragdrop().onDragEnd($event,node.id)\">\n <nz-tree-node-toggle>\n <nz-icon nzType=\"caret-down\" nzTreeNodeToggleRotateIcon />\n </nz-tree-node-toggle>\n <nz-tree-node-option [nzDisabled]=\"node.disabled\" [nzSelected]=\"selectListSelection.isSelected(node.id)\"\n (nzClick)=\"onNodeClick($event,node.id)\" [nz-tooltip]=\"node.id\" [nzTooltipMouseEnterDelay]=\"0.6\">\n <i nz-icon [nzType]=\"node.icon\" style=\"margin: 4px;\"></i>\n <span [innerHTML]=\"node.title | nzHighlight: searchValue() : 'i' : 'highlight'\"></span>\n </nz-tree-node-option>\n </nz-tree-node>\n </nz-tree-view> -->\n }\n</div>", styles: ["nz-tree{overflow:auto;flex:1}nz-tree ::ng-deep nz-tree-node{position:relative}nz-tree ::ng-deep .drop_in{outline:1px solid var(--ant-primary-color)}nz-tree ::ng-deep .drop_up:after{content:\"\";position:absolute;top:-1px;width:100%;height:2px;background-color:var(--ant-primary-color)}nz-tree ::ng-deep .drop_down:after{content:\"\";position:absolute;bottom:-1px;width:100%;height:2px;background-color:var(--ant-primary-color)}nz-tree ::ng-deep .ant-tree-list-holder{margin-bottom:300px}nz-tree ::ng-deep nz-tree-drop-indicator{display:none}nz-tree ::ng-deep .dragging{opacity:.4!important}nz-tree ::ng-deep .dragging:after{display:none!important}\n"] }]
|
|
404
|
+
}], ctorParameters: () => [], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], optionsNodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsNodes", required: true }] }], onChange: [{ type: i0.Output, args: ["onChange"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], onContextMenu: [{ type: i0.Output, args: ["onContextMenu"] }], tree: [{
|
|
455
405
|
type: ViewChild,
|
|
456
|
-
args: [
|
|
406
|
+
args: [NzTreeComponent]
|
|
457
407
|
}] } });
|
|
458
|
-
function filterTreeData(data, value) {
|
|
459
|
-
const needsToExpanded = new Set();
|
|
460
|
-
const _filter = (node, result) => {
|
|
461
|
-
if (node.name?.search(value) !== -1 || node.id?.search(value) !== -1) {
|
|
462
|
-
result.push(node);
|
|
463
|
-
return result;
|
|
464
|
-
}
|
|
465
|
-
if (Array.isArray(node.children)) {
|
|
466
|
-
const nodes = node.children.reduce((a, b) => _filter(b, a), []);
|
|
467
|
-
if (nodes.length) {
|
|
468
|
-
const parentNode = node.copyWith({ children: nodes });
|
|
469
|
-
needsToExpanded.add(parentNode.id);
|
|
470
|
-
result.push(parentNode);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
return result;
|
|
474
|
-
};
|
|
475
|
-
const treeData = data.reduce((a, b) => _filter(b, a), []);
|
|
476
|
-
return new FilteredTreeResult(treeData, [...needsToExpanded]);
|
|
477
|
-
}
|
|
478
408
|
|
|
479
409
|
class DropHandler {
|
|
480
410
|
dragNode;
|
|
@@ -1211,11 +1141,11 @@ class Cmplib {
|
|
|
1211
1141
|
}
|
|
1212
1142
|
}
|
|
1213
1143
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Cmplib, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1214
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Cmplib, isStandalone: true, selector: "axis-cmplib", inputs: { cmplib: { classPropertyName: "cmplib", publicName: "cmplib", isSignal: true, isRequired: false, transformFunction: null }, selectMode: { classPropertyName: "selectMode", publicName: "selectMode", isSignal: true, isRequired: true, transformFunction: null }, tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cmplib: "cmplibChange", clickExample: "clickExample", dragStart: "dragStart", dragEnd: "dragEnd" }, viewQueries: [{ propertyName: "dragElement", first: true, predicate: ["dragElement"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div nz-flex nzAlign=\"center\">\n <input style=\"flex:1\" type=\"text\" nz-input placeholder=\"\u641C\u7D22\"
|
|
1144
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Cmplib, isStandalone: true, selector: "axis-cmplib", inputs: { cmplib: { classPropertyName: "cmplib", publicName: "cmplib", isSignal: true, isRequired: false, transformFunction: null }, selectMode: { classPropertyName: "selectMode", publicName: "selectMode", isSignal: true, isRequired: true, transformFunction: null }, tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cmplib: "cmplibChange", clickExample: "clickExample", dragStart: "dragStart", dragEnd: "dragEnd" }, viewQueries: [{ propertyName: "dragElement", first: true, predicate: ["dragElement"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div nz-flex nzAlign=\"center\">\n <input style=\"flex:1\" type=\"text\" nz-input placeholder=\"\u641C\u7D22\" nzVariant=\"borderless\" ngModel\n (ngModelChange)=\"searchValue$.next($event)\" />\n <nz-select [(ngModel)]=\"cmplib\" nzSize=\"small\" nzVariant=\"borderless\" style=\"width: auto;\">\n @for (lib of cmplibs; track $index) {\n <nz-option [nzValue]=\"lib.lib\" [nzLabel]=\"lib.libName\"></nz-option>\n }\n </nz-select>\n</div>\n<nz-collapse nzAccordion>\n @for (group of displayCmpLib(); track group.groupName) {\n <nz-collapse-panel [nzHeader]=\"`${group.groupName}(${group.children.length})`\">\n <div nz-row [nzGutter]=\"[8,8]\">\n @for (item of group.children; track item.component) {\n <div nz-col [nzSpan]=\"item.span\">\n <nz-card nzSize=\"small\" nzHoverable [nzCover]=\"coverTemplate\" [nzTitle]=\"item.component\"\n [nzExtra]=\"item.moreExamples? more:''\" [nzBodyStyle]=\"{padding:0}\" (click)=\"onClick(item.example)\"\n [draggable]=\"selectMode()=='drag'\" (mouseenter)=\"preloadDragElement(item.example,item)\"\n (dragstart)=\"onDragStart($event)\" (dragend)=\"onDragEnd($event)\">\n </nz-card>\n <ng-template #coverTemplate>\n <img style=\"margin: 4px;object-fit: contain;\" [style.height.px]=\"item.height\"\n [src]=\"item.coverImg\" />\n </ng-template>\n <ng-template #more>\n <a nz-button nzType=\"link\" nzSize=\"small\" nz-dropdown [nzDropdownMenu]=\"examples\">\n <nz-icon nzType=\"ellipsis\"></nz-icon>\n </a>\n <nz-dropdown-menu #examples=\"nzDropdownMenu\">\n <ul nz-menu nzSelectable>\n @for (item of item.moreExamples; track item.name) {\n <li nz-menu-item (click)=\"onClick(item)\" [draggable]=\"selectMode()=='drag'\"\n (mouseenter)=\"preloadDragElement(item)\" (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\">{{item.name}}</li>\n }\n </ul>\n </nz-dropdown-menu>\n </ng-template>\n </div>\n }\n </div>\n </nz-collapse-panel>\n }\n</nz-collapse>\n<div class=\"dragElementContainer\">\n <div #dragElement>\n @if (dragOptions()) {\n <ng-container [axisDynamic]=\"dragOptions()\" [standalone]=\"true\"></ng-container>\n {{dragOptions().type}}\n }\n </div>\n</div>", styles: [".dragElementContainer{position:absolute;z-index:-9999;top:100px}\n"], dependencies: [{ kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i1$1.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon", "nzCollapsible"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i1$1.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition", "nzSize"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzCardModule }, { kind: "component", type: i2$1.NzCardComponent, selector: "nz-card", inputs: ["nzBordered", "nzLoading", "nzHoverable", "nzBodyStyle", "nzCover", "nzActions", "nzType", "nzSize", "nzTitle", "nzExtra"], exportAs: ["nzCard"] }, { kind: "ngmodule", type: NzGridModule }, { kind: "directive", type: i3$2.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i3$2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign", "forceRenderOnChange"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzDropdownModule }, { kind: "directive", type: i6$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i6$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7$1.NzDropdownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzArrow", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "directive", type: i7$1.NzDropdownADirective, selector: "a[nz-dropdown]" }, { kind: "component", type: i7$1.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i2.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled", "readonly"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i12.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i12.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzPrefix", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1215
1145
|
}
|
|
1216
1146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Cmplib, decorators: [{
|
|
1217
1147
|
type: Component,
|
|
1218
|
-
args: [{ selector: 'axis-cmplib', imports: [NzCollapseModule, NzCardModule, NzGridModule, DynamicDirective, NzButtonModule,
|
|
1148
|
+
args: [{ selector: 'axis-cmplib', imports: [NzCollapseModule, NzCardModule, NzGridModule, DynamicDirective, NzButtonModule, NzDropdownModule, NzInputModule, FormsModule, NzIconModule, NzFlexModule, NzSelectModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div nz-flex nzAlign=\"center\">\n <input style=\"flex:1\" type=\"text\" nz-input placeholder=\"\u641C\u7D22\" nzVariant=\"borderless\" ngModel\n (ngModelChange)=\"searchValue$.next($event)\" />\n <nz-select [(ngModel)]=\"cmplib\" nzSize=\"small\" nzVariant=\"borderless\" style=\"width: auto;\">\n @for (lib of cmplibs; track $index) {\n <nz-option [nzValue]=\"lib.lib\" [nzLabel]=\"lib.libName\"></nz-option>\n }\n </nz-select>\n</div>\n<nz-collapse nzAccordion>\n @for (group of displayCmpLib(); track group.groupName) {\n <nz-collapse-panel [nzHeader]=\"`${group.groupName}(${group.children.length})`\">\n <div nz-row [nzGutter]=\"[8,8]\">\n @for (item of group.children; track item.component) {\n <div nz-col [nzSpan]=\"item.span\">\n <nz-card nzSize=\"small\" nzHoverable [nzCover]=\"coverTemplate\" [nzTitle]=\"item.component\"\n [nzExtra]=\"item.moreExamples? more:''\" [nzBodyStyle]=\"{padding:0}\" (click)=\"onClick(item.example)\"\n [draggable]=\"selectMode()=='drag'\" (mouseenter)=\"preloadDragElement(item.example,item)\"\n (dragstart)=\"onDragStart($event)\" (dragend)=\"onDragEnd($event)\">\n </nz-card>\n <ng-template #coverTemplate>\n <img style=\"margin: 4px;object-fit: contain;\" [style.height.px]=\"item.height\"\n [src]=\"item.coverImg\" />\n </ng-template>\n <ng-template #more>\n <a nz-button nzType=\"link\" nzSize=\"small\" nz-dropdown [nzDropdownMenu]=\"examples\">\n <nz-icon nzType=\"ellipsis\"></nz-icon>\n </a>\n <nz-dropdown-menu #examples=\"nzDropdownMenu\">\n <ul nz-menu nzSelectable>\n @for (item of item.moreExamples; track item.name) {\n <li nz-menu-item (click)=\"onClick(item)\" [draggable]=\"selectMode()=='drag'\"\n (mouseenter)=\"preloadDragElement(item)\" (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\">{{item.name}}</li>\n }\n </ul>\n </nz-dropdown-menu>\n </ng-template>\n </div>\n }\n </div>\n </nz-collapse-panel>\n }\n</nz-collapse>\n<div class=\"dragElementContainer\">\n <div #dragElement>\n @if (dragOptions()) {\n <ng-container [axisDynamic]=\"dragOptions()\" [standalone]=\"true\"></ng-container>\n {{dragOptions().type}}\n }\n </div>\n</div>", styles: [".dragElementContainer{position:absolute;z-index:-9999;top:100px}\n"] }]
|
|
1219
1149
|
}], ctorParameters: () => [], propDecorators: { cmplib: [{ type: i0.Input, args: [{ isSignal: true, alias: "cmplib", required: false }] }, { type: i0.Output, args: ["cmplibChange"] }], selectMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectMode", required: true }] }], tags: [{ type: i0.Input, args: [{ isSignal: true, alias: "tags", required: false }] }], clickExample: [{ type: i0.Output, args: ["clickExample"] }], dragStart: [{ type: i0.Output, args: ["dragStart"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], dragElement: [{
|
|
1220
1150
|
type: ViewChild,
|
|
1221
1151
|
args: ["dragElement", { read: ElementRef, static: true }]
|
|
@@ -1309,15 +1239,14 @@ class ShortcutKey {
|
|
|
1309
1239
|
this.design.tools.shortcutKeysModal.set(true);
|
|
1310
1240
|
}
|
|
1311
1241
|
copy() {
|
|
1312
|
-
|
|
1313
|
-
let options = selected.map(nodeId => this.design.optionsNodes.get(nodeId)).map(node => node?.options);
|
|
1242
|
+
let options = Array.from(this.design.tree.selectedNodeids()).map(nodeId => this.design.optionsNodes.get(nodeId)).map(node => node?.options);
|
|
1314
1243
|
if (options.length == 1) {
|
|
1315
1244
|
options = options[0];
|
|
1316
1245
|
}
|
|
1317
1246
|
this.design.clipboard.copy(JSON.stringify(options, null, 2));
|
|
1318
1247
|
}
|
|
1319
1248
|
cut() {
|
|
1320
|
-
const
|
|
1249
|
+
const selected = Array.from(this.design.tree.selectedNodeids());
|
|
1321
1250
|
this.cutNodeIds = selected;
|
|
1322
1251
|
const options = selected.map(nodeId => this.design.optionsNodes.get(nodeId)).map(node => node?.options);
|
|
1323
1252
|
this.design.clipboard.copy(JSON.stringify(options, null, 2));
|
|
@@ -1334,7 +1263,7 @@ class ShortcutKey {
|
|
|
1334
1263
|
else {
|
|
1335
1264
|
objs = [j];
|
|
1336
1265
|
}
|
|
1337
|
-
if (objs?.length && this.design.tree.
|
|
1266
|
+
if (objs?.length && this.design.tree.selectedNodeids().length > 0) {
|
|
1338
1267
|
if (this.cutNodeIds?.length && isEquals(objs.map(r => r.id), this.cutNodeIds)) {
|
|
1339
1268
|
this.design.onNodesMove(this.cutNodeIds);
|
|
1340
1269
|
this.cutNodeIds = undefined;
|
|
@@ -1399,7 +1328,7 @@ class Toolbar {
|
|
|
1399
1328
|
}
|
|
1400
1329
|
}
|
|
1401
1330
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Toolbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1402
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Toolbar, isStandalone: true, selector: "axis-toolbar", inputs: { shortcutKeysModal: { classPropertyName: "shortcutKeysModal", publicName: "shortcutKeysModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shortcutKeysModal: "shortcutKeysModalChange" }, ngImport: i0, template: "<div class=\"tools\" nz-flex nzGap=\"4px\">\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u5FEB\u6377\u952E\u8BF4\u660E\"\n (click)=\"shortcutKeysModal.set(true)\">\n <nz-icon nzType=\"exclamation-circle\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u7F16\u8F91\u5386\u53F2\" nz-popover\n [nzPopoverTitle]=\"historyTitle\" nzPopoverTrigger=\"click\" [nzPopoverContent]=\"historyTemp\"\n nzPopoverPlacement=\"bottom\" nzPopoverOverlayClassName=\"history-popover\">\n <nz-icon nzType=\"history\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" [nz-tooltip]=\"onlyPreview()?'\u6062\u590D':'\u653E\u5927'\"\n (click)=\"onlyPreview.set(!onlyPreview())\">\n <nz-icon [nzType]=\"onlyPreview()?'fullscreen-exit':'fullscreen'\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u91CD\u65B0\u8F7D\u5165\"\n (click)=\"design.preview.forceRender()\">\n <nz-icon nzType=\"reload\" />\n </button>\n</div>\n\n<ng-template #historyTitle>\n <div nz-flex>\n <div style=\"flex:1\">\u7F16\u8F91\u5386\u53F2</div>\n <button nz-button nzSize=\"small\" nzType=\"link\" nzShape=\"circle\" nz-tooltip=\"\u64A4\u9500\" (click)=\"undo()\"\n [disabled]=\"historyIndex==history.length-1\">\n <nz-icon nzType=\"undo\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"link\" nzShape=\"circle\" nz-tooltip=\"\u91CD\u505A\" (click)=\"redo()\"\n [disabled]=\"historyIndex==0\">\n <nz-icon nzType=\"redo\" nzTheme=\"outline\" />\n </button>\n </div>\n</ng-template>\n\n<ng-template #historyTemp>\n <div nz-flex nzVertical nzGap=\"6px\" style=\"max-height: 300px;overflow: auto;\">\n @for (item of history; track item.time;let i=$index) {\n <div nz-flex nzAlign=\"center\" [class.active]=\"i == historyIndex\" class=\"history-item\" (click)=\"switchHistory(i)\">\n <div style=\"width: 20px;\">\n @if (i == historyIndex) {\n <nz-icon nzType=\"aim\" nzTheme=\"outline\" />\n }\n </div>\n <div nz-flex nzVertical>\n <span>{{item.desc}}</span>\n <span style=\"font-size: 10px;color:rgba(0,0,0,0.38)\"> {{item.time | axisHowLong}}</span>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n<nz-modal [(nzVisible)]=\"shortcutKeysModal\" nzTitle=\"\u5FEB\u6377\u952E\u8BF4\u660E\" nzDraggable [nzOkText]=\"null\" nzCancelText=\"\u5173\u95ED\"\n (nzOnCancel)=\"shortcutKeysModal.set(false)\">\n <ng-container *nzModalContent>\n <nz-table nzTemplateMode nzSize=\"small\">\n <thead>\n <tr>\n <th>\u529F\u80FD</th>\n <th>\u5FEB\u6377\u952E</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\u67E5\u770B\u5FEB\u6377\u952E\u8BF4\u660E</td>\n <td>Ctrl Meta H</td>\n </tr>\n <tr>\n <td>\u591A\u9009&\u53CD\u9009</td>\n <td>Ctrl \u5355\u51FB / Meta \u5355\u51FB</td>\n </tr>\n <tr>\n <td>\u590D\u5236</td>\n <td>Ctrl C</td>\n </tr>\n <tr>\n <td>\u526A\u5207</td>\n <td>Ctrl X</td>\n </tr>\n <tr>\n <td>\u7C98\u8D34</td>\n <td>Ctrl V</td>\n </tr>\n <tr>\n <td>\u64A4\u9500</td>\n <td>Ctrl Z</td>\n </tr>\n <tr>\n <td>\u91CD\u505A</td>\n <td>Ctrl Shift Z</td>\n </tr>\n <tr>\n <td>\u9884\u89C8\u653E\u5927&\u6062\u590D</td>\n <td>Ctrl Meta C</td>\n </tr>\n <tr>\n <td>\u91CD\u65B0\u8F7D\u5165</td>\n <td>Ctrl Meta R</td>\n </tr>\n </tbody>\n </nz-table>\n </ng-container>\n</nz-modal>", styles: [".tools{position:absolute;right:20px;top:10px}::ng-deep .history-popover .ant-popover-inner-content{width:100%;padding:12px 0}.history-item{padding:0 12px;cursor:pointer}.history-item:hover{background-color:var(--ant-primary-1)}.active{color:var(--ant-primary-color);pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i1$2.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "directive", type: i1$2.NzModalContentDirective, selector: "[nzModalContent]", exportAs: ["nzModalContent"] }, { kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i2$2.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "directive", type: i2$2.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i2$2.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i2$2.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i2$2.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i2$2.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type:
|
|
1331
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Toolbar, isStandalone: true, selector: "axis-toolbar", inputs: { shortcutKeysModal: { classPropertyName: "shortcutKeysModal", publicName: "shortcutKeysModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shortcutKeysModal: "shortcutKeysModalChange" }, ngImport: i0, template: "<div class=\"tools\" nz-flex nzGap=\"4px\">\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u5FEB\u6377\u952E\u8BF4\u660E\"\n (click)=\"shortcutKeysModal.set(true)\">\n <nz-icon nzType=\"exclamation-circle\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u7F16\u8F91\u5386\u53F2\" nz-popover\n [nzPopoverTitle]=\"historyTitle\" nzPopoverTrigger=\"click\" [nzPopoverContent]=\"historyTemp\"\n nzPopoverPlacement=\"bottom\" nzPopoverOverlayClassName=\"history-popover\">\n <nz-icon nzType=\"history\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" [nz-tooltip]=\"onlyPreview()?'\u6062\u590D':'\u653E\u5927'\"\n (click)=\"onlyPreview.set(!onlyPreview())\">\n <nz-icon [nzType]=\"onlyPreview()?'fullscreen-exit':'fullscreen'\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\" nz-tooltip=\"\u91CD\u65B0\u8F7D\u5165\"\n (click)=\"design.preview.forceRender()\">\n <nz-icon nzType=\"reload\" />\n </button>\n</div>\n\n<ng-template #historyTitle>\n <div nz-flex>\n <div style=\"flex:1\">\u7F16\u8F91\u5386\u53F2</div>\n <button nz-button nzSize=\"small\" nzType=\"link\" nzShape=\"circle\" nz-tooltip=\"\u64A4\u9500\" (click)=\"undo()\"\n [disabled]=\"historyIndex==history.length-1\">\n <nz-icon nzType=\"undo\" nzTheme=\"outline\" />\n </button>\n <button nz-button nzSize=\"small\" nzType=\"link\" nzShape=\"circle\" nz-tooltip=\"\u91CD\u505A\" (click)=\"redo()\"\n [disabled]=\"historyIndex==0\">\n <nz-icon nzType=\"redo\" nzTheme=\"outline\" />\n </button>\n </div>\n</ng-template>\n\n<ng-template #historyTemp>\n <div nz-flex nzVertical nzGap=\"6px\" style=\"max-height: 300px;overflow: auto;\">\n @for (item of history; track item.time;let i=$index) {\n <div nz-flex nzAlign=\"center\" [class.active]=\"i == historyIndex\" class=\"history-item\" (click)=\"switchHistory(i)\">\n <div style=\"width: 20px;\">\n @if (i == historyIndex) {\n <nz-icon nzType=\"aim\" nzTheme=\"outline\" />\n }\n </div>\n <div nz-flex nzVertical>\n <span>{{item.desc}}</span>\n <span style=\"font-size: 10px;color:rgba(0,0,0,0.38)\"> {{item.time | axisHowLong}}</span>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n<nz-modal [(nzVisible)]=\"shortcutKeysModal\" nzTitle=\"\u5FEB\u6377\u952E\u8BF4\u660E\" nzDraggable [nzOkText]=\"null\" nzCancelText=\"\u5173\u95ED\"\n (nzOnCancel)=\"shortcutKeysModal.set(false)\">\n <ng-container *nzModalContent>\n <nz-table nzTemplateMode nzSize=\"small\">\n <thead>\n <tr>\n <th>\u529F\u80FD</th>\n <th>\u5FEB\u6377\u952E</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\u67E5\u770B\u5FEB\u6377\u952E\u8BF4\u660E</td>\n <td>Ctrl Meta H</td>\n </tr>\n <tr>\n <td>\u591A\u9009&\u53CD\u9009</td>\n <td>Ctrl \u5355\u51FB / Meta \u5355\u51FB</td>\n </tr>\n <tr>\n <td>\u590D\u5236</td>\n <td>Ctrl C</td>\n </tr>\n <tr>\n <td>\u526A\u5207</td>\n <td>Ctrl X</td>\n </tr>\n <tr>\n <td>\u7C98\u8D34</td>\n <td>Ctrl V</td>\n </tr>\n <tr>\n <td>\u64A4\u9500</td>\n <td>Ctrl Z</td>\n </tr>\n <tr>\n <td>\u91CD\u505A</td>\n <td>Ctrl Shift Z</td>\n </tr>\n <tr>\n <td>\u9884\u89C8\u653E\u5927&\u6062\u590D</td>\n <td>Ctrl Meta C</td>\n </tr>\n <tr>\n <td>\u91CD\u65B0\u8F7D\u5165</td>\n <td>Ctrl Meta R</td>\n </tr>\n </tbody>\n </nz-table>\n </ng-container>\n</nz-modal>", styles: [".tools{position:absolute;right:20px;top:10px}::ng-deep .history-popover .ant-popover-inner-content{width:100%;padding:12px 0}.history-item{padding:0 12px;cursor:pointer}.history-item:hover{background-color:var(--ant-primary-1)}.active{color:var(--ant-primary-color);pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i1$2.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "directive", type: i1$2.NzModalContentDirective, selector: "[nzModalContent]", exportAs: ["nzModalContent"] }, { kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i2$2.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "directive", type: i2$2.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i2$2.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i2$2.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i2$2.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i2$2.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i5.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzPopoverModule }, { kind: "directive", type: i8$1.NzPopoverDirective, selector: "[nz-popover]", inputs: ["nzPopoverArrowPointAtCenter", "nzPopoverTitle", "nzPopoverTitleContext", "nzPopoverContent", "nzPopoverContentContext", "nz-popover", "nzPopoverTrigger", "nzPopoverPlacement", "nzPopoverOrigin", "nzPopoverVisible", "nzPopoverMouseEnterDelay", "nzPopoverMouseLeaveDelay", "nzPopoverOverlayClassName", "nzPopoverOverlayStyle", "nzPopoverOverlayClickable", "nzPopoverBackdrop"], outputs: ["nzPopoverVisibleChange"], exportAs: ["nzPopover"] }, { kind: "pipe", type: HowLongPipe, name: "axisHowLong" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1403
1332
|
}
|
|
1404
1333
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Toolbar, decorators: [{
|
|
1405
1334
|
type: Component,
|
|
@@ -1762,7 +1691,7 @@ class Design extends ValueAccess {
|
|
|
1762
1691
|
onContextMenu(e, nodeId) {
|
|
1763
1692
|
const node = this.optionsNodes.get(nodeId);
|
|
1764
1693
|
if (node?.contextMenu) {
|
|
1765
|
-
this.tree.
|
|
1694
|
+
this.tree.selectOne(nodeId, { sendEvent: false });
|
|
1766
1695
|
const parent = node.isRoot ? undefined : this.optionsNodes.get(node.parentId);
|
|
1767
1696
|
const injector = Injector.create({
|
|
1768
1697
|
providers: [
|
|
@@ -1885,7 +1814,7 @@ class Design extends ValueAccess {
|
|
|
1885
1814
|
return obj && obj.hasOwnProperty("id") && obj.hasOwnProperty("component");
|
|
1886
1815
|
}
|
|
1887
1816
|
onNodesMove(nodeIds) {
|
|
1888
|
-
if (this.tree.
|
|
1817
|
+
if (this.tree.selectedNodeids().length == 1) {
|
|
1889
1818
|
this.tree.addNodeForSelected(nodeIds.map(id => this.optionsNodes.get(id)), true, `粘贴${nodeIds.length}个组件`);
|
|
1890
1819
|
}
|
|
1891
1820
|
}
|
|
@@ -1966,7 +1895,7 @@ class Design extends ValueAccess {
|
|
|
1966
1895
|
}
|
|
1967
1896
|
}
|
|
1968
1897
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Design, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1969
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Design, isStandalone: true, selector: "axis-design", inputs: { chooseComponentVisible: { classPropertyName: "chooseComponentVisible", publicName: "chooseComponentVisible", isSignal: true, isRequired: false, transformFunction: null }, settingOptionsStr: { classPropertyName: "settingOptionsStr", publicName: "settingOptionsStr", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { chooseComponentVisible: "chooseComponentVisibleChange", settingOptionsStr: "settingOptionsStrChange" }, host: { attributes: { "tabindex": "-1", "autofocus": "true" }, listeners: { "keydown": "onKeyPress($event)" } }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "setting", first: true, predicate: ["setting"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true, static: true }, { propertyName: "tree", first: true, predicate: ["tree"], descendants: true, static: true }, { propertyName: "codeEditor", first: true, predicate: ["codeEditor"], descendants: true }, { propertyName: "tools", first: true, predicate: ["tools"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<nz-splitter (nzResize)=\"layoutEditor($event)\">\n <nz-splitter-panel [nzCollapsible]=\"!tools.onlyPreview()\" [nzDefaultSize]=\"cacheSized[0]\" nzMin=\"15%\" nzMax=\"40%\"\n [nzSize]=\"tools.onlyPreview()?0:undefined\">\n <nz-tabs nzCentered>\n <nz-tab nzTitle=\"\u7EC4\u4EF6\u6811\">\n <axis-design-tree style=\"margin-bottom: 300px;\" #tree [node]=\"treeNode()\" [optionsNodes]=\"optionsNodes\"\n (onSelect)=\"onTreeSelect($event)\" (onChange)=\"onChangeOptionsConfig($event)\"\n (onContextMenu)=\"onContextMenu($event.event,$event.nodeId)\"></axis-design-tree>\n </nz-tab>\n <nz-tab nzTitle=\"\u7EC4\u4EF6\u5E93\">\n <axis-cmplib selectMode=\"drag\" (dragStart)=\"onCmplibDragStart($event.example,$event.element)\"\n (dragEnd)=\"onCmplibDragEnd()\"></axis-cmplib>\n </nz-tab>\n </nz-tabs>\n </nz-splitter-panel>\n <nz-splitter-panel>\n <div nz-flex nzVertical style=\"height: 100%;width: 100%;position: relative;\">\n <h2 style=\"text-align: center;margin-top: 4px;\">\u9884\u89C8</h2>\n <axis-toolbar #tools></axis-toolbar>\n <axis-design-preview #preview style=\"flex:1;overflow: auto;\" [loadAndOptions]=\"loadAndOptions()\"\n [optionsNodes]=\"optionsNodes\" [injectData]=\"injectDataObs\" [injectFunc]=\"injectFunc()\"\n [httpContextData]=\"options.httpContextData()\" [fileBaseUrl]=\"options.fileBaseUrl()\"\n (onChange)=\"onChangeOptionsConfig($event)\" (onSelect)=\"onPreviewSelect($event)\"\n (onContextMenu)=\"onContextMenu($event.event,$event.nodeId)\"\n (onForceRender)=\"triggeEvents('forceRender').subscribe()\"></axis-design-preview>\n </div>\n </nz-splitter-panel>\n <nz-splitter-panel [nzCollapsible]=\"!tools.onlyPreview()\" [nzDefaultSize]=\"cacheSized[1]\" nzMin=\"15%\" nzMax=\"40%\"\n [nzSize]=\"tools.onlyPreview()?0:undefined\" style=\"position: relative;\">\n <nz-tabs nzCentered style=\"height: 100%;\">\n <nz-tab nzTitle=\"\u5C5E\u6027\u8BBE\u7F6E\" (nzClick)=\"syncToSetting()\">\n <ng-container #setting></ng-container>\n <div style=\"height: 300px;\"></div>\n @if (!settingOptionsStr()){\n <nz-empty style=\"height: 300px;\" nzNotFoundContent=\"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u7EC4\u4EF6\"></nz-empty>\n }\n </nz-tab>\n <nz-tab nzTitle=\"\u4EE3\u7801\" nzForceRender (nzSelect)=\"syncToCode();\">\n <ng-container #codeEditor=\"axisDynamic\"\n [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:!settingOptionsStr() && treeNode()!=null,otherOptions:{tabSize:2}}\"\n [standalone]=\"true\" [(ngModel)]=\"settingOptionsStr\"\n (ngModelChange)=\"onEditorChange($event)\"></ng-container>\n </nz-tab>\n </nz-tabs>\n </nz-splitter-panel>\n</nz-splitter>\n<ng-container #menu></ng-container>\n<nz-drawer [(nzVisible)]=\"chooseComponentVisible\" nzTitle=\"\u9009\u62E9\u7EC4\u4EF6\" [nzBodyStyle]=\"{padding:0}\"\n (nzOnClose)=\"chooseComponentVisible.set(false);chooseComponentSubject.next(undefined)\">\n <ng-container *nzDrawerContent>\n <axis-cmplib selectMode=\"click\" [tags]=\"chooseComponentTags()\"\n (clickExample)=\"chooseComponentVisible.set(false);chooseComponentSubject.next($event)\"></axis-cmplib>\n </ng-container>\n</nz-drawer>", styles: ["nz-tabs,::ng-deep .ant-tabs-content,::ng-deep .ant-tabs-tabpane{height:100%}::ng-deep .ant-tabs-content{overflow:auto}:host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: NzSplitterModule }, { kind: "component", type: i1$3.NzSplitterComponent, selector: "nz-splitter", inputs: ["nzLayout", "nzLazy"], outputs: ["nzResizeStart", "nzResize", "nzResizeEnd"], exportAs: ["nzSplitter"] }, { kind: "component", type: i1$3.NzSplitterPanelComponent, selector: "nz-splitter-panel", inputs: ["nzDefaultSize", "nzMin", "nzMax", "nzSize", "nzCollapsible", "nzResizable"], exportAs: ["nzSplitterPanel"] }, { kind: "ngmodule", type: NzTabsModule }, { kind: "component", type: i2$3.NzTabsComponent, selector: "nz-tabs", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact", "nzDestroyInactiveTabPane", "nzIndicator"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabs"] }, { kind: "component", type: i2$3.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "component", type: Preview, selector: "axis-design-preview", inputs: ["loadAndOptions", "optionsNodes", "injectData", "httpContextData", "fileBaseUrl", "injectFunc"], outputs: ["onChange", "onSelect", "onContextMenu", "onForceRender"] }, { kind: "component", type: Tree, selector: "axis-design-tree", inputs: ["node", "optionsNodes"], outputs: ["onChange", "onSelect", "onContextMenu"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "component", type: Cmplib, selector: "axis-cmplib", inputs: ["cmplib", "selectMode", "tags"], outputs: ["cmplibChange", "clickExample", "dragStart", "dragEnd"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type:
|
|
1898
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Design, isStandalone: true, selector: "axis-design", inputs: { chooseComponentVisible: { classPropertyName: "chooseComponentVisible", publicName: "chooseComponentVisible", isSignal: true, isRequired: false, transformFunction: null }, settingOptionsStr: { classPropertyName: "settingOptionsStr", publicName: "settingOptionsStr", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { chooseComponentVisible: "chooseComponentVisibleChange", settingOptionsStr: "settingOptionsStrChange" }, host: { attributes: { "tabindex": "-1", "autofocus": "true" }, listeners: { "keydown": "onKeyPress($event)" } }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "setting", first: true, predicate: ["setting"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true, static: true }, { propertyName: "tree", first: true, predicate: ["tree"], descendants: true, static: true }, { propertyName: "codeEditor", first: true, predicate: ["codeEditor"], descendants: true }, { propertyName: "tools", first: true, predicate: ["tools"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<nz-splitter (nzResize)=\"layoutEditor($event)\">\n <nz-splitter-panel [nzCollapsible]=\"!tools.onlyPreview()\" [nzDefaultSize]=\"cacheSized[0]\" nzMin=\"15%\" nzMax=\"40%\"\n [nzSize]=\"tools.onlyPreview()?0:undefined\">\n <nz-tabs nzCentered>\n <nz-tab nzTitle=\"\u7EC4\u4EF6\u6811\">\n <axis-design-tree style=\"margin-bottom: 300px;\" #tree [node]=\"treeNode()\" [optionsNodes]=\"optionsNodes\"\n (onSelect)=\"onTreeSelect($event)\" (onChange)=\"onChangeOptionsConfig($event)\"\n (onContextMenu)=\"onContextMenu($event.event,$event.nodeId)\"></axis-design-tree>\n </nz-tab>\n <nz-tab nzTitle=\"\u7EC4\u4EF6\u5E93\">\n <axis-cmplib selectMode=\"drag\" (dragStart)=\"onCmplibDragStart($event.example,$event.element)\"\n (dragEnd)=\"onCmplibDragEnd()\"></axis-cmplib>\n </nz-tab>\n </nz-tabs>\n </nz-splitter-panel>\n <nz-splitter-panel>\n <div nz-flex nzVertical style=\"height: 100%;width: 100%;position: relative;\">\n <h2 style=\"text-align: center;margin-top: 4px;\">\u9884\u89C8</h2>\n <axis-toolbar #tools></axis-toolbar>\n <axis-design-preview #preview style=\"flex:1;overflow: auto;\" [loadAndOptions]=\"loadAndOptions()\"\n [optionsNodes]=\"optionsNodes\" [injectData]=\"injectDataObs\" [injectFunc]=\"injectFunc()\"\n [httpContextData]=\"options.httpContextData()\" [fileBaseUrl]=\"options.fileBaseUrl()\"\n (onChange)=\"onChangeOptionsConfig($event)\" (onSelect)=\"onPreviewSelect($event)\"\n (onContextMenu)=\"onContextMenu($event.event,$event.nodeId)\"\n (onForceRender)=\"triggeEvents('forceRender').subscribe()\"></axis-design-preview>\n </div>\n </nz-splitter-panel>\n <nz-splitter-panel [nzCollapsible]=\"!tools.onlyPreview()\" [nzDefaultSize]=\"cacheSized[1]\" nzMin=\"15%\" nzMax=\"40%\"\n [nzSize]=\"tools.onlyPreview()?0:undefined\" style=\"position: relative;\">\n <nz-tabs nzCentered style=\"height: 100%;\">\n <nz-tab nzTitle=\"\u5C5E\u6027\u8BBE\u7F6E\" (nzClick)=\"syncToSetting()\">\n <ng-container #setting></ng-container>\n <div style=\"height: 300px;\"></div>\n @if (!settingOptionsStr()){\n <nz-empty style=\"height: 300px;\" nzNotFoundContent=\"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u7EC4\u4EF6\"></nz-empty>\n }\n </nz-tab>\n <nz-tab nzTitle=\"\u4EE3\u7801\" nzForceRender (nzSelect)=\"syncToCode();\">\n <ng-container #codeEditor=\"axisDynamic\"\n [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:!settingOptionsStr() && treeNode()!=null,otherOptions:{tabSize:2}}\"\n [standalone]=\"true\" [(ngModel)]=\"settingOptionsStr\"\n (ngModelChange)=\"onEditorChange($event)\"></ng-container>\n </nz-tab>\n </nz-tabs>\n </nz-splitter-panel>\n</nz-splitter>\n<ng-container #menu></ng-container>\n<nz-drawer [(nzVisible)]=\"chooseComponentVisible\" nzTitle=\"\u9009\u62E9\u7EC4\u4EF6\" [nzBodyStyle]=\"{padding:0}\"\n (nzOnClose)=\"chooseComponentVisible.set(false);chooseComponentSubject.next(undefined)\">\n <ng-container *nzDrawerContent>\n <axis-cmplib selectMode=\"click\" [tags]=\"chooseComponentTags()\"\n (clickExample)=\"chooseComponentVisible.set(false);chooseComponentSubject.next($event)\"></axis-cmplib>\n </ng-container>\n</nz-drawer>", styles: ["nz-tabs,::ng-deep .ant-tabs-content,::ng-deep .ant-tabs-tabpane{height:100%}::ng-deep .ant-tabs-content{overflow:auto}:host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: NzSplitterModule }, { kind: "component", type: i1$3.NzSplitterComponent, selector: "nz-splitter", inputs: ["nzLayout", "nzLazy"], outputs: ["nzResizeStart", "nzResize", "nzResizeEnd"], exportAs: ["nzSplitter"] }, { kind: "component", type: i1$3.NzSplitterPanelComponent, selector: "nz-splitter-panel", inputs: ["nzDefaultSize", "nzMin", "nzMax", "nzSize", "nzCollapsible", "nzResizable"], exportAs: ["nzSplitterPanel"] }, { kind: "ngmodule", type: NzTabsModule }, { kind: "component", type: i2$3.NzTabsComponent, selector: "nz-tabs", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact", "nzDestroyInactiveTabPane", "nzIndicator"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabs"] }, { kind: "component", type: i2$3.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "component", type: Preview, selector: "axis-design-preview", inputs: ["loadAndOptions", "optionsNodes", "injectData", "httpContextData", "fileBaseUrl", "injectFunc"], outputs: ["onChange", "onSelect", "onContextMenu", "onForceRender"] }, { kind: "component", type: Tree, selector: "axis-design-tree", inputs: ["node", "optionsNodes"], outputs: ["onChange", "onSelect", "onContextMenu"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "component", type: Cmplib, selector: "axis-cmplib", inputs: ["cmplib", "selectMode", "tags"], outputs: ["cmplibChange", "clickExample", "dragStart", "dragEnd"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type: i9.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign", "forceRenderOnChange"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzDrawerModule }, { kind: "component", type: i6$2.NzDrawerComponent, selector: "nz-drawer", inputs: ["nzContent", "nzCloseIcon", "nzClosable", "nzMaskClosable", "nzMask", "nzCloseOnNavigation", "nzNoAnimation", "nzKeyboard", "nzTitle", "nzExtra", "nzFooter", "nzPlacement", "nzSize", "nzMaskStyle", "nzBodyStyle", "nzWrapClassName", "nzWidth", "nzHeight", "nzZIndex", "nzOffsetX", "nzOffsetY", "nzVisible"], outputs: ["nzOnViewInit", "nzOnClose", "nzVisibleChange"], exportAs: ["nzDrawer"] }, { kind: "directive", type: i6$2.NzDrawerContentDirective, selector: "[nzDrawerContent]", exportAs: ["nzDrawerContent"] }, { kind: "component", type: Toolbar, selector: "axis-toolbar", inputs: ["shortcutKeysModal"], outputs: ["shortcutKeysModalChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1970
1899
|
}
|
|
1971
1900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Design, decorators: [{
|
|
1972
1901
|
type: Component,
|