tnx-shared 5.3.202 → 5.3.204
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 +104 -75
- 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/datetime-picker/datetime-picker.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/datetime-picker/datetime-picker.component.js +2 -2
- 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/esm2015/services/common.service.js +8 -2
- package/fesm2015/tnx-shared.js +57 -42
- 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/services/common.service.d.ts +1 -1
- package/services/common.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -1911,6 +1911,7 @@
|
|
|
1911
1911
|
_this.displayField = 'fullNameNew';
|
|
1912
1912
|
_this.fieldPlus = '';
|
|
1913
1913
|
_this.returnType = 'value';
|
|
1914
|
+
_this.getDisplayName = false;
|
|
1914
1915
|
_this.fieldSearchText = [];
|
|
1915
1916
|
_this.operatorFieldSearchText = exports.Operator.contain;
|
|
1916
1917
|
_this.usePicker = true;
|
|
@@ -3974,8 +3975,9 @@
|
|
|
3974
3975
|
// jQuery(".ql-toolbar").find(":button").attr("tabindex", "-1");
|
|
3975
3976
|
};
|
|
3976
3977
|
/** End disable editor tab */
|
|
3977
|
-
CommonService.prototype.processDateInput = function (inputValue, showTime, timeOnly) {
|
|
3978
|
+
CommonService.prototype.processDateInput = function (inputValue, showTime, timeOnly, view) {
|
|
3978
3979
|
if (timeOnly === void 0) { timeOnly = false; }
|
|
3980
|
+
if (view === void 0) { view = 'date'; }
|
|
3979
3981
|
if (!inputValue) {
|
|
3980
3982
|
return null;
|
|
3981
3983
|
}
|
|
@@ -4083,6 +4085,12 @@
|
|
|
4083
4085
|
return tryParseDate;
|
|
4084
4086
|
}
|
|
4085
4087
|
}
|
|
4088
|
+
else if (view == 'month') {
|
|
4089
|
+
var tryParseDate = this.tryParseExtractDate("" + inputValue, 'MM/YYYY');
|
|
4090
|
+
if (tryParseDate + '' != 'Invalid Date') {
|
|
4091
|
+
return tryParseDate;
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4086
4094
|
else {
|
|
4087
4095
|
var tryParseDate = this.tryParseExtractDate(inputValue, 'DD/MM/YYYY');
|
|
4088
4096
|
if (tryParseDate + '' != 'Invalid Date') {
|
|
@@ -14957,80 +14965,97 @@
|
|
|
14957
14965
|
// });
|
|
14958
14966
|
};
|
|
14959
14967
|
CrudFormComponent.prototype.initControlDefaultValue = function (parentModel, control, parentPath) {
|
|
14960
|
-
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
|
|
14970
|
-
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
try {
|
|
14978
|
-
for (var _k = (e_13 = void 0, __values(control.rowTemplate)), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
14979
|
-
var subControl = _l.value;
|
|
14980
|
-
this.initControlDefaultValue(item, subControl, _parentPath + '[' + i + ']');
|
|
14968
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
14969
|
+
var _parentPath, addMore, i, _e, _f, item, _g, _h, subControl, _j, _k, subControl, _l;
|
|
14970
|
+
var e_12, _m, e_13, _o, e_14, _p;
|
|
14971
|
+
return __generator(this, function (_q) {
|
|
14972
|
+
switch (_q.label) {
|
|
14973
|
+
case 0:
|
|
14974
|
+
this.initPrivateData(parentModel, control.field);
|
|
14975
|
+
_parentPath = control.field;
|
|
14976
|
+
if (parentPath != null)
|
|
14977
|
+
_parentPath = parentPath + '.' + _parentPath;
|
|
14978
|
+
if (!(control instanceof TableSchema)) return [3 /*break*/, 1];
|
|
14979
|
+
if (!parentModel[control.field] || !(parentModel[control.field] instanceof Array)) {
|
|
14980
|
+
parentModel[control.field] = [];
|
|
14981
|
+
}
|
|
14982
|
+
addMore = control.initRowCount - parentModel[control.field].length;
|
|
14983
|
+
if (addMore > 0 && !parentModel._status[control.field].ready) {
|
|
14984
|
+
parentModel._status[control.field].ready = true;
|
|
14981
14985
|
}
|
|
14982
|
-
|
|
14983
|
-
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
14984
|
-
finally {
|
|
14986
|
+
i = 0;
|
|
14985
14987
|
try {
|
|
14986
|
-
|
|
14988
|
+
for (_e = __values(parentModel[control.field]), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
14989
|
+
item = _f.value;
|
|
14990
|
+
try {
|
|
14991
|
+
for (_g = (e_13 = void 0, __values(control.rowTemplate)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
14992
|
+
subControl = _h.value;
|
|
14993
|
+
this.initControlDefaultValue(item, subControl, _parentPath + '[' + i + ']');
|
|
14994
|
+
}
|
|
14995
|
+
}
|
|
14996
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
14997
|
+
finally {
|
|
14998
|
+
try {
|
|
14999
|
+
if (_h && !_h.done && (_o = _g.return)) _o.call(_g);
|
|
15000
|
+
}
|
|
15001
|
+
finally { if (e_13) throw e_13.error; }
|
|
15002
|
+
}
|
|
15003
|
+
i++;
|
|
15004
|
+
}
|
|
14987
15005
|
}
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15006
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
15007
|
+
finally {
|
|
15008
|
+
try {
|
|
15009
|
+
if (_f && !_f.done && (_m = _e.return)) _m.call(_e);
|
|
15010
|
+
}
|
|
15011
|
+
finally { if (e_12) throw e_12.error; }
|
|
15012
|
+
}
|
|
15013
|
+
return [3 /*break*/, 5];
|
|
15014
|
+
case 1:
|
|
15015
|
+
if (!(control instanceof ContainerSchema)) return [3 /*break*/, 2];
|
|
15016
|
+
if (parentModel[control.field] == null || !isLiteralObject(parentModel[control.field])) {
|
|
15017
|
+
parentModel[control.field] = {};
|
|
15018
|
+
}
|
|
15019
|
+
try {
|
|
15020
|
+
for (_j = __values(control.controls), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
15021
|
+
subControl = _k.value;
|
|
15022
|
+
this.initControlDefaultValue(parentModel[control.field], subControl, _parentPath);
|
|
15023
|
+
}
|
|
15024
|
+
}
|
|
15025
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
15026
|
+
finally {
|
|
15027
|
+
try {
|
|
15028
|
+
if (_k && !_k.done && (_p = _j.return)) _p.call(_j);
|
|
15029
|
+
}
|
|
15030
|
+
finally { if (e_14) throw e_14.error; }
|
|
15031
|
+
}
|
|
15032
|
+
return [3 /*break*/, 5];
|
|
15033
|
+
case 2:
|
|
15034
|
+
if (!control.funcSetDefaultValue) return [3 /*break*/, 4];
|
|
15035
|
+
_l = control;
|
|
15036
|
+
return [4 /*yield*/, control.funcSetDefaultValue()];
|
|
15037
|
+
case 3:
|
|
15038
|
+
_l.defaultValue = _q.sent();
|
|
15039
|
+
_q.label = 4;
|
|
15040
|
+
case 4:
|
|
15041
|
+
if (!parentModel.hasOwnProperty(control.field) && control.field != null) {
|
|
15042
|
+
if (control.defaultValue !== null && control.defaultValue !== undefined) {
|
|
15043
|
+
parentModel[control.field] = control.defaultValue;
|
|
15044
|
+
}
|
|
15045
|
+
else if (control instanceof DropdownControlSchema) {
|
|
15046
|
+
if (control.autoDisplayFirst
|
|
15047
|
+
&& control._component
|
|
15048
|
+
&& control._component._hasLoadedDatasource
|
|
15049
|
+
&& control._component.dataSourceInternal.length > 0) {
|
|
15050
|
+
parentModel[control.field] = control._component.dataSourceInternal[0].value[control.valueField];
|
|
15051
|
+
}
|
|
15052
|
+
}
|
|
15053
|
+
}
|
|
15054
|
+
_q.label = 5;
|
|
15055
|
+
case 5: return [2 /*return*/];
|
|
15031
15056
|
}
|
|
15032
|
-
}
|
|
15033
|
-
}
|
|
15057
|
+
});
|
|
15058
|
+
});
|
|
15034
15059
|
};
|
|
15035
15060
|
CrudFormComponent.prototype.initPrivateData = function (parentModel, field) {
|
|
15036
15061
|
if (!parentModel._source)
|
|
@@ -39487,11 +39512,12 @@
|
|
|
39487
39512
|
}
|
|
39488
39513
|
this.openThongBao(notificationParams);
|
|
39489
39514
|
};
|
|
39490
|
-
AnnouncementsService.prototype.redirectToNotificationPage = function (orgIds, userIds, title, link, templateTextCode, objTemplate, isSendEmail, isChangeUser) {
|
|
39515
|
+
AnnouncementsService.prototype.redirectToNotificationPage = function (orgIds, userIds, title, link, templateTextCode, objTemplate, isSendEmail, isChangeUser, emails) {
|
|
39491
39516
|
if (orgIds === void 0) { orgIds = []; }
|
|
39492
39517
|
if (userIds === void 0) { userIds = []; }
|
|
39493
39518
|
if (isSendEmail === void 0) { isSendEmail = true; }
|
|
39494
39519
|
if (isChangeUser === void 0) { isChangeUser = true; }
|
|
39520
|
+
if (emails === void 0) { emails = []; }
|
|
39495
39521
|
return __awaiter(this, void 0, void 0, function () {
|
|
39496
39522
|
var notificationParams;
|
|
39497
39523
|
return __generator(this, function (_a) {
|
|
@@ -39509,6 +39535,7 @@
|
|
|
39509
39535
|
}
|
|
39510
39536
|
notificationParams.orgIds = orgIds.join(',');
|
|
39511
39537
|
notificationParams.userIds = userIds.join(',');
|
|
39538
|
+
notificationParams.emails = emails.join(',');
|
|
39512
39539
|
notificationParams.title = title;
|
|
39513
39540
|
notificationParams.link = link ? encodeURIComponent(link) : '';
|
|
39514
39541
|
notificationParams.templateTextCode = templateTextCode;
|
|
@@ -44676,7 +44703,7 @@
|
|
|
44676
44703
|
DatetimePickerComponent.prototype.autoCorectDateTime = function (input) {
|
|
44677
44704
|
if (input != '') {
|
|
44678
44705
|
var dateValue = this.control.timeOnly ? "01/01/0001 " + input : input;
|
|
44679
|
-
var result = this._commonService.processDateInput(dateValue, this.control.showTime, this.control.timeOnly);
|
|
44706
|
+
var result = this._commonService.processDateInput(dateValue, this.control.showTime, this.control.timeOnly, this.control.view);
|
|
44680
44707
|
if (isValidDate(result)) {
|
|
44681
44708
|
if (this.control.minDate || this.control.maxDate) {
|
|
44682
44709
|
if (this.control.maxDate) {
|
|
@@ -51236,6 +51263,7 @@
|
|
|
51236
51263
|
this.showFooter = true;
|
|
51237
51264
|
this.hiddenSave = true;
|
|
51238
51265
|
this.maximizable = true;
|
|
51266
|
+
this.showHeader = true;
|
|
51239
51267
|
this.onSave = new i0.EventEmitter();
|
|
51240
51268
|
this.onCancel = new i0.EventEmitter();
|
|
51241
51269
|
this.onShow = new i0.EventEmitter();
|
|
@@ -51324,7 +51352,7 @@
|
|
|
51324
51352
|
TnDialogComponent.decorators = [
|
|
51325
51353
|
{ type: i0.Component, args: [{
|
|
51326
51354
|
selector: 'tn-dialog',
|
|
51327
|
-
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>",
|
|
51355
|
+
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>",
|
|
51328
51356
|
styles: [""]
|
|
51329
51357
|
},] }
|
|
51330
51358
|
];
|
|
@@ -51353,6 +51381,7 @@
|
|
|
51353
51381
|
minY: [{ type: i0.Input }],
|
|
51354
51382
|
hiddenSave: [{ type: i0.Input }],
|
|
51355
51383
|
maximizable: [{ type: i0.Input }],
|
|
51384
|
+
showHeader: [{ type: i0.Input }],
|
|
51356
51385
|
onSave: [{ type: i0.Output }],
|
|
51357
51386
|
onCancel: [{ type: i0.Output }],
|
|
51358
51387
|
onShow: [{ type: i0.Output }],
|
|
@@ -52371,7 +52400,7 @@
|
|
|
52371
52400
|
var _this = this;
|
|
52372
52401
|
this.control._component = this;
|
|
52373
52402
|
var commonFieldPlus = 'maChucVu,lstTenDonVi';
|
|
52374
|
-
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' :
|
|
52403
|
+
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: function (item) {
|
|
52375
52404
|
var _a;
|
|
52376
52405
|
if (_this.control.funcGetLabel)
|
|
52377
52406
|
return _this.control.funcGetLabel(item);
|