tnx-shared 5.3.371 → 5.3.372
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/bundles/tnx-shared.umd.js +42 -1
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +2 -0
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/esm2015/components/crud/crud-form/crud-form.component.js +42 -1
- package/fesm2015/tnx-shared.js +41 -0
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
package/fesm2015/tnx-shared.js
CHANGED
|
@@ -14485,6 +14485,25 @@ class CrudFormComponent extends ComponentBase {
|
|
|
14485
14485
|
}
|
|
14486
14486
|
}));
|
|
14487
14487
|
}
|
|
14488
|
+
genDicComponent(root) {
|
|
14489
|
+
const result = {};
|
|
14490
|
+
const stack = []; // Khởi tạo stack
|
|
14491
|
+
stack.push(root); // Đẩy node gốc vào stack
|
|
14492
|
+
while (stack.length > 0) {
|
|
14493
|
+
// Lấy node hiện tại ra khỏi stack
|
|
14494
|
+
const currentNode = stack.pop();
|
|
14495
|
+
if (currentNode.component) {
|
|
14496
|
+
result[currentNode.modelPath] = currentNode.component;
|
|
14497
|
+
}
|
|
14498
|
+
// Đẩy các node con vào stack (theo chiều ngược lại để đảm bảo thứ tự duyệt)
|
|
14499
|
+
if (currentNode.childNodes) {
|
|
14500
|
+
for (let i = currentNode.childNodes.length - 1; i >= 0; i--) {
|
|
14501
|
+
stack.push(currentNode.childNodes[i]);
|
|
14502
|
+
}
|
|
14503
|
+
}
|
|
14504
|
+
}
|
|
14505
|
+
return result;
|
|
14506
|
+
}
|
|
14488
14507
|
addNewRow(control, tablePath, eventType, disableOpenDialog = false, initData = {}, fireEventFinish = true) {
|
|
14489
14508
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14490
14509
|
if (control.showEdit && !disableOpenDialog) {
|
|
@@ -14527,8 +14546,10 @@ class CrudFormComponent extends ComponentBase {
|
|
|
14527
14546
|
}
|
|
14528
14547
|
}
|
|
14529
14548
|
if (toAdd !== false) {
|
|
14549
|
+
const dicComponent = this.genDicComponent(this._rootNode);
|
|
14530
14550
|
tableNode.model.push(data);
|
|
14531
14551
|
tableNode.reinitChildNodes(fireEventFinish);
|
|
14552
|
+
this.setOldComponentWhenInitNode(tableNode, dicComponent);
|
|
14532
14553
|
if (eventType != this.eventType.INIT) {
|
|
14533
14554
|
this.fireModelChanged();
|
|
14534
14555
|
}
|
|
@@ -14572,6 +14593,26 @@ class CrudFormComponent extends ComponentBase {
|
|
|
14572
14593
|
}
|
|
14573
14594
|
});
|
|
14574
14595
|
}
|
|
14596
|
+
setOldComponentWhenInitNode(root, dicComponent) {
|
|
14597
|
+
const stack = []; // Khởi tạo stack
|
|
14598
|
+
stack.push(root); // Đẩy node gốc vào stack
|
|
14599
|
+
while (stack.length > 0) {
|
|
14600
|
+
// Lấy node hiện tại ra khỏi stack
|
|
14601
|
+
const currentNode = stack.pop();
|
|
14602
|
+
if (currentNode.modelPath) {
|
|
14603
|
+
const component = dicComponent[currentNode.modelPath];
|
|
14604
|
+
if (component) {
|
|
14605
|
+
currentNode.component = component;
|
|
14606
|
+
}
|
|
14607
|
+
}
|
|
14608
|
+
// Đẩy các node con vào stack (theo chiều ngược lại để đảm bảo thứ tự duyệt)
|
|
14609
|
+
if (currentNode.childNodes) {
|
|
14610
|
+
for (let i = currentNode.childNodes.length - 1; i >= 0; i--) {
|
|
14611
|
+
stack.push(currentNode.childNodes[i]);
|
|
14612
|
+
}
|
|
14613
|
+
}
|
|
14614
|
+
}
|
|
14615
|
+
}
|
|
14575
14616
|
addMultiRow(control, length, tablePath, eventType) {
|
|
14576
14617
|
for (let i = 0; i < length; i++) {
|
|
14577
14618
|
this.addNewRow(control, tablePath, eventType, true);
|