ps-toolkit-ui 1.3.31 → 1.3.32

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.
@@ -1,10 +1,12 @@
1
1
  import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
2
2
  import * as $ from 'jquery';
3
+ import { InputType } from '../../../../classes/enum.class';
3
4
  export class FormTreeItemComponent {
4
5
  constructor() {
5
6
  this.parent = null;
6
- this.changeIndex = new EventEmitter();
7
+ this.toggle = new EventEmitter();
7
8
  }
9
+ get type() { return InputType; }
8
10
  ngOnInit() {
9
11
  this.item.parent = this.parent;
10
12
  }
@@ -23,14 +25,14 @@ export class FormTreeItemComponent {
23
25
  }
24
26
  }
25
27
  onClick() {
26
- this.item.toggle(this.tree.onlyChild);
28
+ this.toggle.emit(this.item);
27
29
  }
28
30
  }
29
31
  FormTreeItemComponent.decorators = [
30
32
  { type: Component, args: [{
31
33
  selector: 'lib-form-tree-item',
32
- template: "<div [className]=\"(item.selected ? 'selected ' : item.selected == null ? 'null ' : '') + 'row-item'\">\r\n <div (click)=\"onClick()\" class=\"checkbox\">{{tree.l(item.name)}}</div>\r\n <i *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" [className]=\"(index == 0 && level == 0 ? 'fa-duotone fa-caret-down ' : 'fa-duotone fa-caret-left ') + 'open-close'\"></i>\r\n <div [className]=\"(index == 0 && level == 0 ? 'open ' : '') + 'children'\" [style]=\"index == 0 && level == 0 ? {display: 'block'} : {}\" *ngIf=\"item.children.length > 0\">\r\n <div class=\"items rightline\">\r\n <lib-form-tree-item [level]=\"level + 1\" [index]=\"i\" [item]=\"child\" [parent]=\"item\" [tree]=\"tree\" *ngFor=\"let child of item.children; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
33
- styles: [".row-item{float:left;position:relative;text-align:center;width:90%}.row-item .content{background-color:rgba(11,72,107,.06666666666666667);border-radius:var(--border-radius-base);cursor:pointer;float:right;width:100%}.row-item .open-close{cursor:pointer;font-size:20px;height:40px;line-height:38px;position:absolute;right:-25px;text-align:center;width:15px}.row-item .content.parent,.row-item .content:hover{background-color:rgba(11,72,107,.13333333333333333)}.row-item .content.parent:hover{background-color:rgba(11,72,107,.26666666666666666)}.row-item .children{display:none;padding:10px;position:relative}.row-item .children,.row-item .children .items{float:left;width:100%}.row-item .children>.line{height:calc(100% - 30px);right:20px;top:15px;width:2px}.row-item .children .row-item>.line,.row-item .children>.line{background-color:rgba(11,72,107,.13333333333333333);position:absolute}.row-item .children .row-item>.line{height:2px;right:-35px;top:17px;width:10px}.row-item .checkbox{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;cursor:pointer;display:flex;float:right;font-size:11px;justify-content:center;line-height:20px;min-height:40px;padding:5px 30px;position:relative;text-align:center;width:100%;z-index:2}.row-item .control{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.row-item>.checkbox:before{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:18px;font-weight:400;height:40px;line-height:40px;position:absolute;right:0;top:0;width:30px}.row-item.selected>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";font-weight:900}.row-item.null>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f146\";font-weight:900}.row-item:after{background-image:linear-gradient(90deg,transparent,rgba(50,50,50,.25),transparent);border:0;bottom:-1px;content:\"\";float:right;height:1px;position:absolute;right:0;width:100%}::ng-deep lib-form-tree-item:last-of-type>.row-item:after{display:none}"]
34
+ template: "<div [className]=\"(item.selected ? 'selected ' : item.selected == null ? 'null ' : '') + 'row-item'\">\r\n <div (click)=\"onClick()\" [className]=\"'checkbox' + (this.tree.type === type.TreeRadio ? ' radio' : '')\">{{tree.l(item.name)}}</div>\r\n <i *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" [className]=\"(index == 0 && level == 0 ? 'fa-duotone fa-caret-down ' : 'fa-duotone fa-caret-left ') + 'open-close'\"></i>\r\n <div [className]=\"(index == 0 && level == 0 ? 'open ' : '') + 'children'\" [style]=\"index == 0 && level == 0 ? {display: 'block'} : {}\" *ngIf=\"item.children.length > 0\">\r\n <div class=\"items rightline\">\r\n <lib-form-tree-item [level]=\"level + 1\" (toggle)=\"toggle.emit($event)\" [index]=\"i\" [item]=\"child\" [parent]=\"item\" [tree]=\"tree\" *ngFor=\"let child of item.children; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
35
+ styles: [".row-item{float:left;position:relative;text-align:center;width:90%}.row-item .content{background-color:rgba(11,72,107,.06666666666666667);border-radius:var(--border-radius-base);cursor:pointer;float:right;width:100%}.row-item .open-close{cursor:pointer;font-size:20px;height:40px;line-height:38px;position:absolute;right:-25px;text-align:center;width:15px}.row-item .content.parent,.row-item .content:hover{background-color:rgba(11,72,107,.13333333333333333)}.row-item .content.parent:hover{background-color:rgba(11,72,107,.26666666666666666)}.row-item .children{display:none;padding:10px;position:relative}.row-item .children,.row-item .children .items{float:left;width:100%}.row-item .children>.line{height:calc(100% - 30px);right:20px;top:15px;width:2px}.row-item .children .row-item>.line,.row-item .children>.line{background-color:rgba(11,72,107,.13333333333333333);position:absolute}.row-item .children .row-item>.line{height:2px;right:-35px;top:17px;width:10px}.row-item .checkbox{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;cursor:pointer;display:flex;float:right;font-size:11px;justify-content:center;line-height:20px;min-height:40px;padding:5px 30px;position:relative;text-align:center;width:100%;z-index:2}.row-item .control{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.row-item>.checkbox:before{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:18px;font-weight:400;height:40px;line-height:40px;position:absolute;right:0;top:0;width:30px}.row-item>.checkbox.radio:before{content:\"\\f111\"}.row-item.selected>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";content:\"\\f192\";font-weight:900}.row-item.null>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f146\";font-weight:900}.row-item:after{background-image:linear-gradient(90deg,transparent,rgba(50,50,50,.25),transparent);border:0;bottom:-1px;content:\"\";float:right;height:1px;position:absolute;right:0;width:100%}::ng-deep lib-form-tree-item:last-of-type>.row-item:after{display:none}"]
34
36
  },] }
