ps-toolkit-ui 1.9.28 → 1.9.30

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.
@@ -5300,6 +5300,7 @@
5300
5300
  });
5301
5301
  FormSelectComponent.prototype.ngOnInit = function () {
5302
5302
  var _this = this;
5303
+ var _a;
5303
5304
  if (this.inp.type !== exports.InputType.SelectAutoComplete) {
5304
5305
  this.inp.load();
5305
5306
  }
@@ -5359,17 +5360,16 @@
5359
5360
  HelperClass.setBarcodeReader(this.inp);
5360
5361
  }
5361
5362
  if (this.inp.addModal) {
5362
- this.addIcon = new InputClass(this.inp.environment, this.inp.l, 'Add' + this.inp.name, 'fa-duotone fa-plus', exports.InputType.Icon, 'blue m-t-25');
5363
- this.addIcon.onClick = function () {
5364
- console.log(1111);
5365
- console.log(_this.inp);
5366
- console.log(_this.inp.addModal);
5367
- _this.inp.addModal.show();
5368
- };
5363
+ if ((_a = this.inp.addModal.form) === null || _a === void 0 ? void 0 : _a.permission) {
5364
+ this.addIcon = new InputClass(this.inp.environment, this.inp.l, 'Add' + this.inp.name, 'fa-duotone fa-plus', exports.InputType.Icon, 'blue m-t-25');
5365
+ this.addIcon.onClick = function () {
5366
+ _this.inp.addModal.show();
5367
+ };
5368
+ }
5369
5369
  }
5370
5370
  };
