tnx-shared 5.3.335 → 5.3.336
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 +49 -19
- 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/base/list-base.d.ts.map +1 -1
- package/classes/base/list-component-base.d.ts +1 -0
- package/classes/base/list-component-base.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/enums/common.d.ts +1 -0
- package/enums/common.d.ts.map +1 -1
- package/esm2015/classes/base/list-base.js +32 -17
- package/esm2015/classes/base/list-component-base.js +8 -3
- package/esm2015/components/tn-dialog/tn-dialog.component.js +3 -2
- package/esm2015/enums/common.js +2 -1
- package/esm2015/services/user.service.js +9 -1
- package/fesm2015/tnx-shared.js +49 -19
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/user.service.d.ts +2 -0
- package/services/user.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -5638,6 +5638,7 @@
|
|
|
5638
5638
|
EnumProperties["NG_REFLECT_TEXT"] = "ng-reflect-text";
|
|
5639
5639
|
EnumProperties["NG_REFLECT_LABEL"] = "ng-reflect-label";
|
|
5640
5640
|
EnumProperties["CRUD_LIST"] = "crud-list";
|
|
5641
|
+
EnumProperties["TREE_LIST"] = "tn-tree-table";
|
|
5641
5642
|
EnumProperties["LABEL"] = "label";
|
|
5642
5643
|
EnumProperties["TAG_NAME"] = "tagName";
|
|
5643
5644
|
EnumProperties["TOOLTIP"] = "ptooltip";
|
|
@@ -12404,6 +12405,14 @@
|
|
|
12404
12405
|
var url = this.serviceUri + "/ValidatePassword/?password=" + password;
|
|
12405
12406
|
return this.defaultGet(url);
|
|
12406
12407
|
};
|
|
12408
|
+
UserService.prototype.getUserCache = function (cacheKey) {
|
|
12409
|
+
var url = this.serviceUri + "/GetUserCache/" + cacheKey;
|
|
12410
|
+
return this.defaultGet(url);
|
|
12411
|
+
};
|
|
12412
|
+
UserService.prototype.setUserCache = function (data) {
|
|
12413
|
+
var url = this.serviceUri + "/SetUserCache";
|
|
12414
|
+
return this.defaultPost(url, data);
|
|
12415
|
+
};
|
|
12407
12416
|
return UserService;
|
|
12408
12417
|
}(BaseService));
|
|
12409
12418
|
UserService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function UserService_Factory() { return new UserService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService), i0__namespace.ɵɵinject(AuthenService), i0__namespace.ɵɵinject(i4__namespace.OAuthService), i0__namespace.ɵɵinject(SignalRService), i0__namespace.ɵɵinject(ExceptionHandlerService), i0__namespace.ɵɵinject(ApplicationContextService)); }, token: UserService, providedIn: "root" });
|
|
@@ -22981,7 +22990,6 @@
|
|
|
22981
22990
|
}
|
|
22982
22991
|
};
|
|
22983
22992
|
ListComponentBase.prototype.initColumnSchema = function (cols) {
|
|
22984
|
-
var _a, _b, _c, _d, _e;
|
|
22985
22993
|
if (!cols || !cols.length)
|
|
22986
22994
|
return;
|
|
22987
22995
|
var colFunction = null, colGroup = null, colHasToggleIcon = null;
|
|
@@ -23004,7 +23012,7 @@
|
|
|
23004
23012
|
colHasToggleIcon = this.setting.cols[0];
|
|
23005
23013
|
}
|
|
23006
23014
|
colHasToggleIcon.colHasToggleIcon = true;
|
|
23007
|
-
this.
|
|
23015
|
+
this.getComponentKey();
|
|
23008
23016
|
this.getColorSetting();
|
|
23009
23017
|
this.getColumnSetting(colGroup);
|
|
23010
23018
|
this.getPageSetting();
|
|
@@ -23013,6 +23021,12 @@
|
|
|
23013
23021
|
this.applyColumnSetting();
|
|
23014
23022
|
this.buildFilterColumn(this.setting.cols);
|
|
23015
23023
|
};
|
|
23024
|
+
ListComponentBase.prototype.getComponentKey = function () {
|
|
23025
|
+
var _a, _b, _c, _d, _e;
|
|
23026
|
+
var parentClass = this.isTreeTable ? exports.EnumProperties.TREE_LIST : exports.EnumProperties.CRUD_LIST;
|
|
23027
|
+
var componentName = ((_e = (_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest(parentClass)) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.tagName) === null || _e === void 0 ? void 0 : _e.toLowerCase()) || '';
|
|
23028
|
+
this.componentKey = "" + location.pathname + (componentName ? '/' + componentName : '') + (this.setting.settingKey ? '/' + this.setting.settingKey : '');
|
|
23029
|
+
};
|
|
23016
23030
|
ListComponentBase.prototype.extendColumns = function (cols, appendCol) {
|
|
23017
23031
|
var e_3, _h;
|
|
23018
23032
|
var _this = this;
|
|
@@ -27893,11 +27907,12 @@
|
|
|
27893
27907
|
ListBase.prototype.loadItemFromQueryParam = function () {
|
|
27894
27908
|
var _this = this;
|
|
27895
27909
|
if (this.loadDetailFromQueryParam === undefined || this.loadDetailFromQueryParam === true) {
|
|
27896
|
-
var idInQueryString = null;
|
|
27910
|
+
var idInQueryString = null, isView = false;
|
|
27897
27911
|
var pid = null; // permission Id được người khác share
|
|
27898
27912
|
if (this._activatedRoute.snapshot
|
|
27899
27913
|
&& this._activatedRoute.snapshot.queryParams) {
|
|
27900
27914
|
idInQueryString = this._activatedRoute.snapshot.queryParams.id || this._activatedRoute.snapshot.queryParams.entityKey;
|
|
27915
|
+
isView = !!this._activatedRoute.snapshot.queryParams.isView;
|
|
27901
27916
|
pid = this._activatedRoute.snapshot.queryParams.pid;
|
|
27902
27917
|
}
|
|
27903
27918
|
if (pid) {
|
|
@@ -27905,22 +27920,36 @@
|
|
|
27905
27920
|
}
|
|
27906
27921
|
else if (idInQueryString) {
|
|
27907
27922
|
// get detail data
|
|
27908
|
-
|
|
27909
|
-
.
|
|
27910
|
-
|
|
27923
|
+
if (isView) {
|
|
27924
|
+
this.setting.baseService.getDetail(idInQueryString)
|
|
27925
|
+
.then(function (res) {
|
|
27926
|
+
if (!res.data) {
|
|
27927
|
+
_this._notifierService.showWarning('Không tìm thấy bản ghi cần xem chi tiết');
|
|
27928
|
+
}
|
|
27929
|
+
_this._viewOnly(res.data);
|
|
27930
|
+
}).catch(function (err) {
|
|
27931
|
+
_this._loggerService.logError('error on get detail from querystring', err);
|
|
27911
27932
|
_this._notifierService.showWarning('Không tìm thấy bản ghi cần xem chi tiết');
|
|
27912
|
-
}
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
|
|
27916
|
-
|
|
27917
|
-
|
|
27918
|
-
|
|
27919
|
-
|
|
27920
|
-
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
|
|
27933
|
+
});
|
|
27934
|
+
}
|
|
27935
|
+
else {
|
|
27936
|
+
this.setting.baseService.getDetailWithPermission(idInQueryString)
|
|
27937
|
+
.then(function (res) {
|
|
27938
|
+
if (!res.data) {
|
|
27939
|
+
_this._notifierService.showWarning('Không tìm thấy bản ghi cần xem chi tiết');
|
|
27940
|
+
}
|
|
27941
|
+
if ((res.data.basePermission & exports.PermissionBase.EDIT) == exports.PermissionBase.EDIT
|
|
27942
|
+
|| (res.data.basePermission & exports.PermissionBase.READ) == exports.PermissionBase.READ) {
|
|
27943
|
+
_this._edit(res.data);
|
|
27944
|
+
}
|
|
27945
|
+
else {
|
|
27946
|
+
_this._notifierService.showWarning('Bạn không có quyền xem bản ghi');
|
|
27947
|
+
}
|
|
27948
|
+
}).catch(function (err) {
|
|
27949
|
+
_this._loggerService.logError('error on get detail from querystring', err);
|
|
27950
|
+
_this._notifierService.showWarning('Không tìm thấy bản ghi cần xem chi tiết');
|
|
27951
|
+
});
|
|
27952
|
+
}
|
|
27924
27953
|
}
|
|
27925
27954
|
}
|
|
27926
27955
|
};
|
|
@@ -53835,7 +53864,7 @@
|
|
|
53835
53864
|
TnDialogComponent.decorators = [
|
|
53836
53865
|
{ type: i0.Component, args: [{
|
|
53837
53866
|
selector: 'tn-dialog',
|
|
53838
|
-
template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [
|
|
53867
|
+
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>",
|
|
53839
53868
|
styles: [""]
|
|
53840
53869
|
},] }
|
|
53841
53870
|
];
|
|
@@ -53848,6 +53877,7 @@
|
|
|
53848
53877
|
scrollbar: [{ type: i0.ViewChild, args: ['scrollbar', { static: true },] }],
|
|
53849
53878
|
formBase: [{ type: i0.ContentChild, args: ['formBase', { static: false },] }],
|
|
53850
53879
|
footer: [{ type: i0.ContentChild, args: ['footer', { static: true },] }],
|
|
53880
|
+
headerTemplate: [{ type: i0.ContentChild, args: ['headerTemplate', { static: true },] }],
|
|
53851
53881
|
children: [{ type: i0.ContentChildren, args: [i0.TemplateRef, { descendants: true },] }],
|
|
53852
53882
|
maskClass: [{ type: i0.Input }],
|
|
53853
53883
|
styleClass: [{ type: i0.Input }],
|