tnx-shared 5.3.428 → 5.3.430

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 (32) hide show
  1. package/bundles/tnx-shared.umd.js +434 -256
  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/base/component-base-with-button.d.ts +2 -0
  6. package/classes/base/component-base-with-button.d.ts.map +1 -1
  7. package/classes/base/data-form-base.d.ts +32 -0
  8. package/classes/base/data-form-base.d.ts.map +1 -1
  9. package/classes/base/list-component-base.d.ts.map +1 -1
  10. package/classes/form-schema.d.ts +2 -0
  11. package/classes/form-schema.d.ts.map +1 -1
  12. package/components/crud/crud-form/crud-form.component.d.ts +1 -1
  13. package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
  14. package/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.d.ts +8 -0
  15. package/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.d.ts.map +1 -1
  16. package/components/file-upload/file-upload.component.d.ts.map +1 -1
  17. package/components/service-file-upload/service-file-upload.component.d.ts.map +1 -1
  18. package/components/user-picker/user-picker-box/user-picker-box.component.d.ts.map +1 -1
  19. package/esm2015/classes/base/component-base-with-button.js +6 -1
  20. package/esm2015/classes/base/data-form-base.js +150 -20
  21. package/esm2015/classes/base/list-component-base.js +2 -1
  22. package/esm2015/classes/form-schema.js +1 -1
  23. package/esm2015/components/crud/crud-form/crud-form.component.js +1 -1
  24. package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.js +35 -5
  25. package/esm2015/components/file-upload/file-upload.component.js +1 -2
  26. package/esm2015/components/service-file-upload/service-file-upload.component.js +1 -2
  27. package/esm2015/components/tn-dialog/tn-dialog.component.js +2 -2
  28. package/esm2015/components/user-picker/user-picker-box/user-picker-box.component.js +4 -1
  29. package/fesm2015/tnx-shared.js +349 -183
  30. package/fesm2015/tnx-shared.js.map +1 -1
  31. package/package.json +2 -2
  32. package/tnx-shared.metadata.json +1 -1