35
37
  ];
36
38
  FormTreeItemComponent.ctorParameters = () => [];
@@ -41,8 +43,8 @@ FormTreeItemComponent.propDecorators = {
41
43
  tree: [{ type: Input }],
42
44
  parent: [{ type: Input }],
43
45
  base: [{ type: Input }],
44
- changeIndex: [{ type: Output }],
46
+ toggle: [{ type: Output }],
45
47
  inputDiv: [{ type: ViewChild, args: ['inputDiv',] }],
46
48
  inputBase: [{ type: ViewChild, args: ['inputBase',] }]
47
49
  };
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS50cmVlLml0ZW0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IkQ6L1Byb2plY3RzL1BzVG9vbGtpdC9VSS9wcm9qZWN0cy9wcy10b29sa2l0LXVpL3NyYy8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2Zvcm0vdHJlZS9pdGVtL2Zvcm0udHJlZS5pdGVtLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFjLFlBQVksRUFBZ0IsS0FBSyxFQUFVLE1BQU0sRUFBRSxTQUFTLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDbEgsT0FBTyxLQUFLLENBQUMsTUFBTSxRQUFRLENBQUM7QUFRNUIsTUFBTSxPQUFPLHFCQUFxQjtJQWlCaEM7UUFQQSxXQUFNLEdBQWlCLElBQUksQ0FBQztRQUk1QixnQkFBVyxHQUFHLElBQUksWUFBWSxFQUFVLENBQUM7SUFJekMsQ0FBQztJQU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bkNsaWNrKCk6IHZvaWQge1xyXG4gICAgdGhpcy50b2dnbGUuZW1pdCh0aGlzLml0ZW0pO1xyXG4gIH1cclxufVxyXG4iXX0=
@@ -412,18 +412,19 @@ var InputType;
412
412
  InputType[InputType["Price"] = 23] = "Price";
413
413
  InputType[InputType["Radio"] = 24] = "Radio";
414
414
  InputType[InputType["Tree"] = 25] = "Tree";
