@acorex/components 3.0.45 → 3.0.50

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.
Files changed (45) hide show
  1. package/acorex-components.metadata.json +1 -1
  2. package/bundles/acorex-components.umd.js +164 -76
  3. package/bundles/acorex-components.umd.js.map +1 -1
  4. package/bundles/acorex-components.umd.min.js +1 -1
  5. package/bundles/acorex-components.umd.min.js.map +1 -1
  6. package/esm2015/lib/calendar/calendar-box/calendar-box.component.js +6 -6
  7. package/esm2015/lib/property-editor/editors/color-editor/color.editor.js +2 -2
  8. package/esm2015/lib/property-editor/editors/column-editor/column.editor.js +2 -2
  9. package/esm2015/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.js +2 -2
  10. package/esm2015/lib/property-editor/editors/date-editor/date.editor.js +2 -2
  11. package/esm2015/lib/property-editor/editors/number-editor/number.editor.js +2 -2
  12. package/esm2015/lib/property-editor/editors/range-editor/range.editor.js +2 -2
  13. package/esm2015/lib/property-editor/editors/selectbox-editor/selectbox.editor.js +22 -12
  14. package/esm2015/lib/property-editor/editors/switch-editor/number.editor.js +2 -2
  15. package/esm2015/lib/property-editor/editors/text-editor/text.editor.js +2 -2
  16. package/esm2015/lib/property-editor/editors/time-editor/time.editor.js +2 -2
  17. package/esm2015/lib/property-editor/property-editor-renderer.directive.js +83 -37
  18. package/esm2015/lib/property-editor/property-editor.class.js +18 -4
  19. package/esm2015/lib/selectbox/selectbox.component.js +6 -3
  20. package/esm2015/lib/selection-list/selection-list.component.js +6 -7
  21. package/esm2015/lib/tab-strip/tab-strip.component.js +11 -9
  22. package/esm5/lib/calendar/calendar-box/calendar-box.component.js +6 -6
  23. package/esm5/lib/property-editor/editors/color-editor/color.editor.js +2 -2
  24. package/esm5/lib/property-editor/editors/column-editor/column.editor.js +2 -2
  25. package/esm5/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.js +2 -2
  26. package/esm5/lib/property-editor/editors/date-editor/date.editor.js +2 -2
  27. package/esm5/lib/property-editor/editors/number-editor/number.editor.js +2 -2
  28. package/esm5/lib/property-editor/editors/range-editor/range.editor.js +2 -2
  29. package/esm5/lib/property-editor/editors/selectbox-editor/selectbox.editor.js +26 -12
  30. package/esm5/lib/property-editor/editors/switch-editor/number.editor.js +2 -2
  31. package/esm5/lib/property-editor/editors/text-editor/text.editor.js +2 -2
  32. package/esm5/lib/property-editor/editors/time-editor/time.editor.js +2 -2
  33. package/esm5/lib/property-editor/property-editor-renderer.directive.js +89 -39
  34. package/esm5/lib/property-editor/property-editor.class.js +24 -4
  35. package/esm5/lib/selectbox/selectbox.component.js +6 -3
  36. package/esm5/lib/selection-list/selection-list.component.js +3 -4
  37. package/esm5/lib/tab-strip/tab-strip.component.js +11 -9
  38. package/fesm2015/acorex-components.js +152 -78
  39. package/fesm2015/acorex-components.js.map +1 -1
  40. package/fesm5/acorex-components.js +165 -77
  41. package/fesm5/acorex-components.js.map +1 -1
  42. package/lib/property-editor/editors/selectbox-editor/selectbox.editor.d.ts +7 -4
  43. package/lib/property-editor/property-editor-renderer.directive.d.ts +5 -3
  44. package/lib/property-editor/property-editor.class.d.ts +4 -2
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata, __param, __awaiter, __asyncValues } from 'tslib';
2
2
  import { Input, Component, EventEmitter, ContentChildren, QueryList, Output, ViewChild, ContentChild, ElementRef, ɵɵdefineInjectable, ɵɵinject, Injectable, ComponentFactoryResolver, Injector, NgZone, Inject, RendererFactory2, INJECTOR, TemplateRef, ApplicationRef, ChangeDetectorRef, HostListener, ViewEncapsulation, NgModule, ChangeDetectionStrategy, Attribute, Directive, ViewContainerRef, Renderer2, ViewChildren } from '@angular/core';
3
- import { AXTranslator, AXHtmlUtil, AXRenderService, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXMenuItem, AXTranslatorModule, AXObjectUtil, AXScrollModule, getPropByPath, AXColorUtil } from '@acorex/core';
3
+ import { AXTranslator, AXHtmlUtil, AXRenderService, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXMenuItem, AXTranslatorModule, AXObjectUtil, AXScrollModule, setPropByPath, AXEventService, AXColorUtil } from '@acorex/core';
4
4
  import { OverlayContainer, Overlay, ScrollStrategyOptions, OverlayPositionBuilder, OverlayKeyboardDispatcher, OverlayModule } from '@angular/cdk/overlay';
