ecabs-components 0.0.51 → 0.0.52

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.
@@ -15,7 +15,7 @@ import * as i3$1 from '@angular/material/form-field';
15
15
  import { MatFormFieldModule } from '@angular/material/form-field';
16
16
  import * as i7 from 'ngx-mat-select-search';
17
17
  import { MatSelectSearchComponent, NgxMatSelectSearchModule } from 'ngx-mat-select-search';
18
- import { ReplaySubject, Subscription, combineLatest, map, debounceTime, Subject, takeUntil } from 'rxjs';
18
+ import { BehaviorSubject, Subscription, combineLatest, map, debounceTime, Subject, takeUntil } from 'rxjs';
19
19
  import * as i4$1 from '@angular/material/select';
20
20
  import { MatSelectModule, MAT_SELECT_SCROLL_STRATEGY } from '@angular/material/select';
21
21
  import * as i2 from '@angular/material/core';
@@ -729,9 +729,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
729
729
  }] });
730
730
 
731
731
  class EcabsSelectComponent extends ElementBaseComponent {
732
- constructor(injector) {
732
+ constructor(injector, changeDetectorRef) {
733
733
  super();
734
734
  this.injector = injector;
735
+ this.changeDetectorRef = changeDetectorRef;
735
736
  this.multiple = false;
736
737
  this.useNoneOption = false;
737
738
  this.useOnlyDisabledClass = false;
@@ -747,9 +748,12 @@ class EcabsSelectComponent extends ElementBaseComponent {
747
748
  this.othersLabel = 'Others';
748
749
  this.updateFilterItems = new EventEmitter();
749
750
  this.selectionChange = new EventEmitter();
750
- this.filteredItems$ = new ReplaySubject(1);
751
+ this.filteredItems$ = new BehaviorSubject([]);
751
752
  this.itemFilterCtrl = new UntypedFormControl();
752
753
  this.isClearAll = false;
754
+ this.showFilteredAllOption = true;
755
+ this.selectedItems = [];
756
+ this.notSelectedItems = [];
753
757
  this.subscriptions = new Subscription();
754
758
  // eslint-disable-next-line @typescript-eslint/no-empty-function
755
759
  this.onChange = () => { };
@@ -762,22 +766,20 @@ class EcabsSelectComponent extends ElementBaseComponent {
762
766
  set value(val) {
763
767
  if (this.val !== val) {
764
768
  this.val = val;
769
+ this.setSelectedItems();
765
770
  this.onChange(val);
766
771
  this.onTouch(val);
767
772
  }
768
773
  }
769
774
  ngOnChanges(changes) {
770
- if (changes['items'] && changes['items'].currentValue) {
771
- this.filteredItems$.next(changes['items'].currentValue.slice());
775
+ const { items } = changes;
776
+ if (items && items.currentValue) {
772
777
  this.filterItems();
773
- if (this.multiple &&
774
- this.useSelectAllOption &&
775
- this.allSelected?.selected) {
778
+ if (this.multiple && this.useSelectAllOption && this.allSelected?.selected) {
776
779
  setTimeout(() => {
777
- this.control.patchValue([
778
- ...this.items.map((item) => item.value),
779
- this.selectAllValue,
780
- ]);
780
+ this.control.patchValue([...this.filteredItems$.value.map((item) => item.value), this.selectAllValue], {
781
+ emitEvent: false,
782
+ });
781
783
  }, 100);
782
784
  }
783
785
  }
@@ -803,17 +805,19 @@ class EcabsSelectComponent extends ElementBaseComponent {
803
805
  this.filterItems();
804
806
  this.updateFilterItems.emit(value);
805
807
  if (this.isClearAll) {
806
- this.control.patchValue([]);
808
+ this.control.patchValue([], { emitEvent: false });
807
809
  this.isClearAll = false;
808
810
  }
809
811
  }));
810
812
  }
811
813
  toggleAllSelection() {
812
814
  if (this.allSelected.selected) {
813
- this.control.patchValue([
814
- ...this.items.map((item) => item.value),
815
- this.selectAllValue,
816
- ]);
815
+ if (this.useSearchOption) {
816
+ this.control.patchValue([...this.filteredItems$.value.map((item) => item.value), this.selectAllValue]);
817
+ }
818
+ else {
819
+ this.control.patchValue([...this.items.map((item) => item.value), this.selectAllValue]);
820
+ }
817
821
  }
818
822
  else {
819
823
  this.control.patchValue([]);
@@ -821,30 +825,44 @@ class EcabsSelectComponent extends ElementBaseComponent {
821
825
  }
822
826
  }
823
827
  togglePerOne() {
824
- if (this.allSelected) {
825
- if (this.allSelected.selected) {
826
- this.allSelected.deselect();
827
- }
828
- if (this.setAllOptionAfterChosenAllItems &&
829
- this.control.value.length === this.items.length) {
830
- this.allSelected.select();
828
+ setTimeout(() => (this.showFilteredAllOption = true));
829
+ setTimeout(() => {
830
+ if (this.allSelected) {
831
+ if (this.allSelected.selected) {
832
+ this.allSelected.deselect();
833
+ }
834
+ if (this.setAllOptionAfterChosenAllItems && this.control.value.length === this.items.length) {
835
+ this.allSelected.select();
836
+ }
831
837
  }
832
- }
838
+ this.showFilteredAllOption = false;
839
+ });
833
840
  this.isClearAll = false;
834
841
  }
842
+ toggleNone() {
843
+ this.selectedItems = [];
844
+ }
835
845
  getAllSelectedChecked() {
836
846
  return this.allSelected !== undefined && this.allSelected.selected;
837
847
  }
838
848
  getLabel(val) {
839
- if (this.useSelectAllOption &&
840
- this.allSelected?.selected &&
841
- this.items &&
842
- this.items.length > 0) {
849
+ if (this.useSelectAllOption && this.allSelected?.selected && this.items && this.items.length > 0) {
843
850
  return this.items[0].label;
844
851
  }
845
- if (val !== undefined && this.items && this.items.length > 0) {
846
- // eslint-disable-next-line @typescript-eslint/no-shadow
847
- const item = this.items.find((item) => item.value === val);
852
+ let item;
853
+ if (val !== undefined) {
854
+ if (this.useSearchOption) {
855
+ if (this.selectedItems && this.selectedItems.length > 0) {
856
+ // eslint-disable-next-line @typescript-eslint/no-shadow
857
+ item = this.selectedItems.find((item) => item.value === val);
858
+ }
859
+ }
860
+ else {
861
+ if (this.items && this.items.length > 0) {
862
+ // eslint-disable-next-line @typescript-eslint/no-shadow
863
+ item = this.items.find((item) => item.value === val);
864
+ }
865
+ }
848
866
  return item ? item.label : '';
849
867
  }
850
868
  return '';
@@ -865,29 +883,99 @@ class EcabsSelectComponent extends ElementBaseComponent {
865
883
  this.selectionChange.emit($event);
866
884
  }
867
885
  filterItems() {
886
+ this.setSelectedItems();
868
887
  if (!this.items) {
869
888
  return;
870
889
  }
871
890
  // get the search keyword
872
891
  let search = this.itemFilterCtrl.value;
873
892
  if (!search || search === '') {
874
- this.filteredItems$.next(this.items.slice());
893
+ if (this.useSearchOption) {
894
+ this.filteredItems$.next([...this.selectedItems]);
895
+ }
896
+ else {
897
+ this.filteredItems$.next(this.items?.slice());
898
+ }
899
+ this.showFilteredAllOption = true;
875
900
  return;
876
901
  }
877
902
  search = search.toLowerCase();
878
- this.filteredItems$.next(this.items && this.items.length > 0
879
- ? this.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
880
- : []);
903
+ this.showFilteredAllOption =
904
+ this.allLabel.toLowerCase().includes(search.toLowerCase()) ||
905
+ (this.value instanceof Array && this.value.includes(this.selectAllValue)) ||
906
+ (!(this.value instanceof Array) && this.value === this.selectAllValue);
907
+ this.changeDetectorRef.detectChanges();
908
+ if (this.useSearchOption) {
909
+ const filteredItems = this.notSelectedItems?.length > 0
910
+ ? this.notSelectedItems.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
911
+ : [];
912
+ this.filteredItems$.next([...this.selectedItems, ...filteredItems]);
913
+ }
914
+ else {
915
+ this.filteredItems$.next(this.items?.length > 0
916
+ ? this.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
917
+ : []);
918
+ }
919
+ }
920
+ setSelectedItems() {
921
+ if (this.useSearchOption) {
922
+ const selectedItems = [];
923
+ if (this.value) {
924
+ if (this.value instanceof Array) {
925
+ const skipSteps = this.value.includes(this.selectAllValue);
926
+ if (!skipSteps) {
927
+ this.value.forEach((value) => {
928
+ const index = this.selectedItems.findIndex((selectedItem) => selectedItem.value === value);
929
+ if (index !== -1) {
930
+ selectedItems.push(this.selectedItems[index]);
931
+ }
932
+ else {
933
+ // eslint-disable-next-line @typescript-eslint/no-shadow
934
+ const item = this.items.find((item) => item.value === value);
935
+ if (item) {
936
+ selectedItems.push(item);
937
+ }
938
+ }
939
+ });
940
+ this.selectedItems.forEach((selectedItem) => {
941
+ const index = this.value.find((value) => selectedItem.value === value);
942
+ if (index === -1) {
943
+ selectedItems.splice(index, 1);
944
+ }
945
+ });
946
+ }
947
+ }
948
+ else {
949
+ const index = this.selectedItems.findIndex((selectedItem) => selectedItem.value === this.value);
950
+ if (index !== -1) {
951
+ selectedItems.push(this.selectedItems[index]);
952
+ }
953
+ else {
954
+ // eslint-disable-next-line @typescript-eslint/no-shadow
955
+ const item = this.items.find((item) => item.value === this.value);
956
+ // eslint-disable-next-line max-depth
957
+ if (item) {
958
+ selectedItems.push(item);
959
+ }
960
+ }
961
+ }
962
+ this.selectedItems = [...selectedItems];
963
+ this.notSelectedItems = this.items.filter((item) => this.selectedItems.findIndex((selectedItem) => selectedItem.value === item.value) === -1);
964
+ }
965
+ else {
966
+ this.notSelectedItems = this.items?.slice();
967
+ }
968
+ }
881
969
  }
882
970
  }
883
- EcabsSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EcabsSelectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
971
+ EcabsSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EcabsSelectComponent, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
884
972
  EcabsSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: EcabsSelectComponent, selector: "ecabs-select", inputs: { items: "items", multiple: "multiple", useNoneOption: "useNoneOption", useOnlyDisabledClass: "useOnlyDisabledClass", searchFieldPlaceholder: "searchFieldPlaceholder", useSearchOption: "useSearchOption", useSelectAllOption: "useSelectAllOption", setAllOptionAfterChosenAllItems: "setAllOptionAfterChosenAllItems", selectAllValue: "selectAllValue", noEntriesFoundLabel: "noEntriesFoundLabel", noneLabel: "noneLabel", allLabel: "allLabel", otherLabel: "otherLabel", othersLabel: "othersLabel" }, outputs: { updateFilterItems: "updateFilterItems", selectionChange: "selectionChange" }, providers: [
885
973
  {
886
974
  provide: NG_VALUE_ACCESSOR,
887
975
  useExisting: EcabsSelectComponent,
888
976
  multi: true,
889
977
  },
890
- ], viewQueries: [{ propertyName: "allSelected", first: true, predicate: ["allSelected"], descendants: true }, { propertyName: "matSelectSearchComponent", first: true, predicate: MatSelectSearchComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<app-element-wrapper [data]=\"getData()\">\r\n <mat-form-field [ngClass]=\"{ disabled: useOnlyDisabledClass }\">\r\n <mat-select\r\n [(ngModel)]=\"value\"\r\n (closed)=\"onTouch()\"\r\n appearance=\"outline\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\"\r\n (selectionChange)=\"onSelectionChanged($event)\"\r\n >\r\n <mat-select-trigger>\r\n <span *ngIf=\"getAllSelectedChecked()\">{{ allLabel }}</span>\r\n <span *ngIf=\"!getAllSelectedChecked()\"\r\n >{{ val && multiple ? getLabel(val[0]) : getLabel(val) }}\r\n <span *ngIf=\"multiple && value?.length > 1\" class=\"additional-selection\">\r\n (+{{ useSelectAllOption && this.allSelected?.selected ? value?.length - 2 : value?.length - 1 }}\r\n {{ (value?.length === 2 ? otherLabel : othersLabel) }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n <ngx-mat-select-search\r\n [formControl]=\"itemFilterCtrl\"\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\">{{ noneLabel }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n allLabel\r\n }}</mat-option>\r\n <mat-option *ngFor=\"let item of filteredItems$ | async\" [value]=\"item.value\" (click)=\"togglePerOne()\">\r\n {{ item.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</app-element-wrapper>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: ["data", "showCloseIcon", "focusedFlag", "showPassword", "control"], outputs: ["showHidePassword", "clear", "increase", "decrease"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i4$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
978
+ ], viewQueries: [{ propertyName: "allSelected", first: true, predicate: ["allSelected"], descendants: true }, { propertyName: "matSelectSearchComponent", first: true, predicate: MatSelectSearchComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<app-element-wrapper [data]=\"getData()\">\r\n <mat-form-field [ngClass]=\"{ disabled: useOnlyDisabledClass }\">\r\n <mat-select\r\n [(ngModel)]=\"value\"\r\n (closed)=\"onTouch()\"\r\n appearance=\"outline\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\"\r\n (selectionChange)=\"onSelectionChanged($event)\"\r\n >\r\n <mat-select-trigger>\r\n <span *ngIf=\"getAllSelectedChecked()\">{{ allLabel }}</span>\r\n <span *ngIf=\"!getAllSelectedChecked()\"\r\n >{{ val && multiple ? getLabel(val[0]) : getLabel(val) }}\r\n <span *ngIf=\"multiple && value?.length > 1\" class=\"additional-selection\">\r\n (+{{ useSelectAllOption && this.allSelected?.selected ? value?.length - 2 : value?.length - 1 }}\r\n {{ (value?.length === 2 ? otherLabel : othersLabel) }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n <ngx-mat-select-search\r\n [formControl]=\"itemFilterCtrl\"\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\" (click)=\"toggleNone()\">{{ noneLabel }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption && showFilteredAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n allLabel\r\n }}</mat-option>\r\n <mat-option *ngFor=\"let item of filteredItems$ | async\" [value]=\"item.value\" (click)=\"togglePerOne()\">\r\n {{ item.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</app-element-wrapper>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: ["data", "showCloseIcon", "focusedFlag", "showPassword", "control"], outputs: ["showHidePassword", "clear", "increase", "decrease"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i4$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
891
979
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EcabsSelectComponent, decorators: [{
892
980
  type: Component,
893
981
  args: [{ selector: 'ecabs-select', providers: [
@@ -896,8 +984,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
896
984
  useExisting: EcabsSelectComponent,
897
985
  multi: true,
898
986
  },
899
- ], template: "<app-element-wrapper [data]=\"getData()\">\r\n <mat-form-field [ngClass]=\"{ disabled: useOnlyDisabledClass }\">\r\n <mat-select\r\n [(ngModel)]=\"value\"\r\n (closed)=\"onTouch()\"\r\n appearance=\"outline\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\"\r\n (selectionChange)=\"onSelectionChanged($event)\"\r\n >\r\n <mat-select-trigger>\r\n <span *ngIf=\"getAllSelectedChecked()\">{{ allLabel }}</span>\r\n <span *ngIf=\"!getAllSelectedChecked()\"\r\n >{{ val && multiple ? getLabel(val[0]) : getLabel(val) }}\r\n <span *ngIf=\"multiple && value?.length > 1\" class=\"additional-selection\">\r\n (+{{ useSelectAllOption && this.allSelected?.selected ? value?.length - 2 : value?.length - 1 }}\r\n {{ (value?.length === 2 ? otherLabel : othersLabel) }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n <ngx-mat-select-search\r\n [formControl]=\"itemFilterCtrl\"\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\">{{ noneLabel }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n allLabel\r\n }}</mat-option>\r\n <mat-option *ngFor=\"let item of filteredItems$ | async\" [value]=\"item.value\" (click)=\"togglePerOne()\">\r\n {{ item.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</app-element-wrapper>\r\n" }]
900
- }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { items: [{
987
+ ], template: "<app-element-wrapper [data]=\"getData()\">\r\n <mat-form-field [ngClass]=\"{ disabled: useOnlyDisabledClass }\">\r\n <mat-select\r\n [(ngModel)]=\"value\"\r\n (closed)=\"onTouch()\"\r\n appearance=\"outline\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\"\r\n (selectionChange)=\"onSelectionChanged($event)\"\r\n >\r\n <mat-select-trigger>\r\n <span *ngIf=\"getAllSelectedChecked()\">{{ allLabel }}</span>\r\n <span *ngIf=\"!getAllSelectedChecked()\"\r\n >{{ val && multiple ? getLabel(val[0]) : getLabel(val) }}\r\n <span *ngIf=\"multiple && value?.length > 1\" class=\"additional-selection\">\r\n (+{{ useSelectAllOption && this.allSelected?.selected ? value?.length - 2 : value?.length - 1 }}\r\n {{ (value?.length === 2 ? otherLabel : othersLabel) }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n <ngx-mat-select-search\r\n [formControl]=\"itemFilterCtrl\"\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\" (click)=\"toggleNone()\">{{ noneLabel }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption && showFilteredAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n allLabel\r\n }}</mat-option>\r\n <mat-option *ngFor=\"let item of filteredItems$ | async\" [value]=\"item.value\" (click)=\"togglePerOne()\">\r\n {{ item.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</app-element-wrapper>\r\n" }]
988
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
901
989
  type: Input
902
990
  }], multiple: [{
903
991
  type: Input