415
- InputType[InputType["Plaque"] = 26] = "Plaque";
416
- InputType[InputType["PlaqueM"] = 27] = "PlaqueM";
417
- InputType[InputType["SelectAutoCompletePlaque"] = 28] = "SelectAutoCompletePlaque";
418
- InputType[InputType["SelectAutoCompletePlaqueM"] = 29] = "SelectAutoCompletePlaqueM";
419
- InputType[InputType["BankCard"] = 30] = "BankCard";
420
- InputType[InputType["Constant"] = 31] = "Constant";
421
- InputType[InputType["Hidden"] = 32] = "Hidden";
422
- InputType[InputType["Table"] = 33] = "Table";
423
- InputType[InputType["CarSearch"] = 34] = "CarSearch";
424
- InputType[InputType["Car"] = 35] = "Car";
425
- InputType[InputType["Finger"] = 36] = "Finger";
426
- InputType[InputType["Color"] = 37] = "Color";
415
+ InputType[InputType["TreeRadio"] = 26] = "TreeRadio";
416
+ InputType[InputType["Plaque"] = 27] = "Plaque";
417
+ InputType[InputType["PlaqueM"] = 28] = "PlaqueM";
418
+ InputType[InputType["SelectAutoCompletePlaque"] = 29] = "SelectAutoCompletePlaque";
419
+ InputType[InputType["SelectAutoCompletePlaqueM"] = 30] = "SelectAutoCompletePlaqueM";
420
+ InputType[InputType["BankCard"] = 31] = "BankCard";
421
+ InputType[InputType["Constant"] = 32] = "Constant";
422
+ InputType[InputType["Hidden"] = 33] = "Hidden";
423
+ InputType[InputType["Table"] = 34] = "Table";
424
+ InputType[InputType["CarSearch"] = 35] = "CarSearch";
425
+ InputType[InputType["Car"] = 36] = "Car";
426
+ InputType[InputType["Finger"] = 37] = "Finger";
427
+ InputType[InputType["Color"] = 38] = "Color";
427
428
  })(InputType || (InputType = {}));
428
429
  var OperationEnum;
