tnx-shared 5.0.42 → 5.0.44

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.
@@ -3245,7 +3245,11 @@
3245
3245
  EnumWorkflowCoreCodeSettingKey["MAC_DINH"] = "workflowCoreTrinhKy";
3246
3246
  EnumWorkflowCoreCodeSettingKey["PHE_DUYET_2_BUOC"] = "workflowCoreTrinhKy2Buoc";
3247
3247
  EnumWorkflowCoreCodeSettingKey["PHE_DUYET_3_BUOC"] = "workflowCoreTrinhKy3Buoc";
3248
- })(exports.EnumWorkflowCoreCodeSettingKey || (exports.EnumWorkflowCoreCodeSettingKey = {}));
3248
+ })(exports.EnumWorkflowCoreCodeSettingKey || (exports.EnumWorkflowCoreCodeSettingKey = {}));
3249
+ (function (EnumCoreVersion) {
3250
+ EnumCoreVersion["V4"] = "V4";
3251
+ EnumCoreVersion["V5"] = "V5";
3252
+ })(exports.EnumCoreVersion || (exports.EnumCoreVersion = {}));
3249
3253
 
3250
3254
  var ModelSchema = /** @class */ (function () {
3251
3255
  function ModelSchema(init) {
@@ -3635,6 +3639,7 @@
3635
3639
  _this.fieldPlus = ''; // Danh sách những trường bổ sung cần lấy thêm ngoài id, ten; Ví dụ ,ma
3636
3640
  _this.fieldValueParent = 'value'; // Trường sử dụng để lấy dữ liệu làm khóa từ bảng cha của item drop down được chọn
3637
3641
  _this.fireCallBackInside = true;
3642
+ _this.coreVersion = exports.EnumCoreVersion.V5;
3638
3643
  _this.funcCompare = function (item, value) { return item[_this.valueField] == value; };
3639
3644
  for (var key in init) {
3640
3645
  _this[key] = init[key];
@@ -11545,7 +11550,7 @@
11545
11550
  arrPromiseDontNeedWait = [];
11546
11551
  arrSchemaDontNeedWait = [];
11547
11552
  _loop_1 = function (schema) {
11548
- var field, arrValue_1, promise, result, funcGetLabel_1;
11553
+ var field, arrValue_1, promise, filters, result, funcGetLabel_1;
11549
11554
  return __generator(this, function (_a) {
11550
11555
  switch (_a.label) {
11551
11556
  case 0:
@@ -11580,7 +11585,11 @@
11580
11585
  promise = schema.baseService.getDataDropdown(schema.groupCode, arrValue_1, this_1.createDropdownOptions(schema));
11581
11586
  }
11582
11587
  else {
11583
- promise = schema.baseService.getDataDropdownByFilter([this_1.newFilter(schema.valueField, exports.Operator.in, arrValue_1)], this_1.createDropdownOptions(schema));
11588
+ filters = [this_1.newFilter(schema.valueField, exports.Operator.in, arrValue_1)];
11589
+ if (schema.modifyFilter) {
11590
+ schema.modifyFilter(filters);
11591
+ }
11592
+ promise = schema.baseService.getDataDropdownByFilter(filters, this_1.createDropdownOptions(schema));
11584
11593
  }
11585
11594
  if (!(schema.order != null)) return [3 /*break*/, 2];
11586
11595
  return [4 /*yield*/, promise];
@@ -18802,27 +18811,49 @@
18802
18811
  AutoCompletePickerComponent.prototype.buildFilterKeyword = function () {
18803
18812
  var _this = this;
18804
18813
  if (this.fieldSearchText.length == 1) {
18805
- this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField, exports.Operator.contain, value); };
18814
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
18815
+ this.getFilterOnSearch = function (value) { return _this.newFilterV4(_this.control.displayField, exports.Operator.contain, value.toString()); };
18816
+ }
18817
+ else {
18818
+ this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField, exports.Operator.contain, value); };
18819
+ }
18806
18820
  }
18807
18821
  else {
18808
18822
  this.getFilterOnSearch = function (value) {
18809
- var e_1, _a;
18823
+ var e_1, _a, e_2, _b;
18810
18824
  var result = new Filter({
18811
18825
  logic: 'or',
18812
18826
  filters: []
18813
18827
  });
18814
- try {
18815
- for (var _b = __values(_this.fieldSearchText), _c = _b.next(); !_c.done; _c = _b.next()) {
18816
- var fieldSearch = _c.value;
18817
- result.filters.push(_this.newFilter(fieldSearch, exports.Operator.contain, value));
18828
+ if (_this.control.coreVersion == exports.EnumCoreVersion.V4) {
18829
+ try {
18830
+ for (var _c = __values(_this.fieldSearchText), _d = _c.next(); !_d.done; _d = _c.next()) {
18831
+ var fieldSearch = _d.value;
18832
+ result.filters.push(_this.newFilterV4(fieldSearch, exports.Operator.contain, value.toString()));
18833
+ }
18834
+ }
18835
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
18836
+ finally {
18837
+ try {
18838
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
18839
+ }
18840
+ finally { if (e_1) throw e_1.error; }
18818
18841
  }
18819
18842
  }
18820
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
18821
- finally {
18843
+ else {
18822
18844
  try {
18823
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
18845
+ for (var _e = __values(_this.fieldSearchText), _f = _e.next(); !_f.done; _f = _e.next()) {
18846
+ var fieldSearch = _f.value;
18847
+ result.filters.push(_this.newFilter(fieldSearch, exports.Operator.contain, value));
18848
+ }
18849
+ }
18850
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
18851
+ finally {
18852
+ try {
18853
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
18854
+ }
18855
+ finally { if (e_2) throw e_2.error; }
18824
18856
  }
18825
- finally { if (e_1) throw e_1.error; }
18826
18857
  }
18827
18858
  return result;
18828
18859
  };
@@ -18901,12 +18932,22 @@
18901
18932
  filters = [];
18902
18933
  if (this.control.multiple) {
18903
18934
  if (this.value && this.value.length > 0) {
18904
- filters.push(this.newFilter(this.control.valueField, exports.Operator.notIn, this.value));
18935
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
18936
+ filters.push(this.newFilterV4(this.control.valueField, exports.Operator.notIn, this.value.join(',')));
18937
+ }
18938
+ else {
18939
+ filters.push(this.newFilter(this.control.valueField, exports.Operator.notIn, this.value));
18940
+ }
18905
18941
  }
18906
18942
  }
18907
18943
  else {
18908
18944
  if (this.value) {
18909
- filters.push(this.newFilter(this.control.valueField, exports.Operator.notEqual, this.value));
18945
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
18946
+ filters.push(this.newFilterV4(this.control.valueField, exports.Operator.notEqual, this.value.toString()));
18947
+ }
18948
+ else {
18949
+ filters.push(this.newFilter(this.control.valueField, exports.Operator.notEqual, this.value));
18950
+ }
18910
18951
  }
18911
18952
  }
18912
18953
  return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
@@ -19106,9 +19147,17 @@
19106
19147
  if (!this.control.multiple) return [3 /*break*/, 5];
19107
19148
  dataSource = [];
19108
19149
  if (!(this.value && this.value.length > 0)) return [3 /*break*/, 4];
19109
- filters = [
19110
- this.newFilter(this.control.valueField, exports.Operator.in, this.value)
19111
- ];
19150
+ filters = [];
19151
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
19152
+ filters = [
19153
+ this.newFilterV4(this.control.valueField, exports.Operator.in, this.value.join(','))
19154
+ ];
19155
+ }
19156
+ else {
19157
+ filters = [
19158
+ this.newFilter(this.control.valueField, exports.Operator.in, this.value)
19159
+ ];
19160
+ }
19112
19161
  if (!this.control.modifyFilter) return [3 /*break*/, 2];
19113
19162
  return [4 /*yield*/, this.control.modifyFilter(filters)];
19114
19163
  case 1:
@@ -19132,9 +19181,17 @@
19132
19181
  case 5:
19133
19182
  dataSource = [];
19134
19183
  if (!this.value) return [3 /*break*/, 9];
19135
- filters = [
19136
- this.newFilter(this.control.valueField, exports.Operator.equal, this.value)
19137
- ];
19184
+ filters = [];
19185
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
19186
+ filters = [
19187
+ this.newFilterV4(this.control.valueField, exports.Operator.equal, this.value.toString())
19188
+ ];
19189
+ }
19190
+ else {
19191
+ filters = [
19192
+ this.newFilter(this.control.valueField, exports.Operator.equal, this.value)
19193
+ ];
19194
+ }
19138
19195
  if (!this.control.modifyFilter) return [3 /*break*/, 7];
19139
19196
  return [4 /*yield*/, this.control.modifyFilter(filters)];
19140
19197
  case 6:
@@ -19179,7 +19236,7 @@
19179
19236
  }
19180
19237
  };
19181
19238
  AutoCompletePickerComponent.prototype.reStructureDataSource = function (sources) {
19182
- var e_2, _a;
19239
+ var e_3, _a;
19183
19240
  if (sources != null && sources.length > 0) {
19184
19241
  var arr = [];
19185
19242
  try {
@@ -19189,12 +19246,12 @@
19189
19246
  arr.push(item);
19190
19247
  }
19191
19248
  }
19192
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
19249
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
19193
19250
  finally {
19194
19251
  try {
19195
19252
  if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
19196
19253
  }
19197
- finally { if (e_2) throw e_2.error; }
19254
+ finally { if (e_3) throw e_3.error; }
19198
19255
  }
19199
19256
  this.dataSource = arr;
19200
19257
  }
@@ -19224,7 +19281,12 @@
19224
19281
  if (!this.control.multiple) return [3 /*break*/, 6];
19225
19282
  if (!(obj != null && obj.length > 0)) return [3 /*break*/, 4];
19226
19283
  filters = [];
19227
- filters.push(this.newFilter(this.control.valueField, exports.Operator.in, obj));
19284
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
19285
+ filters.push(this.newFilterV4(this.control.valueField, exports.Operator.in, obj.join(',')));
19286
+ }
19287
+ else {
19288
+ filters.push(this.newFilter(this.control.valueField, exports.Operator.in, obj));
19289
+ }
19228
19290
  if (!this.control.modifyFilter) return [3 /*break*/, 2];