@@ -9651,6 +9651,11 @@ ComponentBase.propDecorators = {
9651
9651
  class ComponentBaseWithButton extends ComponentBase {
9652
9652
  constructor(_injector) {
9653
9653
  super(_injector);
9654
+ // Danh sách nút hành động quy trình. Được render TỰ ĐỘNG ở footer của tn-dialog,
9655
+ // nên form không cần tự khai báo *ngFor trong #buttonTemplate.
9656
+ this.buttons = [];
9657
+ // Tiền tố nhãn cho các nút quy trình tự động (vd 'Lưu và'); để rỗng nếu không cần.
9658
+ this.workflowButtonLabelPrefix = 'Lưu và ';
9654
9659
  }
9655
9660
  }
9656
9661
  ComponentBaseWithButton.decorators = [
@@ -15941,6 +15946,164 @@ EntityMetadataService.ctorParameters = () => [
15941
15946
  { type: StorageUpdatedService }
15942
15947
  ];
15943
15948
 
15949
+ class WorkflowPermissionDetailService extends BaseService {
15950
+ constructor(http, injector, _moduleConfigService) {
15951
+ super(http, injector, `${_moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint}/${_moduleConfigService.getConfig().environment.apiVersion}/WorkflowPermissionDetail`);
15952
+ this.serviceManagers = {};
15953
+ this.entityName = 'WorkflowPermissionDetail';
15954
+ this.tableName = '';
15955
+ this.guidEmpty = '00000000-0000-0000-0000-000000000000';
15956
+ this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
15957
+ this._moduleConfig = _moduleConfigService.getConfig();
15958
+ }
15959
+ registerService(settingKey, service) {
15960
+ this.serviceManagers[settingKey] = service;
15961
+ }
15962
+ getEndpointByService(service) {
15963
+ return `${service.endPoint}/${this._moduleConfig.environment.apiVersion}`;
15964
+ }
15965
+ changeEndpoint(baseService) {
15966
+ this.serviceUri = `${this.getEndpointByService(baseService)}/WorkflowPermissionDetail`;
15967
+ this.tableName = baseService.entityName;
15968
+ return this;
15969
+ }
15970
+ appendInfoForWorkflowSingle(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
15971
+ return __awaiter(this, void 0, void 0, function* () {
15972
+ if (callBackWhenNotHaveStatus == null) {
15973
+ callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
15974
+ if (rowItem[fieldKey]
15975
+ && rowItem.workflowCode
15976
+ && rowItem.currentStateCode) {
15977
+ itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
15978
+ itemStatus.trangThai = rowItem.currentStateCode;
15979
+ itemStatus.workflowCode = rowItem.workflowCode;
15980
+ itemStatus.permission = PermissionBase.READ;
15981
+ }
15982
+ };
15983
+ }
15984
+ const itemId = data[fieldKey];
15985
+ const filters = [
15986
+ this.newFilter('itemId', Operator.equal, itemId),
15987
+ this.newFilter('notInWorkflow', Operator.equal, false),
15988
+ ];
15989
+ const sorts = [];
15990
+ if (!ignoreWorkflow) {
15991
+ filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
15992
+ }
15993
+ else {
15994
+ sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
15995
+ }
15996
+ const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
15997
+ if (dataStatus == null) {
15998
+ const notifierService = this._injector.get(NotifierService);
15999
+ return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
16000
+ }
16001
+ this.appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
16002
+ return true;
16003
+ });
16004
+ }
16005
+ appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus = null) {
16006
+ let itemStatus = {
16007
+ textTrangThai: 'Chưa chạy quy trình'
16008
+ };
16009
+ if (itemId) {
16010
+ // const lstItemStatus = dataStatus.filter(q => q.itemId == itemId && q.userId == userIdCurrent);
16011
+ // if (ignoreWorkflow === true && lstItemStatus.length === 0) {
16012
+ // lstItemStatus.push(...dataStatus.filter(q => q.itemId === itemId));
16013
+ // }
16014
+ const lstItemStatus = dataStatus.filter(q => q.itemId === itemId);
16015
+ // let itemStatus = null;
16016
+ if (lstItemStatus.length) {
16017
+ itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
16018
+ if (itemStatus == null) {
16019
+ itemStatus = lstItemStatus[0];
16020
+ }
16021
+ }
16022
+ }
16023
+ // Nếu không có bản ghi trạng thái
16024
+ // Nhưng đã tạo task rồi thì hiển thị trạng thái "đã tạo công việc" để tránh trường hợp hiển thị nút bắt đầu thừa trên giao diện
16025
+ if (!itemStatus.trangThai) {
16026
+ callBackWhenNotHaveStatus(itemStatus, data);
16027
+ }
16028
+ data.__isCoEdit = dataStatus.some(x => x.itemId === itemId && x.userId != this.guidEmpty && x.isCOEdit);
16029
+ data.__trangThai = itemStatus.trangThai;
16030
+ data.__textTrangThai = itemStatus.textTrangThai;
16031
+ if (itemStatus.workflowCode == DummyWorkflowCode) {
16032
+ data.hiddenWorkflowAction = true;
16033
+ }
16034
+ data.__workflowCode = itemStatus.workflowCode;
16035
+ data.__permission = itemStatus.permission;
16036
+ data.__disableEdit = true;
16037
+ data.__disableDelete = true;
16038
+ if (data.basePermission & PermissionBase.EDIT
16039
+ || data.__permission & PermissionBase.EDIT) {
16040
+ data.__disableEdit = false;
16041
+ }
16042
+ else {
16043
+ data.__disablePermissionEdit = true;
16044
+ }
16045
+ if (data.basePermission & PermissionBase.DELETE
16046
+ || data.__permission & PermissionBase.DELETE) {
16047
+ data.__disableDelete = false;
16048
+ }
16049
+ else {
16050
+ data.__disablePermissionDelete = true;
16051
+ }
16052
+ }
16053
+ /**
16054
+ * Lấy thêm các thông tin cần cho quy trình nghiệp vụ cho các bản ghi trong data
16055
+ */
16056
+ appendInfoForWorkflow(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
16057
+ return __awaiter(this, void 0, void 0, function* () {
16058
+ if (callBackWhenNotHaveStatus == null) {
16059
+ callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
16060
+ if (rowItem[fieldKey]
16061
+ && rowItem.workflowCode
16062
+ && rowItem.currentStateCode) {
16063
+ itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
16064
+ itemStatus.trangThai = rowItem.currentStateCode;
16065
+ itemStatus.workflowCode = rowItem.workflowCode;
16066
+ itemStatus.permission = PermissionBase.READ;
16067
+ }
16068
+ };
16069
+ }
16070
+ const lstItemId = data.filter(q => q[fieldKey]).map(q => q[fieldKey]);
16071
+ let filters = [
16072
+ this.newFilter('itemId', Operator.in, lstItemId),
16073
+ this.newFilter('notInWorkflow', Operator.equal, false),
16074
+ ];
16075
+ if (this.tableName) {
16076
+ filters.push(this.newFilter('tableName', Operator.equal, this.tableName));
16077
+ }
16078
+ const sorts = [];
16079
+ // if (!ignoreWorkflow) {
16080
+ // filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
16081
+ // }
16082
+ sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
16083
+ const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
16084
+ if (dataStatus == null) {
16085
+ const notifierService = this._injector.get(NotifierService);
16086
+ return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
16087
+ }
16088
+ data.forEach(rowItem => {
16089
+ this.appendWorkflowInfoToItem(rowItem, rowItem[fieldKey], userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
16090
+ });
16091
+ return true;
16092
+ });
16093
+ }
16094
+ }
16095
+ WorkflowPermissionDetailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function WorkflowPermissionDetailService_Factory() { return new WorkflowPermissionDetailService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService)); }, token: WorkflowPermissionDetailService, providedIn: "root" });
16096
+ WorkflowPermissionDetailService.decorators = [
16097
+ { type: Injectable, args: [{
16098
+ providedIn: 'root'
16099
+ },] }
16100
+ ];
16101
+ WorkflowPermissionDetailService.ctorParameters = () => [
16102
+ { type: HttpClient },
16103
+ { type: Injector },
16104
+ { type: ModuleConfigService }
16105
+ ];
16106
+
15944
16107
  class DataFormBase extends ComponentBaseWithButton {
15945
16108
  constructor(_injector) {
15946
16109
  super(_injector);
@@ -15964,6 +16127,8 @@ class DataFormBase extends ComponentBaseWithButton {
15964
16127
  this.autoGetDetail = true;
15965
16128
  this.autoSave = true;
15966
16129
  this.isCloseForm = true;
16130
+ // Khi lưu bằng workflow action: tạm chặn đóng form lúc lưu, chỉ đóng sau khi action chạy xong
16131
+ this._suppressOnSaved = false;
15967
16132
  this.saving = false;
15968
16133
  this.getDetailPlusUrl = null;
15969
16134
  this.insertPlusUrl = null;
@@ -15988,6 +16153,7 @@ class DataFormBase extends ComponentBaseWithButton {
15988
16153
  this._entityMetadataService = this._injector.get(EntityMetadataService);
15989
16154
  this._userService = this._injector.get(UserService);
15990
16155
  this._commonService = this._injector.get(CommonService);
16156
+ this._workflowPermissionDetailService = this._injector.get(WorkflowPermissionDetailService);
15991
16157
  }
15992
16158
  ngOnInit() {
15993
16159
  // this.checkPermission(this.model.data.basePermission);
@@ -16102,6 +16268,110 @@ class DataFormBase extends ComponentBaseWithButton {
16102
16268
  evt.rootModel[FieldWorkflowCodeInCrudForm] = workflowSetting.workflowCode;
16103
16269
  }
16104
16270
  }
16271
+ /**
16272
+ * Lấy trạng thái quy trình hiện tại của bản ghi, gắn các field __trangThai/__textTrangThai/__workflowCode/__permission
16273
+ * vào data và sinh danh sách nút hành động quy trình (this.buttons) khi bản ghi đã chạy quy trình.
16274
+ * Yêu cầu: this.setting.baseService đã được cấu hình và this.crudList được truyền từ crud-list cha.
16275
+ */
16276
+ generateWorkflowButton(data) {
16277
+ return __awaiter(this, void 0, void 0, function* () {
16278
+ // Lấy ra trạng thái quy trình
16279
+ const lstItemStatus = (yield this._workflowPermissionDetailService.changeEndpoint(this.setting.baseService).getAll([
16280
+ this.newFilter('itemId', Operator.equal, data.id),
16281
+ ], 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', [], 'ForCrudList')).data;
16282
+ if (lstItemStatus == null) {
16283
+ return this._notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
16284
+ }
16285
+ let itemStatus = null;
16286
+ if (!lstItemStatus.length) {
16287
+ itemStatus = {
16288
+ textTrangThai: 'Chưa chạy quy trình'
16289
+ };
16290
+ }
16291
+ else {
16292
+ data.startedWorkflow = true;
16293
+ itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
16294
+ if (itemStatus == null) {
16295
+ itemStatus = lstItemStatus[0];
16296
+ }
16297
+ }
16298
+ data.__trangThai = itemStatus.trangThai;
16299
+ data.__textTrangThai = itemStatus.textTrangThai;
16300
+ data.__workflowCode = itemStatus.workflowCode;
16301
+ data.__permission = itemStatus.permission;
16302
+ if (data.startedWorkflow && this.crudList) {
16303
+ const actions = yield this.crudList.getActionWorkflow(data);
16304
+ if (!Array.isArray(actions))
16305
+ return;
16306
+ // Chỉ bọc các action lấy từ getActionAllow; các nút phụ (Thu hồi, Cho ý kiến,
16307
+ // Xem lịch sử, Chuyển xử lý) giữ nguyên hành vi gốc
16308
+ actions.filter(b => b.isActionAllow).forEach(b => this._decorateWorkflowActionButton(b));
16309
+ this.buttons = actions;
16310
+ }
16311
+ });
16312
+ }
16313
+ /**
16314
+ * Gắn hành vi cho 1 nút action quy trình (lấy từ getActionAllow):
16315
+ * - Khi form đang sửa: thêm tiền tố nhãn; nếu dữ liệu thay đổi thì lưu trước (không đóng form), lưu lỗi thì dừng.
16316
+ * - Chạy action gốc, và đóng form sau khi action thực sự hoàn tất.
16317
+ */
16318
+ _decorateWorkflowActionButton(button) {
16319
+ const isEdit = this._isFormEdit();
16320
+ const runAction = button.command;
16321
+ if (isEdit) {
16322
+ button.label = this.workflowButtonLabelPrefix + button.label;
16323
+ }
16324
+ button.command = () => __awaiter(this, void 0, void 0, function* () {
16325
+ if (this.model.submitting)
16326
+ return;
16327
+ if (isEdit && this._isWorkflowDataChanged()) {
16328
+ this.model.submitting = true;
16329
+ this._suppressOnSaved = true; // không đóng form khi lưu
16330
+ const saved = yield this.save();
16331
+ this._suppressOnSaved = false;
16332
+ if (!saved)
16333
+ return;
16334
+ }
16335
+ if (!runAction)
16336
+ return;
16337
+ this._closeFormWhenWorkflowProcessed();
16338
+ yield runAction();
16339
+ });
16340
+ }
16341
+ /**
16342
+ * Đóng form (phát onSaved) đúng một lần khi crudList báo action quy trình đã xử lý xong.
16343
+ */
16344
+ _closeFormWhenWorkflowProcessed() {
16345
+ var _a;
16346
+ const processed = (_a = this.crudList) === null || _a === void 0 ? void 0 : _a.onProcessedWorkflow;
16347
+ if (!processed)
16348
+ return;
16349
+ const sub = processed.subscribe(() => {
16350
+ sub.unsubscribe();
16351
+ this.onSaved.emit({ id: this.model.data.id, insert: false, isCloseForm: true });
16352
+ });
16353
+ }
16354
+ /**
16355
+ * So sánh dữ liệu hiện tại với snapshot lúc tải (logSetting.valueBeforeUpdate) để biết form có thay đổi không.
16356
+ * Chuẩn hoá cả 2 qua crudForm.getMinimizeData (bỏ _status/_errors/_source, resolve dropdown object về giá trị thô)
16357
+ * để so sánh ổn định. Nếu không có snapshot thì coi như có thay đổi (luôn lưu) cho an toàn.
16358
+ */
16359
+ /**
16360
+ * Form có tham gia quy trình hay không (dựa trên cấu hình parentSetting) - cùng điều kiện với biến hasWorkflow trong addSchemaBase.
16361
+ */
16362
+ _hasWorkflow() {
16363
+ var _a;
16364
+ return !!(this.parentSetting
16365
+ && ((this.parentSetting.workflowSettingNew && ((_a = this.parentSetting.workflowSettingNew.workflows) === null || _a === void 0 ? void 0 : _a.length) > 0)
16366
+ || this.parentSetting.isWorkflowTree));
16367
+ }
16368
+ _isWorkflowDataChanged() {
16369
+ if (!this.logSetting.valueBeforeUpdate || !this.crudForm)
16370
+ return true;
16371
+ const current = JSON.stringify(this.crudForm.getMinimizeData(this.model.data));
16372
+ const before = JSON.stringify(this.crudForm.getMinimizeData(this.logSetting.valueBeforeUpdate));
16373
+ return current !== before;
16374
+ }
16105
16375
  _handleFormReady(formEvent) {
16106
16376
  return __awaiter(this, void 0, void 0, function* () {
16107
16377
  yield this.__handleFormReady(formEvent);
@@ -16163,7 +16433,9 @@ class DataFormBase extends ComponentBaseWithButton {
16163
16433
  }
16164
16434
  yield this._processAfterGetData(response.data);
16165
16435
  yield this.onAfterGetDetail(response.data);
16166
- if (this.logSetting.isEnableLog) {
16436
+ // Lưu snapshot dữ liệu trước khi sửa khi: bật log HOẶC form có quy trình
16437
+ // (để so sánh thay đổi, quyết định có cần lưu trước khi chạy action quy trình hay không)
16438
+ if (this.logSetting.isEnableLog || this._hasWorkflow()) {
16167
16439
  this.logSetting.valueBeforeUpdate = this._commonService.cloneObject(response.data);
16168
16440
  }
16169
16441
  }
@@ -16274,6 +16546,11 @@ class DataFormBase extends ComponentBaseWithButton {
16274
16546
  if (this.logSetting.isEnableLog) {
16275
16547
  this.getLogValueAfterLoadDetail();
16276
16548
  }
16549
+ // Sinh nút hành động quy trình tập trung: form chỉ cần được truyền [crudList] và có cấu hình workflow,
16550
+ // không cần tự gọi generateWorkflowButton trong modifyDetailData.
16551
+ if (this._hasWorkflow() && this.crudList) {
16552
+ yield this.generateWorkflowButton(data);
16553
+ }
16277
16554
  });
16278
16555
  }
16279
16556
  getLogValueAfterLoadDetail() {
@@ -16582,21 +16859,24 @@ class DataFormBase extends ComponentBaseWithButton {
16582
16859
  this.triggerSaveFileUpload();
16583
16860
  if (this.autoSave) {
16584
16861
  if (this._isFormEdit() || this._isFormView()) {
16585
- yield this.onUpdate();
16862
+ return yield this.onUpdate();
16586
16863
  }
16587
16864
  else if (this._isFormAddNew()) {
16588
- yield this.onInsert();
16865
+ return yield this.onInsert();
16589
16866
  }
16590
16867
  else {
16591
16868
  // form view, do nothing
16869
+ return false;
16592
16870
  }
16593
16871
  }
16594
16872
  else {
16595
16873
  this.handleManualSave();
16874
+ return true;
16596
16875
  }
16597
16876
  }
16598
16877
  else {
16599
16878
  this.model.submitting = false;
16879
+ return false;
16600
16880
  }
16601
16881
  });
16602
16882
  }
@@ -16668,8 +16948,8 @@ class DataFormBase extends ComponentBaseWithButton {
16668
16948
  }
16669
16949
  const confirmed = yield this.createConfirmIfRequire();
16670
16950
  if (!confirmed)
16671
- return;
16672
- yield this._insert();
16951
+ return false;
16952
+ return yield this._insert();
16673
16953
  });
16674
16954
  }
16675
16955
  createConfirmIfRequire() {
@@ -16691,29 +16971,34 @@ class DataFormBase extends ComponentBaseWithButton {
16691
16971
  }
16692
16972
  _insert() {
16693
16973
  return __awaiter(this, void 0, void 0, function* () {
16694
- this.getPromiseActionInsert()
16974
+ return this.getPromiseActionInsert()
16695
16975
  .then((response) => __awaiter(this, void 0, void 0, function* () {
16696
16976
  this.model.submitting = false;
16697
16977
  this.showMessageAfterInsert(response.success, response);
16698
16978
  if (response.success) {
16699
16979
  this.model.data.id = response.data;
16700
16980
  yield this.onAfterSave(response);
16701
- this.onSaved.emit({
16702
- id: this.model.data.id,
16703
- insert: true,
16704
- isCloseForm: this.isCloseForm
16705
- });
16981
+ if (!this._suppressOnSaved) {
16982
+ this.onSaved.emit({
16983
+ id: this.model.data.id,
16984
+ insert: true,
16985
+ isCloseForm: this.isCloseForm
16986
+ });
16987
+ }
16988
+ return true;
16706
16989
  }
16707
16990
  else {
16708
16991
  this.handleInsertError(response);
16992
+ return false;
16709
16993
  }
16710
16994
  }), error => {
16711
16995
  if (!error.error.success && error.error.errorCheckExist) {
16712
16996
  this.model.submitting = false;
16713
- return;
16997
+ return false;
16714
16998
  }
16715
16999
  this.model.submitting = false;
16716
17000
  this.showMessageAfterInsert(false, error);
17001
+ return false;
16717
17002
  });
16718
17003
  });
16719
17004
  }
@@ -16725,32 +17010,38 @@ class DataFormBase extends ComponentBaseWithButton {
16725
17010
  onUpdate() {
16726
17011
  return __awaiter(this, void 0, void 0, function* () {
16727
17012
  this.setDefaultValue(this.model.data);
16728
- this.getPromiseActionUpdate()
17013
+ const updatePromise = this.getPromiseActionUpdate()
16729
17014
  .then((response) => __awaiter(this, void 0, void 0, function* () {
16730
17015
  this.model.submitting = false;
16731
17016
  this.showMessageAfterUpdate(response.success, response);
16732
17017
  if (response.success) {
16733
17018
  yield this.onAfterSave(response);
16734
- this.onSaved.emit({
16735
- id: this.model.data.id,
16736
- insert: false,
16737
- isCloseForm: this.isCloseForm
16738
- });
17019
+ if (!this._suppressOnSaved) {
17020
+ this.onSaved.emit({
17021
+ id: this.model.data.id,
17022
+ insert: false,
17023
+ isCloseForm: this.isCloseForm
17024
+ });
17025
+ }
17026
+ return true;
16739
17027
  }
16740
17028
  else {
16741
17029
  this.handleUpdateError(response);
17030
+ return false;
16742
17031
  }
16743
17032
  }), error => {
16744
17033
  if (!error.error.success && error.error.errorCheckExist) {
16745
17034
  this.model.submitting = false;
16746
- return;
17035
+ return false;
16747
17036
  }
16748
17037
  this.model.submitting = false;
16749
17038
  this.showMessageAfterUpdate(false, error);
17039
+ return false;
16750
17040
  });
16751
17041
  if (this.logSetting.isEnableLog) {
16752
17042
  this.logSetting.arrValueAfterUpdate = [];
16753
17043
  }
17044
+ return updatePromise;
16754
17045
  });
16755
17046
  }
16756
17047
  handleUpdateError(response) {
@@ -16861,6 +17152,7 @@ DataFormBase.propDecorators = {
16861
17152
  parentSetting: [{ type: Input }],
16862
17153
  model: [{ type: Input }],
16863
17154
  forceOnlyView: [{ type: Input }],
17155
+ crudList: [{ type: Input }],
16864
17156
  onSave: [{ type: Output }],
16865
17157
  onSaved: [{ type: Output }],
16866
17158
  onCancel: [{ type: Output }],
@@ -18964,164 +19256,6 @@ WorkflowHistoryService.ctorParameters = () => [
18964
19256
  { type: ModuleConfigService }
18965
19257
  ];
18966
19258
 
18967
- class WorkflowPermissionDetailService extends BaseService {
18968
- constructor(http, injector, _moduleConfigService) {
18969
- super(http, injector, `${_moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint}/${_moduleConfigService.getConfig().environment.apiVersion}/WorkflowPermissionDetail`);
18970
- this.serviceManagers = {};
18971
- this.entityName = 'WorkflowPermissionDetail';
18972
- this.tableName = '';
18973
- this.guidEmpty = '00000000-0000-0000-0000-000000000000';
18974
- this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
18975
- this._moduleConfig = _moduleConfigService.getConfig();
18976
- }
18977
- registerService(settingKey, service) {
18978
- this.serviceManagers[settingKey] = service;
18979
- }
18980
- getEndpointByService(service) {
18981
- return `${service.endPoint}/${this._moduleConfig.environment.apiVersion}`;
18982
- }
18983
- changeEndpoint(baseService) {
18984
- this.serviceUri = `${this.getEndpointByService(baseService)}/WorkflowPermissionDetail`;
18985
- this.tableName = baseService.entityName;
18986
- return this;
18987
- }
18988
- appendInfoForWorkflowSingle(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
18989
- return __awaiter(this, void 0, void 0, function* () {
18990
- if (callBackWhenNotHaveStatus == null) {
18991
- callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
18992
- if (rowItem[fieldKey]
18993
- && rowItem.workflowCode
18994
- && rowItem.currentStateCode) {
18995
- itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
18996
- itemStatus.trangThai = rowItem.currentStateCode;
18997
- itemStatus.workflowCode = rowItem.workflowCode;
18998
- itemStatus.permission = PermissionBase.READ;
18999
- }
19000
- };
19001
- }
19002
- const itemId = data[fieldKey];
19003
- const filters = [
19004
- this.newFilter('itemId', Operator.equal, itemId),
19005
- this.newFilter('notInWorkflow', Operator.equal, false),
19006
- ];
19007
- const sorts = [];
19008
- if (!ignoreWorkflow) {
19009
- filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
19010
- }
19011
- else {
19012
- sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
19013
- }
19014
- const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
19015
- if (dataStatus == null) {
19016
- const notifierService = this._injector.get(NotifierService);
19017
- return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
19018
- }
19019
- this.appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
19020
- return true;
19021
- });
19022
- }
19023
- appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus = null) {
19024
- let itemStatus = {
19025
- textTrangThai: 'Chưa chạy quy trình'
19026
- };
19027
- if (itemId) {
19028
- // const lstItemStatus = dataStatus.filter(q => q.itemId == itemId && q.userId == userIdCurrent);
19029
- // if (ignoreWorkflow === true && lstItemStatus.length === 0) {
19030
- // lstItemStatus.push(...dataStatus.filter(q => q.itemId === itemId));
19031
- // }
19032
- const lstItemStatus = dataStatus.filter(q => q.itemId === itemId);
19033
- // let itemStatus = null;
19034
- if (lstItemStatus.length) {
19035
- itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
19036
- if (itemStatus == null) {
19037
- itemStatus = lstItemStatus[0];
19038
- }
19039
- }
19040
- }
19041
- // Nếu không có bản ghi trạng thái
19042
- // Nhưng đã tạo task rồi thì hiển thị trạng thái "đã tạo công việc" để tránh trường hợp hiển thị nút bắt đầu thừa trên giao diện
19043
- if (!itemStatus.trangThai) {
19044
- callBackWhenNotHaveStatus(itemStatus, data);
19045
- }
19046
- data.__isCoEdit = dataStatus.some(x => x.itemId === itemId && x.userId != this.guidEmpty && x.isCOEdit);
19047
- data.__trangThai = itemStatus.trangThai;
19048
- data.__textTrangThai = itemStatus.textTrangThai;
19049
- if (itemStatus.workflowCode == DummyWorkflowCode) {
19050
- data.hiddenWorkflowAction = true;
19051
- }
19052
- data.__workflowCode = itemStatus.workflowCode;
19053
- data.__permission = itemStatus.permission;
19054
- data.__disableEdit = true;
19055
- data.__disableDelete = true;
19056
- if (data.basePermission & PermissionBase.EDIT
19057
- || data.__permission & PermissionBase.EDIT) {
19058
- data.__disableEdit = false;
19059
- }
19060
- else {
19061
- data.__disablePermissionEdit = true;
19062
- }
19063
- if (data.basePermission & PermissionBase.DELETE
19064
- || data.__permission & PermissionBase.DELETE) {
19065
- data.__disableDelete = false;
19066
- }
19067
- else {
19068
- data.__disablePermissionDelete = true;
19069
- }
19070
- }
19071
- /**
19072
- * Lấy thêm các thông tin cần cho quy trình nghiệp vụ cho các bản ghi trong data
19073
- */
19074
- appendInfoForWorkflow(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
19075
- return __awaiter(this, void 0, void 0, function* () {
19076
- if (callBackWhenNotHaveStatus == null) {
19077
- callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
19078
- if (rowItem[fieldKey]
19079
- && rowItem.workflowCode
19080
- && rowItem.currentStateCode) {
19081
- itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
19082
- itemStatus.trangThai = rowItem.currentStateCode;
19083
- itemStatus.workflowCode = rowItem.workflowCode;
19084
- itemStatus.permission = PermissionBase.READ;
19085
- }
19086
- };
19087
- }
19088
- const lstItemId = data.filter(q => q[fieldKey]).map(q => q[fieldKey]);
19089
- let filters = [
19090
- this.newFilter('itemId', Operator.in, lstItemId),
19091
- this.newFilter('notInWorkflow', Operator.equal, false),
19092
- ];
19093
- if (this.tableName) {
19094
- filters.push(this.newFilter('tableName', Operator.equal, this.tableName));
19095
- }
19096
- const sorts = [];
19097
- // if (!ignoreWorkflow) {
19098
- // filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
19099
- // }
19100
- sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
19101
- const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
19102
- if (dataStatus == null) {
19103
- const notifierService = this._injector.get(NotifierService);
19104
- return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
19105
- }
19106
- data.forEach(rowItem => {
19107
- this.appendWorkflowInfoToItem(rowItem, rowItem[fieldKey], userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
19108
- });
19109
- return true;
19110
- });
19111
- }
19112
- }
19113
- WorkflowPermissionDetailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function WorkflowPermissionDetailService_Factory() { return new WorkflowPermissionDetailService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService)); }, token: WorkflowPermissionDetailService, providedIn: "root" });
19114
- WorkflowPermissionDetailService.decorators = [
19115
- { type: Injectable, args: [{
19116
- providedIn: 'root'
19117
- },] }
19118
- ];
19119
- WorkflowPermissionDetailService.ctorParameters = () => [
19120
- { type: HttpClient },
19121
- { type: Injector },
19122
- { type: ModuleConfigService }
19123
- ];
19124
-
19125
19259
  var sort_by;
