@gerandon/ngx-widgets 17.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +24 -0
- 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/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 +56 -0
- package/public-api.d.ts +8 -0
@@ -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: "17.3.7", ngImport: i0, type: TextareaInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.7", 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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: "17.3.7", 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtaW5wdXQuY29tcG9uZW50LmpzIiw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3IpIHtcclxuICAgICAgICA8bWF0LWVycm9yPnt7IGVycm9yLnZhbHVlIH19PC9tYXQtZXJyb3I+XHJcbiAgICAgIH1cclxuICAgIH1cclxuICA8L21hdC1mb3JtLWZpZWxkPlxyXG48L2Rpdj5cclxuIl19
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/*
|
2
|
+
* Public API Surface of ngx-widgets
|
3
|
+
*/
|
4
|
+
export * from './lib/core/base-value-accessor';
|
5
|
+
export * from './lib/core/base-input';
|
6
|
+
export * from './lib/core/base-text-input';
|
7
|
+
export * from './lib/core/component-unsubscribe';
|
8
|
+
export * from './lib/basic-input/basic-input.component';
|
9
|
+
export * from './lib/select/select.component';
|
10
|
+
export * from './lib/textarea-input/textarea-input.component';
|
11
|
+
export * from './lib/basic-chips/basic-chips.component';
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC13aWRnZXRzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyxrQ0FBa0MsQ0FBQztBQUVqRCxjQUFjLHlDQUF5QyxDQUFDO0FBQ3hELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYywrQ0FBK0MsQ0FBQztBQUM5RCxjQUFjLHlDQUF5QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBuZ3gtd2lkZ2V0c1xuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvcmUvYmFzZS12YWx1ZS1hY2Nlc3Nvcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2Jhc2UtaW5wdXQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS9iYXNlLXRleHQtaW5wdXQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS9jb21wb25lbnQtdW5zdWJzY3JpYmUnO1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9iYXNpYy1pbnB1dC9iYXNpYy1pbnB1dC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VsZWN0L3NlbGVjdC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdGV4dGFyZWEtaW5wdXQvdGV4dGFyZWEtaW5wdXQuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2Jhc2ljLWNoaXBzL2Jhc2ljLWNoaXBzLmNvbXBvbmVudCc7XG4iXX0=
|
@@ -0,0 +1,409 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, Injector, ChangeDetectorRef, Directive, Input, ViewChild, InjectionToken, Optional, Inject, isDevMode, EventEmitter, forwardRef, Component, ViewEncapsulation, Output, ViewChildren } from '@angular/core';
|
3
|
+
import * as i1 from '@angular/forms';
|
4
|
+
import { FormControl, NgControl, NG_VALUE_ACCESSOR, NG_ASYNC_VALIDATORS, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
5
|
+
import { of, Subject, Observable, takeUntil } from 'rxjs';
|
6
|
+
import { isEmpty, keys, isEqual } from 'lodash-es';
|
7
|
+
import { SafeSubscriber } from 'rxjs/internal/Subscriber';
|
8
|
+
import * as i3 from '@angular/material/form-field';
|
9
|
+
import { MatFormFieldModule, MatFormField, MatLabel, MatError } from '@angular/material/form-field';
|
10
|
+
import * as i2 from '@angular/material/icon';
|
11
|
+
import { MatIconModule } from '@angular/material/icon';
|
12
|
+
import * as i4 from '@angular/material/input';
|
13
|
+
import { MatInputModule, MatInput } from '@angular/material/input';
|
14
|
+
import * as i2$1 from '@angular/material/select';
|
15
|
+
import { MatSelectModule } from '@angular/material/select';
|
16
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
17
|
+
import { takeUntil as takeUntil$1 } from 'rxjs/operators';
|
18
|
+
import * as i3$1 from '@angular/material/core';
|
19
|
+
import * as i5 from '@angular/cdk/text-field';
|
20
|
+
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
21
|
+
import { AsyncPipe, JsonPipe } from '@angular/common';
|
22
|
+
import * as i4$1 from '@angular/material/autocomplete';
|
23
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
24
|
+
import * as i1$1 from '@angular/material/chips';
|
25
|
+
import { MatChipsModule } from '@angular/material/chips';
|
26
|
+
|
27
|
+
class BaseValueAccessor {
|
28
|
+
constructor() {
|
29
|
+
this.validator = of({});
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
31
|
+
this.onChange = (value) => {
|
32
|
+
};
|
33
|
+
this.onTouched = () => {
|
34
|
+
};
|
35
|
+
this.injector = inject(Injector);
|
36
|
+
this.cdr = inject(ChangeDetectorRef);
|
37
|
+
this._defaultValidate = () => null;
|
38
|
+
this.destroy$ = new Subject();
|
39
|
+
this._validate = this._defaultValidate;
|
40
|
+
// Temporarily, AfterViewInit will handle the correct setting
|
41
|
+
this.control = new FormControl();
|
42
|
+
}
|
43
|
+
validate(control) {
|
44
|
+
control.setErrors({ ...control.errors, pending: true });
|
45
|
+
return this.validator;
|
46
|
+
}
|
47
|
+
ngAfterViewInit() {
|
48
|
+
this.controlDir = this.injector.get(NgControl);
|
49
|
+
this.control = this.controlDir.control;
|
50
|
+
// For ng-valid expression changed error workaround purposes
|
51
|
+
this.cdr.detectChanges();
|
52
|
+
}
|
53
|
+
writeValue(obj) {
|
54
|
+
this.valueAccessor?.writeValue(obj);
|
55
|
+
}
|
56
|
+
registerOnChange(fn) {
|
57
|
+
this.onChange = fn;
|
58
|
+
this.valueAccessor?.registerOnChange(fn);
|
59
|
+
}
|
60
|
+
registerOnTouched(fn) {
|
61
|
+
this.onTouched = fn;
|
62
|
+
this.valueAccessor?.registerOnTouched(fn);
|
63
|
+
}
|
64
|
+
get valueAccessor() {
|
65
|
+
return this.input ? this.input.valueAccessor : null;
|
66
|
+
}
|
67
|
+
ngOnDestroy() {
|
68
|
+
this.destroy$.next();
|
69
|
+
this.destroy$.complete();
|
70
|
+
}
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
72
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", type: BaseValueAccessor, inputs: { validator: "validator" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0 }); }
|
73
|
+
}
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseValueAccessor, decorators: [{
|
75
|
+
type: Directive
|
76
|
+
}], ctorParameters: () => [], propDecorators: { validator: [{
|
77
|
+
type: Input
|
78
|
+
}], inputElement: [{
|
79
|
+
type: ViewChild,
|
80
|
+
args: ['inputElement']
|
81
|
+
}], input: [{
|
82
|
+
type: ViewChild,
|
83
|
+
args: ['input']
|
84
|
+
}] } });
|
85
|
+
|
86
|
+
const NGX_WIDGETS_VALIDATION_TRANSLATIONS = new InjectionToken('NGX_WIDGETS_VALIDATION_TRANSLATIONS');
|
87
|
+
class BaseInput extends BaseValueAccessor {
|
88
|
+
constructor(validationTranslations) {
|
89
|
+
super();
|
90
|
+
this.validationTranslations = validationTranslations;
|
91
|
+
this.isDisabled = false;
|
92
|
+
this.floatLabel = 'auto';
|
93
|
+
this.subscriptSizing = 'fixed';
|
94
|
+
this.hintLabel = '';
|
95
|
+
this.validatorMessagesArray = [];
|
96
|
+
}
|
97
|
+
ngOnInit() {
|
98
|
+
this.placeholder = this.placeholder === undefined ? this.label : this.placeholder;
|
99
|
+
if (!this.name) {
|
100
|
+
this.name = this.formControlName;
|
101
|
+
/*
|
102
|
+
console.warn(`name attribute is not defined for ${this.formControlName}! Please beware, that using this control multiple
|
103
|
+
times with the same control name could result in wrong focus, clicking on the label!`);
|
104
|
+
*/
|
105
|
+
}
|
106
|
+
// *ngIf seems like does not re-render component when label is used with dynamic value (e.g.: translate pipe). Strange
|
107
|
+
this.label = this.label || ' ';
|
108
|
+
}
|
109
|
+
ngOnChanges(changes) {
|
110
|
+
if (changes['validatorMessages']) {
|
111
|
+
if (!isEmpty(this.validatorMessages)) {
|
112
|
+
this.validatorMessagesArray = keys(this.validatorMessages).map((key) => ({
|
113
|
+
key,
|
114
|
+
value: this.validatorMessages[key],
|
115
|
+
}));
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
ngAfterViewInit() {
|
120
|
+
super.ngAfterViewInit();
|
121
|
+
this.cdr.detectChanges();
|
122
|
+
}
|
123
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseInput, deps: [{ token: NGX_WIDGETS_VALIDATION_TRANSLATIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
124
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", 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 }); }
|
125
|
+
}
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseInput, decorators: [{
|
127
|
+
type: Directive
|
128
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
129
|
+
type: Optional
|
130
|
+
}, {
|
131
|
+
type: Inject,
|
132
|
+
args: [NGX_WIDGETS_VALIDATION_TRANSLATIONS]
|
133
|
+
}] }], propDecorators: { id: [{
|
134
|
+
type: Input
|
135
|
+
}], name: [{
|
136
|
+
type: Input
|
137
|
+
}], label: [{
|
138
|
+
type: Input
|
139
|
+
}], translateParams: [{
|
140
|
+
type: Input
|
141
|
+
}], placeholder: [{
|
142
|
+
type: Input
|
143
|
+
}], isDisabled: [{
|
144
|
+
type: Input
|
145
|
+
}], floatLabel: [{
|
146
|
+
type: Input
|
147
|
+
}], prefixIcon: [{
|
148
|
+
type: Input
|
149
|
+
}], suffixIcon: [{
|
150
|
+
type: Input
|
151
|
+
}], suffix: [{
|
152
|
+
type: Input
|
153
|
+
}], formControlName: [{
|
154
|
+
type: Input
|
155
|
+
}], validatorMessages: [{
|
156
|
+
type: Input
|
157
|
+
}], subscriptSizing: [{
|
158
|
+
type: Input
|
159
|
+
}], hintLabel: [{
|
160
|
+
type: Input
|
161
|
+
}] } });
|
162
|
+
|
163
|
+
class BaseTextInput extends BaseInput {
|
164
|
+
constructor() {
|
165
|
+
super(...arguments);
|
166
|
+
this.type = 'text';
|
167
|
+
this.maxLength = 512;
|
168
|
+
}
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseTextInput, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
170
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", type: BaseTextInput, inputs: { type: "type", maxLength: "maxLength" }, usesInheritance: true, ngImport: i0 }); }
|
171
|
+
}
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BaseTextInput, decorators: [{
|
173
|
+
type: Directive
|
174
|
+
}], propDecorators: { type: [{
|
175
|
+
type: Input
|
176
|
+
}], maxLength: [{
|
177
|
+
type: Input
|
178
|
+
}] } });
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Automatically unsubscribe from an Observable when the view is destroyed
|
182
|
+
* Tested with checking the "complete" event of a subscribe method
|
183
|
+
* @description
|
184
|
+
* An Annotation that should be used with an Observable typed variable to handle its subscriptions
|
185
|
+
* @author gergo.asztalos
|
186
|
+
*/
|
187
|
+
function UnsubscribeOnDestroy() {
|
188
|
+
return function (target, propertyKey) {
|
189
|
+
const ngOnDestroy = target.ngOnDestroy;
|
190
|
+
const secretKey = `_${propertyKey}$`;
|
191
|
+
// Probably with function we could use own context
|
192
|
+
const destroyKey = (_this) => _this.hasOwnProperty('destroy$') ? 'destroy$' : `${_this.constructor.name}_destroy$`;
|
193
|
+
Object.defineProperty(target, secretKey, { enumerable: false, writable: true });
|
194
|
+
Object.defineProperty(target, propertyKey, {
|
195
|
+
configurable: true,
|
196
|
+
enumerable: true,
|
197
|
+
get: function () {
|
198
|
+
return this[secretKey];
|
199
|
+
},
|
200
|
+
set: function (newValue) {
|
201
|
+
if (!this[destroyKey(this)]) {
|
202
|
+
this[destroyKey(this)] = new Subject();
|
203
|
+
}
|
204
|
+
if (newValue instanceof Observable) {
|
205
|
+
this[secretKey] = newValue.pipe(takeUntil(this[destroyKey(this)]));
|
206
|
+
}
|
207
|
+
else {
|
208
|
+
this[secretKey] = newValue;
|
209
|
+
}
|
210
|
+
},
|
211
|
+
});
|
212
|
+
target.ngOnDestroy = function () {
|
213
|
+
if (this[propertyKey] instanceof SafeSubscriber) {
|
214
|
+
this[propertyKey].unsubscribe();
|
215
|
+
this[secretKey].unsubscribe();
|
216
|
+
}
|
217
|
+
else if (this.hasOwnProperty(destroyKey(this))) {
|
218
|
+
this[destroyKey(this)].next();
|
219
|
+
this[destroyKey(this)].complete();
|
220
|
+
}
|
221
|
+
delete this[secretKey];
|
222
|
+
if (isDevMode()) {
|
223
|
+
// eslint-disable-next-line no-console,max-len
|
224
|
+
console.debug(`<UnsubscribeOnDestroy> - Observable/Subscription <${propertyKey}> completed in class: ${this.constructor.name}`);
|
225
|
+
}
|
226
|
+
ngOnDestroy && ngOnDestroy.call(this);
|
227
|
+
};
|
228
|
+
};
|
229
|
+
}
|
230
|
+
|
231
|
+
class BasicInputComponent extends BaseTextInput {
|
232
|
+
constructor() {
|
233
|
+
super(...arguments);
|
234
|
+
this.iconClick = new EventEmitter();
|
235
|
+
}
|
236
|
+
ngOnInit() {
|
237
|
+
super.ngOnInit();
|
238
|
+
this.id = this.id || this.name;
|
239
|
+
}
|
240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BasicInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
241
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.7", type: BasicInputComponent, isStandalone: true, selector: "gerandon-basic-input", outputs: { iconClick: "iconClick" }, providers: [
|
242
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
243
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
244
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\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 </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 }); }
|
245
|
+
}
|
246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BasicInputComponent, decorators: [{
|
247
|
+
type: Component,
|
248
|
+
args: [{ selector: 'gerandon-basic-input', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
249
|
+
ReactiveFormsModule,
|
250
|
+
MatIconModule,
|
251
|
+
MatFormFieldModule,
|
252
|
+
MatInputModule,
|
253
|
+
], providers: [
|
254
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
255
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => BasicInputComponent), multi: true },
|
256
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\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 </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"] }]
|
257
|
+
}], propDecorators: { iconClick: [{
|
258
|
+
type: Output
|
259
|
+
}] } });
|
260
|
+
|
261
|
+
class SelectComponent extends BaseInput {
|
262
|
+
constructor() {
|
263
|
+
super(...arguments);
|
264
|
+
/**
|
265
|
+
* Angular Material - Select component comparsion is only '===', does not work with Array values
|
266
|
+
* https://github.com/angular/components/blob/a07c0758a5ec2eb4de1bb822354be08178c66aa4/src/lib/select/select.ts#L242C48-L242C58
|
267
|
+
*/
|
268
|
+
this._isEqual = isEqual;
|
269
|
+
}
|
270
|
+
ngOnInit() {
|
271
|
+
this.placeholder = !this.placeholder ? (this.validationTranslations.selectGlobalPlaceholder || this.label) : this.placeholder;
|
272
|
+
super.ngOnInit();
|
273
|
+
this.id = this.id || this.formControlName || this.name;
|
274
|
+
if (this.asyncOptions) {
|
275
|
+
this.asyncOptions.pipe(takeUntil$1(this.destroy$)).subscribe((resp) => {
|
276
|
+
this.options = resp;
|
277
|
+
this.cdr.detectChanges();
|
278
|
+
});
|
279
|
+
}
|
280
|
+
}
|
281
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
282
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.7", type: SelectComponent, isStandalone: true, selector: "gerandon-select", inputs: { emptyOptionLabel: "emptyOptionLabel", multiple: "multiple", options: "options", asyncOptions: "asyncOptions" }, providers: [
|
283
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
284
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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: 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.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$1.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$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTooltipModule }], encapsulation: i0.ViewEncapsulation.None }); }
|
285
|
+
}
|
286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SelectComponent, decorators: [{
|
287
|
+
type: Component,
|
288
|
+
args: [{ selector: 'gerandon-select', encapsulation: ViewEncapsulation.None, standalone: true, providers: [
|
289
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
290
|
+
], imports: [
|
291
|
+
MatInputModule,
|
292
|
+
MatSelectModule,
|
293
|
+
ReactiveFormsModule,
|
294
|
+
MatTooltipModule,
|
295
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\r\n }\r\n }\r\n</mat-form-field>\r\n", styles: ["gerandon-select mat-form-field{width:100%}\n"] }]
|
296
|
+
}], propDecorators: { emptyOptionLabel: [{
|
297
|
+
type: Input
|
298
|
+
}], multiple: [{
|
299
|
+
type: Input
|
300
|
+
}], options: [{
|
301
|
+
type: Input
|
302
|
+
}], asyncOptions: [{
|
303
|
+
type: Input
|
304
|
+
}], optionElements: [{
|
305
|
+
type: ViewChildren,
|
306
|
+
args: ['optionElements']
|
307
|
+
}] } });
|
308
|
+
|
309
|
+
class TextareaInputComponent extends BaseTextInput {
|
310
|
+
constructor() {
|
311
|
+
super(...arguments);
|
312
|
+
this.rows = 10;
|
313
|
+
}
|
314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TextareaInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
315
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.7", type: TextareaInputComponent, isStandalone: true, selector: "gerandon-textarea-input", inputs: { rows: "rows" }, providers: [
|
316
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
317
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
318
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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: 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: MatIconModule }, { kind: "component", type: i2.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 }); }
|
319
|
+
}
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TextareaInputComponent, decorators: [{
|
321
|
+
type: Component,
|
322
|
+
args: [{ selector: 'gerandon-textarea-input', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
323
|
+
FormsModule,
|
324
|
+
MatFormFieldModule,
|
325
|
+
MatIconModule,
|
326
|
+
MatInputModule,
|
327
|
+
ReactiveFormsModule,
|
328
|
+
], providers: [
|
329
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
330
|
+
{ provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => TextareaInputComponent), multi: true },
|
331
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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"] }]
|
332
|
+
}], propDecorators: { rows: [{
|
333
|
+
type: Input
|
334
|
+
}] } });
|
335
|
+
|
336
|
+
class BasicChipsComponent extends BaseInput {
|
337
|
+
constructor() {
|
338
|
+
super(...arguments);
|
339
|
+
this.separatorKeysCodes = [ENTER, COMMA];
|
340
|
+
}
|
341
|
+
remove(item) {
|
342
|
+
const values = this.control.value;
|
343
|
+
const index = values.indexOf(item);
|
344
|
+
if (index >= 0) {
|
345
|
+
values.splice(index, 1);
|
346
|
+
this.control.setValue(values);
|
347
|
+
}
|
348
|
+
this.mark();
|
349
|
+
}
|
350
|
+
add(event) {
|
351
|
+
const value = (event.value || '').trim();
|
352
|
+
if (value) {
|
353
|
+
this.updateValue(value);
|
354
|
+
}
|
355
|
+
event.chipInput.clear();
|
356
|
+
this.mark();
|
357
|
+
}
|
358
|
+
selected(event) {
|
359
|
+
if (!this.control.value?.includes(event.option.value)) {
|
360
|
+
this.updateValue(event.option.value);
|
361
|
+
}
|
362
|
+
this.inputElement.nativeElement.value = '';
|
363
|
+
this.mark();
|
364
|
+
}
|
365
|
+
updateValue(value) {
|
366
|
+
this.control.setValue([
|
367
|
+
...(this.control.value || []),
|
368
|
+
value,
|
369
|
+
]);
|
370
|
+
}
|
371
|
+
mark() {
|
372
|
+
if (!this.control.touched) {
|
373
|
+
this.control.markAsTouched();
|
374
|
+
this.control.markAsDirty();
|
375
|
+
}
|
376
|
+
}
|
377
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BasicChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
378
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.7", 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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$1.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$1.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: 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i4$1.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: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i4$1.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 }); }
|
379
|
+
}
|
380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: BasicChipsComponent, decorators: [{
|
381
|
+
type: Component,
|
382
|
+
args: [{ selector: 'gerandon-basic-chips', standalone: true, encapsulation: ViewEncapsulation.None, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BasicChipsComponent), multi: true }], imports: [
|
383
|
+
MatChipsModule,
|
384
|
+
MatIconModule,
|
385
|
+
ReactiveFormsModule,
|
386
|
+
MatAutocompleteModule,
|
387
|
+
AsyncPipe,
|
388
|
+
JsonPipe,
|
389
|
+
MatFormField,
|
390
|
+
MatInput,
|
391
|
+
MatLabel,
|
392
|
+
MatError,
|
393
|
+
], 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 <mat-error>{{ validationTranslations.required }}</mat-error>\r\n @for (error of validatorMessagesArray; track error) {\r\n <mat-error>{{ error.value }}</mat-error>\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"] }]
|
394
|
+
}], propDecorators: { asyncOptions: [{
|
395
|
+
type: Input
|
396
|
+
}], labelProperty: [{
|
397
|
+
type: Input
|
398
|
+
}] } });
|
399
|
+
|
400
|
+
/*
|
401
|
+
* Public API Surface of ngx-widgets
|
402
|
+
*/
|
403
|
+
|
404
|
+
/**
|
405
|
+
* Generated bundle index. Do not edit.
|
406
|
+
*/
|
407
|
+
|
408
|
+
export { BaseInput, BaseTextInput, BaseValueAccessor, BasicChipsComponent, BasicInputComponent, NGX_WIDGETS_VALIDATION_TRANSLATIONS, SelectComponent, TextareaInputComponent, UnsubscribeOnDestroy };
|
409
|
+
//# sourceMappingURL=gerandon-ngx-widgets.mjs.map
|