ps-toolkit-ui 0.0.92 → 0.0.96

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.
@@ -812,13 +812,22 @@
812
812
  PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 7] = "OptionModal";
813
813
  PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 8] = "OptionConfirm";
814
814
  })(exports.PermissionTypeEnum || (exports.PermissionTypeEnum = {}));
815
+ (function (PermissionOptionTypeEnum) {
816
+ PermissionOptionTypeEnum[PermissionOptionTypeEnum["Icon"] = 0] = "Icon";
817
+ PermissionOptionTypeEnum[PermissionOptionTypeEnum["Button"] = 1] = "Button";
818
+ })(exports.PermissionOptionTypeEnum || (exports.PermissionOptionTypeEnum = {}));
815
819
  (function (VehicleType) {
816
820
  VehicleType[VehicleType["Car"] = 1] = "Car";
817
821
  VehicleType[VehicleType["Motorcycle"] = 2] = "Motorcycle";
818
822
  VehicleType[VehicleType["Airplane"] = 3] = "Airplane";
819
823
  VehicleType[VehicleType["Train"] = 4] = "Train";
820
824
  VehicleType[VehicleType["Ship"] = 5] = "Ship";
821
- })(exports.VehicleType || (exports.VehicleType = {}));
825
+ })(exports.VehicleType || (exports.VehicleType = {}));
826
+ (function (TableOptionType) {
827
+ TableOptionType[TableOptionType["Hidden"] = 1] = "Hidden";
828
+ TableOptionType[TableOptionType["Show"] = 2] = "Show";
829
+ TableOptionType[TableOptionType["Group"] = 3] = "Group";
830
+ })(exports.TableOptionType || (exports.TableOptionType = {}));
822
831
 
823
832
  // @dynamic
824
833
  var HelperClass = /** @class */ (function () {
@@ -2686,6 +2695,11 @@
2686
2695
  enumerable: false,
2687
2696
  configurable: true
2688
2697
  });
2698
+ Object.defineProperty(TableComponent.prototype, "tableOptionType", {
2699
+ get: function () { return exports.TableOptionType; },
2700
+ enumerable: false,
2701
+ configurable: true
2702
+ });
2689
2703
  Object.defineProperty(TableComponent.prototype, "colType", {
2690
2704
  get: function () { return exports.TableCollType; },
2691
2705
  enumerable: false,
@@ -2903,7 +2917,7 @@
2903
2917
  TableComponent.decorators = [
2904
2918
  { type: core.Component, args: [{
2905
2919
  selector: 'lib-table',
2906
- 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.extraButtons\">\r\n <div *ngIf=\"table.permissions && table.permissions.hasAccess('Report')\" class=\"export\">\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div class=\"export-dropdown\" #exportDropDown>\r\n <div (click)=\"report('Print')\" class=\"item\"><div class=\"text\">Print</div><i class=\"fad fa-print\"></i></div>\r\n <div (click)=\"report('Excel')\" class=\"item\"><div class=\"text\">Excel</div><i class=\"fad fa-file-excel\"></i></div>\r\n <div (click)=\"report('CSV')\" class=\"item\"><div class=\"text\">CSV</div><i class=\"fad fa-file-csv\"></i></div>\r\n <div (click)=\"report('PDF')\" class=\"item\"><div class=\"text\">PDF</div><i class=\"fad fa-file-pdf\"></i></div>\r\n </div>\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 </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.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.modal\" *ngFor=\"let opt of getOptionModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
2920
+ 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.extraButtons\">\r\n <div *ngIf=\"table.permissions && table.permissions.hasAccess('Report')\" class=\"export\">\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div class=\"export-dropdown\" #exportDropDown>\r\n <div (click)=\"report('Print')\" class=\"item\"><div class=\"text\">Print</div><i class=\"fad fa-print\"></i></div>\r\n <div (click)=\"report('Excel')\" class=\"item\"><div class=\"text\">Excel</div><i class=\"fad fa-file-excel\"></i></div>\r\n <div (click)=\"report('CSV')\" class=\"item\"><div class=\"text\">CSV</div><i class=\"fad fa-file-csv\"></i></div>\r\n <div (click)=\"report('PDF')\" class=\"item\"><div class=\"text\">PDF</div><i class=\"fad fa-file-pdf\"></i></div>\r\n </div>\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 </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.modal\" *ngFor=\"let opt of getOptionModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
2907
2921
  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 .extra-buttons .export{float:right;position:relative}.table-con>.title .extra-buttons .export .export-dropdown{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);display:none;overflow:hidden;padding:15px 0;position:absolute;right:-50px;top:35px;width:130px;z-index:2}.table-con>.title .extra-buttons .export .export-dropdown .item{cursor:pointer;float:right;padding:0 15px;text-align:center;width:100%}.table-con>.title .extra-buttons .export .export-dropdown .item:hover{background-color:var(--black-22)}.table-con>.title .extra-buttons .export .export-dropdown .text{float:right;font-family:VazirLight;font-size:13px;height:40px;line-height:41px;width:70%}.table-con>.title .extra-buttons .export .export-dropdown i{color:var(--black-88);float:right;font-size:14px;height:40px;line-height:40px;width:30%}.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}"]
2908
2922
  },] }
2909
2923
  ];
