tnx-shared 5.1.204 → 5.1.208

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.
Files changed (36) hide show
  1. package/bundles/tnx-shared.umd.js +194 -61
  2. package/bundles/tnx-shared.umd.js.map +1 -1
  3. package/bundles/tnx-shared.umd.min.js +1 -1
  4. package/bundles/tnx-shared.umd.min.js.map +1 -1
  5. package/classes/form-schema.d.ts +2 -0
  6. package/classes/form-schema.d.ts.map +1 -1
  7. package/components/crud/crud-form/crud-form.component.d.ts +1 -1
  8. package/components/crud/crud-list/crud-list.component.d.ts.map +1 -1
  9. package/components/dropdown/dropdown.component.d.ts +1 -1
  10. package/components/dropdown/dropdown.component.d.ts.map +1 -1
  11. package/components/file-explorer/services/file-data.service.d.ts +1 -1
  12. package/components/file-explorer/services/file-data.service.d.ts.map +1 -1
  13. package/components/file-upload/file-upload.component.d.ts +3 -3
  14. package/components/file-upload/file-upload.component.d.ts.map +1 -1
  15. package/components/tn-tabview/tn-tabview.component.d.ts +2 -0
  16. package/components/tn-tabview/tn-tabview.component.d.ts.map +1 -1
  17. package/esm2015/classes/base/list-base.js +2 -2
  18. package/esm2015/classes/form-schema.js +3 -1
  19. package/esm2015/components/crud/crud-form/crud-form.component.js +2 -2
  20. package/esm2015/components/crud/crud-list/crud-list.component.js +2 -2
  21. package/esm2015/components/dropdown/dropdown.component.js +36 -16
  22. package/esm2015/components/file-explorer/services/file-data.service.js +55 -28
  23. package/esm2015/components/file-upload/file-upload.component.js +4 -4
  24. package/esm2015/components/tn-tabview/tn-tabview.component.js +8 -3
  25. package/esm2015/public-api.js +2 -1
  26. package/esm2015/services/base.service.js +4 -1
  27. package/fesm2015/tnx-shared.js +1052 -945
  28. package/fesm2015/tnx-shared.js.map +1 -1
  29. package/package.json +3 -3
  30. package/public-api.d.ts +1 -0
  31. package/public-api.d.ts.map +1 -1
  32. package/services/base.service.d.ts +1 -0
  33. package/services/base.service.d.ts.map +1 -1
  34. package/tnx-shared.metadata.json +1 -1
  35. package/tnx-shared.module.d.ts +2 -2
  36. package/tnx-shared.module.d.ts.map +1 -1
@@ -3378,6 +3378,7 @@
3378
3378
  this.hiddenCheckbox = false;
3379
3379
  this.hiddenOrderColumn = false;
3380
3380
  this.hiddenWorkflowColumn = false;
3381
+ this.allowFilterWorkflowColumn = false;
3381
3382
  this.hiddenFunctionColumn = false;
3382
3383
  this.hiddenRefresh = false;
3383
3384
  this.hiddenFilterRow = false;
@@ -4186,6 +4187,7 @@
4186
4187
  _this.multiple = false;
4187
4188
  _this.maxSelectedLabels = 5;
4188
4189
  _this.maxItemDisplay = 50;
4190
+ _this.virtualScroll = false;
4189
4191
  _this.fitPanel = true;
4190
4192
  _this.enableCaching = true;
4191
4193
  _this.needClone = false; // Sử dụng trong table schema, khi datasource của một cột trên mỗi dòng là khác nhau cần set needClone = true
@@ -7229,6 +7231,9 @@
7229
7231
  BaseService.prototype.getActionAllowInStart = function (workflowCode) {
7230
7232
  return this.defaultPost(this.serviceUri + "/GetActionAllowInStart/" + workflowCode, {});
7231
7233
  };
7234
+ BaseService.prototype.validateChangeState = function (itemWorkflowHistory) {
7235
+ return this.defaultPost(this.serviceUri + "/ValidateChangeStateBase", itemWorkflowHistory);
7236
+ };
7232
7237
  BaseService.prototype.changeState = function (itemWorkflowHistory) {
7233
7238
  if (itemWorkflowHistory) {
7234
7239
  if (itemWorkflowHistory.departmentIds) {
@@ -15569,7 +15574,7 @@
15569
15574
  currentNode: currentNode,
15570
15575
  eventType: 'dataSourceLoaded',
15571
15576
  crudForm: this,
15572
- data: dataFromDropdown.dataSource
15577
+ data: dataFromDropdown.rawDataSource ? dataFromDropdown.rawDataSource : dataFromDropdown.dataSource
15573
15578
  });
15574
15579
  eventData['elm'] = dataFromDropdown.elm;
15575
15580
  if (!control.callbackDataFinish) return [3 /*break*/, 4];
@@ -21622,7 +21627,7 @@
21622
21627
  operator: exports.Operator.in,
21623
21628
  sourceField: col.field
21624
21629
  }));
21625
- _this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: 'Chọn', multiple: true, loadOnInit: true, isServerLoad: col.isServerLoad }));
21630
+ _this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: "Ch\u1ECDn " + col.label, multiple: true, loadOnInit: true, isServerLoad: col.isServerLoad }));
21626
21631
  }
