tuain-ng-forms-lib 12.0.19 → 12.0.23
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/README.md +3 -3
- package/bundles/tuain-ng-forms-lib.umd.js +39 -38
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/components/elements/field.component.js +2 -2
- package/esm2015/lib/components/elements/layout/element.component.js +9 -8
- package/esm2015/lib/components/elements/tables/table.component.js +31 -31
- package/fesm2015/tuain-ng-forms-lib.js +39 -38
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/components/elements/layout/element.component.d.ts +3 -2
- package/lib/components/elements/tables/table.component.d.ts +1 -1
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ This component allows to receive the following information
|
|
|
123
123
|
|
|
124
124
|
| Input Name | Description |
|
|
125
125
|
| --- | ----------- |
|
|
126
|
-
|
|
|
126
|
+
| element | |
|
|
127
127
|
| formManager | |
|
|
128
128
|
|
|
129
129
|
#### FormErrorComponent
|
|
@@ -199,7 +199,7 @@ This component allows to receive the following information
|
|
|
199
199
|
|
|
200
200
|
| Input Name | Description |
|
|
201
201
|
| --- | ----------- |
|
|
202
|
-
|
|
|
202
|
+
| table | |
|
|
203
203
|
| visiblePages | |
|
|
204
204
|
| pagesGroup | |
|
|
205
205
|
|
|
@@ -237,7 +237,7 @@ This component allows to receive the following information
|
|
|
237
237
|
|
|
238
238
|
| Input Name | Description |
|
|
239
239
|
| --- | ----------- |
|
|
240
|
-
|
|
|
240
|
+
| table | |
|
|
241
241
|
| tableRecords | |
|
|
242
242
|
| currentMode | |
|
|
243
243
|
| waiting | |
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
};
|
|
427
427
|
FieldComponent.prototype.inputChanged = function () {
|
|
428
428
|
this.field._fieldValue = this.value;
|
|
429
|
-
this.
|
|
429
|
+
this.onChangeContent();
|
|
430
430
|
};
|
|
431
431
|
FieldComponent.prototype.inputTyped = function () {
|
|
432
432
|
this.field._fieldValue = this.value;
|
|
@@ -485,22 +485,22 @@
|
|
|
485
485
|
}
|
|
486
486
|
ElementComponent.prototype.ngOnInit = function () {
|
|
487
487
|
var _a;
|
|
488
|
-
this.formConfig = (_a = this.
|
|
488
|
+
this.formConfig = (_a = this.element) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
489
489
|
this.start();
|
|
490
490
|
};
|
|
491
491
|
ElementComponent.prototype.start = function () { };
|
|
492
492
|
Object.defineProperty(ElementComponent.prototype, "visible", {
|
|
493
493
|
get: function () {
|
|
494
|
-
var _a
|
|
495
|
-
return (_a = this.
|
|
494
|
+
var _a;
|
|
495
|
+
return (_a = this.element) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState);
|
|
496
496
|
},
|
|
497
497
|
enumerable: false,
|
|
498
498
|
configurable: true
|
|
499
499
|
});
|
|
500
500
|
Object.defineProperty(ElementComponent.prototype, "disabled", {
|
|
501
501
|
get: function () {
|
|
502
|
-
var _a
|
|
503
|
-
return !((_a = this.
|
|
502
|
+
var _a;
|
|
503
|
+
return !((_a = this.element) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
|
|
504
504
|
},
|
|
505
505
|
enumerable: false,
|
|
506
506
|
configurable: true
|
|
@@ -514,8 +514,9 @@
|
|
|
514
514
|
},] }
|
|
515
515
|
];
|
|
516
516
|
ElementComponent.propDecorators = {
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
element: [{ type: core.Input }],
|
|
518
|
+
form: [{ type: core.Input }],
|
|
519
|
+
currentState: [{ type: core.Input }]
|
|
519
520
|
};
|
|
520
521
|
|
|
521
522
|
var FormErrorComponent = /** @class */ (function () {
|
|
@@ -1573,23 +1574,23 @@
|
|
|
1573
1574
|
LibTableComponent.prototype.ngOnInit = function () {
|
|
1574
1575
|
var _this = this;
|
|
1575
1576
|
var _a, _b;
|
|
1576
|
-
if (this.
|
|
1577
|
-
this.formConfig = (_a = this.
|
|
1577
|
+
if (this.table) {
|
|
1578
|
+
this.formConfig = (_a = this.table) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
1578
1579
|
this.tableFieldStyles = this.formConfig.tableFieldStyles;
|
|
1579
|
-
this.selectable = this.
|
|
1580
|
-
this.hasActions = this.
|
|
1581
|
-
this.
|
|
1582
|
-
this.inlineActions = this.
|
|
1583
|
-
this.globalActions = this.
|
|
1584
|
-
this.selectionActions = this.
|
|
1580
|
+
this.selectable = this.table.selectable;
|
|
1581
|
+
this.hasActions = this.table.hasActions;
|
|
1582
|
+
this.table.widget = this;
|
|
1583
|
+
this.inlineActions = this.table.getActions(this.formConfig.tableActions.inline);
|
|
1584
|
+
this.globalActions = this.table.getActions(this.formConfig.tableActions.global);
|
|
1585
|
+
this.selectionActions = this.table.getActions(this.formConfig.tableActions.selection);
|
|
1585
1586
|
// Inicialización de campos mapeados del objeto
|
|
1586
1587
|
var mapping = Object.entries(this.formConfig.componentTableAttrMap);
|
|
1587
1588
|
for (var index = 0; index < mapping.length; index++) {
|
|
1588
1589
|
var _c = __read(mapping[index], 2), tableAttr = _c[0], compAttr = _c[1];
|
|
1589
|
-
this[compAttr.toString()] = (_b = this.
|
|
1590
|
+
this[compAttr.toString()] = (_b = this.table) === null || _b === void 0 ? void 0 : _b[tableAttr.toString()];
|
|
1590
1591
|
}
|
|
1591
1592
|
// Subscripción a cambios en atributos
|
|
1592
|
-
this.
|
|
1593
|
+
this.table.attributeChange.subscribe(function (event) {
|
|
1593
1594
|
var tableAttr = event.name, value = event.value;
|
|
1594
1595
|
var compAttr = _this.formConfig.componentTableAttrMap[tableAttr];
|
|
1595
1596
|
_this.hasOwnProperty(compAttr) && (_this[compAttr] = value);
|
|
@@ -1599,24 +1600,24 @@
|
|
|
1599
1600
|
};
|
|
1600
1601
|
LibTableComponent.prototype.start = function () { };
|
|
1601
1602
|
LibTableComponent.prototype.tableGlobalAction = function (actionCode) {
|
|
1602
|
-
this.
|
|
1603
|
+
this.table.notifyGlobalAction(actionCode);
|
|
1603
1604
|
};
|
|
1604
1605
|
LibTableComponent.prototype.tableSelectionAction = function (actionCode) {
|
|
1605
|
-
this.
|
|
1606
|
+
this.table.notifySelectionAction(actionCode);
|
|
1606
1607
|
};
|
|
1607
1608
|
LibTableComponent.prototype.tableActionSelected = function (actionEvent) {
|
|
1608
|
-
this.
|
|
1609
|
+
this.table.notifyInlineAction(actionEvent);
|
|
1609
1610
|
};
|
|
1610
1611
|
LibTableComponent.prototype.tableColumnSort = function (columnFieldCode) {
|
|
1611
|
-
this.
|
|
1612
|
+
this.table.setRequiredOrder(columnFieldCode);
|
|
1612
1613
|
if (this.clientPaging) {
|
|
1613
|
-
return this.
|
|
1614
|
+
return this.table.localSortData();
|
|
1614
1615
|
}
|
|
1615
|
-
this.
|
|
1616
|
+
this.table.notifyGetDataAction();
|
|
1616
1617
|
};
|
|
1617
1618
|
LibTableComponent.prototype.changePage = function (requestedPage) {
|
|
1618
1619
|
if (!this.clientPaging) {
|
|
1619
|
-
this.
|
|
1620
|
+
this.table.notifyGetDataAction(requestedPage);
|
|
1620
1621
|
}
|
|
1621
1622
|
};
|
|
1622
1623
|
Object.defineProperty(LibTableComponent.prototype, "records", {
|
|
@@ -1636,50 +1637,50 @@
|
|
|
1636
1637
|
var eventType = tableFilterEvent.eventType;
|
|
1637
1638
|
var triggerDataUpdate = false;
|
|
1638
1639
|
if (eventType === TABLE_FILTER_TYPES.simpleFilterChange || eventType === TABLE_FILTER_TYPES.simpleFilterFinish) {
|
|
1639
|
-
this.
|
|
1640
|
+
this.table.simpleFilterText = tableFilterEvent.simpleFilterString.trim();
|
|
1640
1641
|
if (this.clientPaging) {
|
|
1641
|
-
this.
|
|
1642
|
-
this.
|
|
1642
|
+
this.table.setAttr('currentPage', 1);
|
|
1643
|
+
this.table.updateVisibleRecords();
|
|
1643
1644
|
}
|
|
1644
1645
|
else if (eventType === TABLE_FILTER_TYPES.simpleFilterFinish) {
|
|
1645
1646
|
triggerDataUpdate = true;
|
|
1646
1647
|
}
|
|
1647
1648
|
}
|
|
1648
1649
|
if (eventType === TABLE_FILTER_TYPES.complexFilterAdd) {
|
|
1649
|
-
this.
|
|
1650
|
+
this.table.addFilterRestriction(tableFilterEvent.complexFilterItem);
|
|
1650
1651
|
}
|
|
1651
1652
|
if (eventType === TABLE_FILTER_TYPES.complexFilterRemove) {
|
|
1652
|
-
this.
|
|
1653
|
+
this.table.removeFilterRestriction(tableFilterEvent.itemName);
|
|
1653
1654
|
}
|
|
1654
1655
|
if (triggerDataUpdate) {
|
|
1655
1656
|
var tableGetDataEvent = {
|
|
1656
|
-
tableCode: this.
|
|
1657
|
+
tableCode: this.table.tableCode,
|
|
1657
1658
|
requestedPage: 1,
|
|
1658
1659
|
};
|
|
1659
|
-
this.
|
|
1660
|
+
this.table.notifyGetDataAction(tableGetDataEvent);
|
|
1660
1661
|
}
|
|
1661
1662
|
};
|
|
1662
1663
|
LibTableComponent.prototype.tableSelectionToggle = function (recordId) {
|
|
1663
|
-
this.
|
|
1664
|
+
this.table.notifyRecordSelection(recordId);
|
|
1664
1665
|
};
|
|
1665
1666
|
LibTableComponent.prototype.toggleSelectAll = function () {
|
|
1666
1667
|
if (this.allSelected) {
|
|
1667
|
-
this.
|
|
1668
|
+
this.table.unSelectAll();
|
|
1668
1669
|
}
|
|
1669
1670
|
else {
|
|
1670
|
-
this.
|
|
1671
|
+
this.table.selectAll();
|
|
1671
1672
|
}
|
|
1672
1673
|
};
|
|
1673
1674
|
Object.defineProperty(LibTableComponent.prototype, "availableFilters", {
|
|
1674
1675
|
get: function () {
|
|
1675
|
-
return this.
|
|
1676
|
+
return this.table.availableFilters;
|
|
1676
1677
|
},
|
|
1677
1678
|
enumerable: false,
|
|
1678
1679
|
configurable: true
|
|
1679
1680
|
});
|
|
1680
1681
|
Object.defineProperty(LibTableComponent.prototype, "selectedRecords", {
|
|
1681
1682
|
get: function () {
|
|
1682
|
-
return this.
|
|
1683
|
+
return this.table.selectedRecords;
|
|
1683
1684
|
},
|
|
1684
1685
|
enumerable: false,
|
|
1685
1686
|
configurable: true
|
|
@@ -1694,7 +1695,7 @@
|
|
|
1694
1695
|
},] }
|
|
1695
1696
|
];
|
|
1696
1697
|
LibTableComponent.propDecorators = {
|
|
1697
|
-
|
|
1698
|
+
table: [{ type: core.Input }],
|
|
1698
1699
|
tableRecords: [{ type: core.Input }],
|
|
1699
1700
|
disabled: [{ type: core.Input }],
|
|
1700
1701
|
currentState: [{ type: core.Input }],
|