5
5
  import { TemplatePortal, ComponentPortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
6
6
  import { merge, Subject, Observable } from 'rxjs';
@@ -1047,7 +1047,7 @@ let AXCalendarBoxComponent = class AXCalendarBoxComponent {
1047
1047
  return new AXDateTime(new Date(), this.type);
1048
1048
  }
1049
1049
  findDay(date) {
1050
- if (this.dayStyle.find((c) => c.date == date.toISOString().split('T')[0])) {
1050
+ if (this.dayStyle.find((c) => c.date.split('T')[0] == date.toISOString().split('T')[0])) {
1051
1051
  return true;
1052
1052
  }
1053
1053
  else {
@@ -1055,16 +1055,16 @@ let AXCalendarBoxComponent = class AXCalendarBoxComponent {
1055
1055
  }
1056
1056
  }
1057
1057
  getStyle(date) {
1058
- if (this.dayStyle.find((c) => c.date == date.toISOString().split('T')[0])) {
1059
- return this.dayStyle.find((c) => c.date == date.toISOString().split('T')[0]).style;
1058
+ if (this.dayStyle.find((c) => c.date.split('T')[0] == date.toISOString().split('T')[0])) {
1059
+ return this.dayStyle.find((c) => c.date.split('T')[0] == date.toISOString().split('T')[0]).style;
1060
1060
  }
1061
1061
  else {
1062
1062
  return '';
1063
1063
  }
1064
1064
  }
1065
1065
  getTitle(date) {
1066
- if (this.dayStyle.find((c) => c.date == date.toISOString().split('T')[0])) {
1067
- return this.dayStyle.find((c) => c.date == date.toISOString().split('T')[0]).text;
1066
+ if (this.dayStyle.find((c) => c.date.split('T')[0] == date.toISOString().split('T')[0])) {
1067
+ return this.dayStyle.find((c) => c.date.split('T')[0] == date.toISOString().split('T')[0]).text;
1068
1068
  }
1069
1069
  else {
1070
1070
  return '';
@@ -3714,7 +3714,7 @@ let AXSelectionListComponent = class AXSelectionListComponent extends AXBaseComp
3714
3714
  this.cdr.detectChanges();
3715
3715
  }
3716
3716
  get selectedValues() {
3717
- return this._selectedItems.map(c => c[this.valueField]) || [];
3717
+ return this._selectedItems.map((c) => c[this.valueField]) || [];
3718
3718
  }
3719
3719
  set selectedValues(v) {
3720
3720
  const old = this.selectedValues;
@@ -3722,7 +3722,7 @@ let AXSelectionListComponent = class AXSelectionListComponent extends AXBaseComp
3722
3722
  v = [];
3723
3723
  }
3724
3724
  if (JSON.stringify(old) != JSON.stringify(v)) {
3725
- this.selectedItems = this.items.filter(c => v.includes(c[this.valueField]));
3725
+ this.selectedItems = this.items.filter((c) => v.includes(c[this.valueField]));
3726
3726
  this.selectedValuesChange.emit(this.selectedValues);
3727
3727
  }
3728
3728
  }
@@ -3741,13 +3741,12 @@ let AXSelectionListComponent = class AXSelectionListComponent extends AXBaseComp
3741
3741
  }
3742
3742
  }
3743
3743
  else {
3744
- this.selectedValues = this.selectedValues.filter(c => c !== value);
3744
+ this.selectedValues = this.selectedValues.filter((c) => c !== value);
3745
3745
  }
3746
3746
  }
3747
3747
  }
3748
3748
  }
