ngx-axis-appforge 0.0.45 → 0.0.47
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/axis-components/design/index.d.ts +1 -1
- package/axis-components/edit-table/index.d.ts +2 -1
- package/axis-components/tree-selector/index.d.ts +3 -0
- package/core/index.d.ts +3 -0
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +27 -16
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs +16 -3
- package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs +1 -3
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-select.mjs +2 -1
- package/fesm2022/ngx-axis-appforge-axis-components-select.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs +3 -0
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs +20 -7
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +102 -4
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +15 -2
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +100 -100
|
@@ -249,7 +249,7 @@ declare class Design extends ValueAccess<DesignOptions> implements OnDestroy {
|
|
|
249
249
|
onTreeSelect(nodeIds: string[]): void;
|
|
250
250
|
onPreviewSelect(nodeIds: string[]): void;
|
|
251
251
|
private updateScopeWithNodeId;
|
|
252
|
-
loadSetting(nodeId: string): void;
|
|
252
|
+
loadSetting(nodeId: string, force?: boolean): void;
|
|
253
253
|
private buildScopeInfosGetter;
|
|
254
254
|
private buildScopeInfoSubject;
|
|
255
255
|
private buildComponentInfoForSetting;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnInit, OnDestroy, WritableSignal } from '@angular/core';
|
|
3
|
-
import { ValueAccessOptions, ValueAccess } from 'ngx-axis-appforge/core';
|
|
3
|
+
import { ValueAccessOptions, ValueAccess, RegisteValueAccessOptions } from 'ngx-axis-appforge/core';
|
|
4
4
|
import { BaseTableOptions, SelectableTableOptions, BaseTableFieldOptions, TableService, SelectService } from 'ngx-axis-appforge/axis-components/table-helper';
|
|
5
5
|
import { UntypedFormGroup, FormArray, AbstractControl } from '@angular/forms';
|
|
6
6
|
import { Subscription } from 'rxjs';
|
|
@@ -74,6 +74,7 @@ declare class EditTable extends ValueAccess<EditTableOptions> implements OnInit,
|
|
|
74
74
|
private buildScoll;
|
|
75
75
|
writeValue(value: any): void;
|
|
76
76
|
setInitValue(value: any): void;
|
|
77
|
+
childRegisteValueAccess(opt: RegisteValueAccessOptions, index: number, field: EditTableFieldOptions): void;
|
|
77
78
|
valueToFormValue(): void;
|
|
78
79
|
formValueToValue(): void;
|
|
79
80
|
buildRow(): EditTableRowData;
|
|
@@ -2,6 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { ValueAccessOptions, TriggeEventsOptions, ValueAccess } from 'ngx-axis-appforge/core';
|
|
3
3
|
import { NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
|
4
4
|
import { NzTreeNodeKey, NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/core/tree';
|
|
5
|
+
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
|
5
6
|
import { NzCascaderOption } from 'ng-zorro-antd/cascader';
|
|
6
7
|
|
|
7
8
|
declare class TreeSelectorOptions extends ValueAccessOptions {
|
|
@@ -56,12 +57,14 @@ declare class TreeSelector extends ValueAccess<TreeSelectorOptions> {
|
|
|
56
57
|
readonly selectedKeys: _angular_core.WritableSignal<NzTreeNodeKey[]>;
|
|
57
58
|
readonly selectValue: _angular_core.ModelSignal<any>;
|
|
58
59
|
readonly treeNodeMap: _angular_core.Signal<Map<NzTreeNodeKey, NzTreeNodeOptions>>;
|
|
60
|
+
readonly inputTree?: NzTreeSelectComponent;
|
|
59
61
|
readonly changeOn: (option: NzCascaderOption, level: number) => boolean;
|
|
60
62
|
setInitValue(value: any): void;
|
|
61
63
|
writeValue(value: any): void;
|
|
62
64
|
private buildTreeData;
|
|
63
65
|
private valueToComponentValue;
|
|
64
66
|
nodeClick(e: NzFormatEmitEvent): void;
|
|
67
|
+
internalTreeNode(node: NzTreeNode, e: Event): void;
|
|
65
68
|
private treeNodeToValue;
|
|
66
69
|
private fullArrayToValue;
|
|
67
70
|
hasExpanded(node: NzTreeNode): boolean;
|
package/core/index.d.ts
CHANGED
|
@@ -192,6 +192,7 @@ interface FunFieldOptions {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
declare abstract class FunFieldBase {
|
|
195
|
+
private init;
|
|
195
196
|
private orivalue;
|
|
196
197
|
protected readonly fb: FormBuilder;
|
|
197
198
|
abstract fg: UntypedFormGroup;
|
|
@@ -201,6 +202,8 @@ declare abstract class FunFieldBase {
|
|
|
201
202
|
valid(): boolean;
|
|
202
203
|
buildFunField(obj: any, funFields?: FunFieldOptions): any;
|
|
203
204
|
recoverFunField(obj: any, funFields?: FunFieldOptions, oriObj?: any): any;
|
|
205
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FunFieldBase, never>;
|
|
206
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FunFieldBase, never, never, {}, {}, never, never, true, never>;
|
|
204
207
|
}
|
|
205
208
|
|
|
206
209
|
declare abstract class FunFieldValueBase extends FunFieldBase implements OnInit, OnDestroy, ControlValueAccessor {
|
|
@@ -1252,7 +1252,10 @@ class ShortcutKey {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
copy() {
|
|
1254
1254
|
const { selected } = this.design.tree.selectListSelection;
|
|
1255
|
-
|
|
1255
|
+
let options = selected.map(nodeId => this.design.optionsNodes.get(nodeId)).map(node => node?.options);
|
|
1256
|
+
if (options.length == 1) {
|
|
1257
|
+
options = options[0];
|
|
1258
|
+
}
|
|
1256
1259
|
this.design.clipboard.copy(JSON.stringify(options, null, 2));
|
|
1257
1260
|
}
|
|
1258
1261
|
cut() {
|
|
@@ -1562,25 +1565,29 @@ class Design extends ValueAccess {
|
|
|
1562
1565
|
scopeId = this.scopeInfos.get(scopeId)?.parentScopeId;
|
|
1563
1566
|
}
|
|
1564
1567
|
}
|
|
1565
|
-
loadSetting(nodeId) {
|
|
1568
|
+
loadSetting(nodeId, force = false) {
|
|
1566
1569
|
if (nodeId && this.optionsNodes.has(nodeId)) {
|
|
1567
|
-
if (
|
|
1568
|
-
|
|
1569
|
-
}
|
|
1570
|
-
else if (this.settingOptionsNodeId) {
|
|
1571
|
-
const oldNode = this.optionsNodes.get(this.settingOptionsNodeId);
|
|
1572
|
-
const newNode = this.optionsNodes.get(nodeId);
|
|
1573
|
-
if (newNode.canSetting && oldNode && oldNode.parentId == newNode.parentId && oldNode.settingType == newNode.settingType) {
|
|
1574
|
-
this.settingOptionsNodeId = nodeId;
|
|
1575
|
-
this.settingOptionsStr.set(JSON.stringify(newNode.options, null, " "));
|
|
1576
|
-
Object.keys(oldNode.options).filter(k => !k.startsWith("$")).forEach(k => newNode.options[k] ??= undefined);
|
|
1577
|
-
this.settingRef?.instance.writeValue(newNode.options);
|
|
1570
|
+
if (!force) {
|
|
1571
|
+
if (this.settingOptionsNodeId == nodeId) {
|
|
1578
1572
|
return;
|
|
1579
1573
|
}
|
|
1574
|
+
else if (this.settingOptionsNodeId) {
|
|
1575
|
+
const oldNode = this.optionsNodes.get(this.settingOptionsNodeId);
|
|
1576
|
+
const newNode = this.optionsNodes.get(nodeId);
|
|
1577
|
+
if (newNode.canSetting && oldNode && oldNode.parentId == newNode.parentId && oldNode.settingType == newNode.settingType) {
|
|
1578
|
+
this.settingOptionsNodeId = nodeId;
|
|
1579
|
+
this.settingOptionsStr.set(JSON.stringify(newNode.options, null, " "));
|
|
1580
|
+
this.settingRef?.instance.writeValue(newNode.options);
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1580
1584
|
}
|
|
1581
1585
|
this.resetSetting();
|
|
1582
|
-
this.settingOptionsNodeId = nodeId;
|
|
1583
1586
|
const optionsNode = this.optionsNodes.get(nodeId);
|
|
1587
|
+
if (!optionsNode.canSetting) {
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
this.settingOptionsNodeId = nodeId;
|
|
1584
1591
|
this.settingOptionsStr.set(JSON.stringify(optionsNode.options, null, " "));
|
|
1585
1592
|
if (optionsNode.settingType) {
|
|
1586
1593
|
const injector = Injector.create({
|
|
@@ -1804,8 +1811,12 @@ class Design extends ValueAccess {
|
|
|
1804
1811
|
if (this.settingOptionsNodeId) {
|
|
1805
1812
|
const optionsNode = this.optionsNodes.get(this.settingOptionsNodeId);
|
|
1806
1813
|
if (optionsNode) {
|
|
1807
|
-
|
|
1808
|
-
|
|
1814
|
+
if (optionsNode.canSetting && this.settingRef?.componentType == optionsNode.settingType) {
|
|
1815
|
+
this.settingRef?.instance?.writeValue(optionsNode.options);
|
|
1816
|
+
}
|
|
1817
|
+
else {
|
|
1818
|
+
this.loadSetting(optionsNode.id, true);
|
|
1819
|
+
}
|
|
1809
1820
|
}
|
|
1810
1821
|
}
|
|
1811
1822
|
}
|