@smallpearl/ngx-helper 0.29.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -0
- package/core/index.d.ts +2 -0
- package/core/src/ngx-helper.d.ts +7 -0
- package/core/src/version.d.ts +1 -0
- package/entity-field/index.d.ts +2 -0
- package/entity-field/src/entity-field-spec.d.ts +69 -0
- package/entity-field/src/provider.d.ts +27 -0
- package/fesm2022/smallpearl-ngx-helper-core.mjs +23 -0
- package/fesm2022/smallpearl-ngx-helper-core.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +112 -0
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-forms.mjs +112 -0
- package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +108 -0
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-locale.mjs +296 -0
- package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +504 -0
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +184 -0
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +1486 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +800 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +328 -0
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +468 -0
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +854 -0
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +930 -0
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +926 -0
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs +111 -0
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +384 -0
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper.mjs +13 -0
- package/fesm2022/smallpearl-ngx-helper.mjs.map +1 -0
- package/forms/index.d.ts +1 -0
- package/forms/src/validation-error-handler.d.ts +52 -0
- package/hover-dropdown/index.d.ts +1 -0
- package/hover-dropdown/src/hover-dropdown.directive.d.ts +41 -0
- package/index.d.ts +5 -0
- package/locale/index.d.ts +5 -0
- package/locale/src/currency.pipe.d.ts +14 -0
- package/locale/src/date.pipe.d.ts +14 -0
- package/locale/src/format-currency.d.ts +1 -0
- package/locale/src/format-date.d.ts +2 -0
- package/locale/src/is-empty.d.ts +1 -0
- package/locale/src/providers.d.ts +20 -0
- package/mat-busy-wheel/index.d.ts +4 -0
- package/mat-busy-wheel/src/busy-wheel-op.d.ts +65 -0
- package/mat-busy-wheel/src/busy-wheel.component.d.ts +12 -0
- package/mat-busy-wheel/src/busy-wheel.service.d.ts +42 -0
- package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +35 -0
- package/mat-context-menu/index.d.ts +1 -0
- package/mat-context-menu/src/mat-context-menu.component.d.ts +54 -0
- package/mat-entity-crud/index.d.ts +5 -0
- package/mat-entity-crud/src/default-config.d.ts +9 -0
- package/mat-entity-crud/src/form-view-host.component.d.ts +34 -0
- package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +95 -0
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +66 -0
- package/mat-entity-crud/src/mat-entity-crud-types.d.ts +141 -0
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +267 -0
- package/mat-entity-crud/src/preview-host.component.d.ts +19 -0
- package/mat-entity-crud/src/preview-pane.component.d.ts +27 -0
- package/mat-entity-crud/src/providers.d.ts +3 -0
- package/mat-entity-list/index.d.ts +3 -0
- package/mat-entity-list/src/config.d.ts +6 -0
- package/mat-entity-list/src/mat-entity-list-types.d.ts +53 -0
- package/mat-entity-list/src/mat-entity-list.component.d.ts +209 -0
- package/mat-entity-list/src/providers.d.ts +3 -0
- package/mat-file-input/README.md +63 -0
- package/mat-file-input/index.d.ts +1 -0
- package/mat-file-input/src/mat-file-input.component.d.ts +58 -0
- package/mat-form-error/README.md +306 -0
- package/mat-form-error/index.d.ts +6 -0
- package/mat-form-error/src/locales/en.d.ts +4 -0
- package/mat-form-error/src/locales/hu.d.ts +4 -0
- package/mat-form-error/src/locales/index.d.ts +3 -0
- package/mat-form-error/src/locales/pt-br.d.ts +4 -0
- package/mat-form-error/src/ngx-error-list.component.d.ts +9 -0
- package/mat-form-error/src/ngx-mat-error-control.d.ts +17 -0
- package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +30 -0
- package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +8 -0
- package/mat-form-error/src/ngx-mat-errors.component.d.ts +23 -0
- package/mat-form-error/src/types.d.ts +68 -0
- package/mat-form-error/src/utils/coerce-to-observable.d.ts +3 -0
- package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +2 -0
- package/mat-form-error/src/utils/find-error-for-control.d.ts +9 -0
- package/mat-form-error/src/utils/get-abstract-controls.d.ts +3 -0
- package/mat-form-error/src/utils/get-control-with-error.d.ts +3 -0
- package/mat-select-entity/index.d.ts +2 -0
- package/mat-select-entity/src/mat-select-entity.component.d.ts +207 -0
- package/mat-select-entity/src/providers.d.ts +9 -0
- package/mat-side-menu-layout/index.d.ts +6 -0
- package/mat-side-menu-layout/src/layout.service.d.ts +23 -0
- package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +39 -0
- package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +18 -0
- package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +36 -0
- package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +66 -0
- package/mat-side-menu-layout/src/nav-item.d.ts +10 -0
- package/mat-tel-input/README.md +18 -0
- package/mat-tel-input/index.d.ts +2 -0
- package/mat-tel-input/src/country-codes.d.ts +5 -0
- package/mat-tel-input/src/mat-telephone.component.d.ts +129 -0
- package/mat-tel-input/src/providers.d.ts +38 -0
- package/ngx-helper.d.ts +2 -0
- package/package.json +114 -0
- package/public-api.d.ts +1 -0
- package/sideload/index.d.ts +1 -0
- package/sideload/src/sideload.d.ts +17 -0
- package/stationary-with-line-items/index.d.ts +1 -0
- package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +74 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { AsyncPipe, NgTemplateOutlet, formatDate } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, Injectable, InjectionToken, TemplateRef, Directive, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, LOCALE_ID } from '@angular/core';
|
|
4
|
+
import { isObservable, of, pairwise, filter, merge, startWith, map, combineLatest, ReplaySubject, switchMap, distinctUntilChanged } from 'rxjs';
|
|
5
|
+
import { MAT_FORM_FIELD } from '@angular/material/form-field';
|
|
6
|
+
import { ControlContainer, AbstractControl, AbstractControlDirective } from '@angular/forms';
|
|
7
|
+
import { coerceArray } from '@angular/cdk/coercion';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This class contains the logic of getting the default control of a MatFormField.
|
|
11
|
+
* Extend it to implement a custom getter method.
|
|
12
|
+
*/
|
|
13
|
+
class NgxMatErrorControl {
|
|
14
|
+
matFormField = inject(MAT_FORM_FIELD, { optional: true });
|
|
15
|
+
get() {
|
|
16
|
+
return this.matFormField?._control;
|
|
17
|
+
}
|
|
18
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorControl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
19
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorControl });
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorControl, decorators: [{
|
|
22
|
+
type: Injectable
|
|
23
|
+
}] });
|
|
24
|
+
/**
|
|
25
|
+
* Provides the default control accessor of a MatFormField.
|
|
26
|
+
*/
|
|
27
|
+
function provideDefaultNgxMatErrorControl() {
|
|
28
|
+
return {
|
|
29
|
+
provide: NgxMatErrorControl,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Lightweight injection token. When NgxMatErrorDef is not used, only this token will remain, the directive will be tree-shaken.
|
|
35
|
+
*/
|
|
36
|
+
const NGX_MAT_ERROR_DEF = new InjectionToken('NGX_MAT_ERROR_DEF');
|
|
37
|
+
class NgxMatErrorDef {
|
|
38
|
+
/**
|
|
39
|
+
* Specify the error key to be used for error matching.
|
|
40
|
+
* @required
|
|
41
|
+
*/
|
|
42
|
+
ngxMatErrorDefFor;
|
|
43
|
+
/**
|
|
44
|
+
* Specify the control to be used for error matching.
|
|
45
|
+
* @optional
|
|
46
|
+
*/
|
|
47
|
+
ngxMatErrorDefWithControl = undefined;
|
|
48
|
+
template = inject(TemplateRef);
|
|
49
|
+
controlContainer = inject(ControlContainer, {
|
|
50
|
+
optional: true,
|
|
51
|
+
skipSelf: true,
|
|
52
|
+
});
|
|
53
|
+
get control() {
|
|
54
|
+
const input = this.ngxMatErrorDefWithControl;
|
|
55
|
+
if (typeof input === 'string') {
|
|
56
|
+
return this.controlContainer?.control?.get(input) ?? undefined;
|
|
57
|
+
}
|
|
58
|
+
if (input instanceof AbstractControl) {
|
|
59
|
+
return input;
|
|
60
|
+
}
|
|
61
|
+
return input?.control ?? undefined;
|
|
62
|
+
}
|
|
63
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: NgxMatErrorDef, isStandalone: true, selector: "[ngxMatErrorDef]", inputs: { ngxMatErrorDefFor: "ngxMatErrorDefFor", ngxMatErrorDefWithControl: "ngxMatErrorDefWithControl" }, providers: [
|
|
65
|
+
{
|
|
66
|
+
provide: NGX_MAT_ERROR_DEF,
|
|
67
|
+
useExisting: NgxMatErrorDef,
|
|
68
|
+
},
|
|
69
|
+
], ngImport: i0 });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorDef, decorators: [{
|
|
72
|
+
type: Directive,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: '[ngxMatErrorDef]',
|
|
75
|
+
standalone: true,
|
|
76
|
+
providers: [
|
|
77
|
+
{
|
|
78
|
+
provide: NGX_MAT_ERROR_DEF,
|
|
79
|
+
useExisting: NgxMatErrorDef,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}]
|
|
83
|
+
}], propDecorators: { ngxMatErrorDefFor: [{
|
|
84
|
+
type: Input,
|
|
85
|
+
args: [{
|
|
86
|
+
required: true,
|
|
87
|
+
}]
|
|
88
|
+
}], ngxMatErrorDefWithControl: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}] } });
|
|
91
|
+
|
|
92
|
+
function coerceToObservable(errorMessages) {
|
|
93
|
+
if (isObservable(errorMessages)) {
|
|
94
|
+
return errorMessages;
|
|
95
|
+
}
|
|
96
|
+
return of(errorMessages);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function distinctUntilErrorChanged(prev, curr) {
|
|
100
|
+
if (prev === curr) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
if (!prev || !curr) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (prev.template !== curr.template) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return prev.$implicit === curr.$implicit;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Finds the error key or custom error for a control. The original function
|
|
114
|
+
* has been modified
|
|
115
|
+
* @returns INgxMatErrorDef | undefined
|
|
116
|
+
*/
|
|
117
|
+
function findErrorsForControl(control, messages, customErrorMessages) {
|
|
118
|
+
const errorKeys = Object.keys(control.errors);
|
|
119
|
+
return (customErrorMessages.find((customErrorMessage) => errorKeys.some((error) => {
|
|
120
|
+
if (error !== customErrorMessage.ngxMatErrorDefFor) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return (!customErrorMessage.control || customErrorMessage.control === control);
|
|
124
|
+
})) ?? errorKeys.filter((key) => key in messages));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getAbstractControls(controls) {
|
|
128
|
+
if (!controls) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const _controls = coerceArray(controls)
|
|
132
|
+
.map((control) => !control
|
|
133
|
+
? undefined
|
|
134
|
+
: control instanceof AbstractControlDirective
|
|
135
|
+
? control.control
|
|
136
|
+
: control instanceof AbstractControl
|
|
137
|
+
? control
|
|
138
|
+
: control.ngControl?.control)
|
|
139
|
+
.filter((control) => control != null);
|
|
140
|
+
return _controls.length ? _controls : undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function getControlWithError(controls) {
|
|
144
|
+
const controlChanges = controls.map((control) => {
|
|
145
|
+
const fromPendingStates = control.statusChanges.pipe(pairwise(), filter(([previous, current]) => {
|
|
146
|
+
return previous === 'PENDING' && current !== 'PENDING';
|
|
147
|
+
}));
|
|
148
|
+
const invalidState = control.statusChanges.pipe(filter(state => state === 'INVALID'));
|
|
149
|
+
return merge(control.valueChanges, fromPendingStates, invalidState).pipe(
|
|
150
|
+
// return merge(control.valueChanges, fromPendingStates).pipe(
|
|
151
|
+
startWith(null), map(() => control));
|
|
152
|
+
});
|
|
153
|
+
return combineLatest(controlChanges).pipe(map((control) => control.find((control) => !!control.errors)));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const NGX_MAT_ERROR_DEFAULT_OPTIONS = new InjectionToken('NGX_MAT_ERROR_DEFAULT_OPTIONS');
|
|
157
|
+
class NgxMatErrors {
|
|
158
|
+
messages$ = coerceToObservable(inject(NGX_MAT_ERROR_DEFAULT_OPTIONS));
|
|
159
|
+
defaultControl = inject(NgxMatErrorControl, {
|
|
160
|
+
host: true,
|
|
161
|
+
});
|
|
162
|
+
controlChangedSubject = new ReplaySubject(1);
|
|
163
|
+
error$;
|
|
164
|
+
// ContentChildren is set before ngAfterContentInit which is before ngAfterViewInit.
|
|
165
|
+
// Before ngAfterViewInit lifecycle hook we can modify the error$ observable without needing another change detection cycle.
|
|
166
|
+
// This elaborates the need of rxjs defer;
|
|
167
|
+
set customErrorMessages(queryList) {
|
|
168
|
+
const firstControlWithError$ = this.controlChangedSubject.pipe(switchMap((_controls) => {
|
|
169
|
+
const controls = getAbstractControls(_controls || this.defaultControl.get());
|
|
170
|
+
if (!controls) {
|
|
171
|
+
return of(null);
|
|
172
|
+
}
|
|
173
|
+
return getControlWithError(controls);
|
|
174
|
+
})), customErrorMessages$ = queryList.changes.pipe(startWith(queryList));
|
|
175
|
+
this.error$ = combineLatest([
|
|
176
|
+
firstControlWithError$,
|
|
177
|
+
customErrorMessages$,
|
|
178
|
+
this.messages$,
|
|
179
|
+
]).pipe(map(([controlWithError, customErrorMessages, messages]) => {
|
|
180
|
+
if (!controlWithError) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const errors = controlWithError.errors, errorsOrErrorDef = findErrorsForControl(controlWithError, messages, customErrorMessages.toArray());
|
|
184
|
+
if (!errorsOrErrorDef) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
// errorsOrErrorDef: INgxMatErrorDef
|
|
188
|
+
if (typeof errorsOrErrorDef === 'object' && !Array.isArray(errorsOrErrorDef)) {
|
|
189
|
+
return {
|
|
190
|
+
template: errorsOrErrorDef.template,
|
|
191
|
+
$implicit: errors[errorsOrErrorDef.ngxMatErrorDefFor],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
// errorsOrErrorDef: string[]
|
|
195
|
+
const msgs = errorsOrErrorDef.map(key => {
|
|
196
|
+
const message = messages[key];
|
|
197
|
+
return typeof message === 'function'
|
|
198
|
+
? message(errors[key])
|
|
199
|
+
: message;
|
|
200
|
+
});
|
|
201
|
+
return {
|
|
202
|
+
template: undefined,
|
|
203
|
+
$implicit: msgs
|
|
204
|
+
};
|
|
205
|
+
}), distinctUntilChanged(distinctUntilErrorChanged));
|
|
206
|
+
}
|
|
207
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
208
|
+
/**
|
|
209
|
+
* @deprecated will be changed to a signal and it won't be possible to set the property from TS.
|
|
210
|
+
* Instead of setting it in a directive, the directive should extend the {@link NgxMatErrorControl } class
|
|
211
|
+
* and provide itself as it.
|
|
212
|
+
*/
|
|
213
|
+
set control(control) {
|
|
214
|
+
this.controlChangedSubject.next(control);
|
|
215
|
+
}
|
|
216
|
+
/** @ignore */
|
|
217
|
+
ngOnDestroy() {
|
|
218
|
+
this.controlChangedSubject.complete();
|
|
219
|
+
}
|
|
220
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrors, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
221
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: NgxMatErrors, isStandalone: true, selector: "ngx-mat-errors, [ngx-mat-errors]", inputs: { control: ["ngx-mat-errors", "control"] }, host: { classAttribute: "ngx-mat-errors" }, providers: [provideDefaultNgxMatErrorControl()], queries: [{ propertyName: "customErrorMessages", predicate: NGX_MAT_ERROR_DEF, descendants: true }], ngImport: i0, template: `<ng-template #defaultTemplate let-error>{{ error[0] }}</ng-template
|
|
222
|
+
>@if( error$ | async; as error) {
|
|
223
|
+
<ng-template
|
|
224
|
+
[ngTemplateOutlet]="error.template ?? defaultTemplate"
|
|
225
|
+
[ngTemplateOutletContext]="error"
|
|
226
|
+
></ng-template>
|
|
227
|
+
}`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
228
|
+
}
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrors, decorators: [{
|
|
230
|
+
type: Component,
|
|
231
|
+
args: [{
|
|
232
|
+
selector: 'ngx-mat-errors, [ngx-mat-errors]',
|
|
233
|
+
template: `<ng-template #defaultTemplate let-error>{{ error[0] }}</ng-template
|
|
234
|
+
>@if( error$ | async; as error) {
|
|
235
|
+
<ng-template
|
|
236
|
+
[ngTemplateOutlet]="error.template ?? defaultTemplate"
|
|
237
|
+
[ngTemplateOutletContext]="error"
|
|
238
|
+
></ng-template>
|
|
239
|
+
}`,
|
|
240
|
+
encapsulation: ViewEncapsulation.None,
|
|
241
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
242
|
+
imports: [AsyncPipe, NgTemplateOutlet],
|
|
243
|
+
host: {
|
|
244
|
+
class: 'ngx-mat-errors',
|
|
245
|
+
},
|
|
246
|
+
providers: [provideDefaultNgxMatErrorControl()]
|
|
247
|
+
}]
|
|
248
|
+
}], propDecorators: { customErrorMessages: [{
|
|
249
|
+
type: ContentChildren,
|
|
250
|
+
args: [NGX_MAT_ERROR_DEF, { descendants: true }]
|
|
251
|
+
}], control: [{
|
|
252
|
+
type: Input,
|
|
253
|
+
args: ['ngx-mat-errors']
|
|
254
|
+
}] } });
|
|
255
|
+
|
|
256
|
+
function errorMessagesEnFactory(locale, dateFormat = 'shortDate', timeFormat = 'shortTime') {
|
|
257
|
+
return {
|
|
258
|
+
min: (error) => `Please enter a value greater than or equal to ${error.min}.`,
|
|
259
|
+
max: (error) => `Please enter a value less than or equal to ${error.max}.`,
|
|
260
|
+
required: `This field is required.`,
|
|
261
|
+
email: `Please enter a valid email address.`,
|
|
262
|
+
minlength: (error) => `Please enter at least ${error.requiredLength} characters.`,
|
|
263
|
+
maxlength: (error) => `Please enter no more than ${error.requiredLength} characters.`,
|
|
264
|
+
matDatepickerMin: (error) => {
|
|
265
|
+
const formatted = formatDate(error.min, dateFormat, locale);
|
|
266
|
+
return `Please enter a date greater than or equal to ${formatted ?? error.min}.`;
|
|
267
|
+
},
|
|
268
|
+
matDatepickerMax: (error) => {
|
|
269
|
+
const formatted = formatDate(error.max, dateFormat, locale);
|
|
270
|
+
return `Please enter a date less than or equal to ${formatted ?? error.max}.`;
|
|
271
|
+
},
|
|
272
|
+
matDatepickerParse: (error) => `Invalid date format.`,
|
|
273
|
+
matStartDateInvalid: (error) => `Start date cannot be after end date.`,
|
|
274
|
+
matEndDateInvalid: (error) => `End date cannot be before start date.`,
|
|
275
|
+
matDatepickerFilter: 'This date is filtered out.',
|
|
276
|
+
matTimepickerParse: (error) => `Invalid time format.`,
|
|
277
|
+
matTimepickerMin: (error) => {
|
|
278
|
+
const formatted = formatDate(error.min, timeFormat, locale);
|
|
279
|
+
return `Please enter a time greater than or equal to ${formatted ?? error.min}.`;
|
|
280
|
+
},
|
|
281
|
+
matTimepickerMax: (error) => {
|
|
282
|
+
const formatted = formatDate(error.max, timeFormat, locale);
|
|
283
|
+
return `Please enter a time less than or equal to ${formatted ?? error.max}.`;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const NGX_MAT_ERROR_CONFIG_EN = {
|
|
288
|
+
provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,
|
|
289
|
+
useFactory: errorMessagesEnFactory,
|
|
290
|
+
deps: [LOCALE_ID],
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
function errorMessagesHuFactory(locale, dateFormat = 'shortDate', timeFormat = 'shortTime') {
|
|
294
|
+
return {
|
|
295
|
+
min: (error) => `Nem lehet kisebb, mint ${error.min}.`,
|
|
296
|
+
max: (error) => `Nem lehet nagyobb, mint ${error.max}.`,
|
|
297
|
+
required: `Kötelező mező.`,
|
|
298
|
+
email: `Nem érvényes e-mail cím.`,
|
|
299
|
+
minlength: (error) => `Legalább ${error.requiredLength} karakter hosszú lehet.`,
|
|
300
|
+
maxlength: (error) => `Legfeljebb ${error.requiredLength} karakter hosszú lehet.`,
|
|
301
|
+
server: (error) => error,
|
|
302
|
+
matDatepickerMin: (error) => {
|
|
303
|
+
const formatted = formatDate(error.min, dateFormat, locale);
|
|
304
|
+
// In Hungarian date ends with '.'
|
|
305
|
+
return `Nem lehet korábbi dátum, mint ${formatted ?? error.min}`;
|
|
306
|
+
},
|
|
307
|
+
matDatepickerMax: (error) => {
|
|
308
|
+
const formatted = formatDate(error.max, dateFormat, locale);
|
|
309
|
+
// In Hungarian date ends with '.'
|
|
310
|
+
return `Nem lehet későbbi dátum, mint ${formatted ?? error.max}`;
|
|
311
|
+
},
|
|
312
|
+
matDatepickerParse: (error) => `Érvénytelen dátum.`,
|
|
313
|
+
matStartDateInvalid: (error) => `A kezdő dátum nem lehet a vég dátum után.`,
|
|
314
|
+
matEndDateInvalid: (error) => `A vég dátum nem lehet a kezdő dátum előtt.`,
|
|
315
|
+
matDatepickerFilter: 'Ez a dátum nem engedélyezett.',
|
|
316
|
+
matTimepickerParse: (error) => `Érvénytelen idő.`,
|
|
317
|
+
matTimepickerMin: (error) => {
|
|
318
|
+
const formatted = formatDate(error.min, timeFormat, locale);
|
|
319
|
+
return `Nem lehet korábbi idő, mint ${formatted ?? error.min}.`;
|
|
320
|
+
},
|
|
321
|
+
matTimepickerMax: (error) => {
|
|
322
|
+
const formatted = formatDate(error.max, timeFormat, locale);
|
|
323
|
+
return `Nem lehet későbbi idő, mint ${formatted ?? error.max}.`;
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
const NGX_MAT_ERROR_CONFIG_HU = {
|
|
328
|
+
provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,
|
|
329
|
+
useFactory: errorMessagesHuFactory,
|
|
330
|
+
deps: [LOCALE_ID],
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
function errorMessagesPtBtFactory(locale, dateFormat = 'shortDate', timeFormat = 'shortTime') {
|
|
334
|
+
return {
|
|
335
|
+
min: (error) => `Informe um valor igual ou maior a ${error.min}.`,
|
|
336
|
+
max: (error) => `Informe um valor igual ou menor a ${error.max}.`,
|
|
337
|
+
required: `Campo obrigatório.`,
|
|
338
|
+
email: `Informe um endereço de email válido.`,
|
|
339
|
+
minlength: (error) => `Informe pelo menos ${error.requiredLength} caracteres.`,
|
|
340
|
+
maxlength: (error) => `O campo não pode ter mais que ${error.requiredLength} caracteres.`,
|
|
341
|
+
matDatepickerMin: (error) => {
|
|
342
|
+
const formatted = formatDate(error.min, dateFormat, locale);
|
|
343
|
+
return `Informe uma data maior ou igual a ${formatted ?? error.min}.`;
|
|
344
|
+
},
|
|
345
|
+
matDatepickerMax: (error) => {
|
|
346
|
+
const formatted = formatDate(error.max, dateFormat, locale);
|
|
347
|
+
return `Informe uma data menor ou igual a ${formatted ?? error.max}.`;
|
|
348
|
+
},
|
|
349
|
+
matDatepickerParse: (error) => `Formato de data inválido.`,
|
|
350
|
+
matStartDateInvalid: (error) => `A data de início não pode ser posterior à data de término.`,
|
|
351
|
+
matEndDateInvalid: (error) => `A data de término não pode ser anterior à data de início.`,
|
|
352
|
+
matDatepickerFilter: 'Esta data é filtrada.',
|
|
353
|
+
matTimepickerParse: (error) => `Formato de hora inválido.`,
|
|
354
|
+
matTimepickerMin: (error) => {
|
|
355
|
+
const formatted = formatDate(error.min, timeFormat, locale);
|
|
356
|
+
return `Insira um horário maior ou igual a ${formatted ?? error.min}.`;
|
|
357
|
+
},
|
|
358
|
+
matTimepickerMax: (error) => {
|
|
359
|
+
const formatted = formatDate(error.max, timeFormat, locale);
|
|
360
|
+
return `Insira um horário menor ou igual a ${formatted ?? error.max}.`;
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
const NGX_MAT_ERROR_CONFIG_PT_BR = {
|
|
365
|
+
provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,
|
|
366
|
+
useFactory: errorMessagesPtBtFactory,
|
|
367
|
+
deps: [LOCALE_ID],
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
class NgxMatErrorsForDateRangePicker extends NgxMatErrorControl {
|
|
371
|
+
/** Returns start and end controls of the date range picker. */
|
|
372
|
+
get() {
|
|
373
|
+
const { _startInput, _endInput } = this.matFormField
|
|
374
|
+
._control;
|
|
375
|
+
return [_startInput, _endInput];
|
|
376
|
+
}
|
|
377
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorsForDateRangePicker, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
378
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: NgxMatErrorsForDateRangePicker, isStandalone: true, selector: "[ngx-mat-errors][forDateRangePicker]", host: { classAttribute: "ngx-mat-errors-for-date-range-picker" }, providers: [
|
|
379
|
+
{
|
|
380
|
+
provide: NgxMatErrorControl,
|
|
381
|
+
useExisting: NgxMatErrorsForDateRangePicker,
|
|
382
|
+
},
|
|
383
|
+
], usesInheritance: true, ngImport: i0 });
|
|
384
|
+
}
|
|
385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxMatErrorsForDateRangePicker, decorators: [{
|
|
386
|
+
type: Directive,
|
|
387
|
+
args: [{
|
|
388
|
+
selector: '[ngx-mat-errors][forDateRangePicker]',
|
|
389
|
+
standalone: true,
|
|
390
|
+
host: {
|
|
391
|
+
class: 'ngx-mat-errors-for-date-range-picker',
|
|
392
|
+
},
|
|
393
|
+
providers: [
|
|
394
|
+
{
|
|
395
|
+
provide: NgxMatErrorControl,
|
|
396
|
+
useExisting: NgxMatErrorsForDateRangePicker,
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
}]
|
|
400
|
+
}] });
|
|
401
|
+
|
|
402
|
+
class NgxErrorList extends NgxMatErrors {
|
|
403
|
+
isArray(e) {
|
|
404
|
+
// console.log(`NgxErrorList - isArray.e: ${e}`);
|
|
405
|
+
return typeof e !== 'string' && Array.isArray(e);
|
|
406
|
+
}
|
|
407
|
+
set control(control) {
|
|
408
|
+
super.control = control;
|
|
409
|
+
}
|
|
410
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxErrorList, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
411
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: NgxErrorList, isStandalone: true, selector: "ngx-error-list, [ngx-error-list]", inputs: { control: ["ngx-error-list", "control"] }, host: { classAttribute: "ngx-error-list" }, providers: [provideDefaultNgxMatErrorControl()], usesInheritance: true, ngImport: i0, template: `<ng-template #defaultTemplate let-error>
|
|
412
|
+
<ul>
|
|
413
|
+
@if (isArray(error)) {
|
|
414
|
+
@for (item of error; track $index) {
|
|
415
|
+
<li>{{item}}</li>
|
|
416
|
+
}
|
|
417
|
+
} @else {
|
|
418
|
+
<li>{{ error }}</li>
|
|
419
|
+
}
|
|
420
|
+
</ul>
|
|
421
|
+
</ng-template
|
|
422
|
+
>@if( error$ | async; as error) {
|
|
423
|
+
<ng-template
|
|
424
|
+
[ngTemplateOutlet]="error.template ?? defaultTemplate"
|
|
425
|
+
[ngTemplateOutletContext]="error"
|
|
426
|
+
></ng-template>
|
|
427
|
+
}`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
428
|
+
}
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgxErrorList, decorators: [{
|
|
430
|
+
type: Component,
|
|
431
|
+
args: [{
|
|
432
|
+
selector: 'ngx-error-list, [ngx-error-list]',
|
|
433
|
+
template: `<ng-template #defaultTemplate let-error>
|
|
434
|
+
<ul>
|
|
435
|
+
@if (isArray(error)) {
|
|
436
|
+
@for (item of error; track $index) {
|
|
437
|
+
<li>{{item}}</li>
|
|
438
|
+
}
|
|
439
|
+
} @else {
|
|
440
|
+
<li>{{ error }}</li>
|
|
441
|
+
}
|
|
442
|
+
</ul>
|
|
443
|
+
</ng-template
|
|
444
|
+
>@if( error$ | async; as error) {
|
|
445
|
+
<ng-template
|
|
446
|
+
[ngTemplateOutlet]="error.template ?? defaultTemplate"
|
|
447
|
+
[ngTemplateOutletContext]="error"
|
|
448
|
+
></ng-template>
|
|
449
|
+
}`,
|
|
450
|
+
encapsulation: ViewEncapsulation.None,
|
|
451
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
452
|
+
imports: [AsyncPipe, NgTemplateOutlet],
|
|
453
|
+
host: {
|
|
454
|
+
class: 'ngx-error-list',
|
|
455
|
+
},
|
|
456
|
+
providers: [provideDefaultNgxMatErrorControl()]
|
|
457
|
+
}]
|
|
458
|
+
}], propDecorators: { control: [{
|
|
459
|
+
type: Input,
|
|
460
|
+
args: ['ngx-error-list']
|
|
461
|
+
}] } });
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Generated bundle index. Do not edit.
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
export { NGX_MAT_ERROR_CONFIG_EN, NGX_MAT_ERROR_CONFIG_HU, NGX_MAT_ERROR_CONFIG_PT_BR, NGX_MAT_ERROR_DEF, NGX_MAT_ERROR_DEFAULT_OPTIONS, NgxErrorList, NgxMatErrorDef, NgxMatErrors, NgxMatErrorsForDateRangePicker, errorMessagesEnFactory, errorMessagesHuFactory, errorMessagesPtBtFactory };
|
|
468
|
+
//# sourceMappingURL=smallpearl-ngx-helper-mat-form-error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-form-error.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-form-error/src/ngx-mat-error-control.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/ngx-mat-error-def.directive.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/utils/coerce-to-observable.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/utils/distinct-until-error-changed.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/utils/find-error-for-control.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/utils/get-abstract-controls.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/utils/get-control-with-error.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/ngx-mat-errors.component.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/locales/en.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/locales/hu.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/locales/pt-br.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/ngx-error-list.component.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/smallpearl-ngx-helper-mat-form-error.ts"],"sourcesContent":["import { Injectable, type Provider, inject } from '@angular/core';\nimport { MAT_FORM_FIELD } from '@angular/material/form-field';\nimport type { FormFieldControl } from './types';\n\n/**\n * This class contains the logic of getting the default control of a MatFormField.\n * Extend it to implement a custom getter method.\n */\n@Injectable()\nexport class NgxMatErrorControl {\n protected readonly matFormField = inject(MAT_FORM_FIELD, { optional: true });\n public get(): undefined | FormFieldControl | FormFieldControl[] {\n return this.matFormField?._control;\n }\n}\n\n/**\n * Provides the default control accessor of a MatFormField.\n */\nexport function provideDefaultNgxMatErrorControl(): Provider {\n return {\n provide: NgxMatErrorControl,\n };\n}\n","import {\n Directive,\n InjectionToken,\n Input,\n TemplateRef,\n inject,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlContainer,\n type AbstractControlDirective,\n} from '@angular/forms';\n\nexport interface INgxMatErrorDef {\n ngxMatErrorDefFor: string;\n ngxMatErrorDefWithControl?:\n | AbstractControlDirective\n | AbstractControl\n | string\n | null;\n template: TemplateRef<any>;\n control?: AbstractControl;\n}\n\n/**\n * Lightweight injection token. When NgxMatErrorDef is not used, only this token will remain, the directive will be tree-shaken.\n */\nexport const NGX_MAT_ERROR_DEF = new InjectionToken<INgxMatErrorDef>(\n 'NGX_MAT_ERROR_DEF'\n);\n\n@Directive({\n selector: '[ngxMatErrorDef]',\n standalone: true,\n providers: [\n {\n provide: NGX_MAT_ERROR_DEF,\n useExisting: NgxMatErrorDef,\n },\n ],\n})\nexport class NgxMatErrorDef implements INgxMatErrorDef {\n /**\n * Specify the error key to be used for error matching.\n * @required\n */\n @Input({\n required: true,\n })\n public ngxMatErrorDefFor!: string;\n\n /**\n * Specify the control to be used for error matching.\n * @optional\n */\n @Input()\n public ngxMatErrorDefWithControl?:\n | AbstractControlDirective\n | AbstractControl\n | string\n | null = undefined;\n public readonly template = inject(TemplateRef);\n private readonly controlContainer = inject(ControlContainer, {\n optional: true,\n skipSelf: true,\n });\n\n public get control(): AbstractControl | undefined {\n const input = this.ngxMatErrorDefWithControl;\n if (typeof input === 'string') {\n return this.controlContainer?.control?.get(input) ?? undefined;\n }\n if (input instanceof AbstractControl) {\n return input;\n }\n return input?.control ?? undefined;\n }\n}\n","import { type Observable, isObservable, of, } from 'rxjs';\nimport type { ErrorMessages } from '../types';\n\nexport function coerceToObservable(\n errorMessages: ErrorMessages | Observable<ErrorMessages>\n): Observable<ErrorMessages> {\n if (isObservable(errorMessages)) {\n return errorMessages;\n }\n return of(errorMessages);\n}\n","import type { ErrorTemplate } from '../types';\n\nexport function distinctUntilErrorChanged<P extends ErrorTemplate>(\n prev: P,\n curr: P\n) {\n if (prev === curr) {\n return true;\n }\n if (!prev || !curr) {\n return false;\n }\n if (prev.template !== curr.template) {\n return false;\n }\n return prev.$implicit === curr.$implicit;\n}\n","import type { AbstractControl } from '@angular/forms';\nimport type { INgxMatErrorDef } from '../ngx-mat-error-def.directive';\nimport { ErrorMessages } from '../types';\n\n/**\n * Finds the error key or custom error for a control. The original function\n * has been modified\n * @returns INgxMatErrorDef | undefined\n */\nexport function findErrorsForControl(\n control: AbstractControl,\n messages: ErrorMessages,\n customErrorMessages: readonly INgxMatErrorDef[]\n): string[] | INgxMatErrorDef {\n const errorKeys = Object.keys(control.errors!);\n return (\n customErrorMessages.find((customErrorMessage) =>\n errorKeys.some((error) => {\n if (error !== customErrorMessage.ngxMatErrorDefFor) {\n return false;\n }\n return (\n !customErrorMessage.control || customErrorMessage.control === control\n );\n })\n ) ?? errorKeys.filter((key) => key in messages)\n );\n}\n","import { coerceArray } from '@angular/cdk/coercion';\nimport { AbstractControl, AbstractControlDirective } from '@angular/forms';\nimport type { NgxMatErrorControls } from '../types';\n\nexport function getAbstractControls(\n controls: NgxMatErrorControls\n): AbstractControl[] | undefined {\n if (!controls) {\n return;\n }\n const _controls = coerceArray(controls)\n .map((control) =>\n !control\n ? undefined\n : control instanceof AbstractControlDirective\n ? control.control\n : control instanceof AbstractControl\n ? control\n : control.ngControl?.control\n )\n .filter(<T>(control: T): control is NonNullable<T> => control != null);\n return _controls.length ? _controls : undefined;\n}\n","import type { AbstractControl } from '@angular/forms';\nimport {\n type Observable,\n pairwise,\n filter,\n merge,\n startWith,\n map,\n combineLatest,\n} from 'rxjs';\n\nexport function getControlWithError(\n controls: AbstractControl[]\n): Observable<AbstractControl | undefined> {\n const controlChanges = controls.map((control) => {\n const fromPendingStates = control.statusChanges.pipe(\n pairwise(),\n filter(([previous, current]) => {\n return previous === 'PENDING' && current !== 'PENDING';\n })\n );\n const invalidState = control.statusChanges.pipe(\n filter(state => state === 'INVALID')\n );\n return merge(control.valueChanges, fromPendingStates, invalidState).pipe(\n // return merge(control.valueChanges, fromPendingStates).pipe(\n startWith(null as any),\n map(() => control)\n );\n });\n return combineLatest(controlChanges).pipe(\n map((control) => control.find((control) => !!control.errors))\n );\n}\n","import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n InjectionToken,\n Input,\n ViewEncapsulation,\n inject,\n type OnDestroy,\n type QueryList,\n} from '@angular/core';\nimport {\n ReplaySubject,\n combineLatest,\n distinctUntilChanged,\n map,\n of,\n startWith,\n switchMap,\n type Observable,\n} from 'rxjs';\nimport {\n NgxMatErrorControl,\n provideDefaultNgxMatErrorControl,\n} from './ngx-mat-error-control';\nimport {\n NGX_MAT_ERROR_DEF,\n type INgxMatErrorDef,\n} from './ngx-mat-error-def.directive';\nimport type {\n ErrorMessages,\n ErrorTemplate,\n NgxMatErrorControls,\n} from './types';\nimport { coerceToObservable } from './utils/coerce-to-observable';\nimport { distinctUntilErrorChanged } from './utils/distinct-until-error-changed';\nimport { findErrorsForControl } from './utils/find-error-for-control';\nimport { getAbstractControls } from './utils/get-abstract-controls';\nimport { getControlWithError } from './utils/get-control-with-error';\n\nexport const NGX_MAT_ERROR_DEFAULT_OPTIONS = new InjectionToken<\n ErrorMessages | Observable<ErrorMessages>\n>('NGX_MAT_ERROR_DEFAULT_OPTIONS');\n\n@Component({\n selector: 'ngx-mat-errors, [ngx-mat-errors]',\n template: `<ng-template #defaultTemplate let-error>{{ error[0] }}</ng-template\n >@if( error$ | async; as error) {\n <ng-template\n [ngTemplateOutlet]=\"error.template ?? defaultTemplate\"\n [ngTemplateOutletContext]=\"error\"\n ></ng-template>\n }`,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AsyncPipe, NgTemplateOutlet],\n host: {\n class: 'ngx-mat-errors',\n },\n providers: [provideDefaultNgxMatErrorControl()]\n})\nexport class NgxMatErrors implements OnDestroy {\n private readonly messages$ = coerceToObservable(\n inject(NGX_MAT_ERROR_DEFAULT_OPTIONS)\n );\n private readonly defaultControl = inject(NgxMatErrorControl, {\n host: true,\n });\n private readonly controlChangedSubject =\n new ReplaySubject<NgxMatErrorControls>(1);\n\n protected error$!: Observable<ErrorTemplate>;\n\n // ContentChildren is set before ngAfterContentInit which is before ngAfterViewInit.\n // Before ngAfterViewInit lifecycle hook we can modify the error$ observable without needing another change detection cycle.\n // This elaborates the need of rxjs defer;\n @ContentChildren(NGX_MAT_ERROR_DEF, { descendants: true })\n protected set customErrorMessages(queryList: QueryList<INgxMatErrorDef>) {\n const firstControlWithError$ = this.controlChangedSubject.pipe(\n switchMap((_controls) => {\n const controls = getAbstractControls(\n _controls || this.defaultControl.get()\n );\n if (!controls) {\n return of(null);\n }\n return getControlWithError(controls);\n })\n ),\n customErrorMessages$ = (\n queryList.changes as Observable<QueryList<INgxMatErrorDef>>\n ).pipe(startWith(queryList));\n this.error$ = combineLatest([\n firstControlWithError$,\n customErrorMessages$,\n this.messages$,\n ]).pipe(\n map(([controlWithError, customErrorMessages, messages]) => {\n if (!controlWithError) {\n return;\n }\n const errors = controlWithError.errors!,\n errorsOrErrorDef = findErrorsForControl(\n controlWithError,\n messages,\n customErrorMessages.toArray()\n );\n if (!errorsOrErrorDef) {\n return;\n }\n // errorsOrErrorDef: INgxMatErrorDef\n if (typeof errorsOrErrorDef === 'object' && !Array.isArray(errorsOrErrorDef)) {\n return {\n template: errorsOrErrorDef.template,\n $implicit: errors[errorsOrErrorDef.ngxMatErrorDefFor],\n };\n }\n // errorsOrErrorDef: string[]\n const msgs = errorsOrErrorDef.map(key => {\n const message = messages[key];\n return typeof message === 'function'\n ? message(errors[key])\n : message\n });\n return {\n template: undefined,\n $implicit: msgs\n };\n }),\n distinctUntilChanged(distinctUntilErrorChanged)\n );\n }\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n /**\n * @deprecated will be changed to a signal and it won't be possible to set the property from TS.\n * Instead of setting it in a directive, the directive should extend the {@link NgxMatErrorControl } class\n * and provide itself as it.\n */\n @Input('ngx-mat-errors')\n public set control(control: NgxMatErrorControls) {\n this.controlChangedSubject.next(control);\n }\n\n /** @ignore */\n public ngOnDestroy(): void {\n this.controlChangedSubject.complete();\n }\n}\n","import { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n StartDateError,\n ParseError,\n} from '../types';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\n\nexport function errorMessagesEnFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) =>\n `Please enter a value greater than or equal to ${error.min}.`,\n max: (error: MaxError) =>\n `Please enter a value less than or equal to ${error.max}.`,\n required: `This field is required.`,\n email: `Please enter a valid email address.`,\n minlength: (error: LengthError) =>\n `Please enter at least ${error.requiredLength} characters.`,\n maxlength: (error: LengthError) =>\n `Please enter no more than ${error.requiredLength} characters.`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `Please enter a date greater than or equal to ${\n formatted ?? error.min\n }.`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `Please enter a date less than or equal to ${\n formatted ?? error.max\n }.`;\n },\n matDatepickerParse: (error: ParseError) => `Invalid date format.`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `Start date cannot be after end date.`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `End date cannot be before start date.`,\n matDatepickerFilter: 'This date is filtered out.',\n matTimepickerParse: (error: ParseError) => `Invalid time format.`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `Please enter a time greater than or equal to ${\n formatted ?? error.min\n }.`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `Please enter a time less than or equal to ${\n formatted ?? error.max\n }.`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_EN: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesEnFactory,\n deps: [LOCALE_ID],\n};\n","import { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport type {\n ParseError,\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n StartDateError,\n} from '../types';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\n\nexport function errorMessagesHuFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `Nem lehet kisebb, mint ${error.min}.`,\n max: (error: MaxError) => `Nem lehet nagyobb, mint ${error.max}.`,\n required: `Kötelező mező.`,\n email: `Nem érvényes e-mail cím.`,\n minlength: (error: LengthError) =>\n `Legalább ${error.requiredLength} karakter hosszú lehet.`,\n maxlength: (error: LengthError) =>\n `Legfeljebb ${error.requiredLength} karakter hosszú lehet.`,\n server: (error: string) => error,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n // In Hungarian date ends with '.'\n return `Nem lehet korábbi dátum, mint ${formatted ?? error.min}`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n // In Hungarian date ends with '.'\n return `Nem lehet későbbi dátum, mint ${formatted ?? error.max}`;\n },\n matDatepickerParse: (error: ParseError) => `Érvénytelen dátum.`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `A kezdő dátum nem lehet a vég dátum után.`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `A vég dátum nem lehet a kezdő dátum előtt.`,\n matDatepickerFilter: 'Ez a dátum nem engedélyezett.',\n matTimepickerParse: (error: ParseError) => `Érvénytelen idő.`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `Nem lehet korábbi idő, mint ${\n formatted ?? error.min\n }.`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `Nem lehet későbbi idő, mint ${\n formatted ?? error.max\n }.`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_HU: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesHuFactory,\n deps: [LOCALE_ID],\n};\n","import { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport type {\n ParseError,\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n StartDateError,\n} from '../types';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\n\nexport function errorMessagesPtBtFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `Informe um valor igual ou maior a ${error.min}.`,\n max: (error: MaxError) => `Informe um valor igual ou menor a ${error.max}.`,\n required: `Campo obrigatório.`,\n email: `Informe um endereço de email válido.`,\n minlength: (error: LengthError) =>\n `Informe pelo menos ${error.requiredLength} caracteres.`,\n maxlength: (error: LengthError) =>\n `O campo não pode ter mais que ${error.requiredLength} caracteres.`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `Informe uma data maior ou igual a ${formatted ?? error.min}.`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `Informe uma data menor ou igual a ${formatted ?? error.max}.`;\n },\n matDatepickerParse: (error: ParseError) => `Formato de data inválido.`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `A data de início não pode ser posterior à data de término.`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `A data de término não pode ser anterior à data de início.`,\n matDatepickerFilter: 'Esta data é filtrada.',\n matTimepickerParse: (error: ParseError) => `Formato de hora inválido.`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `Insira um horário maior ou igual a ${\n formatted ?? error.min\n }.`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `Insira um horário menor ou igual a ${\n formatted ?? error.max\n }.`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_PT_BR: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesPtBtFactory,\n deps: [LOCALE_ID],\n};\n","import { Directive } from '@angular/core';\nimport type { MatDateRangeInput } from '@angular/material/datepicker';\nimport { NgxMatErrorControl } from './ngx-mat-error-control';\n\n@Directive({\n selector: '[ngx-mat-errors][forDateRangePicker]',\n standalone: true,\n host: {\n class: 'ngx-mat-errors-for-date-range-picker',\n },\n providers: [\n {\n provide: NgxMatErrorControl,\n useExisting: NgxMatErrorsForDateRangePicker,\n },\n ],\n})\nexport class NgxMatErrorsForDateRangePicker<D> extends NgxMatErrorControl {\n /** Returns start and end controls of the date range picker. */\n public override get() {\n const { _startInput, _endInput } = this.matFormField!\n ._control as MatDateRangeInput<D>;\n return [_startInput, _endInput];\n }\n}\n","import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';\nimport { NgxMatErrors } from './ngx-mat-errors.component';\nimport { provideDefaultNgxMatErrorControl } from './ngx-mat-error-control';\nimport { NgxMatErrorControls } from './types';\n\n@Component({\n selector: 'ngx-error-list, [ngx-error-list]',\n template: `<ng-template #defaultTemplate let-error>\n <ul>\n @if (isArray(error)) {\n @for (item of error; track $index) {\n <li>{{item}}</li>\n }\n } @else {\n <li>{{ error }}</li>\n }\n </ul>\n </ng-template\n >@if( error$ | async; as error) {\n <ng-template\n [ngTemplateOutlet]=\"error.template ?? defaultTemplate\"\n [ngTemplateOutletContext]=\"error\"\n ></ng-template>\n }`,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AsyncPipe, NgTemplateOutlet],\n host: {\n class: 'ngx-error-list',\n },\n providers: [provideDefaultNgxMatErrorControl()]\n})\nexport class NgxErrorList extends NgxMatErrors {\n\n isArray(e: string|string[]) {\n // console.log(`NgxErrorList - isArray.e: ${e}`);\n return typeof e !== 'string' && Array.isArray(e);\n }\n\n @Input('ngx-error-list')\n public override set control(control: NgxMatErrorControls) {\n super.control = control;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mapp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