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
|
@@ -17363,12 +17363,31 @@
|
|
|
17363
17363
|
});
|
|
17364
17364
|
}); });
|
|
17365
17365
|
};
|
|
17366
|
+
CrudFormComponent.prototype.genDicComponent = function (root) {
|
|
17367
|
+
var result = {};
|
|
17368
|
+
var stack = []; // Khởi tạo stack
|
|
17369
|
+
stack.push(root); // Đẩy node gốc vào stack
|
|
17370
|
+
while (stack.length > 0) {
|
|
17371
|
+
// Lấy node hiện tại ra khỏi stack
|
|
17372
|
+
var currentNode = stack.pop();
|
|
17373
|
+
if (currentNode.component) {
|
|
17374
|
+
result[currentNode.modelPath] = currentNode.component;
|
|
17375
|
+
}
|
|
17376
|
+
// Đẩy các node con vào stack (theo chiều ngược lại để đảm bảo thứ tự duyệt)
|
|
17377
|
+
if (currentNode.childNodes) {
|
|
17378
|
+
for (var i = currentNode.childNodes.length - 1; i >= 0; i--) {
|
|
17379
|
+
stack.push(currentNode.childNodes[i]);
|
|
17380
|
+
}
|
|
17381
|
+
}
|
|
17382
|
+
}
|
|
17383
|
+
return result;
|
|
17384
|
+
};
|
|
17366
17385
|
CrudFormComponent.prototype.addNewRow = function (control, tablePath, eventType, disableOpenDialog, initData, fireEventFinish) {
|
|
17367
17386
|
if (disableOpenDialog === void 0) { disableOpenDialog = false; }
|
|
17368
17387
|
if (initData === void 0) { initData = {}; }
|
|
17369
17388
|
if (fireEventFinish === void 0) { fireEventFinish = true; }
|
|
17370
17389
|
return __awaiter(this, void 0, void 0, function () {
|
|
17371
|
-
var tableNode, index, parentPath, data, _e, _f, subControl, toAdd, newRowNode, _b_3, _c_3, _d_1;
|
|
17390
|
+
var tableNode, index, parentPath, data, _e, _f, subControl, toAdd, dicComponent, newRowNode, _b_3, _c_3, _d_1;
|
|
17372
17391
|
var e_34, _g;
|
|
17373
17392
|
return __generator(this, function (_h) {
|
|
17374
17393
|
switch (_h.label) {
|
|
@@ -17423,8 +17442,10 @@
|
|
|
17423
17442
|
}
|
|
17424
17443
|
}
|
|
17425
17444
|
if (!(toAdd !== false)) return [3 /*break*/, 12];
|
|
17445
|
+
dicComponent = this.genDicComponent(this._rootNode);
|
|
17426
17446
|
tableNode.model.push(data);
|
|
17427
17447
|
tableNode.reinitChildNodes(fireEventFinish);
|
|
17448
|
+
this.setOldComponentWhenInitNode(tableNode, dicComponent);
|
|
17428
17449
|
if (eventType != this.eventType.INIT) {
|
|
17429
17450
|
this.fireModelChanged();
|
|
17430
17451
|
}
|
|
@@ -17484,6 +17505,26 @@
|
|
|
17484
17505
|
});
|
|
17485
17506
|
});
|
|
17486
17507
|
};
|
|
17508
|
+
CrudFormComponent.prototype.setOldComponentWhenInitNode = function (root, dicComponent) {
|
|
17509
|
+
var stack = []; // Khởi tạo stack
|
|
17510
|
+
stack.push(root); // Đẩy node gốc vào stack
|
|
17511
|
+
while (stack.length > 0) {
|
|
17512
|
+
// Lấy node hiện tại ra khỏi stack
|
|
17513
|
+
var currentNode = stack.pop();
|
|
17514
|
+
if (currentNode.modelPath) {
|
|
17515
|
+
var component = dicComponent[currentNode.modelPath];
|
|
17516
|
+
if (component) {
|
|
17517
|
+
currentNode.component = component;
|
|
17518
|
+
}
|
|
17519
|
+
}
|
|
17520
|
+
// Đẩy các node con vào stack (theo chiều ngược lại để đảm bảo thứ tự duyệt)
|
|
17521
|
+
if (currentNode.childNodes) {
|
|
17522
|
+
for (var i = currentNode.childNodes.length - 1; i >= 0; i--) {
|
|
17523
|
+
stack.push(currentNode.childNodes[i]);
|
|
17524
|
+
}
|
|
17525
|
+
}
|
|
17526
|
+
}
|
|
17527
|
+
};
|
|
17487
17528
|
CrudFormComponent.prototype.addMultiRow = function (control, length, tablePath, eventType) {
|
|
17488
17529
|
for (var i = 0; i < length; i++) {
|
|
17489
17530
|
this.addNewRow(control, tablePath, eventType, true);
|