5371
5371
  FormSelectComponent.prototype.setValue = function (ids, rows) {
5372
- var e_1, _a;
5372
+ var e_1, _b;
5373
5373
  if (rows === void 0) { rows = this.inp.options; }
5374
5374
  try {
5375
5375
  for (var rows_1 = __values(rows), rows_1_1 = rows_1.next(); !rows_1_1.done; rows_1_1 = rows_1.next()) {
@@ -5386,7 +5386,7 @@
5386
5386
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
5387
5387
  finally {
5388
5388
  try {
5389
- if (rows_1_1 && !rows_1_1.done && (_a = rows_1.return)) _a.call(rows_1);
5389
+ if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
5390
5390
  }
5391
5391
  finally { if (e_1) throw e_1.error; }
5392
5392
  }
@@ -5616,10 +5616,10 @@
5616
5616
  return this.getTitle(this.inp);
5617
5617
  };
5618
5618
  FormSelectComponent.prototype.getTitle = function (os) {
5619
- var e_2, _a;
5619
+ var e_2, _b;
5620
5620
  try {
5621
- for (var _b = __values(os.options), _c = _b.next(); !_c.done; _c = _b.next()) {
5622
- var s = _c.value;
5621
+ for (var _c = __values(os.options), _d = _c.next(); !_d.done; _d = _c.next()) {
5622
+ var s = _d.value;
5623
5623
  if (s.value === this.inp.value.toString()) {
5624
5624
  return this.inp.l(s.name);
5625
5625
  }
@@ -5632,14 +5632,14 @@
5632
5632
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
5633
5633
  finally {
5634
5634
  try {
5635
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5635
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
5636
5636
  }
5637
5637
  finally { if (e_2) throw e_2.error; }
5638
5638
  }
5639
5639
  return null;
5640
5640
  };
5641
5641
  FormSelectComponent.prototype.getValue = function (v, o) {
5642
- var e_3, _a;
5642
+ var e_3, _b;
5643
5643
  if (o === void 0) { o = this.inp.options; }
5644
5644
  var h = o.find(function (x) { return x.value === v; });
5645
5645
  if (h) {
@@ -5657,13 +5657,13 @@
5657
5657
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
5658
5658
  finally {
5659
5659
  try {
5660
- if (o_1_1 && !o_1_1.done && (_a = o_1.return)) _a.call(o_1);
5660
+ if (o_1_1 && !o_1_1.done && (_b = o_1.return)) _b.call(o_1);
5661
5661
  }
5662
5662
  finally { if (e_3) throw e_3.error; }
5663
5663
  }
5664
5664
  };
5665
5665
  FormSelectComponent.prototype.getSelected = function (opts) {
5666
- var e_4, _a;
5666
+ var e_4, _b;
5667
5667
  if (opts === void 0) { opts = this.inp.options; }
5668
5668
  var l = [];
5669
5669
  try {
@@ -5679,7 +5679,7 @@
5679
5679
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
5680
5680
  finally {
5681
5681
  try {
5682
- if (opts_1_1 && !opts_1_1.done && (_a = opts_1.return)) _a.call(opts_1);
5682
+ if (opts_1_1 && !opts_1_1.done && (_b = opts_1.return)) _b.call(opts_1);
5683
5683
  }
5684
5684
  finally { if (e_4) throw e_4.error; }
5685
5685
  }
@@ -5745,7 +5745,7 @@
5745
5745
  FormSelectComponent.decorators = [
5746
5746
  { type: core.Component, args: [{
5747
5747
  selector: 'lib-form-select',
5748
- template: "<div #inputDiv [id]=\"inp.id + 'SelectInput'\" [style]=\"inp.style\" [className]=\"'form-input-con select w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon != null ? '' : ' without-icon') + (inp.addModal != null ? ' add-modal' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"toggleOption($event)\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"f-r fas fa-star-of-life required-icon\"></i><span class=\"f-r\" [innerHTML]=\"inp.getLabel()\"></span></div>\r\n <div class=\"w-100 p-r\">\r\n <div *ngIf=\"inp.type === type.Select\" class=\"without-search\"></div>\r\n <span *ngIf=\"inp.icon != null || inp.loading\" (click)=\"inp.button && onClickButton()\" #inputIcon [className]=\"(inp.button ? inp.button + ' button ' : '') + 'icon'\">\r\n <i [className]=\"inp.loading ? 'fa-duotone fa-spin fa-spinner ' : inp.icon + ' '\"></i>\r\n </span>\r\n <i *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"fa-duotone fa-eraser clear-icon\"></i>\r\n <input (keydown)=\"onKeyDown($event)\" (focusout)=\"onFocusOut()\" (keyup)=\"onKeyUp($event)\" [disabled]=\"inp.disabled\" [(ngModel)]=\"inp.search\" [placeholder]=\"inp.placeholder ? inp.l(inp.placeholder) : ''\" #inputBase type=\"text\" [name]=\"inp.name\" class=\"control\" autocomplete=\"off\" [readOnly]=\"inp.type === type.Select\" [maxLength]=\"inp.maxLength > 0 ? inp.maxLength : 524288\">\r\n <div class=\"options\">\r\n <div #inputOptionsDiv class=\"items\">\r\n <lib-form-select-item (selectOption)=\"selectOption($event)\" [level]=\"1\" [select]=\"inp\" [item]=\"opt\" *ngFor=\"let opt of inp.options\"></lib-form-select-item>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <lib-form-icon *ngIf=\"addIcon != null\" [inp]=\"addIcon\"></lib-form-icon>\r\n</div>\r\n",
5748
+ template: "<div #inputDiv [id]=\"inp.id + 'SelectInput'\" [style]=\"inp.style\" [className]=\"'form-input-con select w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon != null ? '' : ' without-icon') + (inp.addModal != null ? ' add-modal' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"toggleOption($event)\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"f-r fas fa-star-of-life required-icon\"></i><span class=\"f-r\" [innerHTML]=\"inp.getLabel()\"></span></div>\r\n <div class=\"w-100 p-r\">\r\n <div *ngIf=\"inp.type === type.Select\" class=\"without-search\"></div>\r\n <span *ngIf=\"inp.icon != null || inp.loading\" (click)=\"inp.button && onClickButton()\" #inputIcon [className]=\"(inp.button ? inp.button + ' button ' : '') + 'icon'\">\r\n <i [className]=\"inp.loading ? 'fa-duotone fa-spin fa-spinner ' : inp.icon + ' '\"></i>\r\n </span>\r\n <i *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"fa-duotone fa-eraser clear-icon\"></i>\r\n <input (keydown)=\"onKeyDown($event)\" (focusout)=\"onFocusOut()\" (keyup)=\"onKeyUp($event)\" [disabled]=\"inp.disabled\" [(ngModel)]=\"inp.search\" [placeholder]=\"inp.placeholder ? inp.l(inp.placeholder) : ''\" #inputBase type=\"text\" [name]=\"inp.name\" class=\"control\" autocomplete=\"off\" [readOnly]=\"inp.type === type.Select\" [maxLength]=\"inp.maxLength > 0 ? inp.maxLength : 524288\">\r\n <div class=\"options\">\r\n <div #inputOptionsDiv class=\"items\">\r\n <lib-form-select-item (selectOption)=\"selectOption($event)\" [level]=\"1\" [select]=\"inp\" [item]=\"opt\" *ngFor=\"let opt of inp.options\"></lib-form-select-item>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <lib-form-icon *ngIf=\"addIcon != null\" [inp]=\"addIcon\"></lib-form-icon>\r\n</div>\r\n<lib-modal *ngIf=\"inp.addModal != null\" [modal]=\"inp.addModal\"></lib-modal>\r\n",
5749
5749
  styles: [".form-input-con.select{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;font-size:12px;padding:0 15px;position:relative}.form-input-con.select.plaque{width:185px!important}.form-input-con.select>.form-input{float:right;position:relative;width:100%}.form-input-con.select.add-modal>.form-input{margin-left:15px;width:calc(100% - 45px)}.form-input-con.select>.form-input>.label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.select.error>.form-input>.label{color:var(--red);font-size:10px}.form-input-con.select>.form-input>.label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.select>.form-input .without-search{cursor:pointer;height:100%;position:absolute;right:0;top:0;width:100%;z-index:3}.form-input-con.select>.form-input .control{background-color:#fff;background-image:none;border:var(--border-input);border-radius:var(--border-radius-base);color:var(--black);display:block;font-size:11px;height:35px;padding:5px 35px;text-align:center;width:100%}.form-input-con.select>.form-input .control:focus,.form-input-con.select>.form-input:hover .control{border:1px solid var(--black-light);outline:none}.form-input-con.select>.form-input .control:focus{border-radius:var(--border-radius-base) var(--border-radius-base) 0 0;outline:none}.form-input-con.select.error>.form-input .control{border:var(--border-input-red)}.form-input-con.select.error>.form-input .control,.form-input-con.select.error>.form-input span.icon{color:var(--red)}.form-input-con.select.error>.form-input .control:focus,.form-input-con.select.error>.form-input:hover .control{border:var(--border-input-red-dark)}.form-input-con.select.top>.form-input .control:focus{border-radius:0 0 var(--border-radius-base) var(--border-radius-base);outline:none}.form-input-con.select>.form-input span.icon{bottom:0;color:var(--primary);font-size:15px;height:35px;left:0;line-height:37px;position:absolute;text-align:center;width:35px;z-index:1}.form-input-con.select>.form-input span.icon.button{background-color:var(--base);border-radius:5px 0 0 5px;color:#fff;cursor:pointer}.form-input-con.select>.form-input span.icon.button:hover{background-color:var(--base-dark)}.form-input-con.select>.form-input span.icon.button.blue{background-color:var(--blue)}.form-input-con.select>.form-input span.icon.button.blue:hover{background-color:var(--blue-dark)}.form-input-con.select>.form-input span.icon.button.green{background-color:var(--green)}.form-input-con.select>.form-input span.icon.button.green:hover{background-color:var(--green-dark)}.form-input-con.select>.form-input span.icon.button.red{background-color:var(--red)}.form-input-con.select>.form-input span.icon.button.red:hover{background-color:var(--red-dark)}.form-input-con.select>.form-input span.icon.button.yellow{background-color:var(--yellow)}.form-input-con.select>.form-input span.icon.button.yellow:hover{background-color:var(--yellow-dark)}.form-input-con.select>.form-input i.clear-icon{bottom:0;color:var(--red);cursor:pointer;font-size:15px;height:35px;line-height:35px;position:absolute;right:0;text-align:center;width:35px;z-index:1}.form-input-con.select>.form-input .options{background-color:#fff;border:var(--border-input);border-radius:0 0 var(--border-radius-base) var(--border-radius-base);cursor:pointer;overflow:hidden;position:absolute;right:0;top:-200000px;width:100%;z-index:103}.form-input-con.select>.form-input .control:focus+.options{top:35px!important}.form-input-con.select.top>.form-input .control:focus+.options{border-radius:var(--border-radius-base) var(--border-radius-base) 0 0;bottom:35px;top:unset!important}.form-input-con.select>.form-input .options .items{float:right;max-height:200px;overflow-y:auto;scroll-behavior:smooth;width:100%}.form-input-con.select>.form-input .options .option{border-radius:0;float:right;font-size:11px;height:35px;line-height:35px;text-align:center;width:100%}.form-input-con.select .tags{float:right;width:100%}.form-input-con.select .tags .tag-con{float:right;padding:5px;width:auto}.form-input-con.select .tags .tag-con .tag{background-color:var(--base);border-radius:var(--border-radius-base);color:#fff;float:right;font-size:12px;height:25px;line-height:25px;overflow:hidden;position:relative;width:auto}.form-input-con.select .tags .tag-con .tag>.label{float:right;padding:0 5px 0 10px;width:auto}.form-input-con.select .tags .tag-con .tag>.delete{cursor:pointer;float:right;line-height:25px;text-align:center;width:25px}.form-input-con.select .tags .tag-con .tag>.delete:hover{background-color:var(--base-dark)}.form-input-con.select.h-50>.form-input .control{height:50px;line-height:50px}.form-input-con.select.h-50>.form-input .control:focus+.options{top:50px!important}.form-input-con.select.h-50.top>.form-input .options{bottom:50px;top:unset!important}.form-input-con.select.h-25,.form-input-con.select.h-25>.form-input .control{height:25px;line-height:25px}.form-input-con.select.h-25>.form-input span.icon{height:25px;line-height:25px;width:25px}.form-input-con.select.h-25>.form-input .control:focus+.options{top:25px!important}.form-input-con.select.h-25.top>.form-input .control:focus+.options{border-radius:var(--border-radius-base) var(--border-radius-base) 0 0;bottom:25px;top:unset!important}.form-input-con.select.h-25>.form-input .control::-moz-placeholder,.form-input-con.select.h-25>.form-input .control::-webkit-input-placeholder{font-size:10px;font-weight:200}.form-input-con.select.h-30>.form-input .control{height:30px;padding:5px 30px}.form-input-con.select.h-30>.form-input .control:focus+.options{top:30px!important}.form-input-con.select.h-30>.form-input span.icon{font-size:15px;height:30px;line-height:32px;width:30px}.form-input-con.select.h-30>.form-input i.clear-icon{height:30px;line-height:30px;width:30px}.form-input-con.select.h-30.top>.form-input .control:focus+.options{bottom:30px}.form-input-con.select.h-45,.form-input-con.select.h-45>.form-input .control{height:45px;line-height:45px}.form-input-con.select.h-45>.form-input .control::-moz-placeholder,.form-input-con.select.h-45>.form-input .control::-webkit-input-placeholder{font-size:12px}.form-input-con.select.h-45>.form-input span.icon{height:45px;line-height:45px;width:45px}.form-input-con.select.h-45>.form-input .control:focus+.options{top:45px!important}.form-input-con.select.h-45.top>.form-input .control:focus+.options{border-radius:var(--border-radius-base) var(--border-radius-base) 0 0;bottom:45px;top:unset!important}.form-input-con.select.without-icon.h-25>.form-input .control,.form-input-con.select.without-icon.h-30>.form-input .control{padding:0}.form-input-con.select.h-30>.form-input span.icon{font-size:11px}::ng-deep .form-input-con.select.without-sub-options>.form-input .options .option{width:100%}.form-input-con.select.disabled>.form-input .control,.form-input-con.select.disabled>.form-input .label,.form-input-con.select.disabled>.form-input span.icon{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-shadow:unset;cursor:default;filter:blur(.5px);opacity:.7}"]
5750
5750
  },] }
5751
5751
  ];