ecabs-components 0.0.1 → 0.0.2

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 (28) hide show
  1. package/esm2020/lib/base/validation/validation.component.mjs +14 -102
  2. package/esm2020/lib/ecabs-select/ecabs-select.component.mjs +210 -0
  3. package/esm2020/lib/ecabs-select/ecabs-select.module.mjs +53 -0
  4. package/esm2020/lib/ecabs-textarea/ecabs-textarea.component.mjs +62 -0
  5. package/esm2020/lib/ecabs-textarea/ecabs-textarea.module.mjs +20 -0
  6. package/esm2020/lib/services/ecabs-components.service.mjs +32 -0
  7. package/esm2020/public-api.mjs +5 -1
  8. package/fesm2015/ecabs-components.mjs +364 -102
  9. package/fesm2015/ecabs-components.mjs.map +1 -1
  10. package/fesm2020/ecabs-components.mjs +362 -102
  11. package/fesm2020/ecabs-components.mjs.map +1 -1
  12. package/lib/base/validation/validation.component.d.ts +5 -3
  13. package/lib/base/validation/validation.component.ts +12 -99
  14. package/lib/ecabs-select/ecabs-select.component.d.ts +55 -0
  15. package/lib/ecabs-select/ecabs-select.component.html +38 -0
  16. package/lib/ecabs-select/ecabs-select.component.ts +246 -0
  17. package/lib/ecabs-select/ecabs-select.module.d.ts +14 -0
  18. package/lib/ecabs-select/ecabs-select.module.ts +34 -0
  19. package/lib/ecabs-textarea/ecabs-textarea.component.d.ts +20 -0
  20. package/lib/ecabs-textarea/ecabs-textarea.component.html +13 -0
  21. package/lib/ecabs-textarea/ecabs-textarea.component.ts +61 -0
  22. package/lib/ecabs-textarea/ecabs-textarea.module.d.ts +10 -0
  23. package/lib/ecabs-textarea/ecabs-textarea.module.ts +12 -0
  24. package/lib/services/ecabs-components.service.d.ts +16 -0
  25. package/lib/services/ecabs-components.service.ts +33 -0
  26. package/package.json +4 -3
  27. package/public-api.d.ts +4 -0
  28. package/public-api.ts +4 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, HostBinding, NgModule, EventEmitter, Output, Directive, HostListener } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, NgModule, EventEmitter, Output, Injectable, Directive, HostListener, ViewChild } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/material/button';
@@ -7,11 +7,19 @@ import { MatButtonModule } from '@angular/material/button';
7
7
  import * as i4 from '@angular/material/icon';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
9
  import * as i3 from '@angular/forms';
10
- import { NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
10
+ import { NgControl, NG_VALUE_ACCESSOR, FormsModule, UntypedFormControl } from '@angular/forms';
11
11
  import * as i5 from '@angular/material/tooltip';
12
12
  import { MatTooltipModule } from '@angular/material/tooltip';
13
13
  import { MatInputModule } from '@angular/material/input';
14
+ import * as i3$1 from '@angular/material/form-field';
14
15
  import { MatFormFieldModule } from '@angular/material/form-field';
16
+ import * as i7 from 'ngx-mat-select-search';
17
+ import { MatSelectSearchComponent, NgxMatSelectSearchModule } from 'ngx-mat-select-search';
18
+ import { ReplaySubject, Subscription, combineLatest, map, debounceTime } from 'rxjs';
19
+ import * as i4$1 from '@angular/material/select';
20
+ import { MatSelectModule, MAT_SELECT_SCROLL_STRATEGY } from '@angular/material/select';
21
+ import * as i5$1 from '@angular/material/core';
22
+ import { Overlay } from '@angular/cdk/overlay';
15
23
 
16
24
  class EcabsSpinnerComponent {
17
25
  constructor() {
@@ -233,101 +241,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
233
241
  type: Output
234
242
  }] } });
235
243
 
