ps-toolkit-ui 0.0.151 → 0.0.155

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.
@@ -1665,7 +1665,7 @@
1665
1665
  var ivs = _.get(d, inp.name.replace('Id', ''));
1666
1666
  inp.setValue({ Search: ivs, Value: iv }, true);
1667
1667
  }
1668
- else {
1668
+ else if (inp.type !== exports.InputType.Label) {
1669
1669
  inp.setValue(iv, true);
1670
1670
  }
1671
1671
  if (inp.type === exports.InputType.SelectAutoCompletePlaque || inp.type === exports.InputType.SelectAutoComplete) {
@@ -2653,7 +2653,7 @@
2653
2653
  opt.urlNewTab = option.InputAction === exports.PermissionInputActionEnum.LinkNewTab;
2654
2654
  }
2655
2655
  else if (option.InputAction === exports.PermissionInputActionEnum.Modal) {
2656
- opt.modal = this_1.table.modals.find(function (x) { return x.name === option.Action; });
2656
+ opt.modal = this_1.table.optionsActions.find(function (x) { return x.name === option.Action; });
2657
2657
  opt.onClick = function () {
2658
2658
  var e_2, _a;
2659
2659
  if (opt.modal.table) {
@@ -2712,7 +2712,7 @@
2712
2712
  var p = new PermissionClass();
2713
2713
  p.RelatedId = 'Index';
2714
2714
  p.Area = this_1.table.permissions.Area;
2715
- p.Controller = 'Print';
2715
+ p.Controller = option.Controller;
2716
2716
  p.Action = option.Action;
2717
2717
  opt.url = '/Report' + p.getUrl() + '/' + this_1.row.Data.Id;
2718
2718
  opt.urlNewTab = true;
@@ -2886,6 +2886,60 @@
2886
2886
  childrenDiv: [{ type: core.ViewChild, args: ['childrenDiv',] }]
2887
2887
  };
2888
2888
 
2889
+ var ModalClass = /** @class */ (function () {
2890
+ function ModalClass(environment, l, name, cls) {
2891
+ if (cls === void 0) { cls = ''; }
2892
+ this.environment = null;
2893
+ this.form = null;
2894
+ this.firstForm = true;
2895
+ this.table = null;
2896
+ this.accordion = null;
2897
+ this.onShow = null;
2898
+ this.onHide = null;
2899
+ this.environment = environment;
2900
+ this.l = l;
2901
+ this.name = name;
2902
+ this.id = this.name;
2903
+ this.class = cls;
2904
+ }
2905
+ ModalClass.prototype.show = function () {
2906
+ var _this = this;
2907
+ if (this.onShow) {
2908
+ this.onShow();
2909
+ }
2910
+ $__namespace('body').addClass('open-modal');
2911
+ $__namespace('#' + this.id + 'Modal').fadeIn(300, function () {
2912
+ if (_this.form != null) {
2913
+ var i = _this.form.inputs.find(function (x) { return !x.disabled && x.type !== exports.InputType.Label && x.type !== exports.InputType.Hidden &&
2914
+ x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
2915
+ x.type !== exports.InputType.Check; });
2916
+ if (i) {
2917
+ i.focus();
2918
+ }
2919
+ }
2920
+ });
2921
+ };
2922
+ ModalClass.prototype.hide = function () {
2923
+ var _this = this;
2924
+ $__namespace('body').removeClass('open-modal');
2925
+ $__namespace('#' + this.id + 'Modal').fadeOut(300, function () {
2926
+ if (_this.form && _this.form.name !== 'Confirm' && _this.form.name !== 'Alert') {
2927
+ _this.form.clear();
2928
+ if (_this.form.onHideModal) {
2929
+ _this.form.onHideModal();
2930
+ }
2931
+ }
2932
+ if (_this.table && _this.table.form) {
2933
+ _this.table.form.clear();
2934
+ }
2935
+ if (_this.onHide) {
2936
+ _this.onHide();
2937
+ }
2938
+ });
2939
+ };
2940
+ return ModalClass;
2941
+ }());
2942
+
2889
2943
  var TableComponent = /** @class */ (function () {
2890
2944
  function TableComponent(router) {
2891
2945
  this.router = router;
@@ -3066,12 +3120,15 @@
3066
3120
  this.table.sort = s;
3067
3121
  this.table.load();
3068
3122
  };
3123
+ TableComponent.prototype.getModals = function () {
3124
+ return this.table.optionsActions.filter(function (x) { return x instanceof ModalClass; });
3125
+ };
3069
3126
  return TableComponent;
3070
3127
  }());
3071
3128
  TableComponent.decorators = [
3072
3129
  { type: core.Component, args: [{
3073
3130
  selector: 'lib-table',
3074
- 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 table.modals\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
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\"></lib-confirm>\r\n</div>\r\n",
3075
3132
  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}"]
3076
3133
  },] }
3077
3134
  ];
@@ -4024,8 +4081,6 @@
4024
4081
  }
4025
4082
  FormLabelComponent.prototype.ngOnInit = function () {
4026
4083
  var _this = this;
4027
- console.log(this.inp.value, 'this.inp.value');
4028
- console.log(this.inp.l(this.inp.value), 'this.inp.l(this.inp.value)');
4029
4084
  this.inp.setValue = function (v) {
4030
4085
  _this.inp.value = v;
4031
4086
  };
@@ -4045,7 +4100,7 @@
4045
4100
  FormLabelComponent.decorators = [
4046
4101
  { type: core.Component, args: [{
4047
4102
  selector: 'lib-form-label',
4048
- template: "<div [id]=\"inp.name + 'Input'\" (click)=\"onClick()\" #inputDiv [className]=\"inp.class + ' form-input label'\" [innerHTML]=\"inp.l(inp.value)\">\r\n</div>\r\n<div>{{inp.l(inp.value)}}</div>\r\n",
4103
+ template: "<div [id]=\"inp.name + 'Input'\" (click)=\"onClick()\" #inputDiv [className]=\"inp.class + ' form-input label'\" [innerHTML]=\"inp.l(inp.value)\">\r\n</div>\r\n",
4049
4104
  styles: [".form-input.label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;float:right;font-size:12px;line-height:30px;padding:0 15px;position:relative;text-align:center;width:100%}.form-input.label.underline{margin:20px 15px;width:calc(100% - 30px)}.form-input.label.form-group-title{margin:0 15px 10px;width:calc(100% - 30px)}.form-input.label.space{margin:10px 15px;width:calc(100% - 30px)}.form-input.label.h-58{height:58px;line-height:58px}.form-input.label.h-45{height:45px;line-height:45px}.form-input.label.h-30{height:30px;line-height:30px}.form-input.label.h-25{height:25px;line-height:25px}"]
4050
4105
  },] }
4051
4106
  ];
@@ -5942,60 +5997,6 @@
5942
5997
  inputBase: [{ type: core.ViewChild, args: ['inputBase',] }]
5943
5998
  };
5944
5999
 
5945
- var ModalClass = /** @class */ (function () {
5946
- function ModalClass(environment, l, name, cls) {
5947
- if (cls === void 0) { cls = ''; }
5948
- this.environment = null;
5949
- this.form = null;
5950
- this.firstForm = true;
5951
- this.table = null;
5952
- this.accordion = null;
5953
- this.onShow = null;
5954
- this.onHide = null;
5955
- this.environment = environment;
5956
- this.l = l;
5957
- this.name = name;
5958
- this.id = this.name;
5959
- this.class = cls;
5960
- }
5961
- ModalClass.prototype.show = function () {
5962
- var _this = this;
5963
- if (this.onShow) {
5964
- this.onShow();
5965
- }
5966
- $__namespace('body').addClass('open-modal');
5967
- $__namespace('#' + this.id + 'Modal').fadeIn(300, function () {
5968
- if (_this.form != null) {
5969
- var i = _this.form.inputs.find(function (x) { return !x.disabled && x.type !== exports.InputType.Label && x.type !== exports.InputType.Hidden &&
5970
- x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
5971
- x.type !== exports.InputType.Check; });
5972
- if (i) {
5973
- i.focus();
5974
- }
5975
- }
5976
- });
5977
- };
5978
- ModalClass.prototype.hide = function () {
5979
- var _this = this;
5980
- $__namespace('body').removeClass('open-modal');
5981
- $__namespace('#' + this.id + 'Modal').fadeOut(300, function () {
5982
- if (_this.form && _this.form.name !== 'Confirm' && _this.form.name !== 'Alert') {
5983
- _this.form.clear();
5984
- if (_this.form.onHideModal) {
5985
- _this.form.onHideModal();
5986
- }
5987
- }
5988
- if (_this.table && _this.table.form) {
5989
- _this.table.form.clear();
5990
- }
5991
- if (_this.onHide) {
5992
- _this.onHide();
5993
- }
5994
- });
5995
- };
5996
- return ModalClass;
5997
- }());
5998
-
5999
6000
  var AlertComponent = /** @class */ (function () {
6000
6001
  function AlertComponent(config) {
6001
6002
  this.config = config;
@@ -7132,7 +7133,7 @@
7132
7133
  this.perPage = 10;
7133
7134
  this.cols = [];
7134
7135
  this.buttons = [];
7135
- this.modals = [];
7136
+ this.optionsActions = [];
7136
7137
  this.rows = [];
7137
7138
  this.count = 0;
7138
7139
  this.page = 1;