ecabs-components 0.0.51 → 0.0.53
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.
- package/esm2020/lib/ecabs-select/ecabs-select.component.mjs +129 -41
- package/fesm2015/ecabs-components.mjs +130 -40
- package/fesm2015/ecabs-components.mjs.map +1 -1
- package/fesm2020/ecabs-components.mjs +128 -40
- package/fesm2020/ecabs-components.mjs.map +1 -1
- package/lib/ecabs-select/ecabs-select.component.d.ts +17 -5
- package/package.json +1 -1
|
@@ -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 {
|
|
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';
|
|
@@ -732,9 +732,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
732
732
|
}] });
|
|
733
733
|
|
|
734
734
|
class EcabsSelectComponent extends ElementBaseComponent {
|
|
735
|
-
constructor(injector) {
|
|
735
|
+
constructor(injector, changeDetectorRef) {
|
|
736
736
|
super();
|
|
737
737
|
this.injector = injector;
|
|
738
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
738
739
|
this.multiple = false;
|
|
739
740
|
this.useNoneOption = false;
|
|
740
741
|
this.useOnlyDisabledClass = false;
|
|
@@ -750,9 +751,12 @@ class EcabsSelectComponent extends ElementBaseComponent {
|
|
|
750
751
|
this.othersLabel = 'Others';
|
|
751
752
|
this.updateFilterItems = new EventEmitter();
|
|
752
753
|
this.selectionChange = new EventEmitter();
|
|
753
|
-
this.filteredItems$ = new
|
|
754
|
+
this.filteredItems$ = new BehaviorSubject([]);
|
|
754
755
|
this.itemFilterCtrl = new UntypedFormControl();
|
|
755
756
|
this.isClearAll = false;
|
|
757
|
+
this.showFilteredAllOption = true;
|
|
758
|
+
this.selectedItems = [];
|
|
759
|
+
this.notSelectedItems = [];
|
|
756
760
|
this.subscriptions = new Subscription();
|
|
757
761
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
758
762
|
this.onChange = () => { };
|
|
@@ -765,23 +769,21 @@ class EcabsSelectComponent extends ElementBaseComponent {
|
|
|
765
769
|
set value(val) {
|
|
766
770
|
if (this.val !== val) {
|
|
767
771
|
this.val = val;
|
|
772
|
+
this.setSelectedItems();
|
|
768
773
|
this.onChange(val);
|
|
769
774
|
this.onTouch(val);
|
|
770
775
|
}
|
|
771
776
|
}
|
|
772
777
|
ngOnChanges(changes) {
|
|
773
778
|
var _a;
|
|
774
|
-
|
|
775
|
-
|
|
779
|
+
const { items } = changes;
|
|
780
|
+
if (items && items.currentValue) {
|
|
776
781
|
this.filterItems();
|
|
777
|
-
if (this.multiple &&
|
|
778
|
-
this.useSelectAllOption &&
|
|
779
|
-
((_a = this.allSelected) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
782
|
+
if (this.multiple && this.useSelectAllOption && ((_a = this.allSelected) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
780
783
|
setTimeout(() => {
|
|
781
|
-
this.control.patchValue([
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
]);
|
|
784
|
+
this.control.patchValue([...this.filteredItems$.value.map((item) => item.value), this.selectAllValue], {
|
|
785
|
+
emitEvent: false,
|
|
786
|
+
});
|
|
785
787
|
}, 100);
|
|
786
788
|
}
|
|
787
789
|
}
|
|
@@ -807,17 +809,19 @@ class EcabsSelectComponent extends ElementBaseComponent {
|
|
|
807
809
|
this.filterItems();
|
|
808
810
|
this.updateFilterItems.emit(value);
|
|
809
811
|
if (this.isClearAll) {
|
|
810
|
-
this.control.patchValue([]);
|
|
812
|
+
this.control.patchValue([], { emitEvent: false });
|
|
811
813
|
this.isClearAll = false;
|
|
812
814
|
}
|
|
813
815
|
}));
|
|
814
816
|
}
|
|
815
817
|
toggleAllSelection() {
|
|
816
818
|
if (this.allSelected.selected) {
|
|
817
|
-
this.
|
|
818
|
-
...this.
|
|
819
|
-
|
|
820
|
-
|
|
819
|
+
if (this.useSearchOption) {
|
|
820
|
+
this.control.patchValue([...this.filteredItems$.value.map((item) => item.value), this.selectAllValue]);
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
this.control.patchValue([...this.items.map((item) => item.value), this.selectAllValue]);
|
|
824
|
+
}
|
|
821
825
|
}
|
|
822
826
|
else {
|
|
823
827
|
this.control.patchValue([]);
|
|
@@ -825,31 +829,45 @@ class EcabsSelectComponent extends ElementBaseComponent {
|
|
|
825
829
|
}
|
|
826
830
|
}
|
|
827
831
|
togglePerOne() {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
this.
|
|
832
|
+
setTimeout(() => (this.showFilteredAllOption = true));
|
|
833
|
+
setTimeout(() => {
|
|
834
|
+
if (this.allSelected) {
|
|
835
|
+
if (this.allSelected.selected) {
|
|
836
|
+
this.allSelected.deselect();
|
|
837
|
+
}
|
|
838
|
+
if (this.setAllOptionAfterChosenAllItems && this.control.value.length === this.items.length) {
|
|
839
|
+
this.allSelected.select();
|
|
840
|
+
}
|
|
835
841
|
}
|
|
836
|
-
|
|
842
|
+
this.showFilteredAllOption = false;
|
|
843
|
+
});
|
|
837
844
|
this.isClearAll = false;
|
|
838
845
|
}
|
|
846
|
+
toggleNone() {
|
|
847
|
+
this.selectedItems = [];
|
|
848
|
+
}
|
|
839
849
|
getAllSelectedChecked() {
|
|
840
850
|
return this.allSelected !== undefined && this.allSelected.selected;
|
|
841
851
|
}
|
|
842
852
|
getLabel(val) {
|
|
843
853
|
var _a;
|
|
844
|
-
if (this.useSelectAllOption &&
|
|
845
|
-
((_a = this.allSelected) === null || _a === void 0 ? void 0 : _a.selected) &&
|
|
846
|
-
this.items &&
|
|
847
|
-
this.items.length > 0) {
|
|
854
|
+
if (this.useSelectAllOption && ((_a = this.allSelected) === null || _a === void 0 ? void 0 : _a.selected) && this.items && this.items.length > 0) {
|
|
848
855
|
return this.items[0].label;
|
|
849
856
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
857
|
+
let item;
|
|
858
|
+
if (val !== undefined) {
|
|
859
|
+
if (this.useSearchOption) {
|
|
860
|
+
if (this.selectedItems && this.selectedItems.length > 0) {
|
|
861
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
862
|
+
item = this.selectedItems.find((item) => item.value === val);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
if (this.items && this.items.length > 0) {
|
|
867
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
868
|
+
item = this.items.find((item) => item.value === val);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
853
871
|
return item ? item.label : '';
|
|
854
872
|
}
|
|
855
873
|
return '';
|
|
@@ -870,29 +888,101 @@ class EcabsSelectComponent extends ElementBaseComponent {
|
|
|
870
888
|
this.selectionChange.emit($event);
|
|
871
889
|
}
|
|
872
890
|
filterItems() {
|
|
891
|
+
var _a, _b, _c;
|
|
892
|
+
this.setSelectedItems();
|
|
873
893
|
if (!this.items) {
|
|
874
894
|
return;
|
|
875
895
|
}
|
|
876
896
|
// get the search keyword
|
|
877
897
|
let search = this.itemFilterCtrl.value;
|
|
878
898
|
if (!search || search === '') {
|
|
879
|
-
|
|
899
|
+
if (this.useSearchOption) {
|
|
900
|
+
this.filteredItems$.next([...this.selectedItems]);
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
this.filteredItems$.next((_a = this.items) === null || _a === void 0 ? void 0 : _a.slice());
|
|
904
|
+
}
|
|
905
|
+
this.showFilteredAllOption = true;
|
|
880
906
|
return;
|
|
881
907
|
}
|
|
882
908
|
search = search.toLowerCase();
|
|
883
|
-
this.
|
|
884
|
-
|
|
885
|
-
|
|
909
|
+
this.showFilteredAllOption =
|
|
910
|
+
this.allLabel.toLowerCase().includes(search.toLowerCase()) ||
|
|
911
|
+
(this.value instanceof Array && this.value.includes(this.selectAllValue)) ||
|
|
912
|
+
(!(this.value instanceof Array) && this.value === this.selectAllValue);
|
|
913
|
+
this.changeDetectorRef.detectChanges();
|
|
914
|
+
if (this.useSearchOption) {
|
|
915
|
+
const filteredItems = ((_b = this.notSelectedItems) === null || _b === void 0 ? void 0 : _b.length) > 0
|
|
916
|
+
? this.notSelectedItems.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
|
|
917
|
+
: [];
|
|
918
|
+
this.filteredItems$.next([...this.selectedItems, ...filteredItems]);
|
|
919
|
+
}
|
|
920
|
+
else {
|
|
921
|
+
this.filteredItems$.next(((_c = this.items) === null || _c === void 0 ? void 0 : _c.length) > 0
|
|
922
|
+
? this.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
|
|
923
|
+
: []);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
setSelectedItems() {
|
|
927
|
+
var _a, _b;
|
|
928
|
+
if (this.useSearchOption) {
|
|
929
|
+
const selectedItems = [];
|
|
930
|
+
if (this.value) {
|
|
931
|
+
if (this.value instanceof Array) {
|
|
932
|
+
const skipSteps = this.value.includes(this.selectAllValue);
|
|
933
|
+
if (!skipSteps) {
|
|
934
|
+
this.value.forEach((value) => {
|
|
935
|
+
const index = this.selectedItems.findIndex((selectedItem) => selectedItem.value === value);
|
|
936
|
+
if (index !== -1) {
|
|
937
|
+
selectedItems.push(this.selectedItems[index]);
|
|
938
|
+
}
|
|
939
|
+
else {
|
|
940
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
941
|
+
const item = this.items.find((item) => item.value === value);
|
|
942
|
+
if (item) {
|
|
943
|
+
selectedItems.push(item);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
this.selectedItems.forEach((selectedItem) => {
|
|
948
|
+
const index = this.value.find((value) => selectedItem.value === value);
|
|
949
|
+
if (index === -1) {
|
|
950
|
+
selectedItems.splice(index, 1);
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
else {
|
|
956
|
+
const index = this.selectedItems.findIndex((selectedItem) => selectedItem.value === this.value);
|
|
957
|
+
if (index !== -1) {
|
|
958
|
+
selectedItems.push(this.selectedItems[index]);
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
962
|
+
const item = this.items.find((item) => item.value === this.value);
|
|
963
|
+
// eslint-disable-next-line max-depth
|
|
964
|
+
if (item) {
|
|
965
|
+
selectedItems.push(item);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
this.selectedItems = [...selectedItems];
|
|
970
|
+
this.notSelectedItems = (_a = this.items) === null || _a === void 0 ? void 0 : _a.filter((item) => this.selectedItems.findIndex((selectedItem) => selectedItem.value === item.value) === -1);
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
this.notSelectedItems = (_b = this.items) === null || _b === void 0 ? void 0 : _b.slice();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
886
976
|
}
|
|
887
977
|
}
|
|
888
|
-
EcabsSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EcabsSelectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
978
|
+
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 });
|
|
889
979
|
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: [
|
|
890
980
|
{
|
|
891
981
|
provide: NG_VALUE_ACCESSOR,
|
|
892
982
|
useExisting: EcabsSelectComponent,
|
|
893
983
|
multi: true,
|
|
894
984
|
},
|
|
895
|
-
], 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" }] });
|
|
985
|
+
], 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" }] });
|
|
896
986
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EcabsSelectComponent, decorators: [{
|
|
897
987
|
type: Component,
|
|
898
988
|
args: [{ selector: 'ecabs-select', providers: [
|
|
@@ -901,8 +991,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
901
991
|
useExisting: EcabsSelectComponent,
|
|
902
992
|
multi: true,
|
|
903
993
|
},
|
|
904
|
-
], 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" }]
|
|
905
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { items: [{
|
|
994
|
+
], 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" }]
|
|
995
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
906
996
|
type: Input
|
|
907
997
|
}], multiple: [{
|
|
908
998
|
type: Input
|