tnx-shared 5.3.202 → 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.
- package/bundles/tnx-shared.umd.js +95 -73
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/form-schema.d.ts +2 -2
- package/classes/form-schema.d.ts.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/components/tn-dialog/tn-dialog.component.d.ts +1 -0
- package/components/tn-dialog/tn-dialog.component.d.ts.map +1 -1
- package/esm2015/classes/form-schema.js +2 -1
- package/esm2015/components/crud/crud-form/crud-form.component.js +43 -38
- package/esm2015/components/tn-dialog/tn-dialog.component.js +4 -2
- package/esm2015/components/user-picker/user-picker.component.js +2 -2
- package/esm2015/models/notification-param.js +1 -1
- package/esm2015/services/announcements.service.js +3 -2
- package/fesm2015/tnx-shared.js +49 -40
- package/fesm2015/tnx-shared.js.map +1 -1
- package/models/notification-param.d.ts +1 -0
- package/models/notification-param.d.ts.map +1 -1
- package/package.json +2 -2
- package/services/announcements.service.d.ts +1 -1
- package/services/announcements.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
package/fesm2015/tnx-shared.js
CHANGED
|
@@ -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
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
if (
|
|
12646
|
-
parentModel[control.field]
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
parentModel._status[control.field].ready
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
for (const
|
|
12655
|
-
|
|
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
|
-
|
|
12669
|
-
|
|
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
|
-
|
|
12674
|
-
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
|
|
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)
|
|
@@ -34458,7 +34464,7 @@ class AnnouncementsService extends BaseService {
|
|
|
34458
34464
|
}
|
|
34459
34465
|
this.openThongBao(notificationParams);
|
|
34460
34466
|
}
|
|
34461
|
-
redirectToNotificationPage(orgIds = [], userIds = [], title, link, templateTextCode, objTemplate, isSendEmail = true, isChangeUser = true) {
|
|
34467
|
+
redirectToNotificationPage(orgIds = [], userIds = [], title, link, templateTextCode, objTemplate, isSendEmail = true, isChangeUser = true, emails = []) {
|
|
34462
34468
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34463
34469
|
orgIds = this._commonService.distinctArray(orgIds);
|
|
34464
34470
|
userIds = this._commonService.distinctArray(userIds);
|
|
@@ -34474,6 +34480,7 @@ class AnnouncementsService extends BaseService {
|
|
|
34474
34480
|
}
|
|
34475
34481
|
notificationParams.orgIds = orgIds.join(',');
|
|
34476
34482
|
notificationParams.userIds = userIds.join(',');
|
|
34483
|
+
notificationParams.emails = emails.join(',');
|
|
34477
34484
|
notificationParams.title = title;
|
|
34478
34485
|
notificationParams.link = link ? encodeURIComponent(link) : '';
|
|
34479
34486
|
notificationParams.templateTextCode = templateTextCode;
|
|
@@ -44306,6 +44313,7 @@ class TnDialogComponent {
|
|
|
44306
44313
|
this.showFooter = true;
|
|
44307
44314
|
this.hiddenSave = true;
|
|
44308
44315
|
this.maximizable = true;
|
|
44316
|
+
this.showHeader = true;
|
|
44309
44317
|
this.onSave = new EventEmitter();
|
|
44310
44318
|
this.onCancel = new EventEmitter();
|
|
44311
44319
|
this.onShow = new EventEmitter();
|
|
@@ -44388,7 +44396,7 @@ class TnDialogComponent {
|
|
|
44388
44396
|
TnDialogComponent.decorators = [
|
|
44389
44397
|
{ type: Component, args: [{
|
|
44390
44398
|
selector: 'tn-dialog',
|
|
44391
|
-
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>",
|
|
44392
44400
|
styles: [""]
|
|
44393
44401
|
},] }
|
|
44394
44402
|
];
|
|
@@ -44417,6 +44425,7 @@ TnDialogComponent.propDecorators = {
|
|
|
44417
44425
|
minY: [{ type: Input }],
|
|
44418
44426
|
hiddenSave: [{ type: Input }],
|
|
44419
44427
|
maximizable: [{ type: Input }],
|
|
44428
|
+
showHeader: [{ type: Input }],
|
|
44420
44429
|
onSave: [{ type: Output }],
|
|
44421
44430
|
onCancel: [{ type: Output }],
|
|
44422
44431
|
onShow: [{ type: Output }],
|
|
@@ -45310,7 +45319,7 @@ class UserPickerComponent extends ComponentBase {
|
|
|
45310
45319
|
ngOnInit() {
|
|
45311
45320
|
this.control._component = this;
|
|
45312
45321
|
const commonFieldPlus = 'maChucVu,lstTenDonVi';
|
|
45313
|
-
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' :
|
|
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) => {
|
|
45314
45323
|
var _a;
|
|
45315
45324
|
if (this.control.funcGetLabel)
|
|
45316
45325
|
return this.control.funcGetLabel(item);
|