429
430
  (function (OperationEnum) {
@@ -1461,61 +1462,6 @@ class TreeRowClass {
1461
1462
  this.selected = selected;
1462
1463
  this.children = children;
1463
1464
  }
1464
- toggle(onlyChild = true) {
1465
- if (this.selected) {
1466
- this.unCheck(onlyChild);
1467
- if (onlyChild) {
1468
- setTimeout(() => { this.unCheckParent(); });
1469
- }
1470
- }
1471
- else {
1472
- this.check(onlyChild);
1473
- if (onlyChild) {
1474
- setTimeout(() => { this.checkParent(); });
1475
- }
1476
- }
1477
- }
1478
- check(onlyChild, c = this) {
1479
- c.selected = true;
1480
- if (onlyChild) {
1481
- c.checkChildren(onlyChild);
1482
- }
1483
- }
1484
- unCheck(onlyChild, c = this) {
1485
- c.selected = false;
1486
- if (onlyChild) {
1487
- c.children.forEach((ch) => {
1488
- this.unCheck(onlyChild, ch);
1489
- });
1490
- }
1491
- }
1492
- checkChildren(onlyChild) {
1493
- this.children.forEach((ch) => {
1494
- this.check(onlyChild, ch);
1495
- });
1496
- }
1497
- checkParent(p = this.parent) {
1498
- if (p) {
1499
- if (p.children.filter(x => !x.selected).length > 0) {
1500
- p.selected = null;
1501
- }
1502
- else {
1503
- p.selected = true;
1504
- }
1505
- this.checkParent(p.parent);
1506
- }
1507
- }
1508
- unCheckParent(p = this.parent) {
1509
- if (p) {
1510
- if (p.children.filter(x => x.selected || x.selected == null).length > 0) {
1511
- p.selected = null;
1512
- }
1513
- else {
1514
- p.selected = false;
1515
- }
1516
- this.unCheckParent(p.parent);
1517
- }
1518
- }
1519
1465
  }
1520
1466
  class AccordionClass {
1521
1467
  constructor(l, name, cls = '', rows) {
@@ -3509,7 +3455,7 @@ class FormComponent {
3509
3455
  FormComponent.decorators = [
3510
3456
  { type: Component, args: [{
3511
3457
  selector: 'lib-form',
3512
- template: "<form [style]=\"form.style\" *ngIf=\"form\" [id]=\"form.id + 'Form'\" [className]=\"'form' + (form.class ? ' ' + form.class : '')\">\r\n <div *ngIf=\"form.displayLabel\" [className]=\"(form.subName ? '' : 'underline ') + 'title'\">{{this.form.l(this.form.name)}}</div>\r\n <div *ngIf=\"form.displayLabel && form.subName\" class=\"sub-title underline\">{{this.form.l(this.form.subName)}}</div>\r\n <div *ngIf=\"form.loading\" class=\"loading\">\r\n <div class=\"text\" [innerHTML]=\"form.l('LoadingTable', 'Processing')\"></div>\r\n </div>\r\n <div *ngIf=\"!form.permission\" class=\"loading\">\r\n <div class=\"text\"><i class=\"fas fa-shield-alt icon\"></i>{{ form.l(\"PermissionDenied\") }}</div>\r\n </div>\r\n <div class=\"inputs\">\r\n <span *ngFor=\"let inp of form.inputs; let i = index\">\r\n <lib-form-textbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Text || inp.type == type.Password || inp.type == type.Mobile || inp.type == type.Phone || inp.type == type.Email || inp.type == type.NationalCode || inp.type == type.Number || inp.type == type.Url || inp.type == type.PostalCode || inp.type == type.Price || inp.type == type.Sheba || inp.type == type.Color)\" [inp]=\"inp\"></lib-form-textbox>\r\n <lib-form-textarea (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.TextArea\" [inp]=\"inp\"></lib-form-textarea>\r\n <lib-form-checkbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Check\" [inp]=\"inp\"></lib-form-checkbox>\r\n <lib-form-select [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Select || inp.type == type.SelectSearch || inp.type == type.SelectAutoComplete)\" [inp]=\"inp\"></lib-form-select>\r\n <lib-form-date [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Date\" [inp]=\"inp\"></lib-form-date>\r\n <lib-form-time [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Time\" [inp]=\"inp\"></lib-form-time>\r\n <lib-form-datetime [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.DateTime\" [inp]=\"inp\"></lib-form-datetime>\r\n <lib-form-label *ngIf=\"inp.visible && inp.type == type.Label\" [inp]=\"inp\"></lib-form-label>\r\n <lib-form-file (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.File\" [inp]=\"inp\"></lib-form-file>\r\n <lib-form-button (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Button || inp.type == type.Submit)\" [inp]=\"inp\"></lib-form-button>\r\n <lib-form-icon (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Icon\" [inp]=\"inp\"></lib-form-icon>\r\n <lib-form-radio (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Radio\" [inp]=\"inp\"></lib-form-radio>\r\n <lib-form-tree (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Tree\" [inp]=\"inp\"></lib-form-tree>\r\n <lib-form-plaque (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Plaque || inp.type == type.PlaqueM)\" [inp]=\"inp\"></lib-form-plaque>\r\n <lib-form-plaque-select (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.SelectAutoCompletePlaque || inp.type == type.SelectAutoCompletePlaqueM)\" [inp]=\"inp\"></lib-form-plaque-select>\r\n <lib-form-bank-card (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.BankCard\" [inp]=\"inp\"></lib-form-bank-card>\r\n <lib-form-car-search (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.CarSearch\" [inp]=\"inp\"></lib-form-car-search>\r\n <lib-form-car (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Car\" [inp]=\"inp\"></lib-form-car>\r\n <lib-form-finger (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Finger\" [inp]=\"inp\"></lib-form-finger>\r\n <lib-form-table *ngIf=\"inp.visible && inp.type == type.Table\" [inp]=\"inp\"></lib-form-table>\r\n <lib-form-hidden *ngIf=\"inp.type == type.Hidden\" [inp]=\"inp\"></lib-form-hidden>\r\n </span>\r\n </div>\r\n</form>\r\n",
3458
+ template: "<form [style]=\"form.style\" *ngIf=\"form\" [id]=\"form.id + 'Form'\" [className]=\"'form' + (form.class ? ' ' + form.class : '')\">\r\n <div *ngIf=\"form.displayLabel\" [className]=\"(form.subName ? '' : 'underline ') + 'title'\">{{this.form.l(this.form.name)}}</div>\r\n <div *ngIf=\"form.displayLabel && form.subName\" class=\"sub-title underline\">{{this.form.l(this.form.subName)}}</div>\r\n <div *ngIf=\"form.loading\" class=\"loading\">\r\n <div class=\"text\" [innerHTML]=\"form.l('LoadingTable', 'Processing')\"></div>\r\n </div>\r\n <div *ngIf=\"!form.permission\" class=\"loading\">\r\n <div class=\"text\"><i class=\"fas fa-shield-alt icon\"></i>{{ form.l(\"PermissionDenied\") }}</div>\r\n </div>\r\n <div class=\"inputs\">\r\n <span *ngFor=\"let inp of form.inputs; let i = index\">\r\n <lib-form-textbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Text || inp.type == type.Password || inp.type == type.Mobile || inp.type == type.Phone || inp.type == type.Email || inp.type == type.NationalCode || inp.type == type.Number || inp.type == type.Url || inp.type == type.PostalCode || inp.type == type.Price || inp.type == type.Sheba || inp.type == type.Color)\" [inp]=\"inp\"></lib-form-textbox>\r\n <lib-form-textarea (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.TextArea\" [inp]=\"inp\"></lib-form-textarea>\r\n <lib-form-checkbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Check\" [inp]=\"inp\"></lib-form-checkbox>\r\n <lib-form-select [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Select || inp.type == type.SelectSearch || inp.type == type.SelectAutoComplete)\" [inp]=\"inp\"></lib-form-select>\r\n <lib-form-date [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Date\" [inp]=\"inp\"></lib-form-date>\r\n <lib-form-time [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Time\" [inp]=\"inp\"></lib-form-time>\r\n <lib-form-datetime [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.DateTime\" [inp]=\"inp\"></lib-form-datetime>\r\n <lib-form-label *ngIf=\"inp.visible && inp.type == type.Label\" [inp]=\"inp\"></lib-form-label>\r\n <lib-form-file (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.File\" [inp]=\"inp\"></lib-form-file>\r\n <lib-form-button (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Button || inp.type == type.Submit)\" [inp]=\"inp\"></lib-form-button>\r\n <lib-form-icon (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Icon\" [inp]=\"inp\"></lib-form-icon>\r\n <lib-form-radio (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Radio\" [inp]=\"inp\"></lib-form-radio>\r\n <lib-form-tree (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Tree || inp.type == type.TreeRadio)\" [inp]=\"inp\"></lib-form-tree>\r\n <lib-form-plaque (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Plaque || inp.type == type.PlaqueM)\" [inp]=\"inp\"></lib-form-plaque>\r\n <lib-form-plaque-select (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.SelectAutoCompletePlaque || inp.type == type.SelectAutoCompletePlaqueM)\" [inp]=\"inp\"></lib-form-plaque-select>\r\n <lib-form-bank-card (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.BankCard\" [inp]=\"inp\"></lib-form-bank-card>\r\n <lib-form-car-search (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.CarSearch\" [inp]=\"inp\"></lib-form-car-search>\r\n <lib-form-car (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Car\" [inp]=\"inp\"></lib-form-car>\r\n <lib-form-finger (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Finger\" [inp]=\"inp\"></lib-form-finger>\r\n <lib-form-table *ngIf=\"inp.visible && inp.type == type.Table\" [inp]=\"inp\"></lib-form-table>\r\n <lib-form-hidden *ngIf=\"inp.type == type.Hidden\" [inp]=\"inp\"></lib-form-hidden>\r\n </span>\r\n </div>\r\n</form>\r\n",
3513
3459
  styles: [".form{border-radius:var(--border-radius-base);float:right;padding:20px;position:relative;width:100%}.form>.title{font-family:VazirBold;font-size:16px;height:40px}.form>.sub-title,.form>.title{float:right;line-height:30px;margin-bottom:10px;position:relative;text-align:right;width:100%}.form>.sub-title{color:var(--black-light);font-family:VazirLight;font-size:12px;height:30px}.form .loading{background-color:#fff;border-radius:var(--border-radius-base);height:100%;right:0;top:0;z-index:4}.form .loading,.form .loading .text{position:absolute;text-align:center;width:100%}.form .loading .text{font-family:VazirBold;height:35px;line-height:35px;top:calc(50% - 20px)}::ng-deep .form .loading .icon{font-size:20px!important;line-height:30px;margin-left:5px;position:relative;top:5px}.form-buttons,.form-error{float:right;width:100%}.form-error{color:var(--red-light);font-size:11px;height:15px;line-height:8px;margin-top:10px;padding:0 10px;position:relative;text-align:center}.form-error .message{float:left;width:calc(100% - 40px)}.form-error .icon{float:right;height:20px;line-height:6px;right:0;top:0;width:40px}.form .inputs{margin:0 -15px}"]
3514
3460
  },] }
3515
3461
  ];
@@ -5098,8 +5044,9 @@ FormTimeComponent.propDecorators = {
5098
5044
  class FormTreeItemComponent {
5099
5045
  constructor() {
5100
5046
  this.parent = null;
5101
- this.changeIndex = new EventEmitter();
5047
+ this.toggle = new EventEmitter();
5102
5048
  }
5049
+ get type() { return InputType; }
5103
5050
  ngOnInit() {
5104
5051
  this.item.parent = this.parent;
5105
5052
  }
@@ -5118,14 +5065,14 @@ class FormTreeItemComponent {
5118
5065
  }
5119
5066
  }
5120
5067
  onClick() {
5121
- this.item.toggle(this.tree.onlyChild);
5068
+ this.toggle.emit(this.item);
5122
5069
  }
5123
5070
  }
5124
5071
  FormTreeItemComponent.decorators = [
5125
5072
  { type: Component, args: [{
5126
5073
  selector: 'lib-form-tree-item',
5127
- template: "<div [className]=\"(item.selected ? 'selected ' : item.selected == null ? 'null ' : '') + 'row-item'\">\r\n <div (click)=\"onClick()\" class=\"checkbox\">{{tree.l(item.name)}}</div>\r\n <i *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" [className]=\"(index == 0 && level == 0 ? 'fa-duotone fa-caret-down ' : 'fa-duotone fa-caret-left ') + 'open-close'\"></i>\r\n <div [className]=\"(index == 0 && level == 0 ? 'open ' : '') + 'children'\" [style]=\"index == 0 && level == 0 ? {display: 'block'} : {}\" *ngIf=\"item.children.length > 0\">\r\n <div class=\"items rightline\">\r\n <lib-form-tree-item [level]=\"level + 1\" [index]=\"i\" [item]=\"child\" [parent]=\"item\" [tree]=\"tree\" *ngFor=\"let child of item.children; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
5128
- styles: [".row-item{float:left;position:relative;text-align:center;width:90%}.row-item .content{background-color:rgba(11,72,107,.06666666666666667);border-radius:var(--border-radius-base);cursor:pointer;float:right;width:100%}.row-item .open-close{cursor:pointer;font-size:20px;height:40px;line-height:38px;position:absolute;right:-25px;text-align:center;width:15px}.row-item .content.parent,.row-item .content:hover{background-color:rgba(11,72,107,.13333333333333333)}.row-item .content.parent:hover{background-color:rgba(11,72,107,.26666666666666666)}.row-item .children{display:none;padding:10px;position:relative}.row-item .children,.row-item .children .items{float:left;width:100%}.row-item .children>.line{height:calc(100% - 30px);right:20px;top:15px;width:2px}.row-item .children .row-item>.line,.row-item .children>.line{background-color:rgba(11,72,107,.13333333333333333);position:absolute}.row-item .children .row-item>.line{height:2px;right:-35px;top:17px;width:10px}.row-item .checkbox{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;cursor:pointer;display:flex;float:right;font-size:11px;justify-content:center;line-height:20px;min-height:40px;padding:5px 30px;position:relative;text-align:center;width:100%;z-index:2}.row-item .control{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.row-item>.checkbox:before{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:18px;font-weight:400;height:40px;line-height:40px;position:absolute;right:0;top:0;width:30px}.row-item.selected>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";font-weight:900}.row-item.null>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f146\";font-weight:900}.row-item:after{background-image:linear-gradient(90deg,transparent,rgba(50,50,50,.25),transparent);border:0;bottom:-1px;content:\"\";float:right;height:1px;position:absolute;right:0;width:100%}::ng-deep lib-form-tree-item:last-of-type>.row-item:after{display:none}"]
5074
+ template: "<div [className]=\"(item.selected ? 'selected ' : item.selected == null ? 'null ' : '') + 'row-item'\">\r\n <div (click)=\"onClick()\" [className]=\"'checkbox' + (this.tree.type === type.TreeRadio ? ' radio' : '')\">{{tree.l(item.name)}}</div>\r\n <i *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" [className]=\"(index == 0 && level == 0 ? 'fa-duotone fa-caret-down ' : 'fa-duotone fa-caret-left ') + 'open-close'\"></i>\r\n <div [className]=\"(index == 0 && level == 0 ? 'open ' : '') + 'children'\" [style]=\"index == 0 && level == 0 ? {display: 'block'} : {}\" *ngIf=\"item.children.length > 0\">\r\n <div class=\"items rightline\">\r\n <lib-form-tree-item [level]=\"level + 1\" (toggle)=\"toggle.emit($event)\" [index]=\"i\" [item]=\"child\" [parent]=\"item\" [tree]=\"tree\" *ngFor=\"let child of item.children; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
5075
+ styles: [".row-item{float:left;position:relative;text-align:center;width:90%}.row-item .content{background-color:rgba(11,72,107,.06666666666666667);border-radius:var(--border-radius-base);cursor:pointer;float:right;width:100%}.row-item .open-close{cursor:pointer;font-size:20px;height:40px;line-height:38px;position:absolute;right:-25px;text-align:center;width:15px}.row-item .content.parent,.row-item .content:hover{background-color:rgba(11,72,107,.13333333333333333)}.row-item .content.parent:hover{background-color:rgba(11,72,107,.26666666666666666)}.row-item .children{display:none;padding:10px;position:relative}.row-item .children,.row-item .children .items{float:left;width:100%}.row-item .children>.line{height:calc(100% - 30px);right:20px;top:15px;width:2px}.row-item .children .row-item>.line,.row-item .children>.line{background-color:rgba(11,72,107,.13333333333333333);position:absolute}.row-item .children .row-item>.line{height:2px;right:-35px;top:17px;width:10px}.row-item .checkbox{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;cursor:pointer;display:flex;float:right;font-size:11px;justify-content:center;line-height:20px;min-height:40px;padding:5px 30px;position:relative;text-align:center;width:100%;z-index:2}.row-item .control{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.row-item>.checkbox:before{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:18px;font-weight:400;height:40px;line-height:40px;position:absolute;right:0;top:0;width:30px}.row-item>.checkbox.radio:before{content:\"\\f111\"}.row-item.selected>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";content:\"\\f192\";font-weight:900}.row-item.null>.checkbox:before{animation:pop .18s ease-in;color:var(--green);content:\"\\f146\";font-weight:900}.row-item:after{background-image:linear-gradient(90deg,transparent,rgba(50,50,50,.25),transparent);border:0;bottom:-1px;content:\"\";float:right;height:1px;position:absolute;right:0;width:100%}::ng-deep lib-form-tree-item:last-of-type>.row-item:after{display:none}"]
5129
5076
  },] }
5130
5077
  ];
5131
5078
  FormTreeItemComponent.ctorParameters = () => [];
@@ -5136,7 +5083,7 @@ FormTreeItemComponent.propDecorators = {
5136
5083
  tree: [{ type: Input }],
5137
5084
  parent: [{ type: Input }],
5138
5085
  base: [{ type: Input }],
5139
- changeIndex: [{ type: Output }],
5086
+ toggle: [{ type: Output }],
5140
5087
  inputDiv: [{ type: ViewChild, args: ['inputDiv',] }],
5141
5088
  inputBase: [{ type: ViewChild, args: ['inputBase',] }]
5142
5089
  };
@@ -5162,7 +5109,7 @@ class FormTreeComponent {
5162
5109
  return this.getSelected();
5163
5110
  };
5164
5111
  this.inp.setValue = (v) => {
5165
- this.check(v.map(String));
5112
+ this.setValue(v.map(String));
5166
5113
  };
5167
5114
  this.inp.clear = () => {
5168
5115
  this.inp.setValue([], false);
@@ -5199,36 +5146,84 @@ class FormTreeComponent {
5199
5146
  });
5200
5147
  return l;
5201
5148
  }
5202
- check(ids, chs = this.inp.rows) {
5203
- let isChecked = false;
5204
- let cIsChecked = false;
5205
- for (const r of chs) {
5149
+ setValue(ids, rows = this.inp.rows) {
5150
+ for (const r of rows) {
5206
5151
  r.selected = ids.includes(r.value);
5207
- if (r.selected) {
5208
- isChecked = true;
5209
- }
5210
5152
  if (this.inp.onlyChild) {
5211
- cIsChecked = this.check(ids, r.children);
5212
- if (cIsChecked) {
5213
- r.selected = r.children.filter(x => !x.selected).length > 0 ? null : true;
5153
+ if (r.selected) {
5154
+ this.checkParent(r.parent);
5214
5155
  }
5156
+ this.setValue(ids, r.children);
5215
5157
  }
5216
5158
  }
5217
- return isChecked || cIsChecked;
5159
+ return true;
5218
5160
  }
5219
- checkChildren(chs, ids) {
5220
- for (const r of chs) {
5221
- if (ids.includes(r.value)) {
5222
- r.toggle(this.inp.onlyChild);
5161
+ toggle(row) {
5162
+ if (row.selected) {
5163
+ this.unCheck(row);
5164
+ if (this.inp.onlyChild && this.inp.type === InputType.Tree) {
5165
+ this.unCheckParent(row.parent);
5223
5166
  }
5224
- setTimeout(() => { this.checkChildren(r.children, ids); });
5167
+ }
5168
+ else {
5169
+ this.check(row);
5170
+ if (this.inp.onlyChild && this.inp.type === InputType.Tree) {
5171
+ this.checkParent(row.parent);
5172
+ }
5173
+ }
5174
+ }
5175
+ check(c) {
5176
+ if (this.inp.type === InputType.Tree) {
5177
+ c.selected = true;
5178
+ if (this.inp.onlyChild) {
5179
+ this.checkChildren(c);
5180
+ }
5181
+ }
5182
+ else {
5183
+ this.inp.clear();
5184
+ c.selected = true;
5185
+ }
5186
+ }
5187
+ unCheck(c) {
5188
+ c.selected = false;
5189
+ if (this.inp.onlyChild) {
5190
+ c.children.forEach((ch) => {
5191
+ this.unCheck(ch);
5192
+ });
5193
+ }
5194
+ }
5195
+ checkChildren(c) {
5196
+ c.children.forEach((ch) => {
5197
+ this.check(ch);
5198
+ });
5199
+ }
5200
+ checkParent(p) {
5201
+ if (p) {
5202
+ if (p.children.filter(x => !x.selected).length > 0) {
5203
+ p.selected = null;
5204
+ }
5205
+ else {
5206
+ p.selected = true;
5207
+ }
5208
+ this.checkParent(p.parent);
5209
+ }
5210
+ }
5211
+ unCheckParent(p) {
5212
+ if (p) {
5213
+ if (p.children.filter(x => x.selected || x.selected == null).length > 0) {
5214
+ p.selected = null;
5215
+ }
5216
+ else {
5217
+ p.selected = false;
5218
+ }
5219
+ this.unCheckParent(p.parent);
5225
5220
  }
5226
5221
  }
5227
5222
  }
5228
5223
  FormTreeComponent.decorators = [
5229
5224
  { type: Component, args: [{
5230
5225
  selector: 'lib-form-tree',
5231
- template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [className]=\"'form-input-con tree w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onClick()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"fas fa-star-of-life required-icon\"></i>{{inp.getLabel()}}</div>\r\n <input #inputBase type=\"checkbox\" class=\"input-base\" (keydown)=\"onKeyDown($event)\" (focusin)=\"onFocusIn()\">\r\n <div [className]=\"(inp.loading ? 'o-h ' : '') + 'control'\">\r\n <i *ngIf=\"inp.icon != null || inp.loading\" #inputIcon [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'\"></i>\r\n <i *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"fa-duotone fa-eraser clear-icon\"></i>\r\n <lib-form-tree-item [level]=\"0\" [index]=\"i\" [item]=\"item\" [tree]=\"inp\" [base]=\"true\" *ngFor=\"let item of inp.rows; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
5226
+ template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [className]=\"'form-input-con tree w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onClick()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"fas fa-star-of-life required-icon\"></i>{{inp.getLabel()}}</div>\r\n <input #inputBase type=\"checkbox\" class=\"input-base\" (keydown)=\"onKeyDown($event)\" (focusin)=\"onFocusIn()\">\r\n <div [className]=\"(inp.loading ? 'o-h ' : '') + 'control'\">\r\n <i *ngIf=\"inp.icon != null || inp.loading\" #inputIcon [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'\"></i>\r\n <i *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"fa-duotone fa-eraser clear-icon\"></i>\r\n <lib-form-tree-item [level]=\"0\" [index]=\"i\" (toggle)=\"toggle($event)\" [item]=\"item\" [tree]=\"inp\" [base]=\"true\" *ngFor=\"let item of inp.rows; let i = index\"></lib-form-tree-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
5232
5227
  styles: [".form-input-con.tree{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;padding:0 15px;position:relative}.form-input-con.tree .form-input{float:right;position:relative;width:100%}.form-input-con.tree .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.tree.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.tree .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.tree .form-input>.control{background-color:#fff;border:var(--border-input);border-radius:var(--border-radius-base);float:right;max-height:400px;min-height:35px;overflow-x:hidden;overflow-y:auto;padding:10px;position:relative;width:100%}.form-input-con.tree.without-border .form-input>.control{border:unset}.form-input-con.tree:not(.without-border) .form-input .input-base:focus+.control,.form-input-con.tree:not(.without-border) .form-input:hover .control{border:var(--border-input-dark)}.form-input-con.tree.error .form-input .input-base:focus+.control,.form-input-con.tree.error .form-input:hover .control{border:var(--border-input-red-dark)}.form-input-con.tree .form-input .input-base{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.form-input-con.tree .form-input i.icon{color:var(--primary);cursor:default;left:0;line-height:35px;top:0;z-index:1}.form-input-con.tree .form-input i.clear-icon,.form-input-con.tree .form-input i.icon{font-size:14px;height:35px;position:absolute;text-align:center;transition:all .35s ease-in-out;width:35px}.form-input-con.tree .form-input i.clear-icon{bottom:0;color:var(--red);cursor:pointer;line-height:38px;right:0;z-index:3}.form-input-con.tree.error .form-input>.control{border:var(--border-input-red)}.form-input-con.tree.error .form-input i.icon{color:var(--red)}"]
5233
5228
  },] }
5234
5229
  ];