tnx-shared 5.3.184 → 5.3.185

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.
@@ -1116,7 +1116,6 @@
1116
1116
  this.disableViewWorkflowAttach = false;
1117
1117
  this.hiddenWorkflowCoreStatus = true;
1118
1118
  this.requiredVanBanDiAfterTrinhKy = false;
1119
- this.disableLazyLoadCommonSearch = false;
1120
1119
  this.showExportAll = false;
1121
1120
  this.showExportSelectedItems = true;
1122
1121
  this.showExportWordSelectedItems = false;
@@ -1365,7 +1364,6 @@
1365
1364
  _this.isHtmlLabel = false;
1366
1365
  _this.isHorizontallyLabel = false;
1367
1366
  _this.order = 0;
1368
- _this.isLazyLoad = false;
1369
1367
  for (var key in init) {
1370
1368
  _this[key] = init[key];
1371
1369
  }
@@ -2049,6 +2047,7 @@
2049
2047
  _this.searchMultiple = true;
2050
2048
  _this.disableDisplayFieldServerSearch = false;
2051
2049
  _this.loadOnInit = false;
2050
+ _this.isLazyLoad = false;
2052
2051
  _this.allowLoadDataWhenParentNull = false;
2053
2052
  _this.disabledParentItem = true;
2054
2053
  for (var key in init) {
@@ -31646,7 +31645,6 @@
31646
31645
  _this.lstBoolControl = [];
31647
31646
  _this.lstControlNotIn = [];
31648
31647
  _this.lstControlAddToGridInfo = [];
31649
- _this.lstControlLazyLoad = [];
31650
31648
  _this.defaultValues = {};
31651
31649
  _this.isAddDefaultValues = false;
31652
31650
  _this.mapControlBindingFilter = new Map();
@@ -31676,6 +31674,7 @@
31676
31674
  this.searchBoxTooltip += "" + (lstTextSearchControl.map(function (x) { return x.label; })).join(', ');
31677
31675
  }
31678
31676
  if (this.isCustomGenerateSearch) {
31677
+ this.lstControlAddToGridInfo = this.parentSetting.commonSchemas.filter(function (p) { return p.addToGridInfo; }).map(function (p) { return p.field; });
31679
31678
  this.parentSetting.commonSchemas.forEach(function (column) {
31680
31679
  column.showLabel = false;
31681
31680
  column.mdWidth = _this.mdWidth;
@@ -31688,36 +31687,28 @@
31688
31687
  if (column instanceof NumberRangeControlSchema) {
31689
31688
  _this.lstNumberRangeControl.push(column.field);
31690
31689
  }
31691
- if (column.hasOwnProperty('defaultValue') && (column instanceof DropdownControlSchema || column instanceof DateTimeControlSchema)) {
31692
- _this.defaultValues[column.field] = column.defaultValue;
31693
- }
31694
- if (column.addToGridInfo) {
31695
- _this.lstControlAddToGridInfo.push(column.field);
31696
- }
31697
31690
  });
31698
- this.setting.schema = this.genFormSchema(this.parentSetting.commonSchemas);
31691
+ this.setting.schema = this.addSearchBox(this.parentSetting.commonSchemas.sort(function (prev, next) { return prev.order - next.order; }));
31692
+ this.genFormSchema(this.parentSetting.commonSchemas);
31699
31693
  }
31700
31694
  else {
31701
31695
  this.setting.schema = this.genFormSchema(columnFilters);
31702
31696
  }
31703
31697
  this.isDisableOpenFull = this.setting.schema.length <= 4 && !this._commonService.isMobile();
31704
31698
  _super.prototype.ngOnInit.call(this);
31705
- if (Object.keys(this.defaultValues).length) {
31699
+ var controlSetDefaultValue = this.setting.schema.filter(function (p) { return p.hasOwnProperty('defaultValue') && (p instanceof DropdownControlSchema || p instanceof DateTimeControlSchema); });
31700
+ if (controlSetDefaultValue.length) {
31701
+ controlSetDefaultValue.forEach(function (item) {
31702
+ _this.defaultValues[item.field] = item.defaultValue;
31703
+ });
31706
31704
  this.handleSearch();
31707
31705
  }
31708
31706
  };
