ps-toolkit-ui 1.20.49 → 1.20.51
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 +49 -40
- 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/enum.class.js +7 -1
- package/esm2015/lib/components/table/table.component.js +45 -42
- package/fesm2015/ps-toolkit-ui.js +50 -41
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +5 -0
- package/lib/components/table/table.component.d.ts +3 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -1021,6 +1021,11 @@
|
|
|
1021
1021
|
TableCollType[TableCollType["Month"] = 18] = "Month";
|
|
1022
1022
|
TableCollType[TableCollType["Year"] = 19] = "Year";
|
|
1023
1023
|
})(exports.TableCollType || (exports.TableCollType = {}));
|
|
1024
|
+
(function (TableExportType) {
|
|
1025
|
+
TableExportType[TableExportType["Print"] = 0] = "Print";
|
|
1026
|
+
TableExportType[TableExportType["Excel"] = 1] = "Excel";
|
|
1027
|
+
TableExportType[TableExportType["Pdf"] = 2] = "Pdf";
|
|
1028
|
+
})(exports.TableExportType || (exports.TableExportType = {}));
|
|
1024
1029
|
(function (UserType) {
|
|
1025
1030
|
UserType[UserType["All"] = 0] = "All";
|
|
1026
1031
|
UserType[UserType["Admin"] = 1] = "Admin";
|
|
@@ -3889,7 +3894,7 @@
|
|
|
3889
3894
|
this.reload = new InputClass(this.table.environment, this.table.l, 'Reload', 'fad fa-sync-alt', exports.InputType.Icon, 'm-r-10-p');
|
|
3890
3895
|
this.export = new InputClass(this.table.environment, this.table.l, 'Export', 'fad fa-download f-s-21', exports.InputType.Icon, 'm-r-10-p export-dropdown-icon');
|
|
3891
3896
|
this.excel = new InputClass(this.table.environment, this.table.l, 'ExportExcel', 'fad fa-file-excel f-s-21', exports.InputType.Button, 'white f-s-11 h-35 p-0');
|
|
3892
|
-
|
|
3897
|
+
this.excelUi = new InputClass(this.table.environment, this.table.l, 'ExportExcel', 'fad fa-file-excel f-s-21', exports.InputType.Icon, 'm-r-10-p');
|
|
3893
3898
|
this.pdf = new InputClass(this.table.environment, this.table.l, 'ExportPdf', 'fad fa-file-pdf f-s-21', exports.InputType.Button, 'white f-s-11 h-35 p-0');
|
|
3894
3899
|
this.print = new InputClass(this.table.environment, this.table.l, 'ExportPrint', 'fad fa-file-lines f-s-21', exports.InputType.Button, 'white f-s-11 h-35 p-0');
|
|
3895
3900
|
this.maximum = new InputClass(this.table.environment, this.table.l, 'Maximum', 'fad fa-arrows-maximize', exports.InputType.Icon, 'm-r-10-p');
|
|
@@ -3949,49 +3954,18 @@
|
|
|
3949
3954
|
this.export.onClick = function () {
|
|
3950
3955
|
$__namespace(_this.exportDropDown.nativeElement).slideToggle();
|
|
3951
3956
|
};
|
|
3957
|
+
this.pdf.onClick = function () {
|
|
3958
|
+
_this.exportTable(exports.TableExportType.Pdf);
|
|
3959
|
+
};
|
|
3952
3960
|
this.excel.onClick = function () {
|
|
3961
|
+
_this.exportTable(exports.TableExportType.Excel);
|
|
3962
|
+
};
|
|
3963
|
+
this.excelUi.onClick = function () {
|
|
3953
3964
|
_this.table.excel();
|
|
3954
3965
|
};
|
|
3955
3966
|
this.print.onClick = function () {
|
|
3956
|
-
|
|
3957
|
-
var matches = __spread(str.matchAll(/w-(\d+)(?:-(\d+))?/g));
|
|
3958
|
-
if (!matches.length) {
|
|
3959
|
-
return null;
|
|
3960
|
-
}
|
|
3961
|
-
var max = matches.reduce(function (best, m) {
|
|
3962
|
-
var first = +m[1];
|
|
3963
|
-
var second = +m[2] || null;
|
|
3964
|
-
if (!best || first > best.first) {
|
|
3965
|
-
return { first: first, second: second };
|
|
3966
|
-
}
|
|
3967
|
-
return best;
|
|
3968
|
-
}, null);
|
|
3969
|
-
var s = (max.second || max.first);
|
|
3970
|
-
return s == null ? 100 : s;
|
|
3971
|
-
};
|
|
3972
|
-
var url = _this.table.permissions.getAccess(exports.PermissionAccessTypeEnum.List).Url.replace('/list', '/report').replace('-list', '-report');
|
|
3973
|
-
var data = _this.table.searchData();
|
|
3974
|
-
data.Page = 1;
|
|
3975
|
-
data.PerPage = -1;
|
|
3976
|
-
data.Cols = _this.table.cols.map(function (x) {
|
|
3977
|
-
return {
|
|
3978
|
-
Name: x.name,
|
|
3979
|
-
TrnName: _this.table.l(x.name),
|
|
3980
|
-
Width: getWidthValue(x.class),
|
|
3981
|
-
Type: x.type,
|
|
3982
|
-
};
|
|
3983
|
-
});
|
|
3984
|
-
new RequestClass(_this.table.environment, _this.table.l).send(url, exports.Method.Post, data, _this.print, function (result) {
|
|
3985
|
-
window.open(_this.table.environment.url + '/report' + url + '?reportId=' + result, '_blank');
|
|
3986
|
-
}, function () { });
|
|
3967
|
+
_this.exportTable(exports.TableExportType.Print);
|
|
3987
3968
|
};
|
|
3988
|
-
$__namespace(document).mouseup(function (e) {
|
|
3989
|
-
var container = $__namespace(_this.exportDropDown.nativeElement);
|
|
3990
|
-
// @ts-ignore
|
|
3991
|
-
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
|
3992
|
-
container.slideUp(100);
|
|
3993
|
-
}
|
|
3994
|
-
});
|
|
3995
3969
|
this.maximum.onClick = function () {
|
|
3996
3970
|
$__namespace(_this.tableDiv.nativeElement).toggleClass('maximum');
|
|
3997
3971
|
_this.maximum.icon = _this.maximum.name === 'Minimum' ? 'fad fa-arrows-maximize' : 'fad fa-arrows-minimize';
|
|
@@ -4004,6 +3978,41 @@
|
|
|
4004
3978
|
_this.confirm.show(l, url, data, accept);
|
|
4005
3979
|
};
|
|
4006
3980
|
};
|
|
3981
|
+
TableComponent.prototype.exportTable = function (type) {
|
|
3982
|
+
var _this = this;
|
|
3983
|
+
var getWidthValue = function (str) {
|
|
3984
|
+
var matches = __spread(str.matchAll(/w-(\d+)(?:-(\d+))?/g));
|
|
3985
|
+
if (!matches.length) {
|
|
3986
|
+
return null;
|
|
3987
|
+
}
|
|
3988
|
+
var max = matches.reduce(function (best, m) {
|
|
3989
|
+
var first = +m[1];
|
|
3990
|
+
var second = +m[2] || null;
|
|
3991
|
+
if (!best || first > best.first) {
|
|
3992
|
+
return { first: first, second: second };
|
|
3993
|
+
}
|
|
3994
|
+
return best;
|
|
3995
|
+
}, null);
|
|
3996
|
+
var s = (max.second || max.first);
|
|
3997
|
+
return s == null ? 100 : s;
|
|
3998
|
+
};
|
|
3999
|
+
var url = this.table.permissions.getAccess(exports.PermissionAccessTypeEnum.List).Url.replace('/list', '/export').replace('-list', '-export');
|
|
4000
|
+
var data = this.table.searchData();
|
|
4001
|
+
data.Page = 1;
|
|
4002
|
+
data.PerPage = -1;
|
|
4003
|
+
data.Type = type;
|
|
4004
|
+
data.Cols = this.table.cols.map(function (x) {
|
|
4005
|
+
return {
|
|
4006
|
+
Name: x.name,
|
|
4007
|
+
TrnName: _this.table.l(x.name),
|
|
4008
|
+
Width: getWidthValue(x.class),
|
|
4009
|
+
Type: x.type,
|
|
4010
|
+
};
|
|
4011
|
+
});
|
|
4012
|
+
new RequestClass(this.table.environment, this.table.l).send(url, exports.Method.Post, data, this.print, function (result) {
|
|
4013
|
+
window.open(_this.table.environment.url + '/report' + url + '?reportId=' + result, '_blank');
|
|
4014
|
+
}, function () { });
|
|
4015
|
+
};
|
|
4007
4016
|
TableComponent.prototype.allChecked = function () {
|
|
4008
4017
|
return this.table.rows.filter(function (x) { return !x.checked; }).length === 0;
|
|
4009
4018
|
};
|
|
@@ -4090,7 +4099,7 @@
|
|
|
4090
4099
|
TableComponent.decorators = [
|
|
4091
4100
|
{ type: core.Component, args: [{
|
|
4092
4101
|
selector: 'lib-table',
|
|
4093
|
-
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 *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
|
|
4102
|
+
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 *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() ? 'fa-solid fa-square-check c-green' : isChecked() ? 'fa-solid fa-square-minus c-green' : 'fa-regular 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 <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",
|
|
4094
4103
|
styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:102}.table-con>.title{float:right;font-size:16px;font-weight:700;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%;z-index:3}.table-con>.title .description{font-size:13px;font-weight:200;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.title .extra-buttons{min-width:80px}.table-con>.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>.title .extra-buttons .export-dropdown-con lib-form-button .form-input-con.button .form-input .control{border-radius:0}::ng-deep .table-con>.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>.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>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con.expert-search>.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>.search-form{opacity:1;visibility:visible}::ng-deep .table-con.expert-search>.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>.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>.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:200;font-weight:400;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.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>.search-form .form{left:calc(-100% - 20px);width:100%}}@media (min-width:500px) and (max-width:699.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-50% - 20px);width:50%}}@media (min-width:700px) and (max-width:999.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-40% - 20px);width:40%}}@media (min-width:1000px) and (max-width:1599.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-30% - 20px);width:30%}}"]
|
|
4095
4104
|
},] }
|
|
4096
4105
|
];
|