19229
19291
  return [4 /*yield*/, this.control.modifyFilter(filters)];
19230
19292
  case 1:
@@ -19249,9 +19311,17 @@
19249
19311
  case 5: return [3 /*break*/, 10];
19250
19312
  case 6:
19251
19313
  if (!(obj != null)) return [3 /*break*/, 9];
19252
- filters = [
19253
- this.newFilter(this.control.valueField, exports.Operator.equal, obj)
19254
- ];
19314
+ filters = [];
19315
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
19316
+ filters = [
19317
+ this.newFilterV4(this.control.valueField, exports.Operator.equal, obj.toString())
19318
+ ];
19319
+ }
19320
+ else {
19321
+ filters = [
19322
+ this.newFilter(this.control.valueField, exports.Operator.equal, obj)
19323
+ ];
19324
+ }
19255
19325
  if (!this.control.modifyFilter) return [3 /*break*/, 8];
19256
19326
  return [4 /*yield*/, this.control.modifyFilter(filters)];
19257
19327
  case 7:
@@ -30524,12 +30594,22 @@
30524
30594
  gridInfo.fields = this.advanceData.fields;
30525
30595
  if (this.control.multiple) {
30526
30596
  if (this._value && this._value.length > 0) {
30527
- gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.notIn, this._value));
30597
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
30598
+ gridInfo.filters.push(this.newFilterV4(this.control.valueField, exports.Operator.notIn, this._value.join(',')));
30599
+ }
30600
+ else {
30601
+ gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.notIn, this._value));
30602
+ }
30528
30603
  }
