tnx-shared 5.3.201 → 5.3.203

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.
@@ -1349,6 +1349,7 @@ class UserPickerControlSchema extends FormControlBase {
1349
1349
  this.displayField = 'fullNameNew';
1350
1350
  this.fieldPlus = '';
1351
1351
  this.returnType = 'value';
1352
+ this.getDisplayName = false;
1352
1353
  this.fieldSearchText = [];
1353
1354
  this.operatorFieldSearchText = Operator.contain;
1354
1355
  this.usePicker = true;
@@ -12637,49 +12638,54 @@ class CrudFormComponent extends ComponentBase {
12637
12638
  // });
12638
12639
  }
12639
12640
  initControlDefaultValue(parentModel, control, parentPath) {
12640
- this.initPrivateData(parentModel, control.field);
12641
- let _parentPath = control.field;
12642
- if (parentPath != null)
12643
- _parentPath = parentPath + '.' + _parentPath;
12644
- if (control instanceof TableSchema) {
12645
- if (!parentModel[control.field] || !(parentModel[control.field] instanceof Array)) {
12646
- parentModel[control.field] = [];
12647
- }
12648
- const addMore = control.initRowCount - parentModel[control.field].length;
12649
- if (addMore > 0 && !parentModel._status[control.field].ready) {
12650
- parentModel._status[control.field].ready = true;
12651
- }
12652
- let i = 0;
12653
- for (const item of parentModel[control.field]) {
12654
- for (const subControl of control.rowTemplate) {
12655
- this.initControlDefaultValue(item, subControl, _parentPath + '[' + i + ']');
12641
+ return __awaiter(this, void 0, void 0, function* () {
12642
+ this.initPrivateData(parentModel, control.field);
12643
+ let _parentPath = control.field;
12644
+ if (parentPath != null)
12645
+ _parentPath = parentPath + '.' + _parentPath;
12646
+ if (control instanceof TableSchema) {
12647
+ if (!parentModel[control.field] || !(parentModel[control.field] instanceof Array)) {
12648
+ parentModel[control.field] = [];
12649
+ }
12650
+ const addMore = control.initRowCount - parentModel[control.field].length;
12651
+ if (addMore > 0 && !parentModel._status[control.field].ready) {
12652
+ parentModel._status[control.field].ready = true;
12653
+ }
12654
+ let i = 0;
12655
+ for (const item of parentModel[control.field]) {
12656
+ for (const subControl of control.rowTemplate) {
12657
+ this.initControlDefaultValue(item, subControl, _parentPath + '[' + i + ']');
12658
+ }
12659
+ i++;
12656
12660
  }
12657
- i++;
12658
- }
12659
- }
12660
- else if (control instanceof ContainerSchema) {
12661
- if (parentModel[control.field] == null || !isLiteralObject(parentModel[control.field])) {
12662
- parentModel[control.field] = {};
12663
- }
12664
- for (const subControl of control.controls) {
12665
- this.initControlDefaultValue(parentModel[control.field], subControl, _parentPath);
12666
12661
  }
12667
- }
12668
- else {
12669
- if (!parentModel.hasOwnProperty(control.field) && control.field != null) {
12670
- if (control.defaultValue !== null && control.defaultValue !== undefined) {
12671
- parentModel[control.field] = control.defaultValue;
12662
+ else if (control instanceof ContainerSchema) {
12663
+ if (parentModel[control.field] == null || !isLiteralObject(parentModel[control.field])) {
12664
+ parentModel[control.field] = {};
12672
12665
  }
12673
- else if (control instanceof DropdownControlSchema) {
12674
- if (control.autoDisplayFirst
12675
- && control._component
12676
- && control._component._hasLoadedDatasource
12677
- && control._component.dataSourceInternal.length > 0) {
12678
- parentModel[control.field] = control._component.dataSourceInternal[0].value[control.valueField];
12666
+ for (const subControl of control.controls) {
12667
+ this.initControlDefaultValue(parentModel[control.field], subControl, _parentPath);
12668
+ }
12669
+ }
12670
+ else {
12671
+ if (control.funcSetDefaultValue) {
12672
+ control.defaultValue = yield control.funcSetDefaultValue();
12673
+ }
12674
+ if (!parentModel.hasOwnProperty(control.field) && control.field != null) {
12675
+ if (control.defaultValue !== null && control.defaultValue !== undefined) {
12676
+ parentModel[control.field] = control.defaultValue;
12677
+ }
12678
+ else if (control instanceof DropdownControlSchema) {
12679
+ if (control.autoDisplayFirst
12680
+ && control._component
12681
+ && control._component._hasLoadedDatasource
12682
+ && control._component.dataSourceInternal.length > 0) {
12683
+ parentModel[control.field] = control._component.dataSourceInternal[0].value[control.valueField];
12684
+ }
12679
12685
  }
12680
12686
  }
12681
12687
  }
12682
- }
12688
+ });
12683
12689
  }
12684
12690
  initPrivateData(parentModel, field) {
12685
12691
  if (!parentModel._source)
@@ -29305,9 +29311,11 @@ class FileManagerComponent extends DataListBase {
29305
29311
  this._hasLoadedSource = false;
29306
29312
  this.entityKeyChange.emit(this._entityKey);
29307
29313
  if (this.control.multiEntityKey) {
29314
+ this.plusUrl = 'ByEntityKeys';
29308
29315
  this.getFilesInEntityKey();
29309
29316
  }
29310
29317
  else {
29318
+ this.plusUrl = 'ByFolderId';
29311
29319
  this.rootFolderId = null;
29312
29320
  this.checkAndLoadRootFolderContent();
29313
29321
  }
@@ -34456,7 +34464,7 @@ class AnnouncementsService extends BaseService {
34456
34464
  }
34457
34465
  this.openThongBao(notificationParams);
34458
34466
  }
34459
- redirectToNotificationPage(orgIds = [], userIds = [], title, link, templateTextCode, objTemplate, isSendEmail = true, isChangeUser = true) {
34467
+ redirectToNotificationPage(orgIds = [], userIds = [], title, link, templateTextCode, objTemplate, isSendEmail = true, isChangeUser = true, emails = []) {
34460
34468
  return __awaiter(this, void 0, void 0, function* () {
34461
34469
  orgIds = this._commonService.distinctArray(orgIds);
34462
34470
  userIds = this._commonService.distinctArray(userIds);
@@ -34472,6 +34480,7 @@ class AnnouncementsService extends BaseService {
34472
34480
  }
34473
34481
  notificationParams.orgIds = orgIds.join(',');
34474
34482
  notificationParams.userIds = userIds.join(',');
34483
+ notificationParams.emails = emails.join(',');
34475
34484
  notificationParams.title = title;
34476
34485
  notificationParams.link = link ? encodeURIComponent(link) : '';
34477
34486
  notificationParams.templateTextCode = templateTextCode;
@@ -44304,6 +44313,7 @@ class TnDialogComponent {
44304
44313
  this.showFooter = true;
44305
44314
  this.hiddenSave = true;
44306
44315
  this.maximizable = true;
44316
+ this.showHeader = true;
44307
44317
  this.onSave = new EventEmitter();
44308
44318
  this.onCancel = new EventEmitter();
44309
44319
  this.onShow = new EventEmitter();
@@ -44386,7 +44396,7 @@ class TnDialogComponent {
44386
44396
  TnDialogComponent.decorators = [
44387
44397
  { type: Component, args: [{
44388
44398
  selector: 'tn-dialog',
44389
- template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [header]=\"header | translate\" [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\"\n [autoZIndex]=\"true\" [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\"\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-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>",
44399
+ template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [header]=\"header | translate\" [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\"\n [autoZIndex]=\"true\" [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-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>",
44390
44400
  styles: [""]
44391
44401
  },] }
44392
44402
  ];
@@ -44415,6 +44425,7 @@ TnDialogComponent.propDecorators = {
44415
44425
  minY: [{ type: Input }],
44416
44426
  hiddenSave: [{ type: Input }],
44417
44427
  maximizable: [{ type: Input }],
44428
+ showHeader: [{ type: Input }],
44418
44429
  onSave: [{ type: Output }],
44419
44430
  onCancel: [{ type: Output }],
44420
44431
  onShow: [{ type: Output }],
@@ -45308,7 +45319,7 @@ class UserPickerComponent extends ComponentBase {
45308
45319
  ngOnInit() {
45309
45320
  this.control._component = this;
45310
45321
  const commonFieldPlus = 'maChucVu,lstTenDonVi';
45311
- this.controlPicker = new EntityPickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Người dùng', title: 'Chọn người dùng', baseService: this._userV5Service, required: true, displayField: this.control.getDisplayName ? 'displayName' : 'fullNameNew', fieldPlus: this.control.fieldPlus ? `${this.control.fieldPlus},${commonFieldPlus}` : commonFieldPlus, valueField: this.control.valueField, defaultFilters: this.control.defaultFilters, multiple: this.control.multiple, funcGetLabel: (item) => {
45322
+ this.controlPicker = new EntityPickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Người dùng', title: 'Chọn người dùng', baseService: this._userV5Service, required: true, displayField: this.control.getDisplayName ? 'displayName' : this.control.displayField, fieldPlus: this.control.fieldPlus ? `${this.control.fieldPlus},${commonFieldPlus}` : commonFieldPlus, valueField: this.control.valueField, defaultFilters: this.control.defaultFilters, multiple: this.control.multiple, funcGetLabel: (item) => {
45312
45323
  var _a;
45313
45324
  if (this.control.funcGetLabel)
45314
45325
  return this.control.funcGetLabel(item);