31709
31707
  CommonSearchFormComponent.prototype.genFormSchema = function (columns) {
31710
31708
  var _this = this;
31711
31709
  var result = [];
31712
- var totalControlPerRow = 12 / this.mdWidth;
31713
- var i = 1;
31714
31710
  columns.forEach(function (column) {
31715
31711
  var _a;
31716
- var isLazyLoad = !_this.parentSetting.disableLazyLoadCommonSearch && i > totalControlPerRow
31717
- && column instanceof DropdownControlSchema && !!column.baseService && column.baseService instanceof BaseService;
31718
- if (isLazyLoad) {
31719
- _this.lstControlLazyLoad.push(column.field);
31720
- }
31721
31712
  if (!column.isInTable || !column.includeSelect) {
31722
31713
  _this.lstControlNotIn.push(column.field);
31723
31714
  }
@@ -31735,7 +31726,7 @@
31735
31726
  });
31736
31727
  }
31737
31728
  if (column.baseService || (dataSource && dataSource.length > 0)) {
31738
- result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, showLabel: false, isLazyLoad: isLazyLoad, showClear: true, onChanged: function (evt) {
31729
+ result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, showLabel: false, loadOnInit: true, showClear: true, onChanged: function (evt) {
31739
31730
  var _a;
31740
31731
  if (column.dataType == exports.DataType.boolean) {
31741
31732
  evt.parentModel[column.field] = column.single ? (_a = evt.value.id) !== null && _a !== void 0 ? _a : evt.value : evt.value.map(function (p) { return p.id; });
@@ -31784,7 +31775,6 @@
31784
31775
  break;
31785
31776
  }
31786
31777
  }
31787
- i++;
31788
31778
  });
31789
31779
  return this.addSearchBox(result.sort(function (prev, next) { return prev.order - next.order; }));
31790
31780
  };
@@ -31797,7 +31787,7 @@
31797
31787
  label: 'Từ khóa',
31798
31788
  fullLabel: 'Từ khóa',
31799
31789
  showLabel: false,
31800
- mdWidth: this.mdWidth,
31790
+ mdWidth: this.mdWidth
31801
31791
  });
31802
31792
  var index = Number(12 / this.mdWidth) - 1;
31803
31793
  if (this._commonService.isMobile()) {
@@ -31894,29 +31884,8 @@
31894
31884
  };
31895
31885
  CommonSearchFormComponent.prototype.toggleMenuSearch = function () {
31896
31886
  this.isOpenFull = !this.isOpenFull;
31897
- if (this.lstControlLazyLoad.length) {
31898
- this.triggerLazyLoadDropdown();
31899
- }
31900
31887
  this.onAfterToggleMenuSearch.emit(true);
31901
31888
  };
31902
- CommonSearchFormComponent.prototype.triggerLazyLoadDropdown = function () {
31903
- return __awaiter(this, void 0, void 0, function () {
31904
- var promises;
31905
- var _this = this;
31906
- return __generator(this, function (_b) {
31907
- switch (_b.label) {
31908
- case 0:
31909
- promises = [];
31910
- this.lstControlLazyLoad.forEach(function (control) { return promises.push(_this.formControls[control]._component._getDataSource()); });
31911
- return [4 /*yield*/, Promise.all(promises)];
31912
- case 1:
31913
- _b.sent();
31914
- this.lstControlLazyLoad = [];
31915
- return [2 /*return*/];
31916
- }
31917
- });
31918
- });
31919
- };
31920
31889
  CommonSearchFormComponent.prototype.onFormInitialized = function (formEvent) {
31921
31890
  return __awaiter(this, void 0, void 0, function () {
31922
31891
  return __generator(this, function (_b) {
@@ -32170,7 +32139,7 @@
32170
32139
  this.createFilterFunction();
32171
32140
  this.createSearchSubscription();
32172
32141
  }
32173
- if (this.control.loadOnInit && !this.control.isLazyLoad) {
32142
+ if (this.control.loadOnInit) {
32174
32143
  this._getData();
32175
32144
  }
32176
32145
  }