30529
30604
  }
30530
30605
  else {
30531
30606
  if (this._value) {
30532
- gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.notEqual, this._value));
30607
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
30608
+ gridInfo.filters.push(this.newFilterV4(this.control.valueField, exports.Operator.notEqual, this._value.join(',')));
30609
+ }
30610
+ else {
30611
+ gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.notEqual, this._value));
30612
+ }
30533
30613
  }
30534
30614
  }
30535
30615
  return [4 /*yield*/, appendDefaultFilter(gridInfo.filters, this.control.defaultFilters)];
@@ -30712,7 +30792,12 @@
30712
30792
  gridInfo.fields = this.advanceData.fields;
30713
30793
  if (this.control.multiple) {
30714
30794
  if (this._value != null && this._value.length > 0) {
30715
- gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.in, this._value));
30795
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
30796
+ gridInfo.filters.push(this.newFilterV4(this.control.valueField, exports.Operator.in, this._value.join(',')));
30797
+ }
30798
+ else {
30799
+ gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.in, this._value));
30800
+ }
30716
30801
  }
30717
30802
  else {
30718
30803
  return [2 /*return*/, false];
@@ -30720,7 +30805,12 @@
30720
30805
  }
30721
30806
  else {
30722
30807
  if (this._value != null) {
30723
- gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.in, this._value));
30808
+ if (this.control.coreVersion == exports.EnumCoreVersion.V4) {
30809
+ gridInfo.filters.push(this.newFilterV4(this.control.valueField, exports.Operator.in, this._value.join(',')));
30810
+ }
30811
+ else {
30812
+ gridInfo.filters.push(this.newFilter(this.control.valueField, exports.Operator.in, this._value));
30813
+ }
30724
30814
  }
30725
30815
  else {
30726
30816
  return [2 /*return*/, false];