21627
21632
  else {
21628
21633
  _this._notifierService.showWarning("Ch\u01B0a c\u1EA5u h\u00ECnh baseService ho\u1EB7c dataSource cho c\u1ED9t " + col.field + ": " + col.label);
@@ -24059,7 +24064,7 @@
24059
24064
  isTree: true,
24060
24065
  fieldTree: 'parentId',
24061
24066
  dataSource: dataSource,
24062
- allowFilter: false
24067
+ allowFilter: this.setting.allowFilterWorkflowColumn
24063
24068
  });
24064
24069
  this.setting.advanceData.fieldNeedGetRef.unshift(colParent);
24065
24070
  this.setting.advanceData.userData = this.model.advanceData.userData;
@@ -34002,7 +34007,6 @@
34002
34007
  _this.funcReturnValue = function (value) { return value; };
34003
34008
  _this.hideTransitionOptions = '195ms ease-in';
34004
34009
  _this.showTransitionOptions = '225ms ease-out';
34005
- _this.virtualScroll = true;
34006
34010
  _this.autofocusSelectedItem = true;
34007
34011
  _this.valueSearchServer = '';
34008
34012
  _this.keyUp = new rxjs.Subject();
@@ -34013,6 +34017,7 @@
34013
34017
  _this.filterFromParents = [];
34014
34018
  _this.dropdownOptions = [];
34015
34019
  _this.delayFilter = 100;
34020
+ _this.firstScroll = true;
34016
34021
  _this.loading = false;
34017
34022
  _this.page = 1;
34018
34023
  _this.totalPage = 2;
@@ -34026,13 +34031,18 @@
34026
34031
  };
34027
34032
  _this.handleScroll = function (evt) {
34028
34033
  if (evt.srcElement.scrollTop > 0
34034
+ && !_this.firstScroll
34029
34035
  && evt.srcElement.offsetHeight + evt.srcElement.scrollTop == evt.srcElement.scrollHeight) {
34036
+ _this.firstScroll = true;
34030
34037
  if (_this.timeoutScroll)
34031
34038
  clearTimeout(_this.timeoutScroll);
34032
34039
  _this.timeoutScroll = setTimeout(function (f) {
34033
34040
  _this.getDataNextPage();
34034
34041
  }, 150);
34035
34042
  }
34043
+ else {
34044
+ _this.firstScroll = false;
34045
+ }
34036
34046
  };
34037
34047
  return _this;
34038
34048
  }
@@ -34056,7 +34066,24 @@
34056
34066
  });
