@acorex/components 16.19.2 → 16.19.3

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.
@@ -21,8 +21,7 @@ import moment from 'jalali-moment';
21
21
  import { trigger, state, style, transition, animate } from '@angular/animations';
22
22
  import * as i5 from '@angular/cdk/a11y';
23
23
  import { A11yModule } from '@angular/cdk/a11y';
24
- import * as _ from 'lodash';
25
- import { differenceBy } from 'lodash';
24
+ import { differenceBy, chain, cloneDeep } from 'lodash-es';
26
25
  import * as i1$4 from '@angular/router';
27
26
  import { RouterModule } from '@angular/router';
28
27
 
@@ -11775,17 +11774,18 @@ class AXSearchBarComponent {
11775
11774
  title: el.property.title,
11776
11775
  textValue: this._handleTextValue(el),
11777
11776
  value: el.value ? this._handleDefultVlaue(el) : null,
11778
- component: el
11777
+ component: el,
11779
11778
  });
11780
11779
  }
11781
11780
  });
11782
- this._items = _.chain(v)
11781
+ this._items = chain(v)
11783
11782
  .groupBy((x) => x.property.row)
11784
11783
  .map((value, key) => ({ row: key, items: value }))
11785
11784
  .value();
11786
11785
  }
11787
11786
  onValueChange = new EventEmitter();
11788
11787
  onSearchValue = new EventEmitter();
11788
+ onClose = new EventEmitter();
11789
11789
  _items = [];
11790
11790
  _filterItems = [];
11791
11791
  _filterItemsClone = [];