236
- class ValidationComponent {
244
+ class EcabsComponentsService {
237
245
  constructor() {
246
+ this.config = {
247
+ errorMessages: [
248
+ { type: 'required', message: '[label] is required' },
249
+ { type: 'minlength', message: '[label] should be atleast [requiredLength] character' },
250
+ { type: 'maxLength', message: '[label] should be maximum [requiredLength] character' },
251
+ { type: 'min', message: '[label] should be minmum [min]' },
252
+ { type: 'max', message: '[label] should be maximum [max]' },
253
+ { type: 'minValue', message: '[label] should be minmum [requiredMin]' },
254
+ { type: 'maxValue', message: '[label] should be maximum [requiredMax]' },
255
+ ],
256
+ };
257
+ }
258
+ setConfig(c) {
259
+ this.config.errorMessages = c.errorMessages;
260
+ }
261
+ getConfig() {
262
+ return this.config;
263
+ }
264
+ }
265
+ EcabsComponentsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
266
+ EcabsComponentsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsComponentsService, providedIn: 'root' });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsComponentsService, decorators: [{
268
+ type: Injectable,
269
+ args: [{
270
+ providedIn: 'root',
271
+ }]
272
+ }], ctorParameters: function () { return []; } });
273
+
274
+ class ValidationComponent {
275
+ constructor(ecabsService) {
276
+ this.ecabsService = ecabsService;
238
277
  this.showValidationOnNotTouched = false;
239
- this.errorMessages = [];
240
278
  this._messages = {};
241
- // this.errorMessages = [
242
- // {
243
- // type: 'required',
244
- // message: this.translateService.instant(
245
- // 'FORMS.VALIDATION.LABEL_REQUIRED'
246
- // ),
247
- // },
248
- // {
249
- // type: 'minlength',
250
- // message: this.translateService.instant('FORMS.VALIDATION.MIN_LENGTH'),
251
- // },
252
- // {
253
- // type: 'maxlength',
254
- // message: this.translateService.instant('FORMS.VALIDATION.MAX_LENGTH'),
255
- // },
256
- // {
257
- // type: 'min',
258
- // message: this.translateService.instant('FORMS.VALIDATION.MIN'),
259
- // },
260
- // {
261
- // type: 'max',
262
- // message: this.translateService.instant('FORMS.VALIDATION.MAX'),
263
- // },
264
- // {
265
- // type: 'minValue',
266
- // message: this.translateService.instant('FORMS.VALIDATION.MIN_VALUE'),
267
- // },
268
- // {
269
- // type: 'maxValue',
270
- // message: this.translateService.instant('FORMS.VALIDATION.MAX_VALUE'),
271
- // },
272
- // {
273
- // type: 'validatePhoneNumber',
274
- // message: this.translateService.instant(
275
- // 'FORMS.VALIDATION.VALIDATE_PHONE_NUMBER'
276
- // ),
277
- // },
278
- // {
279
- // type: 'pastDate',
280
- // message: this.translateService.instant('FORMS.VALIDATION.PAST_DATE'),
281
- // },
282
- // {
283
- // type: 'affectsError',
284
- // message: this.translateService.instant(
285
- // 'FORMS.VALIDATION.AFFECTS_ERROR'
286
- // ),
287
- // },
288
- // {
289
- // type: 'moreThan',
290
- // message: this.translateService.instant('FORMS.VALIDATION.MORE_THAN'),
291
- // },
292
- // {
293
- // type: 'lessThan',
294
- // message: this.translateService.instant('FORMS.VALIDATION.LESS_THAN'),
295
- // },
296
- // {
297
- // type: 'iban',
298
- // message: this.translateService.instant('FORMS.VALIDATION.INVALID'),
299
- // },
300
- // {
301
- // type: 'email',
302
- // message: this.translateService.instant('FORMS.VALIDATION.EMAIL'),
303
- // },
304
- // {
305
- // type: 'numberMoreThan',
306
- // message: this.translateService.instant(
307
- // 'FORMS.VALIDATION.VALUE_MORE_THAN'
308
- // ),
309
- // },
310
- // {
311
- // type: 'numberLessThan',
312
- // message: this.translateService.instant(
313
- // 'FORMS.VALIDATION.VALUE_LESS_THAN'
314
- // ),
315
- // },
316
- // {
317
- // type: 'outOfRange',
318
- // message: this.translateService.instant('FORMS.VALIDATION.OUT_OF_RANGE'),
319
- // },
320
- // {
321
- // type: 'iban',
322
- // message: this.translateService.instant('FORMS.VALIDATION.IBAN'),
323
- // },
324
- // {
325
- // type: 'timeIsAfter',
326
- // message: this.translateService.instant(
327
- // 'FORMS.VALIDATION.LESS_THAN_TIME'
328
- // ),
329
- // },
330
- // ];
331
279
  }
332
280
  get messages() {
333
281
  if (this.element) {
@@ -344,6 +292,12 @@ class ValidationComponent {
344
292
  set messages(m) {
345
293
  this._messages = m;
346
294
  }
295
+ ngOnInit() {
296
+ this.config = this.ecabsService.getConfig();
297
+ for (let error of this.config.errorMessages) {
298
+ this.messages[error.type] = this.replaceTokens(error.message);
299
+ }
300
+ }
347
301
  ngOnChanges(changes) {
348
302
  const { updatedErrors } = changes;
349
303
  if (updatedErrors &&
@@ -354,11 +308,6 @@ class ValidationComponent {
354
308
  }
355
309
  }
356
310
  }
357
- ngOnInit() {
358
- for (const error of this.errorMessages) {
359
- this.messages[error.type] = this.replaceTokens(error.message);
360
- }
361
- }
362
311
  replaceTokens(message) {
363
312
  let retMessage;
364
313
  if (this.label) {
@@ -373,12 +322,12 @@ class ValidationComponent {
373
322
  return this.messages[key];
374
323
  }
375
324
  }
376
- ValidationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
325
+ ValidationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationComponent, deps: [{ token: EcabsComponentsService }], target: i0.ɵɵFactoryTarget.Component });
377
326
  ValidationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ValidationComponent, selector: "app-validations-messages", inputs: { element: "element", label: "label", showValidationOnNotTouched: "showValidationOnNotTouched", updatedErrors: "updatedErrors" }, usesOnChanges: true, ngImport: i0, template: "<div\r\n class=\"form-field__validation\"\r\n *ngIf=\"element && (element?.touched || showValidationOnNotTouched) && element?.invalid\"\r\n>\r\n <div class=\"form-field__validation__item\" *ngFor=\"let item of element?.errors | keyvalue\">\r\n {{ getMessageDetail(item.key) }}\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }] });
378
327
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationComponent, decorators: [{
379
328
  type: Component,
380
329
  args: [{ selector: 'app-validations-messages', template: "<div\r\n class=\"form-field__validation\"\r\n *ngIf=\"element && (element?.touched || showValidationOnNotTouched) && element?.invalid\"\r\n>\r\n <div class=\"form-field__validation__item\" *ngFor=\"let item of element?.errors | keyvalue\">\r\n {{ getMessageDetail(item.key) }}\r\n </div>\r\n</div>\r\n" }]
381
- }], ctorParameters: function () { return []; }, propDecorators: { element: [{
330
+ }], ctorParameters: function () { return [{ type: EcabsComponentsService }]; }, propDecorators: { element: [{
382
331
  type: Input
383
332
  }], label: [{
384
333
  type: Input
@@ -734,9 +683,320 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
734
683
  }]
735
684
  }] });
736
685
 
686
+ class EcabsSelectComponent extends ElementBaseComponent {
687
+ constructor(injector) {
688
+ super();
689
+ this.injector = injector;
690
+ this.multiple = false;
691
+ this.useNoneOption = false;
692
+ this.useOnlyDisabledClass = false;
693
+ this.searchFieldPlaceholder = 'Search';
694
+ this.useSearchOption = false;
695
+ this.useSelectAllOption = false;
696
+ this.setAllOptionAfterChosenAllItems = true;
697
+ this.selectAllValue = 0;
698
+ this.noEntriesFoundLabel = 'SELECT.NO_MATCHING_FOUND';
699
+ this.updateFilterItems = new EventEmitter();
700
+ this.selectionChange = new EventEmitter();
701
+ this.filteredItems$ = new ReplaySubject(1);
702
+ this.itemFilterCtrl = new UntypedFormControl();
703
+ this.isClearAll = false;
704
+ this.subscriptions = new Subscription();
705
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
706
+ this.onChange = () => { };
707
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
708
+ this.onTouch = () => { };
709
+ }
710
+ get value() {
711
+ return this.val;
712
+ }
713
+ set value(val) {
714
+ if (this.val !== val) {
715
+ this.val = val;
716
+ this.onChange(val);
717
+ this.onTouch(val);
718
+ }
719
+ }
720
+ ngOnChanges(changes) {
721
+ if (changes['items'] && changes['items'].currentValue) {
722
+ this.filteredItems$.next(changes['items'].currentValue.slice());
723
+ this.filterItems();
724
+ if (this.multiple &&
725
+ this.useSelectAllOption &&
726
+ this.allSelected?.selected) {
727
+ setTimeout(() => {
728
+ this.control.patchValue([
729
+ ...this.items.map((item) => item.value),
730
+ this.selectAllValue,
731
+ ]);
732
+ }, 100);
733
+ }
734
+ }
735
+ }
736
+ ngAfterViewInit() {
737
+ const ngControl = this.injector.get(NgControl, null);
738
+ if (ngControl) {
739
+ this.control = ngControl.control;
740
+ }
741
+ if (this.matSelectSearchComponent) {
742
+ this.matSelectSearchComponent._showNoEntriesFound$ = combineLatest([
743
+ this.itemFilterCtrl.valueChanges,
744
+ this.filteredItems$,
745
+ ]).pipe(map(([value, items]) => this.matSelectSearchComponent.noEntriesFoundLabel &&
746
+ value &&
747
+ items.length === 0));
748
+ }
749
+ }
750
+ ngOnInit() {
751
+ this.subscriptions.add(this.itemFilterCtrl.valueChanges
752
+ .pipe(debounceTime(200))
753
+ .subscribe((value) => {
754
+ this.filterItems();
755
+ this.updateFilterItems.emit(value);
756
+ if (this.isClearAll) {
757
+ this.control.patchValue([]);
758
+ this.isClearAll = false;
759
+ }
760
+ }));
761
+ }
762
+ toggleAllSelection() {
763
+ if (this.allSelected.selected) {
764
+ this.control.patchValue([
765
+ ...this.items.map((item) => item.value),
766
+ this.selectAllValue,
767
+ ]);
768
+ }
769
+ else {
770
+ this.control.patchValue([]);
771
+ this.isClearAll = true;
772
+ }
773
+ }
774
+ togglePerOne() {
775
+ if (this.allSelected) {
776
+ if (this.allSelected.selected) {
777
+ this.allSelected.deselect();
778
+ }
779
+ if (this.setAllOptionAfterChosenAllItems &&
780
+ this.control.value.length === this.items.length) {
781
+ this.allSelected.select();
782
+ }
783
+ }
784
+ this.isClearAll = false;
785
+ }
786
+ getAllSelectedChecked() {
787
+ return this.allSelected !== undefined && this.allSelected.selected;
788
+ }
789
+ getLabel(val) {
790
+ if (this.useSelectAllOption &&
791
+ this.allSelected?.selected &&
792
+ this.items &&
793
+ this.items.length > 0) {
794
+ return this.items[0].label;
795
+ }
796
+ if (val !== undefined && this.items && this.items.length > 0) {
797
+ // eslint-disable-next-line @typescript-eslint/no-shadow
798
+ const item = this.items.find((item) => item.value === val);
799
+ return item ? item.label : '';
800
+ }
801
+ return '';
802
+ }
803
+ writeValue(value) {
804
+ this.value = value;
805
+ }
806
+ registerOnChange(fn) {
807
+ this.onChange = fn;
808
+ }
809
+ registerOnTouched(fn) {
810
+ this.onTouch = fn;
811
+ }
812
+ ngOnDestroy() {
813
+ this.subscriptions.unsubscribe();
814
+ }
815
+ onSelectionChanged($event) {
816
+ this.selectionChange.emit($event);
817
+ }
818
+ filterItems() {
819
+ if (!this.items) {
820
+ return;
821
+ }
822
+ // get the search keyword
823
+ let search = this.itemFilterCtrl.value;
824
+ if (!search || search === '') {
825
+ this.filteredItems$.next(this.items.slice());
826
+ return;
827
+ }
828
+ search = search.toLowerCase();
829
+ this.filteredItems$.next(this.items && this.items.length > 0
830
+ ? this.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase()))
831
+ : []);
832
+ }
833
+ }
834
+ EcabsSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
835
+ EcabsSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", 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" }, outputs: { updateFilterItems: "updateFilterItems", selectionChange: "selectionChange" }, providers: [
836
+ {
837
+ provide: NG_VALUE_ACCESSOR,
838
+ useExisting: EcabsSelectComponent,
839
+ multi: true,
840
+ },
841
+ ], 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 floatLabel=\"always\" [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()\">{{ 'All' }}</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 ? 'Other' : 'Others') }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n [formControl]=\"itemFilterCtrl\"\r\n <ngx-mat-select-search\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\">{{ 'None' }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n 'All'\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: i5$1.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: "pipe", type: i1.AsyncPipe, name: "async" }] });
842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectComponent, decorators: [{
843
+ type: Component,
844
+ args: [{ selector: 'ecabs-select', providers: [
845
+ {
846
+ provide: NG_VALUE_ACCESSOR,
847
+ useExisting: EcabsSelectComponent,
848
+ multi: true,
849
+ },
850
+ ], template: "<app-element-wrapper [data]=\"getData()\">\r\n <mat-form-field floatLabel=\"always\" [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()\">{{ 'All' }}</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 ? 'Other' : 'Others') }})\r\n </span>\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"useSearchOption\">\r\n [formControl]=\"itemFilterCtrl\"\r\n <ngx-mat-select-search\r\n [placeholderLabel]=\"searchFieldPlaceholder\"\r\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n ></ngx-mat-select-search>\r\n </mat-option>\r\n <mat-option *ngIf=\"useNoneOption\">{{ 'None' }}</mat-option>\r\n <mat-option #allSelected *ngIf=\"useSelectAllOption\" (click)=\"toggleAllSelection()\" [value]=\"selectAllValue\">{{\r\n 'All'\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" }]
851
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { items: [{
852
+ type: Input
853
+ }], multiple: [{
854
+ type: Input
855
+ }], useNoneOption: [{
856
+ type: Input
857
+ }], useOnlyDisabledClass: [{
858
+ type: Input
859
+ }], searchFieldPlaceholder: [{
860
+ type: Input
861
+ }], useSearchOption: [{
862
+ type: Input
863
+ }], useSelectAllOption: [{
864
+ type: Input
865
+ }], setAllOptionAfterChosenAllItems: [{
866
+ type: Input
867
+ }], selectAllValue: [{
868
+ type: Input
869
+ }], noEntriesFoundLabel: [{
870
+ type: Input
871
+ }], updateFilterItems: [{
872
+ type: Output
873
+ }], selectionChange: [{
874
+ type: Output
875
+ }], allSelected: [{
876
+ type: ViewChild,
877
+ args: ['allSelected']
878
+ }], matSelectSearchComponent: [{
879
+ type: ViewChild,
880
+ args: [MatSelectSearchComponent]
881
+ }] } });
882
+
883
+ class EcabsSelectModule {
884
+ }
885
+ EcabsSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
886
+ EcabsSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectModule, declarations: [EcabsSelectComponent], imports: [CommonModule,
887
+ ElementWrapperModule,
888
+ MatSelectModule,
889
+ FormsModule,
890
+ NgxMatSelectSearchModule], exports: [EcabsSelectComponent] });
891
+ EcabsSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectModule, providers: [
892
+ {
893
+ provide: MAT_SELECT_SCROLL_STRATEGY,
894
+ useFactory: scrollFactory,
895
+ deps: [Overlay],
896
+ },
897
+ ], imports: [CommonModule,
898
+ ElementWrapperModule,
899
+ MatSelectModule,
900
+ FormsModule,
901
+ NgxMatSelectSearchModule] });
902
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSelectModule, decorators: [{
903
+ type: NgModule,
904
+ args: [{
905
+ declarations: [EcabsSelectComponent],
906
+ imports: [
907
+ CommonModule,
908
+ ElementWrapperModule,
909
+ MatSelectModule,
910
+ FormsModule,
911
+ NgxMatSelectSearchModule,
912
+ ],
913
+ exports: [EcabsSelectComponent],
914
+ providers: [
915
+ {
916
+ provide: MAT_SELECT_SCROLL_STRATEGY,
917
+ useFactory: scrollFactory,
918
+ deps: [Overlay],
919
+ },
920
+ ],
921
+ }]
922
+ }] });
923
+ function scrollFactory(overlay) {
924
+ return () => overlay.scrollStrategies.block();
925
+ }
926
+
927
+ class EcabsTextareaComponent extends ElementBaseComponent {
928
+ constructor(injector) {
929
+ super();
930
+ this.injector = injector;
931
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
932
+ this.onChange = () => { };
933
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
934
+ this.onTouch = () => { };
935
+ }
936
+ get value() {
937
+ return this.val;
938
+ }
939
+ set value(val) {
940
+ if (val !== undefined && this.val !== val) {
941
+ this.val = val;
942
+ this.onChange(val);
943
+ this.onTouch(val);
944
+ }
945
+ }
946
+ ngAfterViewInit() {
947
+ const ngControl = this.injector.get(NgControl, null);
948
+ if (ngControl) {
949
+ this.control = ngControl.control;
950
+ }
951
+ }
952
+ writeValue(value) {
953
+ this.value = value;
954
+ }
955
+ registerOnChange(fn) {
956
+ this.onChange = fn;
957
+ }
958
+ registerOnTouched(fn) {
959
+ this.onTouch = fn;
960
+ }
961
+ }
962
+ EcabsTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextareaComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
963
+ EcabsTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: EcabsTextareaComponent, selector: "ecabs-textarea", inputs: { rows: "rows" }, providers: [
964
+ {
965
+ provide: NG_VALUE_ACCESSOR,
966
+ useExisting: EcabsTextareaComponent,
967
+ multi: true,
968
+ },
969
+ ], usesInheritance: true, ngImport: i0, template: "<app-element-wrapper [data]=\"getData()\">\r\n <textarea\r\n class=\"form-field__textarea\"\r\n [id]=\"name\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouch()\"\r\n [disabled]=\"disabled\"\r\n [maxlength]=\"maxLength\"\r\n [rows]=\"rows\"\r\n >\r\n </textarea>\r\n</app-element-wrapper>\r\n", dependencies: [{ kind: "component", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: ["data", "showCloseIcon", "focusedFlag", "showPassword", "control"], outputs: ["showHidePassword", "clear", "increase", "decrease"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextareaComponent, decorators: [{
971
+ type: Component,
972
+ args: [{ selector: 'ecabs-textarea', providers: [
973
+ {
974
+ provide: NG_VALUE_ACCESSOR,
975
+ useExisting: EcabsTextareaComponent,
976
+ multi: true,
977
+ },
978
+ ], template: "<app-element-wrapper [data]=\"getData()\">\r\n <textarea\r\n class=\"form-field__textarea\"\r\n [id]=\"name\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouch()\"\r\n [disabled]=\"disabled\"\r\n [maxlength]=\"maxLength\"\r\n [rows]=\"rows\"\r\n >\r\n </textarea>\r\n</app-element-wrapper>\r\n" }]
979
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { rows: [{
980
+ type: Input
981
+ }] } });
982
+
983
+ class EcabsTextAreaModule {
984
+ }
985
+ EcabsTextAreaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
986
+ EcabsTextAreaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextAreaModule, declarations: [EcabsTextareaComponent], imports: [CommonModule, ElementWrapperModule, FormsModule], exports: [EcabsTextareaComponent] });
987
+ EcabsTextAreaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextAreaModule, imports: [CommonModule, ElementWrapperModule, FormsModule] });
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsTextAreaModule, decorators: [{
989
+ type: NgModule,
990
+ args: [{
991
+ declarations: [EcabsTextareaComponent],
992
+ imports: [CommonModule, ElementWrapperModule, FormsModule],
993
+ exports: [EcabsTextareaComponent],
994
+ }]
995
+ }] });
996
+
737
997
  /**
738
998
  * Generated bundle index. Do not edit.
739
999
  */
740
1000
 
741
- export { ButtonsComponent, EcabsButtonsModule, EcabsInputComponent, EcabsInputModule, EcabsLoadingComponent, EcabsLoadingModule, EcabsSpinnerComponent };
1001
+ export { ButtonsComponent, EcabsButtonsModule, EcabsInputComponent, EcabsInputModule, EcabsLoadingComponent, EcabsLoadingModule, EcabsSelectComponent, EcabsSelectModule, EcabsSpinnerComponent, EcabsTextAreaModule, EcabsTextareaComponent, scrollFactory };
742
1002
  //# sourceMappingURL=ecabs-components.mjs.map