34057
34067
  Object.defineProperty(DropdownComponent.prototype, "dataSource", {
34058
34068
  set: function (value) {
34059
- this.combineDataSource(value, 1);
34069
+ var e_1, _a;
34070
+ var dataSource = [];
34071
+ if (value) {
34072
+ try {
34073
+ for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {
34074
+ var item = value_1_1.value;
34075
+ dataSource.push(this.reStructureItemObject(item));
34076
+ }
34077
+ }
34078
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
34079
+ finally {
34080
+ try {
34081
+ if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);
34082
+ }
34083
+ finally { if (e_1) throw e_1.error; }
34084
+ }
34085
+ }
34086
+ this.combineDataSource(dataSource, 1);
34060
34087
  this.checkAndFireEvent();
34061
34088
  },
34062
34089
  enumerable: false,
@@ -34107,7 +34134,7 @@
34107
34134
  this.setDefaultSetting();
34108
34135
  if (this.control.baseService) {
34109
34136
  if (this.control.isServerLoad) {
34110
- this.virtualScroll = false;
34137
+ this.control.maxItemDisplay = 9999;
34111
34138
  this.createFilterFunction();
34112
34139
  this.subscription = this.keyUp.pipe(operators.map(function (event) { return event.target.value; }), operators.debounceTime(500), operators.distinctUntilChanged()).subscribe(function (value) {
34113
34140
  _this._getData();
@@ -34228,7 +34255,7 @@
34228
34255
  }
34229
34256
  else {
34230
34257
  this.getFilterOnServerSearch = function (value) {
34231
- var e_1, _a;
34258
+ var e_2, _a;
34232
34259
  var result = new Filter({
34233
34260
  logic: 'or',
34234
34261
  filters: []
@@ -34240,12 +34267,12 @@
34240
34267
  result.filters.push({ field: fieldSearch, operator: exports.Operator.contain, value: tmpValue });
34241
34268
  }
34242
34269
  }
34243
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
34270
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
34244
34271
  finally {
34245
34272
  try {
34246
34273
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
34247
34274
  }
34248
- finally { if (e_1) throw e_1.error; }
34275
+ finally { if (e_2) throw e_2.error; }
34249
34276
  }
34250
34277
  return result;
34251
34278
  };
@@ -34298,12 +34325,12 @@
34298
34325
  dataSource.forEach(function (source) {
34299
34326
  var index = destSource.findIndex(function (q) { return q.value[_this.control.fieldMaPhanCap] > source.value[_this.control.fieldMaPhanCap]; });
34300
34327
  if (index == -1) {
34301
- if (direction == -1) {
34302
- destSource.unshift(source);
34303
- }
34304
- else {
34305
- destSource.push(source);
34328
+ // Kiểm tra bản ghi cuối cùng là nó thì k insert
34329
+ if (destSource.length > 0
34330
+ && destSource[destSource.length - 1].value[_this.control.valueField] == source.value[_this.control.valueField]) {
34331
+ return;
34306
34332
  }
34333
+ destSource.push(source);
34307
34334
  }
34308
34335
  else if (index == 0) {
34309
34336
  destSource.unshift(source);
@@ -34419,13 +34446,13 @@
34419
34446
  return newValue;
34420
34447
  };
34421
34448
  DropdownComponent.prototype.appendValueFromDataSource = function (newValue, currentValue, dataSource) {
34422
- var e_2, _a;
34449
+ var e_3, _a;
34423
34450
  if (!dataSource || !dataSource.length)
34424
34451
  return;
34425
34452
  for (var i = 0; i < currentValue.length; i++) {
34426
34453
  var selectedItem = currentValue[i];
34427
34454
  try {
34428
- for (var dataSource_1 = (e_2 = void 0, __values(dataSource)), dataSource_1_1 = dataSource_1.next(); !dataSource_1_1.done; dataSource_1_1 = dataSource_1.next()) {
34455
+ for (var dataSource_1 = (e_3 = void 0, __values(dataSource)), dataSource_1_1 = dataSource_1.next(); !dataSource_1_1.done; dataSource_1_1 = dataSource_1.next()) {
34429
34456
  var item = dataSource_1_1.value;
34430
34457
  if (this.control.funcCompare(item.value, selectedItem)
34431
34458
  || this.control.funcCompare(item.value, selectedItem[this.control.valueField])) {
@@ -34436,12 +34463,12 @@
34436
34463
  }
34437
34464
  }
34438
34465
  }
34439
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
34466
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
34440
34467
  finally {
34441
34468
  try {
34442
34469
  if (dataSource_1_1 && !dataSource_1_1.done && (_a = dataSource_1.return)) _a.call(dataSource_1);
34443
34470
  }
34444
- finally { if (e_2) throw e_2.error; }
34471
+ finally { if (e_3) throw e_3.error; }
34445
34472
  }
34446
34473
  }
34447
34474
  };
@@ -34454,7 +34481,7 @@
34454
34481
  this.findItemFromDataSource(oldValue, this.dataSourceSelected);
34455
34482
  };
34456
34483
  DropdownComponent.prototype.findItemFromDataSource = function (oldValue, dataSource) {
34457
- var e_3, _a;
34484
+ var e_4, _a;
34458
34485
  if (!dataSource || !dataSource.length)
34459
34486
  return;
34460
34487
  try {
@@ -34467,12 +34494,12 @@
34467
34494
  }
34468
34495
  }
34469
34496
  }
34470
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
34497
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
34471
34498
  finally {
34472
34499
  try {
34473
34500
  if (dataSource_2_1 && !dataSource_2_1.done && (_a = dataSource_2.return)) _a.call(dataSource_2);
34474
34501
  }
34475
- finally { if (e_3) throw e_3.error; }
34502
+ finally { if (e_4) throw e_4.error; }
34476
34503
  }
34477
34504
  };
34478
34505
  DropdownComponent.prototype.checkReady = function () {
@@ -34526,7 +34553,7 @@
34526
34553
  };
34527
34554
  DropdownComponent.prototype._getDataSource = function (page) {
34528
34555
  return __awaiter(this, void 0, void 0, function () {
34529
- var filters, _a, dataSource, totalPage;
34556
+ var filters, _a, dataSource, rawDataSource, totalPage;
34530
34557
  return __generator(this, function (_b) {
34531
34558
  switch (_b.label) {
34532
34559
  case 0:
@@ -34543,7 +34570,7 @@
34543
34570
  }
34544
34571
  return [4 /*yield*/, this._getDataSourceByService(filters, page)];
34545
34572
  case 2:
34546
- _a = _b.sent(), dataSource = _a.dataSource, totalPage = _a.totalPage;
34573
+ _a = _b.sent(), dataSource = _a.dataSource, rawDataSource = _a.rawDataSource, totalPage = _a.totalPage;
34547
34574
  this.totalPage = totalPage;
34548
34575
  this.loading = false;
34549
34576
  this.combineDataSource(dataSource, page);
@@ -34554,7 +34581,7 @@
34554
34581
  if (this.control.fireCallBackInside) {
34555
34582
  if (this.control.callbackDataFinish) {
34556
34583
  this.control.callbackDataFinish({
34557
- data: dataSource,
34584
+ data: rawDataSource,
34558
34585
  elm: this
34559
34586
  });
34560
34587
  }
@@ -34575,7 +34602,7 @@
34575
34602
  if (pageSize === void 0) { pageSize = null; }
34576
34603
  return __awaiter(this, void 0, void 0, function () {
34577
34604
  var dataSource, totalPage, dropdownOptions, response, result, dataSource_3, dataSource_3_1, item;
34578
- var e_4, _a;
34605
+ var e_5, _a;
34579
34606
  return __generator(this, function (_b) {
34580
34607
  switch (_b.label) {
34581
34608
  case 0:
@@ -34618,14 +34645,14 @@
34618
34645
  result.push(this.reStructureItemObject(item));
34619
34646
  }
34620
34647
  }
34621
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
34648
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
34622
34649
  finally {
34623
34650
  try {
34624
34651
  if (dataSource_3_1 && !dataSource_3_1.done && (_a = dataSource_3.return)) _a.call(dataSource_3);
34625
34652
  }
34626
- finally { if (e_4) throw e_4.error; }
34653
+ finally { if (e_5) throw e_5.error; }
34627
34654
  }
34628
- return [2 /*return*/, { dataSource: result, totalPage: totalPage }];
34655
+ return [2 /*return*/, { dataSource: result, rawDataSource: dataSource, totalPage: totalPage }];
34629
34656
  }
34630
34657
  });
34631
34658
  });
@@ -34798,8 +34825,12 @@
34798
34825
  if (!this.control.isServerLoad) {
34799
34826
  return;
34800
34827
  }
34801
- // this.scrollContainer = this.dropdown.overlay.querySelector('.cdk-virtual-scroll-viewport');
34802
- this.scrollContainer = this.dropdown.overlay.querySelector('.p-dropdown-items-wrapper');
34828
+ if (this.control.virtualScroll) {
34829
+ this.scrollContainer = this.dropdown.overlay.querySelector('.cdk-virtual-scroll-viewport');
34830
+ }
34831
+ else {
34832
+ this.scrollContainer = this.dropdown.overlay.querySelector('.p-dropdown-items-wrapper');
34833
+ }
34803
34834
  this.scrollContainer.addEventListener('scroll', this.handleScroll);
34804
34835
  var defaultInput = this.dropdown.filterViewChild.nativeElement;
34805
34836
  this._insertTextboxAndFocus(defaultInput);
@@ -34817,7 +34848,12 @@
34817
34848
  if (!this.control.isServerLoad) {
34818
34849
  return;
34819
34850
  }
34820
- this.scrollContainer = this.multiSelect.overlay.querySelector('.p-multiselect-items-wrapper');
34851
+ if (this.control.virtualScroll) {
34852
+ this.scrollContainer = this.multiSelect.overlay.querySelector('.cdk-virtual-scroll-viewport');
34853
+ }
34854
+ else {
34855
+ this.scrollContainer = this.multiSelect.overlay.querySelector('.p-multiselect-items-wrapper');
34856
+ }
34821
34857
  this.scrollContainer.addEventListener('scroll', this.handleScroll);
34822
34858
  var defaultInput = this.multiSelect.filterInputChild.nativeElement;
34823
34859
  this._insertTextboxAndFocus(defaultInput);
@@ -34881,7 +34917,7 @@
34881
34917
  DropdownComponent.decorators = [
34882
34918
  { type: i0.Component, args: [{
34883
34919
  selector: 'dropdown',
34884
- template: "<div #el class=\"tn-dropdown\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\">\r\n <p-dropdown *ngIf=\"!control.multiple\" [options]=\"dataSourceInternal\" [placeholder]=\"control.placeholder\"\r\n [filter]=\"control.filter\" [panelStyleClass]=\"getPanelClass()\" [appendTo]=\"control.appendTo\"\r\n [styleClass]=\"'tn-dropdown'\" [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\"\r\n [disabled]=\"control.disabled ? true : null\" [autoZIndex]=\"true\" [showClear]=\"control.showClear\"\r\n [showTransitionOptions]=\"showTransitionOptions\" [autoDisplayFirst]=\"control.autoDisplayFirst\"\r\n [virtualScroll]=\"virtualScroll\" itemSize=\"30\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [autofocusSelectedItem]=\"autofocusSelectedItem\" [hideTransitionOptions]=\"hideTransitionOptions\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilter\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (onChange)=\"onChangeSelected($event)\"\r\n (onClick)=\"onDropdownClickHandler($event)\" (onShow)=\"onShowHandler($event)\" (onHide)=\"onHideHandler($event)\">\r\n <ng-template *ngIf=\"control.templateSelectedItem\" let-item pTemplate=\"selectedItem\">\r\n <ng-container\r\n *ngTemplateOutlet=\"control.templateSelectedItem; context: {$implicit: item, selectedValue: _value}\">\r\n </ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"control.templateItem\" let-item pTemplate=\"item\">\r\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {$implicit: item}\"></ng-container>\r\n </ng-template>\r\n </p-dropdown>\r\n <p-multiSelect *ngIf=\"control.multiple\" [options]=\"dataSourceInternal\" [filter]=\"control.filter\"\r\n [defaultLabel]=\"control.placeholder\" [placeholder]=\"control.placeholder\" [panelStyleClass]=\"getPanelClass()\"\r\n [appendTo]=\"control.appendTo\" [styleClass]=\"'tn-dropdown'\"\r\n [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\" [disabled]=\"control.disabled ? true : null\"\r\n [autoZIndex]=\"true\" [showTransitionOptions]=\"showTransitionOptions\"\r\n [hideTransitionOptions]=\"hideTransitionOptions\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [selectedItemsLabel]=\"control.selectedItemsLabel\" [maxSelectedLabels]=\"control.maxSelectedLabels\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilterMultiple\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onChange)=\"onChangeSelected($event)\" (onClick)=\"onDropdownClickHandler($event)\"\r\n (onPanelShow)=\"onPanelShowHandler($event)\" (onPanelHide)=\"onHideHandler($event)\">\r\n <ng-template pTemplate=\"selectedItems\" let-value>\r\n <ng-container *ngIf=\"!value || value.length == 0\">{{control.placeholder}}</ng-container>\r\n <ng-container *ngIf=\"value && value.length > 0\">\r\n <span *ngFor=\"let selectedItem of value\" [class]=\"_itemSelectedStyleClass\">\r\n {{selectedItem[control.displayField]}}<span class=\"remove-item\"\r\n (click)=\"removeItem($event, selectedItem)\"><i class=\"fas fa-times\"></i></span>\r\n </span>\r\n </ng-container>\r\n </ng-template>\r\n </p-multiSelect>\r\n <input #inputMask class=\"input-mask hide p-inputtext\" type=\"text\" [disabled]=\"loading\"\r\n [(ngModel)]=\"valueSearchServer\" (keyup)=\"keyUp.next($event)\" />\r\n <button *ngIf=\"control.quickAdd && control.cols\" type=\"button\" pButton icon=\"pi pi-plus\"\r\n class=\"p-button-text p-button-rounded button-quick-add\" pTooltip=\"Th\u00EAm nhanh\" tooltipPosition=\"top\"\r\n (click)=\"showFormQuickAdd()\"></button>\r\n</div>\r\n<tn-dialog *ngIf=\"showQuickAddForm\" #dialog [styleClass]=\"'address-form'\"\r\n [header]=\"'Th\u00EAm m\u1EDBi ' + control.label | translate\" [popupSize]=\"control.popupSize\"\r\n (onHide)=\"showQuickAddForm = false\">\r\n <quick-add-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"formModel\" [control]=\"control\"\r\n [baseService]=\"control.baseService\" (onSaved)=\"handleSaved()\" (onCancel)=\"handleCancel()\">\r\n </quick-add-form>\r\n</tn-dialog>",
34920
+ template: "<div #el class=\"tn-dropdown\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\">\r\n <p-dropdown *ngIf=\"!control.multiple\" [options]=\"dataSourceInternal\" [placeholder]=\"control.placeholder\"\r\n [filter]=\"control.filter\" [panelStyleClass]=\"getPanelClass()\" [appendTo]=\"control.appendTo\"\r\n [styleClass]=\"'tn-dropdown'\" [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\"\r\n [disabled]=\"control.disabled ? true : null\" [autoZIndex]=\"true\" [showClear]=\"control.showClear\"\r\n [showTransitionOptions]=\"showTransitionOptions\" [autoDisplayFirst]=\"control.autoDisplayFirst\"\r\n [virtualScroll]=\"control.virtualScroll\" itemSize=\"30\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [autofocusSelectedItem]=\"autofocusSelectedItem\" [hideTransitionOptions]=\"hideTransitionOptions\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilter\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (onChange)=\"onChangeSelected($event)\"\r\n (onClick)=\"onDropdownClickHandler($event)\" (onShow)=\"onShowHandler($event)\" (onHide)=\"onHideHandler($event)\">\r\n <ng-template *ngIf=\"control.templateSelectedItem\" let-item pTemplate=\"selectedItem\">\r\n <ng-container\r\n *ngTemplateOutlet=\"control.templateSelectedItem; context: {$implicit: item, selectedValue: _value}\">\r\n </ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"control.templateItem\" let-item pTemplate=\"item\">\r\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {$implicit: item}\"></ng-container>\r\n </ng-template>\r\n </p-dropdown>\r\n <p-multiSelect *ngIf=\"control.multiple\" [options]=\"dataSourceInternal\" [filter]=\"control.filter\"\r\n [defaultLabel]=\"control.placeholder\" [placeholder]=\"control.placeholder\" [panelStyleClass]=\"getPanelClass()\"\r\n [appendTo]=\"control.appendTo\" [styleClass]=\"'tn-dropdown'\"\r\n [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\" [disabled]=\"control.disabled ? true : null\"\r\n [autoZIndex]=\"true\" [showTransitionOptions]=\"showTransitionOptions\"\r\n [hideTransitionOptions]=\"hideTransitionOptions\" [virtualScroll]=\"control.virtualScroll\"\r\n [maxItemDisplay]=\"control.maxItemDisplay\" [selectedItemsLabel]=\"control.selectedItemsLabel\"\r\n [maxSelectedLabels]=\"control.maxSelectedLabels\" [modifyOptionsWhenFilter]=\"modifyOptionWhenFilterMultiple\"\r\n [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\" (onChange)=\"onChangeSelected($event)\"\r\n (onClick)=\"onDropdownClickHandler($event)\" (onPanelShow)=\"onPanelShowHandler($event)\"\r\n (onPanelHide)=\"onHideHandler($event)\">\r\n <ng-template pTemplate=\"selectedItems\" let-value>\r\n <ng-container *ngIf=\"!value || value.length == 0\">{{control.placeholder}}</ng-container>\r\n <ng-container *ngIf=\"value && value.length > 0\">\r\n <span *ngFor=\"let selectedItem of value\" [class]=\"_itemSelectedStyleClass\">\r\n {{selectedItem[control.displayField]}}<span class=\"remove-item\"\r\n (click)=\"removeItem($event, selectedItem)\"><i class=\"fas fa-times\"></i></span>\r\n </span>\r\n </ng-container>\r\n </ng-template>\r\n </p-multiSelect>\r\n <input #inputMask class=\"input-mask hide p-inputtext\" type=\"text\" [disabled]=\"loading\"\r\n [(ngModel)]=\"valueSearchServer\" (keyup)=\"keyUp.next($event)\" />\r\n <button *ngIf=\"control.quickAdd && control.cols\" type=\"button\" pButton icon=\"pi pi-plus\"\r\n class=\"p-button-text p-button-rounded button-quick-add\" pTooltip=\"Th\u00EAm nhanh\" tooltipPosition=\"top\"\r\n (click)=\"showFormQuickAdd()\"></button>\r\n</div>\r\n<tn-dialog *ngIf=\"showQuickAddForm\" #dialog [styleClass]=\"'address-form'\"\r\n [header]=\"'Th\u00EAm m\u1EDBi ' + control.label | translate\" [popupSize]=\"control.popupSize\"\r\n (onHide)=\"showQuickAddForm = false\">\r\n <quick-add-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"formModel\" [control]=\"control\"\r\n [baseService]=\"control.baseService\" (onSaved)=\"handleSaved()\" (onCancel)=\"handleCancel()\">\r\n </quick-add-form>\r\n</tn-dialog>",
34885
34921
  providers: [ComponentContextService],
34886
34922
  styles: [".tn-dropdown{display:flex}.tn-dropdown p-dropdown,.tn-dropdown p-multiSelect{flex:1 1;width:100%}.tn-dropdown>.button-quick-add{flex:0 0 auto}.input-mask{background:transparent;border:1px solid transparent;border-radius:3px;box-sizing:border-box;outline:none;padding-left:12px;position:absolute;width:100%;z-index:1}.input-mask.hide{display:none}.input-mask:focus{border-color:#2196f3;box-shadow:0 0 0 .2rem #a6d5fa}.custom-select-item{align-items:center;background:#d2eefb;border:1px solid #a9d8ff;border-radius:3px;display:inline-flex;margin:0 0 0 3px;padding:3px 5px}.custom-select-item>span{color:#555;font-size:12px;margin-left:3px}.custom-select-item>span i{font-size:10px}.custom-select-item.min{margin-left:2px;padding:1px 5px}.custom-select-item:first-child{margin-left:0}::ng-deep .tn-dropdown.ui-state-disabled .custom-select-item{background:#e1e1e1;border-color:#d4d4d4}::ng-deep .tn-dropdown.ui-state-disabled .custom-select-item>span{display:none}::ng-deep .ui-multiselect-filter-container .input-mask{box-sizing:border-box;height:22px;left:1px;padding:.2em;text-indent:1.5em;top:1px;width:calc(100% - 2px)}::ng-deep .ui-multiselect-filter-container .input-mask:focus{left:1px;width:calc(100% - 2px)}"]
34887
34923
  },] }
@@ -46612,7 +46648,9 @@
46612
46648
  this.data = [];
46613
46649
  this.allowViewAll = false;
46614
46650
  this.isDynamicHeight = false;
46651
+ this.useScrollbar = false;
46615
46652
  this.onTabChange = new i0.EventEmitter();
46653
+ this.activeIndexChange = new i0.EventEmitter();
46616
46654
  this.template = {};
46617
46655
  this.onlyIcon = false;
46618
46656
  this.styleClass = 'tn-tabview-beauty';
@@ -46670,6 +46708,7 @@
46670
46708
  };
46671
46709
  TnTabViewComponent.prototype.handleTabChange = function (evt) {
46672
46710
  this.currentTabIndex = evt.index;
46711
+ this.activeIndexChange.emit(this.currentTabIndex);
46673
46712
  this.onTabChange.emit(evt);
46674
46713
  };
46675
46714
  return TnTabViewComponent;
@@ -46677,7 +46716,7 @@
46677
46716
  TnTabViewComponent.decorators = [
46678
46717
  { type: i0.Component, args: [{
46679
46718
  selector: 'tn-tabview',
46680
- template: "<div [style.height]=\"height\">\r\n <p-tabView #tab orientation=\"top\" [styleClass]=\"styleClass\" [activeIndex]=\"currentTabIndex\"\r\n (onChange)=\"handleTabChange($event)\">\r\n <ng-container *ngFor=\"let item of data; let i = index\">\r\n <p-tabPanel *ngIf=\"!item.hidden\" [leftIcon]=\"item.icon\" [header]=\"item.label\"\r\n [headerStyleClass]=\"item.headerStyleClass\">\r\n <ng-container *ngIf=\"allowViewAll || currentTabIndex == i\">\r\n <ng-container *ngTemplateOutlet=\"template[item.code]; context: {$implicit: item}\">\r\n </ng-container>\r\n </ng-container>\r\n </p-tabPanel>\r\n </ng-container>\r\n </p-tabView>\r\n</div>",
46719
+ template: "<div [style.height]=\"height\">\r\n <p-tabView #tab orientation=\"top\" [styleClass]=\"styleClass\" [activeIndex]=\"currentTabIndex\"\r\n (onChange)=\"handleTabChange($event)\">\r\n <ng-container *ngFor=\"let item of data; let i = index\">\r\n <p-tabPanel *ngIf=\"!item.hidden\" [leftIcon]=\"item.icon\" [header]=\"item.label\"\r\n [headerStyleClass]=\"item.headerStyleClass\">\r\n <ng-container *ngIf=\"allowViewAll || currentTabIndex == i\">\r\n <tn-custom-scrollbar *ngIf=\"useScrollbar\">\r\n <ng-container *ngTemplateOutlet=\"template[item.code]; context: {$implicit: item}\">\r\n </ng-container>\r\n </tn-custom-scrollbar>\r\n <ng-container *ngIf=\"!useScrollbar\">\r\n <ng-container *ngTemplateOutlet=\"template[item.code]; context: {$implicit: item}\">\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </p-tabPanel>\r\n </ng-container>\r\n </p-tabView>\r\n</div>",
46681
46720
  styles: [".accordion-link{flex:1 1;text-align:right}.accordion-link ul{list-style:none;margin-bottom:0;margin-top:0;padding-left:0}.accordion-link ul li{background-color:#a4a5a4;border-radius:4px;color:#fff;display:inline-block;line-height:20px;margin-bottom:.5rem;margin-left:.5rem;padding:6px 12px;transition:all .3s ease-out}.accordion-link ul li:hover{background-color:#3db762;cursor:pointer}.accordion-link ul li.tab-active{background-color:#23a349}.tn-l-toolbar{display:flex;padding:.5rem .5rem 0}.hoso-container{height:auto;max-height:none}.tab-number{align-items:center;background:#a4a5a4;border-radius:2px;color:#fff;display:inline-flex;font-size:.9em;height:20px;justify-content:center;margin-right:.5rem;padding-top:2px;width:20px}.tab-number.active{background:#23a349}::ng-deep tn-accordion-tab{display:flex;flex-direction:column;height:100%}::ng-deep tn-accordion-tab .p-accordion-header{position:-webkit-sticky;position:sticky;top:1px;z-index:6}::ng-deep tn-accordion-tab .tn-l-p-accordion-wrapper{border-radius:4px;display:flex;flex:1;margin-left:.5rem;margin-right:.5rem;overflow:auto}::ng-deep tn-accordion-tab .tn-l-p-accordion-wrapper tn-custom-scrollbar{width:100%}::ng-deep tn-accordion-tab .ps__rail-x,::ng-deep tn-accordion-tab .ps__rail-y{z-index:7}::ng-deep tn-accordion-tab .tn-l-toolbar .toolbar{flex:0 0 auto;padding-top:0}@media (max-width:640px){.accordion-link,.toolbar{overflow-x:auto;white-space:nowrap}.tn-l-custom-wrapper{display:block}.accordion-link ul{margin-top:0}.tn-l-toolbar{display:block}}"]
46682
46721
  },] }
46683
46722
  ];
@@ -46691,7 +46730,9 @@
46691
46730
  allowViewAll: [{ type: i0.Input }],
46692
46731
  activeIndex: [{ type: i0.Input }],
46693
46732
  isDynamicHeight: [{ type: i0.Input }],
46694
- onTabChange: [{ type: i0.Output }]
46733
+ useScrollbar: [{ type: i0.Input }],
46734
+ onTabChange: [{ type: i0.Output }],
46735
+ activeIndexChange: [{ type: i0.Output }]
46695
46736
  };
46696
46737
 
46697
46738
  var TnTinymceComponent = /** @class */ (function (_super) {
@@ -49783,42 +49824,79 @@
49783
49824
  if (control instanceof FileManagerComponent) {
49784
49825
  this._fileManagerControls.push(control);
49785
49826
  }
49827
+ if (control instanceof ServiceFileUploadComponent) {
49828
+ this._fileUploadControls.push(control);
49829
+ }
49786
49830
  };
49787
49831
  FileDataService.prototype.unregister = function (control) {
49788
- if (!this._fileManagerControls || !this._fileManagerControls.length || !control) {
49789
- return;
49832
+ if (control instanceof FileManagerComponent) {
49833
+ if (!this._fileManagerControls || !this._fileManagerControls.length || !control) {
49834
+ return;
49835
+ }
49836
+ var index = this._fileManagerControls.findIndex(function (i) { return i.serviceCode == control.serviceCode
49837
+ && i.entity == control.entity
49838
+ && i.entityKey == control.entityKey; });
49839
+ if (index != -1) {
49840
+ this._fileManagerControls.splice(index, 1);
49841
+ }
49790
49842
  }
49791
- var index = this._fileManagerControls.findIndex(function (i) { return i.serviceCode == control.serviceCode
49792
- && i.entity == control.entity
49793
- && i.entityKey == control.entityKey; });
49794
- if (index != -1) {
49795
- this._fileManagerControls.splice(index, 1);
49843
+ else if (control instanceof ServiceFileUploadComponent) {
49844
+ if (!this._fileUploadControls || !this._fileUploadControls.length || !control) {
49845
+ return;
49846
+ }
49847
+ var controlIndex = this._fileUploadControls.findIndex(function (x) { return x.serviceCode == control.serviceCode
49848
+ && x.entity == control.entity && x.entityKey == control.entityKey; });
49849
+ if (controlIndex != -1) {
49850
+ this._fileUploadControls.splice(controlIndex, 1);
49851
+ }
49796
49852
  }
49797
49853
  };
49798
49854
  FileDataService.prototype.getData = function () {
49855
+ var e_1, _a;
49799
49856
  var _this = this;
49800
- if (!this._fileManagerControls.length)
49801
- return;
49802
- var dataPosts = [];
49803
- this._fileManagerControls.forEach(function (control) {
49804
- dataPosts.push({
49805
- serviceCode: control.serviceCode,
49806
- entity: control.entity,
49807
- entityKey: control._entityKey
49857
+ if (this._fileManagerControls.length > 0) {
49858
+ var dataPosts_1 = [];
49859
+ this._fileManagerControls.forEach(function (control) {
49860
+ dataPosts_1.push({
49861
+ serviceCode: control.serviceCode,
49862
+ entity: control.entity,
49863
+ entityKey: control._entityKey
49864
+ });
49808
49865
  });
49809
- });
49810
- this._folderService.getSimpleDataByEntityKeys(dataPosts)
49811
- .then(function (res) { return _this._crudService.handleResponse(res, '', function (f) {
49812
- var dataFile = _this.processDatasourceFile(res.data);
49813
- var key = '';
49814
- _this._fileManagerControls.forEach(function (control) {
49815
- key = control.serviceCode + "/" + control.entity + "/" + control._entityKey;
49816
- if (dataFile[key]) {
49817
- control.setRootFolderId(dataFile[key].folderId);
49818
- control.setDatasource(dataFile[key].lstFile);
49866
+ this._folderService.getSimpleDataByEntityKeys(dataPosts_1)
49867
+ .then(function (res) { return _this._crudService.handleResponse(res, '', function (f) {
49868
+ var dataFile = _this.processDatasourceFile(res.data);
49869
+ var key = '';
49870
+ _this._fileManagerControls.forEach(function (control) {
49871
+ key = control.serviceCode + "/" + control.entity + "/" + control._entityKey;
49872
+ if (dataFile[key]) {
49873
+ control.setRootFolderId(dataFile[key].folderId);
49874
+ control.setDatasource(dataFile[key].lstFile);
49875
+ }
49876
+ });
49877
+ }); });
49878
+ }
49879
+ else if (this._fileUploadControls.length > 0) {
49880
+ var fileData = [];
49881
+ try {
49882
+ for (var _b = __values(this._fileUploadControls), _c = _b.next(); !_c.done; _c = _b.next()) {
49883
+ var control = _c.value;
49884
+ fileData.push({
49885
+ serviceCode: control.serviceCode,
49886
+ entity: control.entity,
49887
+ entityKey: control.entityKey,
49888
+ });
49819
49889
  }
49820
- });
49821
- }); });
49890
+ }
49891
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
49892
+ finally {
49893
+ try {
49894
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
49895
+ }
49896
+ finally { if (e_1) throw e_1.error; }
49897
+ }
49898
+ // this._fileService.getfile;
49899
+ }
49822
49900
  };
49823
49901
  FileDataService.prototype.processDatasourceFile = function (fileData) {
49824
49902
  var _this = this;
@@ -55944,6 +56022,59 @@
55944
56022
  return StartupBusinessComponentBase;
55945
56023
  }(ComponentBase));
55946
56024
 
56025
+ var FileUploadSetting = /** @class */ (function () {
56026
+ function FileUploadSetting(init) {
56027
+ this.entityKeyField = 'id';
56028
+ this.readonly = true;
56029
+ this.sharedFolderType = exports.SharedFolderType.Tempt;
56030
+ this.mode = exports.FileUploadMode.usingServiceFile;
56031
+ this.control = new FileUploadControlSchema();
56032
+ this.control = new FileUploadControlSchema({
56033
+ serviceCode: this.serviceCode,
56034
+ entity: this.entity,
56035
+ entityKeyField: this.entityKeyField,
56036
+ readonly: this.readonly,
56037
+ accept: this.accept,
56038
+ mode: this.mode,
56039
+ sharedFolderType: this.sharedFolderType
56040
+ });
56041
+ for (var key in init) {
56042
+ this.control[key] = init[key];
56043
+ }
56044
+ }
56045
+ return FileUploadSetting;
56046
+ }());
56047
+ var FileManagerSetting = /** @class */ (function () {
56048
+ function FileManagerSetting(init) {
56049
+ this.mode = exports.FileManagerMode.multiple;
56050
+ this.layout = exports.EnumFileLayout.INLINE;
56051
+ this.readonly = true;
56052
+ this.inTaiLieu = false;
56053
+ this.inTaiLieuChung = false;
56054
+ this.copyToFolderId = '';
56055
+ this.entityKeyField = 'id';
56056
+ this.control = new FileManagerControlSchema();
56057
+ this.control = new FileManagerControlSchema({
56058
+ serviceCode: this.serviceCode,
56059
+ entity: this.entity,
56060
+ entityKeyField: this.entityKeyField,
56061
+ readonly: this.readonly,
56062
+ accept: this.accept,
56063
+ mode: this.mode,
56064
+ layout: this.layout,
56065
+ fileDataService: this.fileDataService,
56066
+ rootFolderName: this.rootFolderName,
56067
+ inTaiLieu: this.inTaiLieu,
56068
+ inTaiLieuChung: this.inTaiLieuChung,
56069
+ copyToFolderId: this.copyToFolderId,
56070
+ });
56071
+ for (var key in init) {
56072
+ this.control[key] = init[key];
56073
+ }
56074
+ }
56075
+ return FileManagerSetting;
56076
+ }());
56077
+
55947
56078
  var TnComponentConfig = /** @class */ (function () {
55948
56079
  function TnComponentConfig(_moduleConfig) {
55949
56080
  this._moduleConfig = _moduleConfig;
@@ -57400,10 +57531,12 @@
57400
57531
  exports.FileExplorerService = FileExplorerService;
57401
57532
  exports.FileManagerComponent = FileManagerComponent;
57402
57533
  exports.FileManagerControlSchema = FileManagerControlSchema;
57534
+ exports.FileManagerSetting = FileManagerSetting;
57403
57535
  exports.FileObjectService = FileObjectService;
57404
57536
  exports.FilePickerDialogComponent = FilePickerDialogComponent;
57405
57537
  exports.FileUploadComponent = FileUploadComponent;
57406
57538
  exports.FileUploadControlSchema = FileUploadControlSchema;
57539
+ exports.FileUploadSetting = FileUploadSetting;
57407
57540
  exports.FileV4Service = FileV4Service;
57408
57541
  exports.Filter = Filter;
57409
57542
  exports.FolderService = FolderService;