@gerandon/ngx-widgets 18.0.0 → 18.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/gerandon-ngx-widgets.mjs +5 -0
- package/esm2022/lib/basic-chips/basic-chips.component.mjs +80 -0
- package/esm2022/lib/basic-input/basic-input.component.mjs +41 -0
- package/esm2022/lib/core/base-input.mjs +81 -0
- package/esm2022/lib/core/base-text-input.mjs +20 -0
- package/esm2022/lib/core/base-value-accessor.mjs +63 -0
- package/esm2022/lib/core/component-unsubscribe.mjs +54 -0
- package/esm2022/lib/select/select.component.mjs +61 -0
- package/esm2022/lib/textarea-input/textarea-input.component.mjs +39 -0
- package/esm2022/public-api.mjs +12 -0
- package/fesm2022/gerandon-ngx-widgets.mjs +409 -0
- package/fesm2022/gerandon-ngx-widgets.mjs.map +1 -0
- package/gerandon-ngx-widgets-18.0.2.tgz +0 -0
- package/index.d.ts +5 -0
- package/lib/basic-chips/basic-chips.component.d.ts +17 -0
- package/lib/basic-input/basic-input.component.d.ts +9 -0
- package/lib/core/base-input.d.ts +38 -0
- package/lib/core/base-text-input.d.ts +8 -0
- package/lib/core/base-value-accessor.d.ts +28 -0
- package/lib/core/component-unsubscribe.d.ts +8 -0
- package/lib/select/select.component.d.ts +26 -0
- package/lib/textarea-input/textarea-input.component.d.ts +7 -0
- package/package.json +16 -6
- package/{src/public-api.ts → public-api.d.ts} +0 -5
- package/ng-package.json +0 -7
- package/src/lib/basic-chips/basic-chips.component.html +0 -39
- package/src/lib/basic-chips/basic-chips.component.scss +0 -31
- package/src/lib/basic-chips/basic-chips.component.ts +0 -83
- package/src/lib/basic-input/basic-input.component.html +0 -44
- package/src/lib/basic-input/basic-input.component.scss +0 -26
- package/src/lib/basic-input/basic-input.component.ts +0 -41
- package/src/lib/core/base-input.ts +0 -69
- package/src/lib/core/base-text-input.ts +0 -13
- package/src/lib/core/base-value-accessor.ts +0 -80
- package/src/lib/core/component-unsubscribe.ts +0 -58
- package/src/lib/select/select.component.html +0 -36
- package/src/lib/select/select.component.scss +0 -7
- package/src/lib/select/select.component.ts +0 -70
- package/src/lib/textarea-input/textarea-input.component.html +0 -45
- package/src/lib/textarea-input/textarea-input.component.scss +0 -27
- package/src/lib/textarea-input/textarea-input.component.ts +0 -30
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Generated bundle index. Do not edit.
|
3
|
+
*/
|
4
|
+
export * from './public-api';
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VyYW5kb24tbmd4LXdpZGdldHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9uZ3gtd2lkZ2V0cy9zcmMvZ2VyYW5kb24tbmd4LXdpZGdldHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
2
|
+
import { AsyncPipe, JsonPipe } from '@angular/common';
|
3
|
+
import { Component, forwardRef, Input, ViewEncapsulation } from '@angular/core';
|
4
|
+
import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
5
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
6
|
+
import { MatChipsModule } from '@angular/material/chips';
|
7
|
+
import { MatIconModule } from '@angular/material/icon';
|
8
|
+
import { BaseInput } from "../core/base-input";
|
9
|
+
import { MatError, MatFormField, MatLabel } from "@angular/material/form-field";
|
10
|
+
import { MatInput } from "@angular/material/input";
|
11
|
+
import * as i0 from "@angular/core";
|
12
|
+
import * as i1 from "@angular/material/chips";
|
13
|
+
import * as i2 from "@angular/material/icon";
|
14
|
+
import * as i3 from "@angular/forms";
|
15
|
+
import * as i4 from "@angular/material/autocomplete";
|
16
|
+
import * as i5 from "@angular/material/core";
|
17
|
+
export class BasicChipsComponent extends BaseInput {
|
18
|
+
constructor() {
|
19
|
+
super(...arguments);
|
20
|
+
this.separatorKeysCodes = [ENTER, COMMA];
|
21
|
+
}
|
22
|
+
remove(item) {
|
23
|
+
const values = this.control.value;
|
24
|
+
const index = values.indexOf(item);
|
25
|
+
if (index >= 0) {
|
26
|
+
values.splice(index, 1);
|
27
|
+
this.control.setValue(values);
|
28
|
+
}
|
29
|
+
this.mark();
|
30
|
+
}
|
31
|
+
add(event) {
|
32
|
+
const value = (event.value || '').trim();
|
33
|
+
if (value) {
|
34
|
+
this.updateValue(value);
|
35
|
+
}
|
36
|
+
event.chipInput.clear();
|
37
|
+
this.mark();
|
38
|
+
}
|
39
|
+
selected(event) {
|
40
|
+
if (!this.control.value?.includes(event.option.value)) {
|
41
|
+
this.updateValue(event.option.value);
|
42
|
+
}
|
43
|
+
this.inputElement.nativeElement.value = '';
|
44
|
+
this.mark();
|
45
|
+
}
|
46
|
+
updateValue(value) {
|
47
|
+
this.control.setValue([
|
48
|
+
...(this.control.value || []),
|
49
|
+
value,
|
50
|
+
]);
|
51
|
+
}
|
52
|
+
mark() {
|
53
|
+
if (!this.control.touched) {
|
54
|
+
this.control.markAsTouched();
|
55
|
+
this.control.markAsDirty();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BasicChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: BasicChipsComponent, isStandalone: true, selector: "gerandon-basic-chips", inputs: { asyncOptions: "asyncOptions", labelProperty: "labelProperty" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicChipsComponent), multi: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{ label }}</mat-label>\r\n }\r\n <mat-chip-grid #chipGrid class=\"w-100\">\r\n @for(item of control.value; track item) {\r\n <mat-chip-row (removed)=\"remove(item)\" color=\"primary\" highlighted>\r\n {{ labelProperty ? item[labelProperty] : item}}\r\n <button matChipRemove [attr.aria-label]=\"(labelProperty ? item[labelProperty] : item) + ' elt\u00E1vol\u00EDt\u00E1sa'\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n <input #inputElement\r\n matInput\r\n [placeholder]=\"placeholder || label\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"!labelProperty && add($event)\"/>\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event)\">\r\n @for (filterItem of asyncOptions | async; track filterItem) {\r\n <mat-option [value]=\"filterItem\">\r\n {{labelProperty ? filterItem[labelProperty] : filterItem}}\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n </mat-chip-grid>\r\n <input #input=\"ngForm\" [style.display]=\"'none'\" [formControl]=\"control\" />\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n</mat-form-field>\r\n", styles: ["gerandon-basic-chips{display:block}gerandon-basic-chips .mat-mdc-standard-chip{height:28px!important}gerandon-basic-chips mat-form-field{width:100%}gerandon-basic-chips mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{display:flex;align-items:center;min-height:40px!important;padding:unset!important}gerandon-basic-chips mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-floating-label:not(.mdc-floating-label--float-above){top:1.2rem!important}gerandon-basic-chips mat-form-field mat-chip-row{margin-top:8px!important;margin-bottom:8px!important}gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden!important}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
60
|
+
}
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BasicChipsComponent, decorators: [{
|
62
|
+
type: Component,
|
63
|
+
args: [{ selector: 'gerandon-basic-chips', standalone: true, encapsulation: ViewEncapsulation.None, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicChipsComponent), multi: true }], imports: [
|
64
|
+
MatChipsModule,
|
65
|
+
MatIconModule,
|
66
|
+
ReactiveFormsModule,
|
67
|
+
MatAutocompleteModule,
|
68
|
+
AsyncPipe,
|
69
|
+
JsonPipe,
|
70
|
+
MatFormField,
|
71
|
+
MatInput,
|
72
|
+
MatLabel,
|
73
|
+
MatError,
|
74
|
+
], template: "<mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{ label }}</mat-label>\r\n }\r\n <mat-chip-grid #chipGrid class=\"w-100\">\r\n @for(item of control.value; track item) {\r\n <mat-chip-row (removed)=\"remove(item)\" color=\"primary\" highlighted>\r\n {{ labelProperty ? item[labelProperty] : item}}\r\n <button matChipRemove [attr.aria-label]=\"(labelProperty ? item[labelProperty] : item) + ' elt\u00E1vol\u00EDt\u00E1sa'\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n <input #inputElement\r\n matInput\r\n [placeholder]=\"placeholder || label\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"!labelProperty && add($event)\"/>\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event)\">\r\n @for (filterItem of asyncOptions | async; track filterItem) {\r\n <mat-option [value]=\"filterItem\">\r\n {{labelProperty ? filterItem[labelProperty] : filterItem}}\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n </mat-chip-grid>\r\n <input #input=\"ngForm\" [style.display]=\"'none'\" [formControl]=\"control\" />\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n</mat-form-field>\r\n", styles: ["gerandon-basic-chips{display:block}gerandon-basic-chips .mat-mdc-standard-chip{height:28px!important}gerandon-basic-chips mat-form-field{width:100%}gerandon-basic-chips mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{display:flex;align-items:center;min-height:40px!important;padding:unset!important}gerandon-basic-chips mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-floating-label:not(.mdc-floating-label--float-above){top:1.2rem!important}gerandon-basic-chips mat-form-field mat-chip-row{margin-top:8px!important;margin-bottom:8px!important}gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,gerandon-basic-chips mat-form-field .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden!important}\n"] }]
|
75
|
+
}], propDecorators: { asyncOptions: [{
|
76
|
+
type: Input
|
77
|
+
}], labelProperty: [{
|
78
|
+
type: Input
|
79
|
+
}] } });
|
80
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzaWMtY2hpcHMuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpZGdldHMvc3JjL2xpYi9iYXNpYy1jaGlwcy9iYXNpYy1jaGlwcy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtd2lkZ2V0cy9zcmMvbGliL2Jhc2ljLWNoaXBzL2Jhc2ljLWNoaXBzLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsS0F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ZXInXSB9fTwvbWF0LWVycm9yPlxyXG4gIH0gQGVsc2UgaWYgKGNvbnRyb2wuZXJyb3JzPy5bJ3JlcXVpcmVkJ10pIHtcclxuICAgIEBpZiAodmFsaWRhdGlvblRyYW5zbGF0aW9ucy5yZXF1aXJlZCkge1xyXG4gICAgICA8bWF0LWVycm9yPnt7IHZhbGlkYXRpb25UcmFuc2xhdGlvbnMucmVxdWlyZWQgfX08L21hdC1lcnJvcj5cclxuICAgIH0gQGVsc2Uge1xyXG4gICAgICBAZm9yIChlcnJvciBvZiB2YWxpZGF0b3JNZXNzYWdlc0FycmF5OyB0cmFjayBlcnJvcikge1xyXG4gICAgICAgIDxtYXQtZXJyb3I+e3sgZXJyb3IudmFsdWUgfX08L21hdC1lcnJvcj5cclxuICAgICAgfVxyXG4gICAgfVxyXG4gIH1cclxuPC9tYXQtZm9ybS1maWVsZD5cclxuIl19
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { Component, EventEmitter, forwardRef, Output, ViewEncapsulation, } from '@angular/core';
|
2
|
+
import { NG_ASYNC_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
6
|
+
import { BaseTextInput } from '../core/base-text-input';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "@angular/forms";
|
9
|
+
import * as i2 from "@angular/material/icon";
|
10
|
+
import * as i3 from "@angular/material/form-field";
|
11
|
+
import * as i4 from "@angular/material/input";
|
12
|
+
export class BasicInputComponent extends BaseTextInput {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments);
|
15
|
+
this.iconClick = new EventEmitter();
|
16
|
+
}
|
17
|
+
ngOnInit() {
|
18
|
+
super.ngOnInit();
|
19
|
+
this.id = this.id || this.name;
|
20
|
+
}
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BasicInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: BasicInputComponent, isStandalone: true, selector: "gerandon-basic-input", outputs: { iconClick: "iconClick" }, providers: [
|
23
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
24
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
25
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"basic-input cva-input\">\r\n <mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [hintLabel]=\"hintLabel\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{label}}</mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n #inputElement\r\n #input=\"ngForm\"\r\n matInput\r\n [style.padding-right]=\"(suffix || prefixIcon) && '35px'\"\r\n [type]=\"type\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\"\r\n [readonly]=\"isDisabled\"\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"control\"\r\n [maxLength]=\"maxLength\"\r\n [name]=\"name\"\r\n [required]=\"!!control.errors?.['required']\"/>\r\n @if (prefixIcon) {\r\n <mat-icon matPrefix color=\"accent\">\r\n {{prefixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffixIcon) {\r\n <mat-icon matSuffix color=\"accent\">\r\n {{suffixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffix) {\r\n <span matSuffix style=\"margin-right: 10px\">{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n @if (control.errors?.[error.key]) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n }\r\n </mat-form-field>\r\n</div>\r\n", styles: ["gerandon-basic-input{display:block}gerandon-basic-input .basic-input{height:inherit}gerandon-basic-input .basic-input .disabled{color:#ced4da}gerandon-basic-input .basic-input mat-form-field{width:100%}gerandon-basic-input .basic-input mat-form-field .mat-icon{padding:unset;margin-left:10px;margin-right:10px}gerandon-basic-input .basic-input mat-form-field input::placeholder{color:#adb5bd;font-style:italic}gerandon-basic-input .basic-input mat-form-field input:disabled{cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
26
|
+
}
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BasicInputComponent, decorators: [{
|
28
|
+
type: Component,
|
29
|
+
args: [{ selector: 'gerandon-basic-input', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
30
|
+
ReactiveFormsModule,
|
31
|
+
MatIconModule,
|
32
|
+
MatFormFieldModule,
|
33
|
+
MatInputModule,
|
34
|
+
], providers: [
|
35
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
36
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
37
|
+
], template: "<div class=\"basic-input cva-input\">\r\n <mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [hintLabel]=\"hintLabel\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{label}}</mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n #inputElement\r\n #input=\"ngForm\"\r\n matInput\r\n [style.padding-right]=\"(suffix || prefixIcon) && '35px'\"\r\n [type]=\"type\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\"\r\n [readonly]=\"isDisabled\"\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"control\"\r\n [maxLength]=\"maxLength\"\r\n [name]=\"name\"\r\n [required]=\"!!control.errors?.['required']\"/>\r\n @if (prefixIcon) {\r\n <mat-icon matPrefix color=\"accent\">\r\n {{prefixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffixIcon) {\r\n <mat-icon matSuffix color=\"accent\">\r\n {{suffixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffix) {\r\n <span matSuffix style=\"margin-right: 10px\">{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n @if (control.errors?.[error.key]) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n }\r\n </mat-form-field>\r\n</div>\r\n", styles: ["gerandon-basic-input{display:block}gerandon-basic-input .basic-input{height:inherit}gerandon-basic-input .basic-input .disabled{color:#ced4da}gerandon-basic-input .basic-input mat-form-field{width:100%}gerandon-basic-input .basic-input mat-form-field .mat-icon{padding:unset;margin-left:10px;margin-right:10px}gerandon-basic-input .basic-input mat-form-field input::placeholder{color:#adb5bd;font-style:italic}gerandon-basic-input .basic-input mat-form-field input:disabled{cursor:not-allowed}\n"] }]
|
38
|
+
}], propDecorators: { iconClick: [{
|
39
|
+
type: Output
|
40
|
+
}] } });
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzaWMtaW5wdXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpZGdldHMvc3JjL2xpYi9iYXNpYy1pbnB1dC9iYXNpYy1pbnB1dC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtd2lkZ2V0cy9zcmMvbGliL2Jhc2ljLWlucHV0L2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bWF0LWVycm9yPlxyXG4gICAgICB9IEBlbHNlIHtcclxuICAgICAgICBAZm9yIChlcnJvciBvZiB2YWxpZGF0b3JNZXNzYWdlc0FycmF5OyB0cmFjayBlcnJvcikge1xyXG4gICAgICAgICAgQGlmIChjb250cm9sLmVycm9ycz8uW2Vycm9yLmtleV0pIHtcclxuICAgICAgICAgICAgPG1hdC1lcnJvcj57eyBlcnJvci52YWx1ZSB9fTwvbWF0LWVycm9yPlxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgfVxyXG4gIDwvbWF0LWZvcm0tZmllbGQ+XHJcbjwvZGl2PlxyXG4iXX0=
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import { Directive, Inject, InjectionToken, Input, Optional, } from '@angular/core';
|
2
|
+
import { BaseValueAccessor } from './base-value-accessor';
|
3
|
+
import { isEmpty, keys } from 'lodash-es';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export const NGX_WIDGETS_VALIDATION_TRANSLATIONS = new InjectionToken('NGX_WIDGETS_VALIDATION_TRANSLATIONS');
|
6
|
+
export class BaseInput extends BaseValueAccessor {
|
7
|
+
constructor(validationTranslations) {
|
8
|
+
super();
|
9
|
+
this.validationTranslations = validationTranslations;
|
10
|
+
this.isDisabled = false;
|
11
|
+
this.floatLabel = 'auto';
|
12
|
+
this.subscriptSizing = 'fixed';
|
13
|
+
this.hintLabel = '';
|
14
|
+
this.validatorMessagesArray = [];
|
15
|
+
}
|
16
|
+
ngOnInit() {
|
17
|
+
this.placeholder = this.placeholder === undefined ? this.label : this.placeholder;
|
18
|
+
if (!this.name) {
|
19
|
+
this.name = this.formControlName;
|
20
|
+
/*
|
21
|
+
console.warn(`name attribute is not defined for ${this.formControlName}! Please beware, that using this control multiple
|
22
|
+
times with the same control name could result in wrong focus, clicking on the label!`);
|
23
|
+
*/
|
24
|
+
}
|
25
|
+
// *ngIf seems like does not re-render component when label is used with dynamic value (e.g.: translate pipe). Strange
|
26
|
+
this.label = this.label || ' ';
|
27
|
+
}
|
28
|
+
ngOnChanges(changes) {
|
29
|
+
if (changes['validatorMessages']) {
|
30
|
+
if (!isEmpty(this.validatorMessages)) {
|
31
|
+
this.validatorMessagesArray = keys(this.validatorMessages).map((key) => ({
|
32
|
+
key,
|
33
|
+
value: this.validatorMessages[key],
|
34
|
+
}));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
ngAfterViewInit() {
|
39
|
+
super.ngAfterViewInit();
|
40
|
+
this.cdr.detectChanges();
|
41
|
+
}
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseInput, deps: [{ token: NGX_WIDGETS_VALIDATION_TRANSLATIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
43
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: BaseInput, inputs: { id: "id", name: "name", label: "label", translateParams: "translateParams", placeholder: "placeholder", isDisabled: "isDisabled", floatLabel: "floatLabel", prefixIcon: "prefixIcon", suffixIcon: "suffixIcon", suffix: "suffix", formControlName: "formControlName", validatorMessages: "validatorMessages", subscriptSizing: "subscriptSizing", hintLabel: "hintLabel" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
44
|
+
}
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseInput, decorators: [{
|
46
|
+
type: Directive
|
47
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
48
|
+
type: Optional
|
49
|
+
}, {
|
50
|
+
type: Inject,
|
51
|
+
args: [NGX_WIDGETS_VALIDATION_TRANSLATIONS]
|
52
|
+
}] }], propDecorators: { id: [{
|
53
|
+
type: Input
|
54
|
+
}], name: [{
|
55
|
+
type: Input
|
56
|
+
}], label: [{
|
57
|
+
type: Input
|
58
|
+
}], translateParams: [{
|
59
|
+
type: Input
|
60
|
+
}], placeholder: [{
|
61
|
+
type: Input
|
62
|
+
}], isDisabled: [{
|
63
|
+
type: Input
|
64
|
+
}], floatLabel: [{
|
65
|
+
type: Input
|
66
|
+
}], prefixIcon: [{
|
67
|
+
type: Input
|
68
|
+
}], suffixIcon: [{
|
69
|
+
type: Input
|
70
|
+
}], suffix: [{
|
71
|
+
type: Input
|
72
|
+
}], formControlName: [{
|
73
|
+
type: Input
|
74
|
+
}], validatorMessages: [{
|
75
|
+
type: Input
|
76
|
+
}], subscriptSizing: [{
|
77
|
+
type: Input
|
78
|
+
}], hintLabel: [{
|
79
|
+
type: Input
|
80
|
+
}] } });
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS1pbnB1dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC13aWRnZXRzL3NyYy9saWIvY29yZS9iYXNlLWlucHV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxTQUFTLEVBQUUsTUFBTSxFQUFVLGNBQWMsRUFDekMsS0FBSyxFQUNHLFFBQVEsR0FDakIsTUFBTSxlQUFlLENBQUM7QUFHdkIsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDMUQsT0FBTyxFQUFFLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxXQUFXLENBQUM7O0FBTTFDLE1BQU0sQ0FBQyxNQUFNLG1DQUFtQyxHQUFHLElBQUksY0FBYyxDQUFpQyxxQ0FBcUMsQ0FBQyxDQUFDO0FBRzdJLE1BQU0sT0FBTyxTQUFhLFNBQVEsaUJBQW9CO0lBa0JwRCxZQUF3RixzQkFBc0Q7UUFDNUksS0FBSyxFQUFFLENBQUM7UUFEOEUsMkJBQXNCLEdBQXRCLHNCQUFzQixDQUFnQztRQVg5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cbiAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Directive, Input, } from '@angular/core';
|
2
|
+
import { BaseInput } from './base-input';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export class BaseTextInput extends BaseInput {
|
5
|
+
constructor() {
|
6
|
+
super(...arguments);
|
7
|
+
this.type = 'text';
|
8
|
+
this.maxLength = 512;
|
9
|
+
}
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseTextInput, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
11
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: BaseTextInput, inputs: { type: "type", maxLength: "maxLength" }, usesInheritance: true, ngImport: i0 }); }
|
12
|
+
}
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseTextInput, decorators: [{
|
14
|
+
type: Directive
|
15
|
+
}], propDecorators: { type: [{
|
16
|
+
type: Input
|
17
|
+
}], maxLength: [{
|
18
|
+
type: Input
|
19
|
+
}] } });
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS10ZXh0LWlucHV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpZGdldHMvc3JjL2xpYi9jb3JlL2Jhc2UtdGV4dC1pbnB1dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULEtBQUssR0FDTixNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sY0FBYyxDQUFDOztBQUd6QyxNQUFNLE9BQU8sYUFBaUIsU0FBUSxTQUFZO0lBRGxEOztRQUdrQixTQUFJLEdBQXVELE1BQU0sQ0FBQztRQUNsRSxjQUFTLEdBQUksR0FBRyxDQUFDO0tBQ2xDOzhHQUpZLGFBQWE7a0dBQWIsYUFBYTs7MkZBQWIsYUFBYTtrQkFEekIsU0FBUzs4QkFHUSxJQUFJO3NCQUFuQixLQUFLO2dCQUNVLFNBQVM7c0JBQXhCLEtBQUsiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xyXG4gIERpcmVjdGl2ZSxcclxuICBJbnB1dCxcclxufSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuXHJcbmltcG9ydCB7IEJhc2VJbnB1dCB9IGZyb20gJy4vYmFzZS1pbnB1dCc7XHJcblxyXG5ARGlyZWN0aXZlKClcclxuZXhwb3J0IGNsYXNzIEJhc2VUZXh0SW5wdXQ8VD4gZXh0ZW5kcyBCYXNlSW5wdXQ8VD4ge1xyXG5cclxuICBASW5wdXQoKSBwdWJsaWMgdHlwZTogKCd0ZXh0JyB8ICdwYXNzd29yZCcgfCAnbnVtYmVyJyB8ICdlbWFpbCcgfCAndGVsJykgPSAndGV4dCc7XHJcbiAgQElucHV0KCkgcHVibGljIG1heExlbmd0aD8gPSA1MTI7XHJcbn1cclxuIl19
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { ChangeDetectorRef, Directive, inject, Injector, Input, ViewChild, } from '@angular/core';
|
2
|
+
import { FormControl, NgControl, } from '@angular/forms';
|
3
|
+
import { of, Subject } from 'rxjs';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export class BaseValueAccessor {
|
6
|
+
constructor() {
|
7
|
+
this.validator = of({});
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9
|
+
this.onChange = (value) => {
|
10
|
+
};
|
11
|
+
this.onTouched = () => {
|
12
|
+
};
|
13
|
+
this.injector = inject(Injector);
|
14
|
+
this.cdr = inject(ChangeDetectorRef);
|
15
|
+
this._defaultValidate = () => null;
|
16
|
+
this.destroy$ = new Subject();
|
17
|
+
this._validate = this._defaultValidate;
|
18
|
+
// Temporarily, AfterViewInit will handle the correct setting
|
19
|
+
this.control = new FormControl();
|
20
|
+
}
|
21
|
+
validate(control) {
|
22
|
+
control.setErrors({ ...control.errors, pending: true });
|
23
|
+
return this.validator;
|
24
|
+
}
|
25
|
+
ngAfterViewInit() {
|
26
|
+
this.controlDir = this.injector.get(NgControl);
|
27
|
+
this.control = this.controlDir.control;
|
28
|
+
// For ng-valid expression changed error workaround purposes
|
29
|
+
this.cdr.detectChanges();
|
30
|
+
}
|
31
|
+
writeValue(obj) {
|
32
|
+
this.valueAccessor?.writeValue(obj);
|
33
|
+
}
|
34
|
+
registerOnChange(fn) {
|
35
|
+
this.onChange = fn;
|
36
|
+
this.valueAccessor?.registerOnChange(fn);
|
37
|
+
}
|
38
|
+
registerOnTouched(fn) {
|
39
|
+
this.onTouched = fn;
|
40
|
+
this.valueAccessor?.registerOnTouched(fn);
|
41
|
+
}
|
42
|
+
get valueAccessor() {
|
43
|
+
return this.input ? this.input.valueAccessor : null;
|
44
|
+
}
|
45
|
+
ngOnDestroy() {
|
46
|
+
this.destroy$.next();
|
47
|
+
this.destroy$.complete();
|
48
|
+
}
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
50
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: BaseValueAccessor, inputs: { validator: "validator" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0 }); }
|
51
|
+
}
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BaseValueAccessor, decorators: [{
|
53
|
+
type: Directive
|
54
|
+
}], ctorParameters: () => [], propDecorators: { validator: [{
|
55
|
+
type: Input
|
56
|
+
}], inputElement: [{
|
57
|
+
type: ViewChild,
|
58
|
+
args: ['inputElement']
|
59
|
+
}], input: [{
|
60
|
+
type: ViewChild,
|
61
|
+
args: ['input']
|
62
|
+
}] } });
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS12YWx1ZS1hY2Nlc3Nvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC13aWRnZXRzL3NyYy9saWIvY29yZS9iYXNlLXZhbHVlLWFjY2Vzc29yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxpQkFBaUIsRUFBRSxTQUFTLEVBQ2hCLE1BQU0sRUFDbEIsUUFBUSxFQUFFLEtBQUssRUFDZixTQUFTLEdBQ1YsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUVpQixXQUFXLEVBQ2pDLFNBQVMsR0FHVixNQUFNLGdCQUFnQixDQUFDO0FBRXhCLE9BQU8sRUFBYSxFQUFFLEVBQUUsT0FBTyxFQUFDLE1BQU0sTUFBTSxDQUFDOztBQUc3QyxNQUFNLE9BQU8saUJBQWlCO0lBcUI1QjtRQW5CZ0IsY0FBUyxHQUFpQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFNakUsNkRBQTZEO1FBQ3JELGFBQVEsR0FBRyxDQUFDLEtBQVEsRUFBRSxFQUFFO1FBQ2hDLENBQUMsQ0FBQztRQUNNLGNBQVMsR0FBRyxHQUFHLEVBQUU7UUFDekIsQ0FBQyxDQUFDO1FBQ2UsYUFBUSxHQUFhLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUVwQyxRQUFHLEdBQXNCLE1BQU0sQ0FBQyxpQkFBaUIsQ0FB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mFsdWVBY2Nlc3Nvcj8ud3JpdGVWYWx1ZShvYmopO1xyXG4gIH1cclxuXHJcbiAgcmVnaXN0ZXJPbkNoYW5nZShmbjogKHZhbHVlOiBUKSA9PiB1bmtub3duKTogdm9pZCB7XHJcbiAgICB0aGlzLm9uQ2hhbmdlID0gZm47XHJcbiAgICB0aGlzLnZhbHVlQWNjZXNzb3I/LnJlZ2lzdGVyT25DaGFuZ2UoZm4pO1xyXG4gIH1cclxuXHJcbiAgcmVnaXN0ZXJPblRvdWNoZWQoZm46ICgpID0+IHVua25vd24pIHtcclxuICAgIHRoaXMub25Ub3VjaGVkID0gZm47XHJcbiAgICB0aGlzLnZhbHVlQWNjZXNzb3I/LnJlZ2lzdGVyT25Ub3VjaGVkKGZuKTtcclxuICB9XHJcblxyXG4gIHByb3RlY3RlZCBnZXQgdmFsdWVBY2Nlc3NvcigpOiBDb250cm9sVmFsdWVBY2Nlc3NvciB8IG51bGwge1xyXG4gICAgcmV0dXJuIHRoaXMuaW5wdXQgPyB0aGlzLmlucHV0LnZhbHVlQWNjZXNzb3IgOiBudWxsO1xyXG4gIH1cclxuXHJcbiAgbmdPbkRlc3Ryb3koKSB7XHJcbiAgICB0aGlzLmRlc3Ryb3kkLm5leHQoKTtcclxuICAgIHRoaXMuZGVzdHJveSQuY29tcGxldGUoKTtcclxuICB9XHJcbn1cclxuIl19
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { isDevMode } from '@angular/core';
|
2
|
+
import { Observable, Subject, takeUntil } from 'rxjs';
|
3
|
+
import { SafeSubscriber } from 'rxjs/internal/Subscriber';
|
4
|
+
/**
|
5
|
+
* Automatically unsubscribe from an Observable when the view is destroyed
|
6
|
+
* Tested with checking the "complete" event of a subscribe method
|
7
|
+
* @description
|
8
|
+
* An Annotation that should be used with an Observable typed variable to handle its subscriptions
|
9
|
+
* @author gergo.asztalos
|
10
|
+
*/
|
11
|
+
export function UnsubscribeOnDestroy() {
|
12
|
+
return function (target, propertyKey) {
|
13
|
+
const ngOnDestroy = target.ngOnDestroy;
|
14
|
+
const secretKey = `_${propertyKey}$`;
|
15
|
+
// Probably with function we could use own context
|
16
|
+
const destroyKey = (_this) => _this.hasOwnProperty('destroy$') ? 'destroy$' : `${_this.constructor.name}_destroy$`;
|
17
|
+
Object.defineProperty(target, secretKey, { enumerable: false, writable: true });
|
18
|
+
Object.defineProperty(target, propertyKey, {
|
19
|
+
configurable: true,
|
20
|
+
enumerable: true,
|
21
|
+
get: function () {
|
22
|
+
return this[secretKey];
|
23
|
+
},
|
24
|
+
set: function (newValue) {
|
25
|
+
if (!this[destroyKey(this)]) {
|
26
|
+
this[destroyKey(this)] = new Subject();
|
27
|
+
}
|
28
|
+
if (newValue instanceof Observable) {
|
29
|
+
this[secretKey] = newValue.pipe(takeUntil(this[destroyKey(this)]));
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
this[secretKey] = newValue;
|
33
|
+
}
|
34
|
+
},
|
35
|
+
});
|
36
|
+
target.ngOnDestroy = function () {
|
37
|
+
if (this[propertyKey] instanceof SafeSubscriber) {
|
38
|
+
this[propertyKey].unsubscribe();
|
39
|
+
this[secretKey].unsubscribe();
|
40
|
+
}
|
41
|
+
else if (this.hasOwnProperty(destroyKey(this))) {
|
42
|
+
this[destroyKey(this)].next();
|
43
|
+
this[destroyKey(this)].complete();
|
44
|
+
}
|
45
|
+
delete this[secretKey];
|
46
|
+
if (isDevMode()) {
|
47
|
+
// eslint-disable-next-line no-console,max-len
|
48
|
+
console.debug(`<UnsubscribeOnDestroy> - Observable/Subscription <${propertyKey}> completed in class: ${this.constructor.name}`);
|
49
|
+
}
|
50
|
+
ngOnDestroy && ngOnDestroy.call(this);
|
51
|
+
};
|
52
|
+
};
|
53
|
+
}
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LXVuc3Vic2NyaWJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4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cmlwdGlvbiA8JHs8c3RyaW5nPnByb3BlcnR5S2V5fT4gY29tcGxldGVkIGluIGNsYXNzOiAke3RoaXMuY29uc3RydWN0b3IubmFtZX1gKTtcbiAgICAgIH1cbiAgICAgIG5nT25EZXN0cm95ICYmIG5nT25EZXN0cm95LmNhbGwodGhpcyk7XG4gICAgfTtcbiAgfTtcbn1cbiJdfQ==
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Component, forwardRef, Input, ViewChildren, ViewEncapsulation, } from '@angular/core';
|
2
|
+
import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
3
|
+
import { MatInputModule } from '@angular/material/input';
|
4
|
+
import { MatSelectModule } from '@angular/material/select';
|
5
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
6
|
+
import { BaseInput } from '../core/base-input';
|
7
|
+
import { isEqual } from 'lodash-es';
|
8
|
+
import { takeUntil } from 'rxjs/operators';
|
9
|
+
import * as i0 from "@angular/core";
|
10
|
+
import * as i1 from "@angular/material/form-field";
|
11
|
+
import * as i2 from "@angular/material/select";
|
12
|
+
import * as i3 from "@angular/material/core";
|
13
|
+
import * as i4 from "@angular/forms";
|
14
|
+
export class SelectComponent extends BaseInput {
|
15
|
+
constructor() {
|
16
|
+
super(...arguments);
|
17
|
+
/**
|
18
|
+
* Angular Material - Select component comparsion is only '===', does not work with Array values
|
19
|
+
* https://github.com/angular/components/blob/a07c0758a5ec2eb4de1bb822354be08178c66aa4/src/lib/select/select.ts#L242C48-L242C58
|
20
|
+
*/
|
21
|
+
this._isEqual = isEqual;
|
22
|
+
}
|
23
|
+
ngOnInit() {
|
24
|
+
this.placeholder = !this.placeholder ? (this.validationTranslations.selectGlobalPlaceholder || this.label) : this.placeholder;
|
25
|
+
super.ngOnInit();
|
26
|
+
this.id = this.id || this.formControlName || this.name;
|
27
|
+
if (this.asyncOptions) {
|
28
|
+
this.asyncOptions.pipe(takeUntil(this.destroy$)).subscribe((resp) => {
|
29
|
+
this.options = resp;
|
30
|
+
this.cdr.detectChanges();
|
31
|
+
});
|
32
|
+
}
|
33
|
+
}
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: SelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
35
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: SelectComponent, isStandalone: true, selector: "gerandon-select", inputs: { emptyOptionLabel: "emptyOptionLabel", multiple: "multiple", options: "options", asyncOptions: "asyncOptions" }, providers: [
|
36
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
37
|
+
], viewQueries: [{ propertyName: "optionElements", predicate: ["optionElements"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label>{{ label }}</mat-label>\r\n }\r\n <mat-select #inputElement\r\n #input=\"ngForm\"\r\n [multiple]=\"multiple\"\r\n [placeholder]=\"!floatLabel ? label : placeholder\"\r\n [formControl]=\"control\"\r\n [id]=\"id\"\r\n [class.input-disabled]=\"isDisabled || control.disabled\"\r\n [compareWith]=\"_isEqual\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\">\r\n @if (emptyOptionLabel) {\r\n <mat-option (click)=\"control.reset()\">\r\n {{ emptyOptionLabel }}\r\n </mat-option>\r\n }\r\n @for(option of options; track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n @if (suffix) {\r\n <span matSuffix>{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n</mat-form-field>\r\n", styles: ["gerandon-select mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTooltipModule }], encapsulation: i0.ViewEncapsulation.None }); }
|
38
|
+
}
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: SelectComponent, decorators: [{
|
40
|
+
type: Component,
|
41
|
+
args: [{ selector: 'gerandon-select', encapsulation: ViewEncapsulation.None, standalone: true, providers: [
|
42
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
43
|
+
], imports: [
|
44
|
+
MatInputModule,
|
45
|
+
MatSelectModule,
|
46
|
+
ReactiveFormsModule,
|
47
|
+
MatTooltipModule,
|
48
|
+
], template: "<mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label>{{ label }}</mat-label>\r\n }\r\n <mat-select #inputElement\r\n #input=\"ngForm\"\r\n [multiple]=\"multiple\"\r\n [placeholder]=\"!floatLabel ? label : placeholder\"\r\n [formControl]=\"control\"\r\n [id]=\"id\"\r\n [class.input-disabled]=\"isDisabled || control.disabled\"\r\n [compareWith]=\"_isEqual\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\">\r\n @if (emptyOptionLabel) {\r\n <mat-option (click)=\"control.reset()\">\r\n {{ emptyOptionLabel }}\r\n </mat-option>\r\n }\r\n @for(option of options; track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n @if (suffix) {\r\n <span matSuffix>{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n</mat-form-field>\r\n", styles: ["gerandon-select mat-form-field{width:100%}\n"] }]
|
49
|
+
}], propDecorators: { emptyOptionLabel: [{
|
50
|
+
type: Input
|
51
|
+
}], multiple: [{
|
52
|
+
type: Input
|
53
|
+
}], options: [{
|
54
|
+
type: Input
|
55
|
+
}], asyncOptions: [{
|
56
|
+
type: Input
|
57
|
+
}], optionElements: [{
|
58
|
+
type: ViewChildren,
|
59
|
+
args: ['option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c2xhdGlvbnMucmVxdWlyZWQgfX08L21hdC1lcnJvcj5cclxuICAgIH0gQGVsc2Uge1xyXG4gICAgICBAZm9yIChlcnJvciBvZiB2YWxpZGF0b3JNZXNzYWdlc0FycmF5OyB0cmFjayBlcnJvcikge1xyXG4gICAgICAgIDxtYXQtZXJyb3I+e3sgZXJyb3IudmFsdWUgfX08L21hdC1lcnJvcj5cclxuICAgICAgfVxyXG4gICAgfVxyXG4gIH1cclxuPC9tYXQtZm9ybS1maWVsZD5cclxuIl19
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Component, forwardRef, Input, ViewEncapsulation } from '@angular/core';
|
2
|
+
import { FormsModule, NG_ASYNC_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
6
|
+
import { BaseTextInput } from "../core/base-text-input";
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "@angular/forms";
|
9
|
+
import * as i2 from "@angular/material/form-field";
|
10
|
+
import * as i3 from "@angular/material/icon";
|
11
|
+
import * as i4 from "@angular/material/input";
|
12
|
+
import * as i5 from "@angular/cdk/text-field";
|
13
|
+
export class TextareaInputComponent extends BaseTextInput {
|
14
|
+
constructor() {
|
15
|
+
super(...arguments);
|
16
|
+
this.rows = 10;
|
17
|
+
}
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: TextareaInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: TextareaInputComponent, isStandalone: true, selector: "gerandon-textarea-input", inputs: { rows: "rows" }, providers: [
|
20
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
21
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
22
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"textarea-input cva-input\">\r\n <mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{ label }}</mat-label>\r\n }\r\n <textarea\r\n [id]=\"id\"\r\n #inputElement\r\n #input=\"ngForm\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n matInput\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"rows\"\r\n class=\"w-100 cva-control\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\"\r\n [readonly]=\"isDisabled\"\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"control\"\r\n [maxLength]=\"maxLength\"\r\n [name]=\"name\">\r\n </textarea>\r\n <span class=\"counter\">{{control.value?.length || 0}} / {{ maxLength }}</span>\r\n @if (prefixIcon) {\r\n <mat-icon matPrefix color=\"accent\">\r\n {{prefixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffixIcon) {\r\n <mat-icon matSuffix color=\"accent\">\r\n {{suffixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffix) {\r\n <span matSuffix>{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n </mat-form-field>\r\n</div>\r\n", styles: ["gerandon-textarea-input{display:block}gerandon-textarea-input .counter{right:20px;bottom:0;position:absolute;font-size:10px}gerandon-textarea-input .textarea-input .disabled{color:#ced4da}gerandon-textarea-input .textarea-input mat-form-field{width:100%}gerandon-textarea-input .textarea-input mat-form-field textarea{padding-top:10px}gerandon-textarea-input .textarea-input mat-form-field textarea::placeholder{color:#adb5bd;font-style:italic}gerandon-textarea-input .textarea-input mat-form-field textarea:disabled{cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
23
|
+
}
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: TextareaInputComponent, decorators: [{
|
25
|
+
type: Component,
|
26
|
+
args: [{ selector: 'gerandon-textarea-input', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
27
|
+
FormsModule,
|
28
|
+
MatFormFieldModule,
|
29
|
+
MatIconModule,
|
30
|
+
MatInputModule,
|
31
|
+
ReactiveFormsModule,
|
32
|
+
], providers: [
|
33
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
34
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
35
|
+
], template: "<div class=\"textarea-input cva-input\">\r\n <mat-form-field appearance=\"outline\" [subscriptSizing]=\"subscriptSizing\" [floatLabel]=\"floatLabel\">\r\n @if (label) {\r\n <mat-label [class.disabled]=\"isDisabled\">{{ label }}</mat-label>\r\n }\r\n <textarea\r\n [id]=\"id\"\r\n #inputElement\r\n #input=\"ngForm\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n matInput\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"rows\"\r\n class=\"w-100 cva-control\"\r\n [attr.disabled]=\"isDisabled || control.disabled ? '' : null\"\r\n [readonly]=\"isDisabled\"\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"control\"\r\n [maxLength]=\"maxLength\"\r\n [name]=\"name\">\r\n </textarea>\r\n <span class=\"counter\">{{control.value?.length || 0}} / {{ maxLength }}</span>\r\n @if (prefixIcon) {\r\n <mat-icon matPrefix color=\"accent\">\r\n {{prefixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffixIcon) {\r\n <mat-icon matSuffix color=\"accent\">\r\n {{suffixIcon}}\r\n </mat-icon>\r\n }\r\n @if (suffix) {\r\n <span matSuffix>{{suffix}}</span>\r\n }\r\n @if (control.errors?.['server']) {\r\n <mat-error>{{ control.errors?.['server'] }}</mat-error>\r\n } @else if (control.errors?.['required']) {\r\n @if (validationTranslations.required) {\r\n <mat-error>{{ validationTranslations.required }}</mat-error>\r\n } @else {\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n }\r\n </mat-form-field>\r\n</div>\r\n", styles: ["gerandon-textarea-input{display:block}gerandon-textarea-input .counter{right:20px;bottom:0;position:absolute;font-size:10px}gerandon-textarea-input .textarea-input .disabled{color:#ced4da}gerandon-textarea-input .textarea-input mat-form-field{width:100%}gerandon-textarea-input .textarea-input mat-form-field textarea{padding-top:10px}gerandon-textarea-input .textarea-input mat-form-field textarea::placeholder{color:#adb5bd;font-style:italic}gerandon-textarea-input .textarea-input mat-form-field textarea:disabled{cursor:not-allowed}\n"] }]
|
36
|
+
}], propDecorators: { rows: [{
|
37
|
+
type: Input
|
38
|
+
}] } });
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtaW5wdXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXdpZGdldHMvc3JjL2xpYi90ZXh0YXJlYS1pbnB1dC90ZXh0YXJlYS1pbnB1dC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtd2lkZ2V0cy9zcmMvbGliL3RleHRhcmVhLWlucHV0L3RleHRhcmVhLWlucHV0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUF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