ps-toolkit-ui 1.22.44 → 1.22.46
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 +21 -11
- 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/string.class.js +2 -1
- package/esm2015/lib/classes/table.class.js +9 -7
- package/esm2015/lib/components/table/row/table.row.component.js +2 -1
- package/esm2015/lib/components/table/table.component.js +12 -6
- package/fesm2015/ps-toolkit-ui.js +21 -11
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/string.class.d.ts +1 -0
- package/lib/classes/table.class.d.ts +1 -0
- package/lib/components/table/table.component.d.ts +1 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -287,6 +287,7 @@ const strings = {
|
|
|
287
287
|
Invalid: 'نامعتبر است',
|
|
288
288
|
ExpertSearch: 'جستجو پیشرفته',
|
|
289
289
|
SumCountCol: 'تعداد : {}',
|
|
290
|
+
SumCountFromCol: '{} از {}',
|
|
290
291
|
UploaderTitle: 'برای آپلود فایل <span class="f-u f-w-700 c-primary">کلیک کنید</span> و یا فایل خود را به اینجا کشیده و رها کنید',
|
|
291
292
|
UploaderMaxLength: 'حداکثر اندازه برای آپلود {}MB',
|
|
292
293
|
FormErrorRequired: '{} را وارد کنید',
|
|
@@ -2691,6 +2692,7 @@ class TableClass {
|
|
|
2691
2692
|
this.method = Method.Post;
|
|
2692
2693
|
this.height = 40;
|
|
2693
2694
|
this.perPage = 10;
|
|
2695
|
+
this.allChecked = false;
|
|
2694
2696
|
this.cols = [];
|
|
2695
2697
|
this.buttons = [];
|
|
2696
2698
|
this.optionsActions = [];
|
|
@@ -3063,8 +3065,9 @@ class TableClass {
|
|
|
3063
3065
|
p.Area = this.permissions.Area;
|
|
3064
3066
|
p.Controller = option.Controller;
|
|
3065
3067
|
p.Action = option.Action;
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3068
|
+
const ids = this.data().map(x => x.Id);
|
|
3069
|
+
const data = this.allChecked ? this.searchData() : { Ids: ids };
|
|
3070
|
+
this.showConfirm(this.l(option.Action + 'ConfirmMulti', this.allChecked ? this.count : ids.length), this.getOptionUrl(option.Url, this.permissions.RelatedId, (this.allChecked ? '-1' : '')), data, () => {
|
|
3068
3071
|
this.load();
|
|
3069
3072
|
});
|
|
3070
3073
|
};
|
|
@@ -3142,7 +3145,7 @@ class TableClass {
|
|
|
3142
3145
|
const cv = get(row.Data, col.name);
|
|
3143
3146
|
if (row.Data.isSum) {
|
|
3144
3147
|
if (idx === 0) {
|
|
3145
|
-
return this.l('
|
|
3148
|
+
return this.data().length === 0 ? this.l('SumCountFromCol', this.count) : this.l('SumCountFromCol', [this.allChecked ? this.count : this.data().length, this.count]);
|
|
3146
3149
|
}
|
|
3147
3150
|
else if (col.sumFun != null) {
|
|
3148
3151
|
return col.sumFun(this.sumRow);
|
|
@@ -3278,11 +3281,11 @@ class TableClass {
|
|
|
3278
3281
|
this.sumRow.isSum = true;
|
|
3279
3282
|
return;
|
|
3280
3283
|
}
|
|
3281
|
-
const result = Object.keys(this.sumRowBase).reduce((
|
|
3282
|
-
|
|
3284
|
+
const result = Object.keys(this.sumRowBase).reduce((rs, key) => {
|
|
3285
|
+
rs[key] = checks.reduce((total, item) => {
|
|
3283
3286
|
return total + (item[key] || 0);
|
|
3284
3287
|
}, 0);
|
|
3285
|
-
return
|
|
3288
|
+
return rs;
|
|
3286
3289
|
}, {});
|
|
3287
3290
|
result.isSum = true;
|
|
3288
3291
|
this.sumRow = result;
|
|
@@ -3456,6 +3459,7 @@ class TableRowComponent {
|
|
|
3456
3459
|
}
|
|
3457
3460
|
check() {
|
|
3458
3461
|
this.row.checked = !this.row.checked;
|
|
3462
|
+
this.table.allChecked = false;
|
|
3459
3463
|
if (this.table.onChangeCheck) {
|
|
3460
3464
|
this.table.onChangeCheck(this.row);
|
|
3461
3465
|
}
|
|
@@ -3900,15 +3904,21 @@ class TableComponent {
|
|
|
3900
3904
|
this.confirm.show(l, url, data, accept);
|
|
3901
3905
|
};
|
|
3902
3906
|
}
|
|
3903
|
-
|
|
3907
|
+
allRowsChecked() {
|
|
3904
3908
|
return this.table.rows.filter(x => !x.checked).length === 0;
|
|
3905
3909
|
}
|
|
3906
3910
|
isChecked() {
|
|
3907
3911
|
return this.table.rows.filter(x => x.checked).length > 0;
|
|
3908
3912
|
}
|
|
3909
3913
|
checkAll() {
|
|
3910
|
-
if (this.table.rows.
|
|
3911
|
-
this.table.
|
|
3914
|
+
if (this.table.rows.every(x => x.checked)) {
|
|
3915
|
+
if (this.table.perPage === -1 || this.table.allChecked) {
|
|
3916
|
+
this.table.rows.forEach(x => x.checked = false);
|
|
3917
|
+
this.table.allChecked = false;
|
|
3918
|
+
}
|
|
3919
|
+
else {
|
|
3920
|
+
this.table.allChecked = true;
|
|
3921
|
+
}
|
|
3912
3922
|
}
|
|
3913
3923
|
else {
|
|
3914
3924
|
this.table.rows.forEach(x => x.checked = true);
|
|
@@ -3988,8 +3998,8 @@ class TableComponent {
|
|
|
3988
3998
|
TableComponent.decorators = [
|
|
3989
3999
|
{ type: Component, args: [{
|
|
3990
4000
|
selector: 'lib-table',
|
|
3991
|
-
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren || table.subTable != null ? ' has-children' : '') + (table.vertical ? ' vertical' : '') + (table.expertSearch ? ' expert-search' : '') + ' table-con w-100'\">\r\n <div class=\"table-items\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n <div class=\"f-r\" [innerHTML]=\"this.table.title ? this.table.title : table.l('List')\"></div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\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 <span *ngIf=\"isChecked()\">\r\n <lib-form-icon *ngFor=\"let btn of table.optionButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\r\n <span *ngIf=\"!isChecked()\">\r\n <lib-form-icon *ngIf=\"table.expertSearch\" [inp]=\"expertSearch\"></lib-form-icon>\r\n <!-- <lib-form-icon [inp]=\"excelUi\"></lib-form-icon>-->\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div #exportDropDown class=\"export-dropdown-con\">\r\n <lib-form-button [inp]=\"print\"></lib-form-button>\r\n <lib-form-button [inp]=\"excel\"></lib-form-button>\r\n <lib-form-button [inp]=\"pdf\"></lib-form-button>\r\n </div>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </span>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-icon [inp]=\"btn\" *ngIf=\"btn.type == type.Icon\"></lib-form-icon>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n <lib-form-select [inp]=\"btn\" *ngIf=\"btn.type == type.Select\"></lib-form-select>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\" (click)=\"hideExpertSearch($event)\">\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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren || table.subTable != null ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withCheck ? 'with-handle-check ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-check\" *ngIf=\"table.hasChildren || table.subTable != null\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withCheck\">\r\n <i (click)=\"checkAll()\" [className]=\"(allChecked
|
|
3992
|
-
styles: [".table-con{float:right;position:relative}.table-con>.table-items{padding:20px;position:relative}.table-con>.sum-row,.table-con>.table-items{background-color:#fff;border-radius:var(--border-radius-base);
|
|
4001
|
+
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren || table.subTable != null ? ' has-children' : '') + (table.vertical ? ' vertical' : '') + (table.expertSearch ? ' expert-search' : '') + ' table-con w-100'\">\r\n <div class=\"table-items\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n <div class=\"f-r\" [innerHTML]=\"this.table.title ? this.table.title : table.l('List')\"></div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\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 <span *ngIf=\"isChecked()\">\r\n <lib-form-icon *ngFor=\"let btn of table.optionButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\r\n <span *ngIf=\"!isChecked()\">\r\n <lib-form-icon *ngIf=\"table.expertSearch\" [inp]=\"expertSearch\"></lib-form-icon>\r\n <!-- <lib-form-icon [inp]=\"excelUi\"></lib-form-icon>-->\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div #exportDropDown class=\"export-dropdown-con\">\r\n <lib-form-button [inp]=\"print\"></lib-form-button>\r\n <lib-form-button [inp]=\"excel\"></lib-form-button>\r\n <lib-form-button [inp]=\"pdf\"></lib-form-button>\r\n </div>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </span>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-icon [inp]=\"btn\" *ngIf=\"btn.type == type.Icon\"></lib-form-icon>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n <lib-form-select [inp]=\"btn\" *ngIf=\"btn.type == type.Select\"></lib-form-select>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\" (click)=\"hideExpertSearch($event)\">\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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren || table.subTable != null ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withCheck ? 'with-handle-check ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-check\" *ngIf=\"table.hasChildren || table.subTable != null\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withCheck\">\r\n <i (click)=\"checkAll()\" [className]=\"(allChecked ? 'fas fa-square-check c-green' : allRowsChecked() ? 'far fa-square-check c-green' : isChecked() ? 'far fa-square-minus c-green' : 'far fa-square') + ' check-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </div>\r\n </div>\r\n <div (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort ' : '') + col.class + ' ' + col.name + '-cell cell w-100'\" *ngFor=\"let col of table.cols\">\r\n <div class=\"header-title\" *ngIf=\"col.search == null || table.sortable\" [innerHTML]=\"table.l(col.name)\"></div>\r\n <div class=\"header-search\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date && col.type != colType.DateTime && col.type != colType.DateDif && col.type != colType.DateRemain && col.type != colType.Month && col.type != colType.Year && col.enum == null\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"(col.type == colType.Date || col.type == colType.DateTime || col.type === colType.DateDif || col.type === colType.DateRemain || col.type == colType.Month || col.type == colType.Year) && col.enum == null\" [inp]=\"col.search\"></lib-form-date>\r\n <lib-form-select *ngIf=\"col.enum != null\" [inp]=\"col.search\"></lib-form-select>\r\n </div>\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 </div>\r\n <div class=\"cell options\" *ngIf=\"table.optionType == tableOptionType.Show\">{{table.l('Options')}}</div>\r\n </div>\r\n </div>\r\n <div class=\"body\" #rows [style]=\"table.perPage > 0 ? {minHeight: table.height * table.perPage + 'px'} : {minHeight: '250px'}\">\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 <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </div>\r\n </div>\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </div>\r\n <div class=\"sum-row\" *ngIf=\"table.sumRowBase != null\">\r\n <lib-table-row [id]=\"'Sum'\" [table]=\"table\" [row]=\"{Data: table.sumRow, Options: []}\"></lib-table-row>\r\n </div>\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",
|
|
4002
|
+
styles: [".table-con{float:right;position:relative}.table-con>.table-items{padding:20px;position:relative}.table-con>.sum-row,.table-con>.table-items{background-color:#fff;border-radius:var(--border-radius-base);float:right;width:100%}.table-con>.sum-row{bottom:0;box-shadow:var(--box-shadow-table);margin-top:5px;padding:0 20px;position:sticky}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:112}.table-con>.table-items>.title{float:right;font-size:16px;font-weight:var(--font-bold);line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%;z-index:3}.table-con>.table-items>.title .description{font-size:13px;font-weight:var(--font-light);margin-right:10px}.table-con>.table-items>.title .buttons,.table-con>.table-items>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.table-items>.title .extra-buttons{min-width:80px}.table-con>.table-items>.title .extra-buttons .export-dropdown-con{background-color:var(--white);border-radius:var(--border-radius-base);display:none;left:20px;position:absolute;top:30px;width:150px;z-index:1}::ng-deep .table-con>.table-items>.title .extra-buttons .export-dropdown-con lib-form-button .form-input-con.button .form-input .control{border-radius:0}::ng-deep .table-con>.table-items>.title .extra-buttons .export-dropdown-con lib-form-button:first-of-type .form-input-con.button .form-input .control{border-radius:var(--border-radius-base) var(--border-radius-base) 0 0}::ng-deep .table-con>.table-items>.title .extra-buttons .export-dropdown-con lib-form-button:last-of-type .form-input-con.button .form-input .control{border-radius:0 0 var(--border-radius-base) var(--border-radius-base)}.table-con>.table-items>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con.expert-search>.table-items>.search-form{background-color:rgba(51,51,51,.4);height:100%;left:0;margin-bottom:0;opacity:0;overflow:hidden;position:absolute;top:0;transition:all .35s ease-in-out;visibility:hidden;width:100%;z-index:4}.table-con.expert-search.show-expert-search>.table-items>.search-form{opacity:1;visibility:visible}::ng-deep .table-con.expert-search>.table-items>.search-form .form{background-color:var(--white);box-shadow:var(--box-shadow-right);height:100%;left:calc(-20% - 20px);padding:20px;position:absolute;top:0;transition:all .35s ease-in-out;width:20%;z-index:4}::ng-deep .table-con.expert-search>.table-items>.search-form .form .inputs{float:right;height:calc(100% - 50px);margin:0;overflow-y:auto;width:100%}::ng-deep .table-con.expert-search.show-expert-search>.table-items>.search-form .form{left:0}.table-con .table,.table-con .table .header{float:right;width:100%}.table-con .table .header .row{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;background-color:var(--base-white);border-radius:var(--border-radius-base);display:flex;flex-wrap:wrap;float:right;justify-content:right;position:relative;width:100%}.table-con .table .header .row.with-handle-check,.table-con .table .header .row.with-handle-children,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-check,.table-con .table .header .row.with-handle-sortable.with-handle-check,.table-con .table .header .row.with-handle-sortable.with-handle-children{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-check{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-size:12px;font-weight:var(--font-normal);height:45px;justify-content:center;position:relative}.table-con .table .header .row .cell.options{margin-left:auto;margin-right:auto}.table-con .table .header .row .handle-con{height:100%;position:absolute;right:0;top:0}.table-con .table .header .row .handle-con .handle{align-items:center;display:flex;float:right;height:100%;justify-content:center;width:30px}.table-con .table .header .row .handle-con .handle i{cursor:pointer;font-size:18px}.table-con .table .header .row .cell.sort{cursor:pointer}.table-con .table .header .row .cell .header-title{float:right;padding:0 15px;text-align:center;width:calc(100% - 20px)}.table-con .table .header .row .cell .header-search{float:right;width:calc(100% - 20px)}.table-con .table .header .row .cell .sort-icon{float:right;font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;top:calc(50% - 10px);width:20px}.table-con .table .body{float:right;position:relative;width:100%}::ng-deep .table-con .table .header .row .cell .check-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}::ng-deep .table-con.vertical .table lib-table-row>.row-con>.row:after{background-image:linear-gradient(180deg,rgba(0,0,0,.05),rgba(50,50,50,.15),rgba(0,0,0,.05));height:100%;left:0;right:unset;width:1px}::ng-deep .table-con .sum-row lib-table-row:first-of-type>.row-con>.row:after,::ng-deep .table-con.vertical:not(.sortable) .table lib-table-row:first-of-type>.row-con>.row:after,::ng-deep .table-con:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}.table-con.vertical .table .header{display:none}::ng-deep .table-con .table lib-table-row{display:contents}.table-con.vertical .table .body{display:flex}::ng-deep .table-con.vertical .table lib-table-row:first-of-type>.row-con{background-color:var(--base-white);border-radius:var(--border-radius-base);max-width:150px}@media (max-width:499.99px){::ng-deep .table-con.expert-search>.table-items>.search-form .form{left:calc(-100% - 20px);width:100%}}@media (min-width:500px) and (max-width:699.99px){::ng-deep .table-con.expert-search>.table-items>.search-form .form{left:calc(-50% - 20px);width:50%}}@media (min-width:700px) and (max-width:999.99px){::ng-deep .table-con.expert-search>.table-items>.search-form .form{left:calc(-40% - 20px);width:40%}}@media (min-width:1000px) and (max-width:1599.99px){::ng-deep .table-con.expert-search>.table-items>.search-form .form{left:calc(-30% - 20px);width:30%}}"]
|
|
3993
4003
|
},] }
|
|
3994
4004
|
];
|
|
3995
4005
|
TableComponent.ctorParameters = () => [
|