ps-toolkit-ui 0.0.162 → 0.0.166
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/ps-toolkit-ui.umd.js +16 -12
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/request.class.js +6 -5
- package/esm2015/lib/components/alert/alert.component.js +5 -5
- package/esm2015/lib/components/confirm/confirm.component.js +7 -3
- package/esm2015/lib/components/table/table.component.js +2 -2
- package/fesm2015/ps-toolkit-ui.js +15 -11
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -1205,14 +1205,15 @@
|
|
|
1205
1205
|
else {
|
|
1206
1206
|
var m = '';
|
|
1207
1207
|
if (res.status === exports.ResultStatusEnum.Unauthorized) {
|
|
1208
|
-
m = 'FormBaseErrorExpired';
|
|
1208
|
+
m = form.l('FormBaseErrorExpired');
|
|
1209
1209
|
}
|
|
1210
1210
|
else if (res.status === exports.ResultStatusEnum.NotAccess) {
|
|
1211
|
-
m = 'FormBaseErrorPermission';
|
|
1211
|
+
m = form.l('FormBaseErrorPermission');
|
|
1212
1212
|
}
|
|
1213
1213
|
else {
|
|
1214
1214
|
if (typeof res.message === 'string') {
|
|
1215
|
-
|
|
1215
|
+
var am = res.message.split(':');
|
|
1216
|
+
m = form.l(am[0], am.length > 1 ? am.slice(1) : null);
|
|
1216
1217
|
}
|
|
1217
1218
|
else {
|
|
1218
1219
|
// tslint:disable-next-line:forin
|
|
@@ -1242,7 +1243,7 @@
|
|
|
1242
1243
|
}
|
|
1243
1244
|
}
|
|
1244
1245
|
if (m) {
|
|
1245
|
-
HelperClass.addNotification(
|
|
1246
|
+
HelperClass.addNotification(m);
|
|
1246
1247
|
}
|
|
1247
1248
|
if (form.onFailed) {
|
|
1248
1249
|
form.onFailed(res.message);
|
|
@@ -3128,7 +3129,7 @@
|
|
|
3128
3129
|
TableComponent.decorators = [
|
|
3129
3130
|
{ type: core.Component, args: [{
|
|
3130
3131
|
selector: 'lib-table',
|
|
3131
|
-
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.title ? this.table.title : 'List'}}\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngFor=\"let btn of table.buttons\"></lib-form-button>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <table>\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"table.hasChildren\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.sortable\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.withSelect\" style=\"width: 50px\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </th>\r\n <th (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort' : '')\" *ngFor=\"let col of table.cols\" [style]=\"{width: col.percent + '%'}\">\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n <span *ngIf=\"col.search == null\">{{ table.l(col.name) }}</span>\r\n <div class=\"w-90 header-search p-h-20 m-r-5\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date\" [inp]=\"col.search\"></lib-form-date>\r\n </div>\r\n </th>\r\n <th *ngIf=\"table.optionType == tableOptionType.Show\" [style]=\"{width: (100 - itemsWidth) + '%'}\">{{table.l('Options')}}</th>\r\n<!-- <th *ngIf=\"table.hasOption()\" [style]=\"{width: (100 - itemsWidth) + '%'}\">-->\r\n<!-- <span *ngIf=\"!table.withSelect || !isSelected()\">{{ table.l('Options') }}</span>-->\r\n<!-- <span *ngIf=\"table.withSelect && isSelected()\" class=\"option-con\">-->\r\n<!-- <span *ngFor=\"let opt of options\">-->\r\n<!-- <lib-form-button *ngIf=\"opt.type == type.Button\" [inp]=\"opt\"></lib-form-button>-->\r\n<!-- <lib-form-icon *ngIf=\"opt.type == type.Icon\" [inp]=\"opt\"></lib-form-icon>-->\r\n<!-- </span>-->\r\n<!-- </span>-->\r\n<!-- </th>-->\r\n </tr>\r\n </thead>\r\n <tbody #rows [style]=\"table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <tr *ngIf=\"table.perPage > 0\" [style]=\"{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}\"></tr>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </tbody>\r\n <tfoot>\r\n <tr>\r\n <td colspan=\"100%\">\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n </table>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"
|
|
3132
|
+
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.title ? this.table.title : 'List'}}\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngFor=\"let btn of table.buttons\"></lib-form-button>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <table>\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"table.hasChildren\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.sortable\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.withSelect\" style=\"width: 50px\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </th>\r\n <th (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort' : '')\" *ngFor=\"let col of table.cols\" [style]=\"{width: col.percent + '%'}\">\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n <span *ngIf=\"col.search == null\">{{ table.l(col.name) }}</span>\r\n <div class=\"w-90 header-search p-h-20 m-r-5\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date\" [inp]=\"col.search\"></lib-form-date>\r\n </div>\r\n </th>\r\n <th *ngIf=\"table.optionType == tableOptionType.Show\" [style]=\"{width: (100 - itemsWidth) + '%'}\">{{table.l('Options')}}</th>\r\n<!-- <th *ngIf=\"table.hasOption()\" [style]=\"{width: (100 - itemsWidth) + '%'}\">-->\r\n<!-- <span *ngIf=\"!table.withSelect || !isSelected()\">{{ table.l('Options') }}</span>-->\r\n<!-- <span *ngIf=\"table.withSelect && isSelected()\" class=\"option-con\">-->\r\n<!-- <span *ngFor=\"let opt of options\">-->\r\n<!-- <lib-form-button *ngIf=\"opt.type == type.Button\" [inp]=\"opt\"></lib-form-button>-->\r\n<!-- <lib-form-icon *ngIf=\"opt.type == type.Icon\" [inp]=\"opt\"></lib-form-icon>-->\r\n<!-- </span>-->\r\n<!-- </span>-->\r\n<!-- </th>-->\r\n </tr>\r\n </thead>\r\n <tbody #rows [style]=\"table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <tr *ngIf=\"table.perPage > 0\" [style]=\"{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}\"></tr>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </tbody>\r\n <tfoot>\r\n <tr>\r\n <td colspan=\"100%\">\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n </table>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
|
|
3132
3133
|
styles: [".table-con{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative;width:100%}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:11}.table-con>.title{float:right;font-family:VazirBold;font-size:16px;height:40px;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .extra-buttons{float:left;margin-top:5px}.table-con>.title .buttons{float:left;margin-left:10px;margin-top:5px}.table-con>.search-form{border-radius:5px;float:right;margin-bottom:5px;width:100%}.table-con table{border-spacing:0!important;width:100%}.table-con table thead tr{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;position:relative}.table-con table thead tr th{background-color:var(--base-11);color:var(--black-88);font-family:VazirLight;font-size:12px;font-weight:400;height:45px;position:relative;vertical-align:middle}.table-con table thead tr th:first-child{border-bottom-right-radius:5px;border-top-right-radius:5px}.table-con table thead tr th:last-child{border-bottom-left-radius:5px;border-top-left-radius:5px}.table-con table thead tr th.sort{cursor:pointer}.table-con table thead tr th .sort-icon{font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;position:absolute;top:calc(50% - 10px);width:20px}.table-con table tbody{position:relative}.table-con table tfoot tr{height:45px}.table-con table tfoot tr td{position:relative;vertical-align:bottom}::ng-deep .table-con:not(.sortable) table lib-table-row:last-of-type>tr:after{background-image:unset}::ng-deep .table-con table thead tr th .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}"]
|
|
3133
3134
|
},] }
|
|
3134
3135
|
];
|
|
@@ -6013,12 +6014,11 @@
|
|
|
6013
6014
|
];
|
|
6014
6015
|
}
|
|
6015
6016
|
AlertComponent.prototype.show = function (l, accept) {
|
|
6016
|
-
var _this = this;
|
|
6017
6017
|
this.alertLabel.value = l;
|
|
6018
|
-
this.alert.onHide =
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
};
|
|
6018
|
+
// this.alert.onHide = () => {
|
|
6019
|
+
// this.alert.hide();
|
|
6020
|
+
// accept();
|
|
6021
|
+
// };
|
|
6022
6022
|
this.alert.show();
|
|
6023
6023
|
};
|
|
6024
6024
|
return AlertComponent;
|
|
@@ -6037,6 +6037,11 @@
|
|
|
6037
6037
|
var ConfirmComponent = /** @class */ (function () {
|
|
6038
6038
|
function ConfirmComponent(config) {
|
|
6039
6039
|
this.config = config;
|
|
6040
|
+
var lang = new LangClass(config.currentLang, config.strings);
|
|
6041
|
+
this.l = function (key, v) {
|
|
6042
|
+
if (v === void 0) { v = null; }
|
|
6043
|
+
return lang.get('Public', 'Confirm', key, v);
|
|
6044
|
+
};
|
|
6040
6045
|
}
|
|
6041
6046
|
ConfirmComponent.prototype.ngOnInit = function () {
|
|
6042
6047
|
this.confirm = new ModalClass(this.config.environment, this.l, (this.tableId ? this.tableId : '') + 'Confirm');
|
|
@@ -6073,8 +6078,7 @@
|
|
|
6073
6078
|
{ type: PsToolkitUiConfigService }
|
|
6074
6079
|
]; };
|
|
6075
6080
|
ConfirmComponent.propDecorators = {
|
|
6076
|
-
tableId: [{ type: core.Input }]
|
|
6077
|
-
l: [{ type: core.Input }]
|
|
6081
|
+
tableId: [{ type: core.Input }]
|
|
6078
6082
|
};
|
|
6079
6083
|
|
|
6080
6084
|
var NotfoundComponent = /** @class */ (function () {
|