3749
- focus() {
3750
- }
3749
+ focus() { }
3751
3750
  onvalueChanged(e) {
3752
3751
  if (!this.disabled) {
3753
3752
  this.selectedItemsChange.emit([e]);
@@ -3814,7 +3813,7 @@ __decorate([
3814
3813
  AXSelectionListComponent = __decorate([
3815
3814
  Component({
3816
3815
  selector: 'ax-selection-list',
3817
- template: "<ng-container *ngIf=\" mode == 'multiple'; then checkboxList; else radioButtonList\"></ng-container>\r\n<ng-template #checkboxList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <ax-check-box label=\"{{item[textField]}}\" *ngFor=\"let item of items\" [disabled]=\"disabled\" [readonly]=\"disabled\"\r\n [value]=\"selectedValues.indexOf(item[valueField])>-1\"\r\n (onValueChanged)=\"onCheckValueChange(item[valueField],$event.value)\">\r\n </ax-check-box>\r\n </div>\r\n</ng-template>\r\n<ng-template #radioButtonList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <label class=\"ax radio\" for=\"{{uid}}\" [class.disabled]=\"disabled\" [class.readonly]=\"disabled\"\r\n *ngFor=\"let item of items\" (click)=\"onvalueChanged(item)\">\r\n {{ item[textField] }}\r\n <input type=\"radio\" (change)=\"onCheckValueChange(item[valueField],true)\" [value]=\"item[valueField]\"\r\n [checked]=\"selectedValues==item[valueField]\" [name]=\"uid\" [disabled]=\"disabled\" [readonly]=\"readonly\" />\r\n <span class=\"checkmark\"></span>\r\n </label>\r\n </div>\r\n</ng-template>",
3816
+ template: "<ng-container *ngIf=\" mode == 'multiple'; then checkboxList; else radioButtonList\"></ng-container>\r\n<ng-template #checkboxList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <ax-check-box label=\"{{item[textField]}}\" *ngFor=\"let item of items\" [disabled]=\"item.disable || disabled\"\r\n [readonly]=\"item.readonly || readonly\" [value]=\"selectedValues.indexOf(item[valueField])>-1\"\r\n (onValueChanged)=\"onCheckValueChange(item[valueField],$event.value)\">\r\n </ax-check-box>\r\n </div>\r\n</ng-template>\r\n<ng-template #radioButtonList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <label class=\"ax radio\" for=\"{{uid}}\" [class.disabled]=\"disabled\" [class.readonly]=\"disabled\"\r\n *ngFor=\"let item of items\" (click)=\"onvalueChanged(item)\">\r\n {{ item[textField] }}\r\n <input type=\"radio\" (change)=\"onCheckValueChange(item[valueField],true)\" [value]=\"item[valueField]\"\r\n [checked]=\"selectedValues==item[valueField]\" [name]=\"uid\" [disabled]=\"item.disable || disabled\"\r\n [readonly]=\"item.readonly || readonly\" />\r\n <span class=\"checkmark\"></span>\r\n </label>\r\n </div>\r\n</ng-template>",
3818
3817
  encapsulation: ViewEncapsulation.None,
3819
3818
  changeDetection: ChangeDetectionStrategy.OnPush
3820
3819
  }),
@@ -7994,7 +7993,10 @@ let AXSelectBoxComponent = AXSelectBoxComponent_1 = class AXSelectBoxComponent e
7994
7993
  v = [];
7995
7994
  }
7996
7995
  // const old = this.selectedItems;
7997
- if (JSON.stringify(old) !== JSON.stringify(v)) {
7996
+ var f = differenceBy(old, v, this.valueField);
7997
+ var s = differenceBy(v, old, this.valueField);
7998
+ // if (JSON.stringify(old) !== JSON.stringify(v)) {
7999
+ if (f.length != 0 || s.length != 0) {
7998
8000
  this._selectedItems = this.mode == 'single' ? v.slice(0, 1) : [...new Set(v)]; //[...new Set(v[0])] : [...new Set(v)];
7999
8001
  this._selectedItems.forEach((c) => (c.selected = true));
8000
8002
  this.selectedItemsChange.emit(this._selectedItems);
@@ -8876,7 +8878,7 @@ __decorate([
8876
8878
  AXSelectBoxComponent = AXSelectBoxComponent_1 = __decorate([
8877
8879
  Component({
8878
8880
  selector: 'ax-select-box',
8879
- template: "<ax-drop-down [size]=\"size\" [rtl]=\"rtl\" [showDropDownButton]=\"showDropDownButton\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" #d (dropdownToggle)=\"dropdownToggleSelecBox($event)\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container header>\r\n <div class=\"ax chips-container\" [horizontalScroll]=\"40\">\r\n <div class=\"chips\" [class.chips-blank]=\"mode === 'single'\" [title]=\"item[textField]\"\r\n *ngFor=\"let item of selectedItems\">\r\n <span class=\"chips-text\">\r\n {{item[textField]}}\r\n </span>\r\n <span class=\"close-icon\" (click)=\"handleItemRemoveClick(item)\"\r\n *ngIf=\"(readonly!=true || itemRemove ==true)&& disabled!=true && (allowNull==true || (selectedItems.length > 1))\">\r\n <i class=\"far fa-times-circle close\"></i>\r\n </span>\r\n </div>\r\n <div class=\"search-wrapper\" (click)=\"onTextBoxClick($event)\">\r\n <ax-text-box #textBoxSelectBox [textAlign]=\"textAlign\"\r\n [placeholder]=\"selectedItems.length == 0 ? placeholder : ''\" [readonly]=\"readonly\"\r\n [disabled]=\"disabled\" (onkey)=\"handleKeyEvent($event)\" [size]=\"size\"\r\n (onFocus)=\"onFocusTextBox($event)\">\r\n </ax-text-box>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container end>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n\r\n <ng-container panel>\r\n <div *ngIf=\"allowSearch\" class=\"search-wrapper\" style=\"padding: 0.7em;\">\r\n <ax-search-box #serchBox [(value)]=\"text\" (onkey)=\"handleKeyEventSearch($event)\"\r\n (textChanged)=\"textChanged($event)\" (onButtonClick)=\"textChanged($event)\">\r\n </ax-search-box>\r\n </div>\r\n <div class=\"ax list-container\">\r\n <div #listContainer style=\"max-height: 300px;overflow-y: auto;width: 100%;\" (scroll)=\"scrolled($event)\">\r\n <ng-container *ngIf=\"getItems().length>0; then thenTemplate; else elseTemplate\"></ng-container>\r\n <ng-template #thenTemplate>\r\n <div class=\"list-item\" *ngFor=\"let item of getItems();let i = index\"\r\n [class.focused]=\"i==currentfocusedIndex\" [class.selected]=\"isItemSelected(item)\"\r\n (click)=\"handleItemClick($event,item)\">\r\n <div style=\"display: flex;\">\r\n <ax-check-box *ngIf=\"showCheckBox\" [size]=\"size\" [value]=\"isItemSelected(item)\"\r\n [disabled]=\"!allowNull && selectedItems.length === 1 && isItemSelected(item)\">\r\n </ax-check-box>\r\n <ng-container *ngIf=\"rowTemplate; else elseTemplate\">\r\n <div style=\"white-space: nowrap;text-overflow: ellipsis;overflow: hidden;\"\r\n [title]=\"item[textField]\"\r\n [ngStyle]=\"(showCheckBox) ? {'padding-inline-start': '0.5rem'}:''\">\r\n <ng-container *ngTemplateOutlet=\"rowTemplate; context:{ $implicit: item }\">\r\n </ng-container>\r\n </div>\r\n\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div style=\"white-space: nowrap;text-overflow: ellipsis;overflow: hidden;\"\r\n [title]=\"item[textField]\"\r\n [ngStyle]=\"(showCheckBox) ? {'padding-inline-start': '0.5rem'}:''\">\r\n {{ item[textField] }}\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </ng-template>\r\n <div *ngIf=\"showLoading\" class=\"ax-pad-sm\" style=\"text-align: center;\">\r\n <i class=\"far fa-spinner-third fa-pulse fa-2x\" style=\"color: var(--ax-primary-color);\"></i>\r\n\r\n </div>\r\n <!-- <ax-loading-indicator ></ax-loading-indicator> -->\r\n <ng-template #elseTemplate>\r\n <ng-container *ngIf=\"showLoading == true; then searchTemplate else noDataTemplate\"></ng-container>\r\n <ng-template #searchTemplate>\r\n <div class=\"list-item\">\r\n {{'common.searching' | trans}}\r\n </div>\r\n </ng-template>\r\n <ng-template #noDataTemplate>\r\n <div class=\"list-item\">\r\n {{'common.noDataFound' | trans}}\r\n </div>\r\n </ng-template>\r\n\r\n </ng-template>\r\n\r\n </div>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n</ax-drop-down>",
8881
+ template: "<ax-drop-down [size]=\"size\" [rtl]=\"rtl\" [showDropDownButton]=\"showDropDownButton\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" #d (dropdownToggle)=\"dropdownToggleSelecBox($event)\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container header>\r\n <div class=\"ax chips-container\" [horizontalScroll]=\"40\">\r\n <div class=\"chips\" [class.chips-blank]=\"mode === 'single'\" [title]=\"item[textField]\"\r\n *ngFor=\"let item of selectedItems\">\r\n <span class=\"chips-text\">\r\n {{item[textField]}}\r\n </span>\r\n <span class=\"close-icon\" (click)=\"handleItemRemoveClick(item)\"\r\n *ngIf=\"(readonly!=true || itemRemove ==true)&& disabled!=true && (allowNull==true || (selectedItems.length > 1))\">\r\n <i class=\"far fa-times-circle close\"></i>\r\n </span>\r\n </div>\r\n <div class=\"search-wrapper\" (click)=\"onTextBoxClick($event)\">\r\n <ax-text-box #textBoxSelectBox [textAlign]=\"textAlign\"\r\n [placeholder]=\"selectedItems.length == 0 ? placeholder : ''\" [readonly]=\"readonly\"\r\n [disabled]=\"disabled\" (onkey)=\"handleKeyEvent($event)\" [size]=\"size\"\r\n (onFocus)=\"onFocusTextBox($event)\">\r\n </ax-text-box>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container end>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n\r\n <ng-container panel>\r\n <div *ngIf=\"allowSearch\" class=\"search-wrapper\" style=\"padding: 0.7em;\">\r\n <ax-search-box #serchBox [(value)]=\"text\" (onkey)=\"handleKeyEventSearch($event)\"\r\n (textChanged)=\"textChanged($event)\" (onButtonClick)=\"textChanged($event)\">\r\n </ax-search-box>\r\n </div>\r\n <div class=\"ax list-container\">\r\n <div #listContainer style=\"max-height: 300px;overflow-y: auto;width: 100%;\" (scroll)=\"scrolled($event)\">\r\n <ng-container *ngIf=\"getItems().length>0; then thenTemplate; else elseTemplate\"></ng-container>\r\n <ng-template #thenTemplate>\r\n <div class=\"list-item\" *ngFor=\"let item of getItems();let i = index\"\r\n [class.focused]=\"i==currentfocusedIndex\" [class.selected]=\"isItemSelected(item)\"\r\n (click)=\"handleItemClick($event,item)\">\r\n <div style=\"display: flex;\">\r\n <ax-check-box *ngIf=\"showCheckBox\" [size]=\"size\" [value]=\"isItemSelected(item)\"\r\n [disabled]=\"!allowNull && selectedItems.length === 1 && isItemSelected(item)\"\r\n (onClick)=\"handleItemClick($event,item)\">\r\n </ax-check-box>\r\n <ng-container *ngIf=\"rowTemplate; else elseTemplate\">\r\n <div style=\"white-space: nowrap;text-overflow: ellipsis;overflow: hidden;\"\r\n [title]=\"item[textField]\"\r\n [ngStyle]=\"(showCheckBox) ? {'padding-inline-start': '0.5rem'}:''\">\r\n <ng-container *ngTemplateOutlet=\"rowTemplate; context:{ $implicit: item }\">\r\n </ng-container>\r\n </div>\r\n\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div style=\"white-space: nowrap;text-overflow: ellipsis;overflow: hidden;\"\r\n [title]=\"item[textField]\"\r\n [ngStyle]=\"(showCheckBox) ? {'padding-inline-start': '0.5rem'}:''\">\r\n {{ item[textField] }}\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </ng-template>\r\n <div *ngIf=\"showLoading\" class=\"ax-pad-sm\" style=\"text-align: center;\">\r\n <i class=\"far fa-spinner-third fa-pulse fa-2x\" style=\"color: var(--ax-primary-color);\"></i>\r\n\r\n </div>\r\n <!-- <ax-loading-indicator ></ax-loading-indicator> -->\r\n <ng-template #elseTemplate>\r\n <ng-container *ngIf=\"showLoading == true; then searchTemplate else noDataTemplate\"></ng-container>\r\n <ng-template #searchTemplate>\r\n <div class=\"list-item\">\r\n {{'common.searching' | trans}}\r\n </div>\r\n </ng-template>\r\n <ng-template #noDataTemplate>\r\n <div class=\"list-item\">\r\n {{'common.noDataFound' | trans}}\r\n </div>\r\n </ng-template>\r\n\r\n </ng-template>\r\n\r\n </div>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n</ax-drop-down>",
8880
8882
  encapsulation: ViewEncapsulation.None,
8881
8883
  changeDetection: ChangeDetectionStrategy.OnPush,
8882
8884
  host: { style: 'width: 100%' },
@@ -10949,13 +10951,15 @@ let AXTabStripComponent = class AXTabStripComponent {
10949
10951
  }
10950
10952
  ngOnInit() { }
10951
10953
  handleClick(i) {
10952
- this.items.forEach((c) => (c.active = false));
10953
- i.active = true;
10954
- this.onTabChanged.emit({
10955
- component: this,
10956
- seledtedTab: i,
10957
- htmlElement: this.ref.nativeElement
10958
- });
10954
+ if (!i.disable) {
10955
+ this.items.forEach((c) => (c.active = false));
10956
+ i.active = true;
10957
+ this.onTabChanged.emit({
10958
+ component: this,
10959
+ seledtedTab: i,
10960
+ htmlElement: this.ref.nativeElement
10961
+ });
10962
+ }
10959
10963
  }
10960
10964
  };
10961
10965
  AXTabStripComponent.ctorParameters = () => [
@@ -10972,7 +10976,7 @@ __decorate([
10972
10976
  AXTabStripComponent = __decorate([
10973
10977
  Component({
10974
10978
  selector: 'ax-tab-strip',
10975
- template: "<ul class=\"tab-strip-container\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <li [class.active]=\"item.active\" (click)=\"handleClick(item)\">{{item.text}}</li>\r\n </ng-container>\r\n</ul>"
10979
+ template: "<ul class=\"tab-strip-container\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <li *ngIf=\"!!item.visible || item.visible == undefined\" [class.active]=\"item.active\"\r\n [class.disabled]=\"item.disable\" (click)=\"handleClick(item)\">{{item.text}}</li>\r\n </ng-container>\r\n</ul>"
10976
10980
  }),
10977
10981
  __metadata("design:paramtypes", [ElementRef])
10978
10982
  ], AXTabStripComponent);
@@ -13935,9 +13939,17 @@ class AXProperyEditorComponent {
13935
13939
  constructor(cdr) {
13936
13940
  this.cdr = cdr;
13937
13941
  this.readonly = false;
13938
- this.initiated = false;
13942
+ this._initiated = false;
13943
+ this._valueBound = false;
13939
13944
  this.validatableComponentRegistered = new Subject();
13940
13945
  this.valueChange = new EventEmitter();
13946
+ this.onRenderCompleted = new EventEmitter();
13947
+ this.onRenderCompleted.subscribe(() => {
13948
+ this._initiated = true;
13949
+ });
13950
+ }
13951
+ get initiated() {
13952
+ return this._initiated && this._valueBound;
13941
13953
  }
13942
13954
  registerForValidationForm(component) {
13943
13955
  this.validatableComponentRegistered.next(component);
@@ -13950,18 +13962,24 @@ class AXProperyEditorComponent {
13950
13962
  this._value = v;
13951
13963
  this.valueChange.emit(v);
13952
13964
  this.cdr.detectChanges();
13965
+ //TODO: find better solution
13966
+ setTimeout(() => {
13967
+ this._valueBound = true;
13968
+ }, 100);
13953
13969
  }
13954
13970
  }
13955
13971
  handleValueChange(v) {
13956
13972
  this.value = v;
13957
13973
  }
13958
- initiat() {
13959
- }
13960
13974
  }
13961
13975
  __decorate([
13962
13976
  Output(),
13963
13977
  __metadata("design:type", EventEmitter)
13964
13978
  ], AXProperyEditorComponent.prototype, "valueChange", void 0);
13979
+ __decorate([
13980
+ Output(),
13981
+ __metadata("design:type", EventEmitter)
13982
+ ], AXProperyEditorComponent.prototype, "onRenderCompleted", void 0);
13965
13983
  __decorate([
13966
13984
  Input(),
13967
13985
  __metadata("design:type", Object),
@@ -14018,11 +14036,12 @@ function propertyEditor(options) {
14018
14036
  }
14019
14037
 
14020
14038
  let AXPropertyEditorRendererDirective = class AXPropertyEditorRendererDirective {
14021
- constructor(target, componentFactoryResolver, renderService) {
14039
+ constructor(target, componentFactoryResolver, renderService, eventService) {
14022
14040
  this.target = target;
14023
14041
  this.componentFactoryResolver = componentFactoryResolver;
14024
14042
  this.renderService = renderService;
14025
- this.readonly = false;
14043
+ this.eventService = eventService;
14044
+ this._context = {};
14026
14045
  this.onValueChange = new EventEmitter();
14027
14046
  }
14028
14047
  get context() {
@@ -14030,9 +14049,6 @@ let AXPropertyEditorRendererDirective = class AXPropertyEditorRendererDirective
14030
14049
  }
14031
14050
  set context(v) {
14032
14051
  this._context = v;
14033
- if (v && this.instance) {
14034
- this.assignProps();
14035
- }
14036
14052
  }
14037
14053
  clear() {
14038
14054
  this.instance.value = null;
@@ -14047,52 +14063,98 @@ let AXPropertyEditorRendererDirective = class AXPropertyEditorRendererDirective
14047
14063
  const cmpRef = this.target.createComponent(factory);
14048
14064
  this.instance = cmpRef.instance;
14049
14065
  this.subscription = this.instance.valueChange.subscribe(value => {
14050
- if (this.instance.initiated === true) {
14051
- this.property.value = value;
14052
- this.onValueChange.emit(this.property);
14066
+ var _a, _b;
14067
+ this.property.value = value;
14068
+ this.onValueChange.emit(this.property);
14069
+ if ((_b = (_a = this.property) === null || _a === void 0 ? void 0 : _a.property) === null || _b === void 0 ? void 0 : _b.name) {
14070
+ setTimeout(() => {
14071
+ this.eventService.broadcast(`props-${this.groupId}-${this.property.property.name}`, this.property);
14072
+ }, 0);
14053
14073
  }
14054
14074
  });
14055
- //
14075
+ this.watchChanges();
14076
+ this.assignProps();
14077
+ this.instance.value = this.property.value;
14078
+ // this.instance.onRenderCompleted.subscribe(() => {
14079
+ // });
14056
14080
  if (this.validationForm) {
14057
14081
  this.instance.validatableComponentRegistered.subscribe(v => {
14058
14082
  this.validationForm.addWidget(v);
14059
14083
  });
14060
14084
  }
14061
- //
14062
- //setTimeout(() => {
14063
- this.instance.readonly = this.readonly;
14064
- this.assignProps();
14065
- this.instance.value = this.property.value;
14066
- this.instance.initiat();
14067
- cmpRef.changeDetectorRef.markForCheck();
14068
- //});
14069
14085
  }
14070
14086
  });
14071
14087
  }
14088
+ watchChanges() {
14089
+ var _a, _b;
14090
+ const varsRegx = /((\$\{[a-zA-Z_0-9]+\})+)/gm;
14091
+ const varNameRegx = /[a-zA-Z_0-9]+/gm;
14092
+ const options = this.property.property.editorOptions;
14093
+ if (!options) {
14094
+ return;
14095
+ }
14096
+ for (const p in options) {
14097
+ if (options.hasOwnProperty(p)) {
14098
+ const opt = options[p];
14099
+ const vars = typeof opt === 'string' ? (_a = opt) === null || _a === void 0 ? void 0 : _a.match(varsRegx) : [];
14100
+ // bind the props
14101
+ if ((_b = vars) === null || _b === void 0 ? void 0 : _b.length) {
14102
+ vars.forEach(v => {
14103
+ var _a;
14104
+ const path = ((_a = v.match(varNameRegx)) === null || _a === void 0 ? void 0 : _a.length) ? v.match(varNameRegx)[0] : null;
14105
+ if (path) {
14106
+ this.eventService.on(`props-${this.groupId}-${path}`, (e) => {
14107
+ let execCode = opt.slice();
14108
+ const params = {};
14109
+ vars.forEach(vv => {
14110
+ var _a;
14111
+ const p2 = ((_a = vv.match(varNameRegx)) === null || _a === void 0 ? void 0 : _a.length) ? vv.match(varNameRegx)[0] : null;
14112
+ params[p2] = AXObjectUtil.deepCopy(this.context[p2]) || null;
14113
+ execCode = execCode.replace(vv, `__params__.${p2}`);
14114
+ });
14115
+ const func = new Function('__params__', `try { return ${execCode}} catch(e){ console.log(e); return null; }`);
14116
+ const val = func(params);
14117
+ const keys = p.split('.');
14118
+ const prop = Object.assign({}, this.instance[keys[0]]);
14119
+ if (keys.length > 1) {
14120
+ this.instance[keys[0]] = setPropByPath(prop, p, val);
14121
+ }
14122
+ else {
14123
+ setPropByPath(this.instance, p, val);
14124
+ }
14125
+ });
14126
+ }
14127
+ });
14128
+ }
14129
+ // else {
14130
+ // this.assignProps();
14131
+ // }
14132
+ }
14133
+ }
14134
+ }
14072
14135
  assignProps() {
14136
+ var _a, _b;
14073
14137
  const options = this.property.property.editorOptions;
14074
14138
  if (!options) {
14075
14139
  return;
14076
14140
  }
14141
+ const varsRegx = /((\$\{[a-zA-Z_0-9]+\})+)/gm;
14077
14142
  for (const p in options) {
14078
14143
  if (options.hasOwnProperty(p)) {
14079
14144
  const opt = options[p];
14080
- if (typeof opt === 'string' && opt.startsWith('$$')) {
14081
- const key = opt.substring(2);
14082
- const val = getPropByPath(this.context, key);
14083
- if (val) {
14084
- this.instance[p] = typeof val === 'function' ? val({ data: this.context, host: this.host }, this.property) : val;
14085
- }
14145
+ const vars = typeof opt === 'string' ? (_a = opt) === null || _a === void 0 ? void 0 : _a.match(varsRegx) : [];
14146
+ if ((_b = vars) === null || _b === void 0 ? void 0 : _b.length) {
14147
+ continue;
14086
14148
  }
14087
14149
  else {
14088
- const res = typeof opt === 'function' ? opt({ data: this.context, host: this.host }, this.property) : opt;
14089
- if (res instanceof Promise) {
14090
- res.then(v => {
14091
- this.instance[p] = v;
14150
+ const val = typeof opt === 'function' ? opt({ data: this.context, host: this.host }, this.property) : opt;
14151
+ if (val instanceof Promise) {
14152
+ val.then(v => {
14153
+ setPropByPath(this.instance, p, val);
14092
14154
  });
14093
14155
  }
14094
14156
  else {
14095
- this.instance[p] = res;
14157
+ setPropByPath(this.instance, p, val);
14096
14158
  }
14097
14159
  }
14098
14160
  }
@@ -14107,16 +14169,13 @@ let AXPropertyEditorRendererDirective = class AXPropertyEditorRendererDirective
14107
14169
  AXPropertyEditorRendererDirective.ctorParameters = () => [
14108
14170
  { type: ViewContainerRef },
14109
14171
  { type: ComponentFactoryResolver },
14110
- { type: AXRenderService }
14172
+ { type: AXRenderService },
14173
+ { type: AXEventService }
14111
14174
  ];
14112
14175
  __decorate([
14113
14176
  Input(),
14114
14177
  __metadata("design:type", Object)
14115
14178
  ], AXPropertyEditorRendererDirective.prototype, "property", void 0);
14116
- __decorate([
14117
- Input(),
14118
- __metadata("design:type", Boolean)
14119
- ], AXPropertyEditorRendererDirective.prototype, "readonly", void 0);
14120
14179
  __decorate([
14121
14180
  Input(),
14122
14181
  __metadata("design:type", AXValidationFormComponent)
@@ -14130,6 +14189,10 @@ __decorate([
14130
14189
  Input(),
14131
14190
  __metadata("design:type", Object)
14132
14191
  ], AXPropertyEditorRendererDirective.prototype, "host", void 0);
14192
+ __decorate([
14193
+ Input(),
14194
+ __metadata("design:type", Object)
14195
+ ], AXPropertyEditorRendererDirective.prototype, "groupId", void 0);
14133
14196
  __decorate([
14134
14197
  Output(),
14135
14198
  __metadata("design:type", EventEmitter)
@@ -14140,7 +14203,8 @@ AXPropertyEditorRendererDirective = __decorate([
14140
14203
  }),
14141
14204
  __metadata("design:paramtypes", [ViewContainerRef,
14142
14205
  ComponentFactoryResolver,
14143
- AXRenderService])
14206
+ AXRenderService,
14207
+ AXEventService])
14144
14208
  ], AXPropertyEditorRendererDirective);
14145
14209
 
14146
14210
  let AXTextPropertyEditorComponent = class AXTextPropertyEditorComponent extends AXProperyEditorComponent {
@@ -14154,7 +14218,7 @@ let AXTextPropertyEditorComponent = class AXTextPropertyEditorComponent extends
14154
14218
  }
14155
14219
  ngAfterViewInit() {
14156
14220
  this.registerForValidationForm(this.textBox);
14157
- this.initiated = true;
14221
+ this.onRenderCompleted.emit();
14158
14222
  }
14159
14223
  };
14160
14224
  AXTextPropertyEditorComponent.ctorParameters = () => [
@@ -14200,8 +14264,8 @@ let AXNumberBoxPropertyEditorComponent = class AXNumberBoxPropertyEditorComponen
14200
14264
  super.handleValueChange(e.value);
14201
14265
  }
14202
14266
  ngAfterViewInit() {
14203
- this.initiated = true;
14204
14267
  this.registerForValidationForm(this.textBox);
14268
+ this.onRenderCompleted.emit();
14205
14269
  }
14206
14270
  };
14207
14271
  AXNumberBoxPropertyEditorComponent.ctorParameters = () => [
@@ -14255,16 +14319,18 @@ let AXSelectBoxPropertyEditorComponent = class AXSelectBoxPropertyEditorComponen
14255
14319
  this.selectionDataMode = 'value';
14256
14320
  this.allowSearch = true;
14257
14321
  this.allowNull = false;
14322
+ this.disabled = false;
14258
14323
  this.items = [];
14259
14324
  this.remoteOperation = false;
14260
14325
  this.provideData = (e) => {
14261
14326
  return new Promise((resolve) => {
14262
14327
  const func = () => {
14263
14328
  if (Array.isArray(this.items)) {
14264
- resolve(this.items);
14329
+ resolve(this.items.slice());
14265
14330
  }
14266
14331
  else if (typeof this.items === 'function') {
14267
- resolve(this.items(e));
14332
+ const a = Object.assign(e, { sender: this });
14333
+ resolve(this.items(a));
14268
14334
  }
14269
14335
  else {
14270
14336
  resolve([]);
@@ -14279,27 +14345,35 @@ let AXSelectBoxPropertyEditorComponent = class AXSelectBoxPropertyEditorComponen
14279
14345
  });
14280
14346
  };
14281
14347
  }
14348
+ get filter() {
14349
+ return this._filter;
14350
+ }
14351
+ set filter(v) {
14352
+ var _a;
14353
+ this._filter = v;
14354
+ if (this.value && this.initiated) {
14355
+ this.value = null;
14356
+ (_a = this.selectBox) === null || _a === void 0 ? void 0 : _a.refresh();
14357
+ }
14358
+ }
14282
14359
  handleValueChange(e) {
14283
- super.handleValueChange(e.value);
14360
+ super.handleValueChange(e.selectedValues);
14284
14361
  }
14285
14362
  ngAfterViewInit() {
14286
- this.selectBox.refresh();
14287
14363
  this.registerForValidationForm(this.selectBox);
14288
- }
14289
- initiat() {
14290
- this.initiated = true;
14364
+ this.onRenderCompleted.emit();
14291
14365
  }
14292
14366
  };
14293
14367
  AXSelectBoxPropertyEditorComponent.ctorParameters = () => [
14294
14368
  { type: ChangeDetectorRef }
14295
14369
  ];
14296
14370
  __decorate([
14297
- ViewChild(AXSelectBox2Component, { static: true }),
14298
- __metadata("design:type", AXSelectBox2Component)
14371
+ ViewChild(AXSelectBoxComponent, { static: true }),
14372
+ __metadata("design:type", AXSelectBoxComponent)
14299
14373
  ], AXSelectBoxPropertyEditorComponent.prototype, "selectBox", void 0);
14300
14374
  AXSelectBoxPropertyEditorComponent = __decorate([
14301
14375
  Component({
14302
- template: "<ax-select-box2 [selectionMode]=\"selectionMode\"\r\n [selectionDataMode]=\"selectionDataMode\" \r\n [textField]=\"textField\" \r\n [valueField]=\"valueField\" \r\n [value]=\"value\" \r\n [remoteOperation]=\"remoteOperation\"\r\n [allowSearch]=\"allowSearch\" \r\n [allowNull]=\"allowNull\"\r\n (onValueChanged)=\"handleValueChange($event)\">\r\n <ax-data-source [provideData]=\"provideData\">\r\n </ax-data-source>\r\n <ax-validation [rules]=\"validation?.rules\">\r\n </ax-validation>\r\n</ax-select-box2>"
14376
+ template: "<ax-select-box [mode]=\"selectionMode\"\r\n [textField]=\"textField\" \r\n [valueField]=\"valueField\" \r\n [selectedValues]=\"value\" \r\n [remoteOperation]=\"remoteOperation\"\r\n [allowSearch]=\"allowSearch\" \r\n [allowNull]=\"allowNull\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n (selectionChanged)=\"handleValueChange($event)\">\r\n <ax-data-source [provideData]=\"provideData\">\r\n </ax-data-source>\r\n <ax-validation [rules]=\"validation?.rules\">\r\n </ax-validation>\r\n</ax-select-box>"
14303
14377
  }),
14304
14378
  __metadata("design:paramtypes", [ChangeDetectorRef])
14305
14379
  ], AXSelectBoxPropertyEditorComponent);
@@ -14333,7 +14407,7 @@ let AXRangePropertyEditorComponent = class AXRangePropertyEditorComponent extend
14333
14407
  this.cdr.detectChanges();
14334
14408
  }
14335
14409
  ngAfterViewInit() {
14336
- this.initiated = true;
14410
+ this.onRenderCompleted.emit();
14337
14411
  }
14338
14412
  // getRanges() {
14339
14413
  // return this.ranges.sort((a, b) => a.minValue - b.minValue);
@@ -15014,7 +15088,7 @@ let AXColorPropertyEditorComponent = class AXColorPropertyEditorComponent extend
15014
15088
  }
15015
15089
  ngAfterViewInit() {
15016
15090
  this.registerForValidationForm(this.textBox);
15017
- this.initiated = true;
15091
+ this.onRenderCompleted.emit();
15018
15092
  }
15019
15093
  };
15020
15094
  AXColorPropertyEditorComponent.ctorParameters = () => [
@@ -15073,7 +15147,7 @@ let ColumnPropertyEditorComponent = class ColumnPropertyEditorComponent extends
15073
15147
  this.columns = this.value ? JSON.parse(JSON.stringify(this.value)) : [];
15074
15148
  }
15075
15149
  ngAfterViewInit() {
15076
- this.initiated = true;
15150
+ this.onRenderCompleted.emit();
15077
15151
  }
15078
15152
  drop(event) {
15079
15153
  moveItemInArray(this.columns, event.previousIndex, event.currentIndex);
@@ -15227,8 +15301,8 @@ let AXConditionalColorPropertyEditorComponent = class AXConditionalColorProperty
15227
15301
  ].filter(c => c.dataTypes == null || c.dataTypes.includes(this.dataType));
15228
15302
  }
15229
15303
  ngAfterViewInit() {
15230
- this.initiated = true;
15231
15304
  this.cdr.detectChanges();
15305
+ this.onRenderCompleted.emit();
15232
15306
  }
15233
15307
  handleEditClick(item) {
15234
15308
  this.updateOperations();
@@ -15421,7 +15495,7 @@ let AXSwitchPropertyEditorComponent = class AXSwitchPropertyEditorComponent exte
15421
15495
  super.handleValueChange(e.value);
15422
15496
  }
15423
15497
  ngAfterViewInit() {
15424
- this.initiated = true;
15498
+ this.onRenderCompleted.emit();
15425
15499
  }
15426
15500
  };
15427
15501
  AXSwitchPropertyEditorComponent.ctorParameters = () => [
@@ -15468,8 +15542,8 @@ let AXDatePropertyEditorComponent = class AXDatePropertyEditorComponent extends
15468
15542
  super.handleValueChange(e.value);
15469
15543
  }
15470
15544
  ngAfterViewInit() {
15471
- this.initiated = true;
15472
15545
  this.registerForValidationForm(this.date);
15546
+ this.onRenderCompleted.emit();
15473
15547
  }
15474
15548
  };
15475
15549
  AXDatePropertyEditorComponent.ctorParameters = () => [
@@ -15519,8 +15593,8 @@ let AXTimePropertyEditorComponent = class AXTimePropertyEditorComponent extends
15519
15593
  super.handleValueChange((_a = e.value) === null || _a === void 0 ? void 0 : _a.time);
15520
15594
  }
15521
15595
  ngAfterViewInit() {
15522
- this.initiated = true;
15523
15596
  this.registerForValidationForm(this.time);
15597
+ this.onRenderCompleted.emit();
15524
15598
  }
15525
15599
  };
15526
15600
  AXTimePropertyEditorComponent.ctorParameters = () => [