ps-toolkit-ui 1.4.73 → 1.4.76

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.
@@ -1744,6 +1744,7 @@
1744
1744
  this.disabled = false;
1745
1745
  this.inEditDisabled = false;
1746
1746
  this.inEditVisible = true;
1747
+ this.inEditRequired = true;
1747
1748
  this.displayLabel = true;
1748
1749
  this.withClear = false;
1749
1750
  this.minLength = -1;
@@ -1799,7 +1800,9 @@
1799
1800
  this.type = type;
1800
1801
  this.value = value;
1801
1802
  this.default = typeof value === 'number' ? _.cloneDeep(value) : HelperClass.clone(value);
1803
+ this.baseRequired = required;
1802
1804
  this.required = required;
1805
+ this.inEditRequired = required;
1803
1806
  this.minLength = type === exports.InputType.Mobile || type === exports.InputType.Phone ? 11 :
1804
1807
  type === exports.InputType.NationalCode || type === exports.InputType.PostalCode ? 10 :
1805
1808
  type === exports.InputType.Sheba ? 24 : minLength;
@@ -2877,14 +2880,16 @@
2877
2880
  this.table.form.setButtons(this.table.form.onTop, true, this.row.Data.Id);
2878
2881
  this.table.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = true; });
2879
2882
  this.table.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = false; });
2883
+ this.table.form.inputs.forEach(function (x) { return x.required = x.inEditRequired; });
2880
2884
  }
2881
2885
  else {
2882
2886
  new RequestClass(this.table.environment, this.table.l).send(this.getOptionUrl(option.Url.replace('update', 'get'), this.table.permissions.RelatedId, this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
2883
2887
  _this.table.form.name = opt.name;
2884
- _this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Data.Id);
2885
2888
  _this.table.form.setData(result);
2889
+ _this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Data.Id);
2886
2890
  _this.table.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = true; });
2887
2891
  _this.table.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = false; });
2892
+ _this.table.form.inputs.forEach(function (x) { return x.required = x.inEditRequired; });
2888
2893
  if (_this.table.modal) {
2889
2894
  _this.table.modal.show();
2890
2895
  }
@@ -3145,7 +3150,7 @@
3145
3150
  TableComponent.decorators = [
3146
3151
  { type: core.Component, args: [{
3147
3152
  selector: 'lib-table',
3148
- 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 <div class=\"f-r\">{{this.table.title ? this.table.title : '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 <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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\" + (table.hasChildren ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withSelect ? 'with-handle-select ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.hasChildren\"></div>\r\n <div class=\"handle handle-select\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withSelect\">\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 </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\">{{ 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\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date || col.type == colType.DateTime\" [inp]=\"col.search\"></lib-form-date>\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'} : table.loading || !table.permission || table.rows.length == 0 ? {minHeight: '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 <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",
3153
+ 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 <div class=\"f-r\">{{this.table.title ? this.table.title : '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 <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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withSelect ? 'with-handle-select ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-select\" *ngIf=\"table.hasChildren\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withSelect\">\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 </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\">{{ 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\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date || col.type == colType.DateTime\" [inp]=\"col.search\"></lib-form-date>\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'} : table.loading || !table.permission || table.rows.length == 0 ? {minHeight: '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 <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",
3149
3154
  styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);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:102}.table-con>.title{float:right;font-family:VazirBold;font-size:16px;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .description{font-family:VazirLight;font-size:13px;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px}.table-con>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.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-children,.table-con .table .header .row.with-handle-select,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-select,.table-con .table .header .row.with-handle-sortable.with-handle-children,.table-con .table .header .row.with-handle-sortable.with-handle-select{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-select{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-family:VazirLight;font-size:12px;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 .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:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}::ng-deep .table-con .table .header .row .cell .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}"]
3150
3155
  },] }
3151
3156
  ];
@@ -5782,7 +5787,7 @@
5782
5787
  };
5783
5788
  this.inp.data = function () {
5784
5789
  var v = _this.inp.value;
5785
- if (v === null) {
5790
+ if (v === null || v === '') {
5786
5791
  return null;
5787
5792
  }
5788
5793
  if (v && _this.inp.type === exports.InputType.Number || _this.inp.type === exports.InputType.Price) {
@@ -7443,6 +7448,7 @@
7443
7448
  this.form.method = exports.Method.Post;
7444
7449
  this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
7445
7450
  this.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = true; });
7451
+ this.form.inputs.forEach(function (x) { return x.required = x.baseRequired; });
7446
7452
  this.modal.show();
7447
7453
  };
7448
7454
  TableClass.prototype.set = function (changeRows) {