tuain-ng-forms-lib 14.0.6 → 14.0.8

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.
@@ -344,12 +344,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
344
344
  const changeViewAttributes = ['visibleRecords', 'currentPage', 'recordsPerPage'];
345
345
  class LibTableComponent {
346
346
  constructor() {
347
- this.globalFilterString = '';
348
347
  this.currentPage = 1;
349
348
  this.globalSearch = false;
349
+ this.globalFilterString = '';
350
+ this.visibleRecords = [];
350
351
  this.selectedRecords = [];
351
352
  this.totalRecordsNumber = 0;
352
353
  this.allSelected = false;
354
+ this.layout = '';
353
355
  this.loaded = false;
354
356
  this.selectable = false;
355
357
  this.hasActions = false;
@@ -392,8 +394,7 @@ class LibTableComponent {
392
394
  globalFilterCompleted() { this.changePage(1); }
393
395
  changePage(requestedPage) { this.table.changePage(requestedPage); }
394
396
  tableColumnSort(columnName, direction = null) { this.table.sort(columnName, direction !== null && direction !== void 0 ? direction : 'ascend'); }
395
- globalFilterChanged() { var _a, _b; this.table.setGlobalFilterString((_b = (_a = this.globalFilterString) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ''); }
396
- cleanGlobalFilter() { this.globalFilterString = ''; this.globalFilterChanged(); }
397
+ globalFilterChanged() { var _a, _b; this.table.setGlobalFilterString((_b = (_a = this.globalFilterString) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '', false); }
397
398
  syncAttribute(name, value) {
398
399
  try {
399
400
  if (name === 'visibleRecords') {
@@ -685,6 +686,7 @@ class FieldDescriptor extends FormElement {
685
686
  get value() { return this.getValue(); }
686
687
  set value(newValue) { this.setValue(newValue); }
687
688
  notifyEditionPartial() {
689
+ this.resetError();
688
690
  this._editionPartial.next({ code: this.fieldCode, intrinsicValidation: true });
689
691
  }
690
692
  notifyEditionFinish() {
@@ -692,6 +694,7 @@ class FieldDescriptor extends FormElement {
692
694
  let intrinsicValidation = true;
693
695
  const fieldDefaultFormat = (_b = (_a = this._formConfig.fieldTypesPatterns) === null || _a === void 0 ? void 0 : _a[this.fieldType]) !== null && _b !== void 0 ? _b : null;
694
696
  const fieldValue = this.getValue();
697
+ this.resetError();
695
698
  if (fieldValue && (fieldDefaultFormat || this.fieldFormat)) {
696
699
  intrinsicValidation = ((_c = fieldDefaultFormat === null || fieldDefaultFormat === void 0 ? void 0 : fieldDefaultFormat.test(fieldValue)) !== null && _c !== void 0 ? _c : true)
697
700
  && ((_e = (_d = this.fieldFormat) === null || _d === void 0 ? void 0 : _d.test(fieldValue)) !== null && _e !== void 0 ? _e : true);
@@ -1132,6 +1135,7 @@ class RecordTable extends FormElement {
1132
1135
  this.setAttr('tableCode', tableReceived.tableCode);
1133
1136
  this.setAttr('clientPaging', (_e = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.clientPaging) !== null && _e !== void 0 ? _e : true);
1134
1137
  this.setAttr('globalSearch', (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.simpleFilter) !== null && _f !== void 0 ? _f : false);
1138
+ this.setAttr('globalFilterString', '');
1135
1139
  this.setAttr('sorting', { columnName: '', direction: '' });
1136
1140
  this.setAttr('recordsPerPage', formConfig.defaultRecordsPerPage);
1137
1141
  this.setAttr('layout', '');
@@ -1362,12 +1366,15 @@ class RecordTable extends FormElement {
1362
1366
  this.restrictedId = null;
1363
1367
  this.updateVisibleRecords();
1364
1368
  }
1365
- setGlobalFilterString(text) {
1369
+ setGlobalFilterString(text, notifyComponent = true) {
1366
1370
  var _a;
1367
1371
  this.globalFilterStrings = (_a = text.split(' ').filter(t => t && t.trim().length > 0).map(t => t.trim())) !== null && _a !== void 0 ? _a : [];
1368
1372
  if (this.clientPaging) {
1369
1373
  this.changePage(1);
1370
1374
  }
1375
+ if (notifyComponent) {
1376
+ this.setAttr('globalFilterString', text);
1377
+ }
1371
1378
  }
1372
1379
  addFilterDefinition(columnName, filterDefinition) {
1373
1380
  const tableColumn = this.columnDefinition(columnName);
@@ -1397,7 +1404,7 @@ class RecordTable extends FormElement {
1397
1404
  const tableColumn = this.columnDefinition(columnName);
1398
1405
  const columnFilterDefinition = (_a = tableColumn === null || tableColumn === void 0 ? void 0 : tableColumn.filterDefinition) !== null && _a !== void 0 ? _a : null;
1399
1406
  if (!columnFilterDefinition) {
1400
- return null;
1407
+ return;
1401
1408
  }
1402
1409
  tableColumn && tableColumn.addFilter(columnValues, operator);
1403
1410
  this.updateVisibleRecords();
@@ -3042,7 +3049,6 @@ class BasicFormComponent {
3042
3049
  if (!fieldToValidate) {
3043
3050
  return false;
3044
3051
  }
3045
- fieldToValidate.resetError();
3046
3052
  const validationCallbacks = this._fieldInputValidation[fieldCode];
3047
3053
  if (validationCallbacks) {
3048
3054
  const clientValidationPromises = [];
@@ -3062,7 +3068,6 @@ class BasicFormComponent {
3062
3068
  if (!fieldToValidate) {
3063
3069
  return;
3064
3070
  }
3065
- fieldToValidate.resetError();
3066
3071
  const validationCallbacks = this._fieldValidationsStart[fieldCode];
3067
3072
  if (validationCallbacks) {
3068
3073
  const clientValidationPromises = [];