@@ -5079,10 +5093,11 @@
5079
5093
  };
5080
5094
 
5081
5095
  var PermissionClass = /** @class */ (function () {
5082
- function PermissionClass(Name, Icon, Type, Area, Controller, Action, Condition, Accesses) {
5096
+ function PermissionClass(Name, Icon, Type, OptionType, Area, Controller, Action, Condition, Accesses) {
5083
5097
  if (Name === void 0) { Name = ''; }
5084
5098
  if (Icon === void 0) { Icon = ''; }
5085
5099
  if (Type === void 0) { Type = null; }
5100
+ if (OptionType === void 0) { OptionType = null; }
5086
5101
  if (Area === void 0) { Area = ''; }
5087
5102
  if (Controller === void 0) { Controller = ''; }
5088
5103
  if (Action === void 0) { Action = ''; }
@@ -5091,6 +5106,7 @@
5091
5106
  this.Name = Name;
5092
5107
  this.Icon = Icon;
5093
5108
  this.Type = Type;
5109
+ this.OptionType = OptionType;
5094
5110
  this.Area = Area;
5095
5111
  this.Controller = Controller;
5096
5112
  this.Action = Action;
@@ -6950,7 +6966,7 @@
6950
6966
  return p.length > 0 ? this.getPermissionClass(p[0]) : null;
6951
6967
  };
6952
6968
  BaseComponent.prototype.getPermissionClass = function (p) {
6953
- return new PermissionClass(p.Name, p.Icon, p.Type, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
6969
+ return new PermissionClass(p.Name, p.Icon, p.Type, p.OptionType, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
6954
6970
  };
6955
6971
  BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
6956
6972
  var _this = this;
@@ -7023,6 +7039,7 @@
7023
7039
  this.displayLabel = true;
7024
7040
  this.isReport = false;
7025
7041
  this.sortable = false;
7042
+ this.optionType = exports.TableOptionType.Hidden;
7026
7043
  this.loading = true;
7027
7044
  this.hasStatus = false;
7028
7045
  this.hasChildren = false;
@@ -7185,7 +7202,7 @@
7185
7202
  if (this_1.options.filter(function (x) { return x.name === option.Name; }).length > 0) {
7186
7203
  return "continue";
7187
7204
  }
7188
- var opt = new InputClass(this_1.environment, this_1.l, option.Name, option.Icon, exports.InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
7205
+ var opt = new InputClass(this_1.environment, this_1.l, option.Name, option.Icon, option.OptionType === exports.PermissionOptionTypeEnum.Icon ? exports.InputType.Icon : exports.InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
7189
7206
  opt.condition = option.Condition;
7190
7207
  if (option.Type === exports.PermissionTypeEnum.OptionLink || option.Type === exports.PermissionTypeEnum.OptionLinkNewTab) {
7191
7208
  var p = new PermissionClass();