@@ -11794,14 +11794,19 @@ class AXSearchBarComponent {
11794
11794
  _isEmitted = false;
11795
11795
  _searchCount;
11796
11796
  disableItem(name, disableValue) {
11797
- this._editors.find((x) => x.property.property.name === name).disabeld(disableValue);
11797
+ this._editors
11798
+ .find((x) => x.property.property.name === name)
11799
+ .disabeld(disableValue);
11798
11800
  }
11799
11801
  clearItem(name) {
11800
11802
  this._editors.find((x) => x.property.property.name === name).clear();
11801
11803
  }
11802
11804
  ngOnInit() {
11803
11805
  if (this.rtl == null) {
11804
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
11806
+ this.rtl =
11807
+ window
11808
+ .getComputedStyle(this.ref.nativeElement, null)
11809
+ .getPropertyValue('direction') === 'rtl';
11805
11810
  }
11806
11811
  }
11807
11812
  refresh() {
@@ -11834,7 +11839,7 @@ class AXSearchBarComponent {
11834
11839
  search() {
11835
11840
  this.form.validate().then((c) => {
11836
11841
  if (c.result) {
11837
- this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value === 0 || el.value != null && el.value != '')));
11842
+ this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value === 0 || (el.value != null && el.value != ''))));
11838
11843
  this._searchCount = this._filterItems.filter((x) => x.component.property.visible != false).length;
11839
11844
  this.searchPopover.close();
11840
11845
  this.onSearchValue.emit(this._filterItems);
@@ -11850,6 +11855,7 @@ class AXSearchBarComponent {
11850
11855
  this.searchPopover.close();
11851
11856
  this._searchCount = null;
11852
11857
  this.onSearchValue.emit(this._filterItems);
11858
+ this.onClose.emit();
11853
11859
  }
11854
11860
  renderCol(e) {
11855
11861
  let className = [];
@@ -11916,8 +11922,10 @@ class AXSearchBarComponent {
11916
11922
  }
11917
11923
  async _handleDefultVlaue(dataItem) {
11918
11924
  await this._handleInitVlaue(dataItem);
11919
- this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value === 0 || el.value != null && el.value != '')));
11920
- if (this._filterItems.length === this._defultValueCount.length && this.loadOnInit && !this._isEmitted) {
11925
+ this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value === 0 || (el.value != null && el.value != ''))));
11926
+ if (this._filterItems.length === this._defultValueCount.length &&
11927
+ this.loadOnInit &&
11928
+ !this._isEmitted) {
11921
11929
  this._isEmitted = true;
11922
11930
  this._searchCount = this._filterItems.filter((x) => x.component.property.visible != false).length;
11923
11931
  setTimeout(() => {
@@ -11953,7 +11961,10 @@ class AXSearchBarComponent {
11953
11961
  const findEl = this._filterItemsClone.find((el) => el.uniqueNumber == e.property.uniqueNumber);
11954
11962
  if (findEl) {
11955
11963
  findEl.value = value;
11956
- findEl.textValue = e.property.editorClass === 'ax/editors/date' ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD') : text;
11964
+ findEl.textValue =
11965
+ e.property.editorClass === 'ax/editors/date'
11966
+ ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD')
11967
+ : text;
11957
11968
  }
11958
11969
  else if (e.value != null) {
11959
11970
  this._filterItemsClone.push({
@@ -11961,16 +11972,30 @@ class AXSearchBarComponent {
11961
11972
  title: e.property.title,
11962
11973
  uniqueNumber: e.property.uniqueNumber,
11963
11974
  value,
11964
- textValue: e.property.editorClass === 'ax/editors/date' ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD') : text,
11975
+ textValue: e.property.editorClass === 'ax/editors/date'
11976
+ ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD')
11977
+ : text,
11965
11978
  component: e,
11966
11979
  filterOptions: {
11967
- filters: e.property?.filterOptions?.filters ? e.property.filterOptions.filters : [],
11968
- logic: e.property?.filterOptions?.logic ? e.property.filterOptions.logic : 'and',
11969
- ignoreCase: e.property?.filterOptions?.ignoreCase ? e.property.filterOptions.ignoreCase : true,
11970
- joinType: e.property?.filterOptions?.joinType ? e.property.filterOptions.joinType : 'INNER',
11971
- operator: e.property?.filterOptions?.operator ? e.property.filterOptions.operator : null,
11972
- truncateDate: e.property?.filterOptions?.truncateDate ? e.property.filterOptions.truncateDate : true
11973
- }
11980
+ filters: e.property?.filterOptions?.filters
11981
+ ? e.property.filterOptions.filters
11982
+ : [],
11983
+ logic: e.property?.filterOptions?.logic
11984
+ ? e.property.filterOptions.logic
11985
+ : 'and',
11986
+ ignoreCase: e.property?.filterOptions?.ignoreCase
11987
+ ? e.property.filterOptions.ignoreCase
11988
+ : true,
11989
+ joinType: e.property?.filterOptions?.joinType
11990
+ ? e.property.filterOptions.joinType
11991
+ : 'INNER',
11992
+ operator: e.property?.filterOptions?.operator
11993
+ ? e.property.filterOptions.operator
11994
+ : null,
11995
+ truncateDate: e.property?.filterOptions?.truncateDate
11996
+ ? e.property.filterOptions.truncateDate
11997
+ : true,
11998
+ },
11974
11999
  });
11975
12000
  }
11976
12001
  }
@@ -11985,7 +12010,7 @@ class AXSearchBarComponent {
11985
12010
  this.searchPopover.close();
11986
12011
  }
11987
12012
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AXSearchBarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
11988
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: AXSearchBarComponent, isStandalone: false, selector: "ax-search-bar", inputs: { sizeButton: "sizeButton", size: "size", disabled: "disabled", fitParent: "fitParent", popoverWidth: "popoverWidth", rtl: "rtl", loadOnInit: "loadOnInit", caption: "caption", block: "block", items: "items" }, outputs: { onValueChange: "onValueChange", onSearchValue: "onSearchValue" }, viewQueries: [{ propertyName: "searchPopover", first: true, predicate: ["searchPop"], descendants: true }, { propertyName: "form", first: true, predicate: AXValidationFormComponent, descendants: true }, { propertyName: "_editors", predicate: AXPropertyEditorRendererDirective, descendants: true }], ngImport: i0, template: "<ax-button [block]=\"block\" end icon=\"far fa-sliders-h icon\" [selected]=\"_searchCount? true:false\"\n [type]=\" _searchCount ? 'primary':'primary outline'\" [disabled]=\"disabled\" [size]=\"sizeButton\" [tabIndex]=\"-1\"\n (click)=\"handleButtonClick()\"> {{caption? caption:'common.search' | trans}}\n <span *ngIf=\"_searchCount\" class=\"search-count\">{{_searchCount}}</span></ax-button>\n\n\n<ax-popover #searchPop [target]=\"ref\" [rtl]=\"rtl\"\n [position]=\"{originX:'end',originY:'bottom',overlayX:'end',overlayY:'top',offsetY:10}\">\n <div class=\"panel-box ax-dropdown-container-bordered {{size}}\">\n <ax-validation-form #form>\n <ng-container *ngFor=\"let item of _items\">\n <div class=\"row\">\n <ng-container *ngFor=\"let prop of item.items\">\n <div *ngIf=\"prop.property.visible != false\" class=\"{{renderCol(prop.property.col)}}\">\n <div>\n <ax-label>{{prop.property.title}}</ax-label>\n <ng-container ax-property-editor-renderer [validationForm]=\"form\" [property]=\"prop\"\n [context]=\"_context\" (onValueChange)=\"handleValueChange($event)\"></ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div class=\"footer-button\">\n <ax-button (click)=\"search()\">{{'common.search' | trans}}</ax-button>\n <ax-button type=\"blank danger\" (click)=\"clear()\">{{'common.reset' | trans}}</ax-button>\n </div>\n </ax-validation-form>\n </div>\n</ax-popover>", styles: [".panel-box{padding:1rem}.panel-box.ax-dropdown-container-bordered{background:var(--ax-white-color);border:1px solid;border-color:var(--ax-border-color);border-radius:var(--ax-border-radius-size);box-shadow:0 5px 10px #0000004d}.panel-box .footer-button{margin-top:1rem;display:flex;align-items:center;gap:.5rem}.panel-box.sm{width:30vw}.panel-box.md{width:50vw}.panel-box.lg{width:70vw}.panel-box.full{width:80vw}@media all and (min-width: 1280px){.panel-box.sm{width:420px!important}.panel-box.md{width:680px!important}.panel-box.lg{width:1024px!important}}@media all and (min-width: 1024px) and (max-width: 1279px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md{width:500px!important}.panel-box.lg{width:900px!important}}@media all and (min-width: 768px) and (max-width: 1023px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md{width:500px!important}.panel-box.lg{width:700px!important}}@media all and (min-width: 425px) and (max-width: 767px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md,.panel-box.lg{width:460px!important}}@media all and (min-width: 0px) and (max-width: 424px){.panel-box.sm,.panel-box.md,.panel-box.lg{width:100vw;max-height:100vh}}.search-count{background:#fff3;border-radius:50%;color:var(--ax-white-color);padding:.125rem;width:1.75rem;height:1.75rem;font-size:.875rem;display:inline-flex;align-items:center;justify-content:center;margin-inline-start:.5rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }, { kind: "directive", type: AXPropertyEditorRendererDirective, selector: "[ax-property-editor-renderer]", inputs: ["property", "validationForm", "context", "host", "groupId"], outputs: ["onValueChange"] }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["size"], outputs: ["clickLabel"] }, { kind: "component", type: AXValidationFormComponent, selector: "ax-validation-form", inputs: ["validateOn"], outputs: ["onInit"] }, { kind: "component", type: AXPopoverComponent, selector: "ax-popover", inputs: ["target", "position", "openMode", "closeMode", "rtl", "visible"], outputs: ["onOutSideClick"] }, { kind: "pipe", type: i1$2.AXTranslatorPipe, name: "trans" }] });
12013
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: AXSearchBarComponent, isStandalone: false, selector: "ax-search-bar", inputs: { sizeButton: "sizeButton", size: "size", disabled: "disabled", fitParent: "fitParent", popoverWidth: "popoverWidth", rtl: "rtl", loadOnInit: "loadOnInit", caption: "caption", block: "block", items: "items" }, outputs: { onValueChange: "onValueChange", onSearchValue: "onSearchValue", onClose: "onClose" }, viewQueries: [{ propertyName: "searchPopover", first: true, predicate: ["searchPop"], descendants: true }, { propertyName: "form", first: true, predicate: AXValidationFormComponent, descendants: true }, { propertyName: "_editors", predicate: AXPropertyEditorRendererDirective, descendants: true }], ngImport: i0, template: "<ax-button [block]=\"block\" end icon=\"far fa-sliders-h icon\" [selected]=\"_searchCount? true:false\"\n [type]=\" _searchCount ? 'primary':'primary outline'\" [disabled]=\"disabled\" [size]=\"sizeButton\" [tabIndex]=\"-1\"\n (click)=\"handleButtonClick()\"> {{caption? caption:'common.search' | trans}}\n <span *ngIf=\"_searchCount\" class=\"search-count\">{{_searchCount}}</span></ax-button>\n\n\n<ax-popover #searchPop [target]=\"ref\" [rtl]=\"rtl\"\n [position]=\"{originX:'end',originY:'bottom',overlayX:'end',overlayY:'top',offsetY:10}\">\n <div class=\"panel-box ax-dropdown-container-bordered {{size}}\">\n <ax-validation-form #form>\n <ng-container *ngFor=\"let item of _items\">\n <div class=\"row\">\n <ng-container *ngFor=\"let prop of item.items\">\n <div *ngIf=\"prop.property.visible != false\" class=\"{{renderCol(prop.property.col)}}\">\n <div>\n <ax-label>{{prop.property.title}}</ax-label>\n <ng-container ax-property-editor-renderer [validationForm]=\"form\" [property]=\"prop\"\n [context]=\"_context\" (onValueChange)=\"handleValueChange($event)\"></ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div class=\"footer-button\">\n <ax-button (click)=\"search()\">{{'common.search' | trans}}</ax-button>\n <ax-button type=\"blank danger\" (click)=\"clear()\">{{'common.reset' | trans}}</ax-button>\n </div>\n </ax-validation-form>\n </div>\n</ax-popover>", styles: [".panel-box{padding:1rem}.panel-box.ax-dropdown-container-bordered{background:var(--ax-white-color);border:1px solid;border-color:var(--ax-border-color);border-radius:var(--ax-border-radius-size);box-shadow:0 5px 10px #0000004d}.panel-box .footer-button{margin-top:1rem;display:flex;align-items:center;gap:.5rem}.panel-box.sm{width:30vw}.panel-box.md{width:50vw}.panel-box.lg{width:70vw}.panel-box.full{width:80vw}@media all and (min-width: 1280px){.panel-box.sm{width:420px!important}.panel-box.md{width:680px!important}.panel-box.lg{width:1024px!important}}@media all and (min-width: 1024px) and (max-width: 1279px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md{width:500px!important}.panel-box.lg{width:900px!important}}@media all and (min-width: 768px) and (max-width: 1023px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md{width:500px!important}.panel-box.lg{width:700px!important}}@media all and (min-width: 425px) and (max-width: 767px){.panel-box.sm{width:100vw;max-height:100vh}.panel-box.md,.panel-box.lg{width:460px!important}}@media all and (min-width: 0px) and (max-width: 424px){.panel-box.sm,.panel-box.md,.panel-box.lg{width:100vw;max-height:100vh}}.search-count{background:#fff3;border-radius:50%;color:var(--ax-white-color);padding:.125rem;width:1.75rem;height:1.75rem;font-size:.875rem;display:inline-flex;align-items:center;justify-content:center;margin-inline-start:.5rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }, { kind: "directive", type: AXPropertyEditorRendererDirective, selector: "[ax-property-editor-renderer]", inputs: ["property", "validationForm", "context", "host", "groupId"], outputs: ["onValueChange"] }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["size"], outputs: ["clickLabel"] }, { kind: "component", type: AXValidationFormComponent, selector: "ax-validation-form", inputs: ["validateOn"], outputs: ["onInit"] }, { kind: "component", type: AXPopoverComponent, selector: "ax-popover", inputs: ["target", "position", "openMode", "closeMode", "rtl", "visible"], outputs: ["onOutSideClick"] }, { kind: "pipe", type: i1$2.AXTranslatorPipe, name: "trans" }] });
11989
12014
  }
11990
12015
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AXSearchBarComponent, decorators: [{
11991
12016
  type: Component,
@@ -12023,6 +12048,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
12023
12048
  type: Output
12024
12049
  }], onSearchValue: [{
12025
12050
  type: Output
12051
+ }], onClose: [{
12052
+ type: Output
12026
12053
  }] } });
12027
12054
 
12028
12055
  class AXProperyEditorComponent {
@@ -15430,7 +15457,7 @@ class AXTabPageService {
15430
15457
  newTab[TAB_META_KEY] = {};
15431
15458
  newTab[TAB_META_KEY].uid = AXHtmlUtil.getUID();
15432
15459
  if (newTab?.data) {
15433
- newTab[TAB_META_KEY].oldData = _.cloneDeep(newTab.data);
15460
+ newTab[TAB_META_KEY].oldData = cloneDeep(newTab.data);
15434
15461
  }
15435
15462
  //
15436
15463
  const existTab = this.tabs.find((c) => newTab[TAB_META_KEY].uid && c[TAB_META_KEY].uid === newTab[TAB_META_KEY].uid) ||