19126
19260
  (function () {
19127
19261
  const defaultCompareFunc = function (a, b) {
@@ -22153,6 +22287,7 @@ class ListComponentBase extends ComponentBase {
22153
22287
  buttonContexts.push({
22154
22288
  soThuTu: action.soThuTu,
22155
22289
  actionCode: action.code,
22290
+ isActionAllow: true,
22156
22291
  icon: this.sourceIcon[action.icon],
22157
22292
  label: action.name,
22158
22293
  command: () => this.processWorkflow(crudListSetting, itemWorkflowSetting, action)
@@ -28624,7 +28759,6 @@ class FileUploadComponent extends ComponentBase {
28624
28759
  if (!dataKySo) {
28625
28760
  this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
28626
28761
  }
28627
- debugger;
28628
28762
  this.forms.fileViewer.formData.data = {
28629
28763
  fileId: sourceFileId,
28630
28764
  isFileVersion: false,
@@ -35547,7 +35681,6 @@ class ServiceFileUploadComponent extends ComponentBase {
35547
35681
  if (!dataKySo) {
35548
35682
  this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
35549
35683
  }
35550
- debugger;
35551
35684
  this.forms.fileViewer.formData.data = {
35552
35685
  fileId: sourceFileId,
35553
35686
  isFileVersion: false,
@@ -40742,8 +40875,16 @@ class EntityPickerDataComponent extends DataListBase {
40742
40875
  this.onPick = new EventEmitter();
40743
40876
  this.onPickAll = new EventEmitter();
40744
40877
  this.onPickSelected = new EventEmitter();
40878
+ this.template = {};
40879
+ // Context truyền vào templateFilterHeader để template gọi ngược lại (onChange/reload)
40880
+ this.filterHeaderContext = {
40881
+ $implicit: this,
40882
+ onChange: (value) => this.handleFilterHeaderChange(value),
40883
+ reload: () => this._triggerProcessData(),
40884
+ };
40745
40885
  this.showFormAdvancedSearch = false;
40746
40886
  this.popupSizeSearchForm = new PopupSize({ width: 1000, height: 700 });
40887
+ this.schemaData = {};
40747
40888
  this.lstDataNotExist = [];
40748
40889
  }
40749
40890
  set selectedValue(value) {
@@ -40935,13 +41076,34 @@ class EntityPickerDataComponent extends DataListBase {
40935
41076
  this.searchData = model;
40936
41077
  this._triggerProcessData();
40937
41078
  }
41079
+ handleFilterHeaderChange(value) {
41080
+ console.log(value);
41081
+ // Nhận sự kiện onChange từ templateFilterHeader, mặc định lọc lại lưới
41082
+ this._triggerProcessData();
41083
+ }
41084
+ findTemplate(templateName) {
41085
+ var _a;
41086
+ return (_a = this._commonService.findTemplateFromList(this.children, templateName)) !== null && _a !== void 0 ? _a : this._commonService.findTemplateFromList(this.templates, templateName);
41087
+ }
41088
+ hasTemplate(templateName) {
41089
+ if (this.template[templateName] === undefined) {
41090
+ this.template[templateName] = this.findTemplate(templateName);
41091
+ }
41092
+ return this.template[templateName] != null;
41093
+ }
41094
+ getTemplate(templateName) {
41095
+ if (this.template[templateName] === undefined) {
41096
+ this.template[templateName] = this.findTemplate(templateName);
41097
+ }
41098
+ return this.template[templateName];
41099
+ }
40938
41100
  }
40939
41101
  EntityPickerDataComponent.decorators = [
40940
41102
  { type: Component, args: [{
40941
41103
  selector: 'app-entity-picker-data',
40942
- template: "<crud-list #crudList [templates]=\"templates\" [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\"\n [showScrollHorizontal]=\"true\" (onContentInit)=\"onContentInit.emit($event)\" (onReload)=\"_triggerProcessData($event)\"\n (onAdd)=\"_add($event)\" (onRowSelect)=\"handleRowSelect($event)\" (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\"\n (onDelete)=\"_delete($event)\" (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n <ng-template #customTitle>\n <h1 [innerHTML]=\"dom.bypassSecurityTrustHtml(control.titleUnPicked)\"></h1>\n </ng-template>\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button *ngIf=\"(isSingleSelection || model.total <= 0) && !model.dataSource.length && setting.hiddenAdvanceSearch\" pButton\n style=\"visibility: hidden\"></button>\n <button *ngIf=\"!isSingleSelection && model.total > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y t\u1EA5t c\u1EA3 ({{model.total}})\" icon=\"pi pi-angle-double-right\" class=\"p-button-text p-button-success\"\n [disabled]=\"model.loading\" (click)=\"pickAll()\"></button>\n <button *ngIf=\"!isSingleSelection && selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-right\"\n class=\"p-button-text p-button-success\" [disabled]=\"model.loading\"\n (click)=\"pickSelected(selectedItems)\"></button>\n <button *ngIf=\"datasourceFieldFilter.length\" type=\"button\" pButton pRipple label=\"T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng\"\n icon=\"pi pi-search\" class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\"\n (click)=\"handleAdvansearch()\"></button>\n <button *ngIf=\"datasourceFieldFilter.length && searchData\" type=\"button\" pButton pRipple\n label=\"X\u00F3a danh s\u00E1ch t\u00ECm ki\u1EBFm\" pTooltip=\"X\u00F3a t\u1EA5t c\u1EA3 ng\u01B0\u1EDDi d\u00F9ng \u1EDF Danh s\u00E1ch t\u00ECm ki\u1EBFm\" icon=\"pi pi-times\"\n class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\" (click)=\"handleSearch(null)\"></button>\n </ng-template>\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button pButton type=\"button\" class=\"link-or-action p-button-success p-button-text p-button-rounded\"\n icon=\"pi pi-check\" pTooltip=\"Ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" [disabled]=\"rowData.disabled\"\n (click)=\"pickEntity(rowData)\"></button>\n </ng-template>\n</crud-list>\n\n\n<tn-dialog *ngIf=\"showFormAdvancedSearch\" #dialog [styleClass]=\"'address-form'\" [header]=\"'T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng'\"\n [popupSize]=\"popupSizeSearchForm\" [maskClass]=\"setting.maskClass\" (onHide)=\"showFormAdvancedSearch = false\">\n <entity-picker-search-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [lstDataNotExist]=\"lstDataNotExist\" [model]=\"formModel\"\n (onSearch)=\"handleSearch($event)\" (onCancel)=\"showFormAdvancedSearch = false;\">\n </entity-picker-search-form>\n</tn-dialog>",
41104
+ template: "<crud-list #crudList [templates]=\"templates\" [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\"\n [dataSource]=\"model.dataSource\" [showScrollHorizontal]=\"true\" (onContentInit)=\"onContentInit.emit($event)\"\n (onReload)=\"_triggerProcessData($event)\" (onAdd)=\"_add($event)\" (onRowSelect)=\"handleRowSelect($event)\"\n (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n <ng-template #customTitle>\n <h1 [innerHTML]=\"dom.bypassSecurityTrustHtml(control.titleUnPicked)\"></h1>\n <div class=\"header-search-box\" *ngIf=\"control.templateFilterHeader\">\n <ng-container *ngTemplateOutlet=\"control.templateFilterHeader; context: filterHeaderContext\">\n </ng-container>\n </div>\n </ng-template>\n\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button\n *ngIf=\"(isSingleSelection || model.total <= 0) && !model.dataSource.length && setting.hiddenAdvanceSearch\"\n pButton style=\"visibility: hidden\"></button>\n <button *ngIf=\"!isSingleSelection && model.total > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y t\u1EA5t c\u1EA3 ({{model.total}})\" icon=\"pi pi-angle-double-right\" class=\"p-button-text p-button-success\"\n [disabled]=\"model.loading\" (click)=\"pickAll()\"></button>\n <button *ngIf=\"!isSingleSelection && selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-right\"\n class=\"p-button-text p-button-success\" [disabled]=\"model.loading\"\n (click)=\"pickSelected(selectedItems)\"></button>\n <button *ngIf=\"datasourceFieldFilter.length\" type=\"button\" pButton pRipple label=\"T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng\"\n icon=\"pi pi-search\" class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\"\n (click)=\"handleAdvansearch()\"></button>\n <button *ngIf=\"datasourceFieldFilter.length && searchData\" type=\"button\" pButton pRipple\n label=\"X\u00F3a danh s\u00E1ch t\u00ECm ki\u1EBFm\" pTooltip=\"X\u00F3a t\u1EA5t c\u1EA3 ng\u01B0\u1EDDi d\u00F9ng \u1EDF Danh s\u00E1ch t\u00ECm ki\u1EBFm\" icon=\"pi pi-times\"\n class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\" (click)=\"handleSearch(null)\"></button>\n </ng-template>\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button pButton type=\"button\" class=\"link-or-action p-button-success p-button-text p-button-rounded\"\n icon=\"pi pi-check\" pTooltip=\"Ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" [disabled]=\"rowData.disabled\"\n (click)=\"pickEntity(rowData)\"></button>\n </ng-template>\n</crud-list>\n\n\n<tn-dialog *ngIf=\"showFormAdvancedSearch\" #dialog [styleClass]=\"'address-form'\" [header]=\"'T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng'\"\n [popupSize]=\"popupSizeSearchForm\" [maskClass]=\"setting.maskClass\" (onHide)=\"showFormAdvancedSearch = false\">\n <entity-picker-search-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [lstDataNotExist]=\"lstDataNotExist\" [model]=\"formModel\"\n (onSearch)=\"handleSearch($event)\" (onCancel)=\"showFormAdvancedSearch = false;\">\n </entity-picker-search-form>\n</tn-dialog>",
40943
41105
  providers: [ComponentContextService],
40944
- styles: ["::ng-deep app-entity-picker-data .custom-card{padding:.5em!important}"]
41106
+ styles: ["::ng-deep app-entity-picker-data .custom-card{padding:.5em!important}::ng-deep app-entity-picker-data .header-search-box{padding:1rem 0}::ng-deep app-entity-picker-data .header-search-box p-dropdown .p-dropdown{min-width:300px}"]
40945
41107
  },] }
40946
41108
  ];
40947
41109
  EntityPickerDataComponent.ctorParameters = () => [
@@ -40963,7 +41125,8 @@ EntityPickerDataComponent.propDecorators = {
40963
41125
  onRowSelect: [{ type: Output }],
40964
41126
  onPick: [{ type: Output }],
40965
41127
  onPickAll: [{ type: Output }],
40966
- onPickSelected: [{ type: Output }]
41128
+ onPickSelected: [{ type: Output }],
41129
+ children: [{ type: ContentChildren, args: [TemplateRef,] }]
40967
41130
  };
40968
41131
 
40969
41132
  class EntityPickerSelectedComponent extends DataListBase {
@@ -49031,7 +49194,7 @@ class TnDialogComponent {
49031
49194
  TnDialogComponent.decorators = [
49032
49195
  { type: Component, args: [{
49033
49196
  selector: 'tn-dialog',
49034
- template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\" [autoZIndex]=\"true\"\n [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\" [showHeader]=\"showHeader\"\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\">\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\n <ng-content></ng-content>\n </tn-custom-scrollbar>\n <p-header *ngIf=\"showHeader\">\n <ng-container *ngIf=\"header && !headerTemplate\">\n <div>{{header | translate}}</div>\n </ng-container>\n <ng-container *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n </p-header>\n <p-footer *ngIf=\"showFooter\">\n <p-footer *ngIf=\"formBase && formBase.buttonTemplate\" style=\"display: flex;float: right\">\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\n </ng-container>\n </p-footer>\n <ng-container *ngIf=\"!formBase || !formBase.buttonTemplate\">\n <p-footer *ngIf=\"footer\">\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"buttonTemplateInput\">\n <ng-container *ngTemplateOutlet=\"buttonTemplateInput\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"!footer && !buttonTemplateInput\">\n <button pButton preventTab type=\"button\" icon=\"pi pi-replay\" class=\"p-button-text p-button-secondary\"\n [label]=\"'FORM.CANCEL' | translate\" (click)=\"handleHideDialog($event)\"></button>\n </p-footer>\n </ng-container>\n </p-footer>\n</p-dialog>",
49197
+ template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\" [autoZIndex]=\"true\"\n [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\" [showHeader]=\"showHeader\"\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\">\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\n <ng-content></ng-content>\n </tn-custom-scrollbar>\n <p-header *ngIf=\"showHeader\">\n <ng-container *ngIf=\"header && !headerTemplate\">\n <div>{{header | translate}}</div>\n </ng-container>\n <ng-container *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n </p-header>\n <p-footer *ngIf=\"showFooter\">\n <p-footer *ngIf=\"formBase && formBase.buttonTemplate\" style=\"display: flex;float: right\">\n <button *ngFor=\"let butt of formBase.buttons\" pButton [icon]=\"butt.icon\" class=\"p-button-text\"\n [label]=\"butt.label\" (click)=\"butt.command()\"></button>\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\n </ng-container>\n </p-footer>\n <ng-container *ngIf=\"!formBase || !formBase.buttonTemplate\">\n <p-footer *ngIf=\"footer\">\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"buttonTemplateInput\">\n <ng-container *ngTemplateOutlet=\"buttonTemplateInput\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"!footer && !buttonTemplateInput\">\n <button pButton preventTab type=\"button\" icon=\"pi pi-replay\" class=\"p-button-text p-button-secondary\"\n [label]=\"'FORM.CANCEL' | translate\" (click)=\"handleHideDialog($event)\"></button>\n </p-footer>\n </ng-container>\n </p-footer>\n</p-dialog>",
49035
49198
  styles: [""]
49036
49199
  },] }
49037
49200
  ];
@@ -49806,6 +49969,9 @@ class UserPickerBoxComponent extends ComponentBase {
49806
49969
  }
49807
49970
  }
49808
49971
  ngOnInit() {
49972
+ if (this.controlSetting.templateFilterHeader) {
49973
+ this.control.templateFilterHeader = this.controlSetting.templateFilterHeader;
49974
+ }
49809
49975
  this.control.plusUrl = 'ForUserPicker';
49810
49976
  this.control.filterWhileProcess = [
49811
49977
  this.newFilter('userType', Operator.equal, this.controlSetting.userType)