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