@smallpearl/ngx-helper 0.32.5 → 0.32.6

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.
@@ -153,9 +153,30 @@ function getControlWithError(controls) {
153
153
  return combineLatest(controlChanges).pipe(map((control) => control.find((control) => !!control.errors)));
154
154
  }
155
155
 
156
+ /**
157
+ * Default error messages for form controls. These messages can be overridden
158
+ * by providing custom messages using the {@link NGX_MAT_ERROR_ADDL_OPTIONS}
159
+ * injection token. Typically, this is initialized in the root module
160
+ * (or AppComponent) of the application, providing the app with a global set
161
+ * of validation error messages.
162
+ *
163
+ * Messages specific to each form can be provided using the
164
+ * {@link NGX_MAT_ERROR_ADDL_OPTIONS} injection token (see below).
165
+ */
156
166
  const NGX_MAT_ERROR_DEFAULT_OPTIONS = new InjectionToken('NGX_MAT_ERROR_DEFAULT_OPTIONS');
167
+ /**
168
+ * Additional error messages to be merged with the default error messages.
169
+ * These messages will override the default messages if the same key is
170
+ * provided. This is useful for adding custom error messages specific to a
171
+ * form, without having to redefine all the default messages.
172
+ *
173
+ * Typically, this is provided in the component or module where the form
174
+ * is defined.
175
+ */
176
+ const NGX_MAT_ERROR_ADDL_OPTIONS = new InjectionToken('NGX_MAT_ERROR_ADDL_OPTIONS');
157
177
  class NgxMatErrors {
158
178
  messages$ = coerceToObservable(inject(NGX_MAT_ERROR_DEFAULT_OPTIONS));
179
+ addlMessages$ = coerceToObservable(inject(NGX_MAT_ERROR_ADDL_OPTIONS, { optional: true }) ?? of({}));
159
180
  defaultControl = inject(NgxMatErrorControl, {
160
181
  host: true,
161
182
  });
@@ -176,11 +197,13 @@ class NgxMatErrors {
176
197
  firstControlWithError$,
177
198
  customErrorMessages$,
178
199
  this.messages$,
179
- ]).pipe(map(([controlWithError, customErrorMessages, messages]) => {
200
+ this.addlMessages$,
201
+ ]).pipe(map(([controlWithError, customErrorMessages, messages, addlMessages]) => {
180
202
  if (!controlWithError) {
181
203
  return;
182
204
  }
183
- const errors = controlWithError.errors, errorsOrErrorDef = findErrorsForControl(controlWithError, messages, customErrorMessages.toArray());
205
+ const allMessages = { ...messages, ...addlMessages };
206
+ const errors = controlWithError.errors, errorsOrErrorDef = findErrorsForControl(controlWithError, allMessages, customErrorMessages.toArray());
184
207
  if (!errorsOrErrorDef) {
185
208
  return;
186
209
  }
@@ -193,7 +216,7 @@ class NgxMatErrors {
193
216
  }
194
217
  // errorsOrErrorDef: string[]
195
218
  const msgs = errorsOrErrorDef.map(key => {
196
- const message = messages[key];
219
+ const message = allMessages[key];
197
220
  return typeof message === 'function'
198
221
  ? message(errors[key])
199
222
  : message;
@@ -538,5 +561,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
538
561
  * Generated bundle index. Do not edit.
539
562
  */
540
563
 
541
- export { NGX_MAT_ERROR_CONFIG_EN, NGX_MAT_ERROR_CONFIG_HU, NGX_MAT_ERROR_CONFIG_PT_BR, NGX_MAT_ERROR_CONFIG_ZH_HANS, NGX_MAT_ERROR_CONFIG_ZH_HANT, NGX_MAT_ERROR_DEF, NGX_MAT_ERROR_DEFAULT_OPTIONS, NgxErrorList, NgxMatErrorDef, NgxMatErrors, NgxMatErrorsForDateRangePicker, errorMessagesEnFactory, errorMessagesHuFactory, errorMessagesPtBtFactory, errorMessagesZhHansFactory, errorMessagesZhHantFactory };
564
+ export { NGX_MAT_ERROR_ADDL_OPTIONS, NGX_MAT_ERROR_CONFIG_EN, NGX_MAT_ERROR_CONFIG_HU, NGX_MAT_ERROR_CONFIG_PT_BR, NGX_MAT_ERROR_CONFIG_ZH_HANS, NGX_MAT_ERROR_CONFIG_ZH_HANT, NGX_MAT_ERROR_DEF, NGX_MAT_ERROR_DEFAULT_OPTIONS, NgxErrorList, NgxMatErrorDef, NgxMatErrors, NgxMatErrorsForDateRangePicker, errorMessagesEnFactory, errorMessagesHuFactory, errorMessagesPtBtFactory, errorMessagesZhHansFactory, errorMessagesZhHantFactory };
542
565
  //# sourceMappingURL=smallpearl-ngx-helper-mat-form-error.mjs.map
@@ -1 +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/locales/zh-hans.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/locales/zh-hant.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 { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\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 { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\n\nexport function errorMessagesZhHansFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `请输入大于或等于 ${error.min} 的数值。`,\n max: (error: MaxError) => `请输入小于或等于 ${error.max} 的数值。`,\n required: `此字段为必填。`,\n email: `请输入有效的电子邮件地址。`,\n minlength: (error: LengthError) =>\n `请至少输入 ${error.requiredLength} 个字符。`,\n maxlength: (error: LengthError) =>\n `请勿输入超过 ${error.requiredLength} 个字符。`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `请输入大于或等于 ${formatted ?? error.min} 的日期。`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `请输入小于或等于 ${formatted ?? error.max} 的日期。`;\n },\n matDatepickerParse: (error: ParseError) => `无效的日期格式。`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `开始日期不可晚于结束日期。`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `结束日期不可早于开始日期。`,\n matDatepickerFilter: '此日期不可选择。',\n matTimepickerParse: (error: ParseError) => `无效的时间格式。`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `请输入大于或等于 ${formatted ?? error.min} 的时间。`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `请输入小于或等于 ${formatted ?? error.max} 的时间。`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_ZH_HANS: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesZhHansFactory,\n deps: [LOCALE_ID],\n};\n","import { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\n\nexport function errorMessagesZhHantFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `請輸入大於或等於 ${error.min} 的數值。`,\n max: (error: MaxError) => `請輸入小於或等於 ${error.max} 的數值。`,\n required: `此欄位為必填。`,\n email: `請輸入有效的電子郵件地址。`,\n minlength: (error: LengthError) =>\n `請至少輸入 ${error.requiredLength} 個字元。`,\n maxlength: (error: LengthError) =>\n `請勿輸入超過 ${error.requiredLength} 個字元。`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `請輸入大於或等於 ${formatted ?? error.min} 的日期。`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `請輸入小於或等於 ${formatted ?? error.max} 的日期。`;\n },\n matDatepickerParse: (error: ParseError) => `無效的日期格式。`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `開始日期不可晚於結束日期。`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `結束日期不可早於開始日期。`,\n matDatepickerFilter: '此日期不可選取。',\n matTimepickerParse: (error: ParseError) => `無效的時間格式。`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `請輸入大於或等於 ${formatted ?? error.min} 的時間。`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `請輸入小於或等於 ${formatted ?? error.max} 的時間。`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_ZH_HANT: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesZhHantFactory,\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":[],"mappings":";;;;;;;;AAIA;;;AAGG;MAEU,kBAAkB,CAAA;IACV,YAAY,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrE,GAAG,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,YAAY,EAAE,QAAQ;;0HAHzB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;8HAAlB,kBAAkB,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B;;AAQD;;AAEG;SACa,gCAAgC,GAAA;IAC9C,OAAO;AACL,QAAA,OAAO,EAAE,kBAAkB;KAC5B;AACH;;ACCA;;AAEG;MACU,iBAAiB,GAAG,IAAI,cAAc,CACjD,mBAAmB;MAaR,cAAc,CAAA;AACzB;;;AAGG;AAII,IAAA,iBAAiB;AAExB;;;AAGG;IAEI,yBAAyB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EAAA,CAAA;;2FAM5B,YAAY,EAAA,UAAA,EAAA,CAAA;kBA3BxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kCAAkC;AAC5C,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;AAgBR,KAAA,CAAA;oBACF,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC;AACtC,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,gBAAgB;AAC1B,qBAAA;AACD,oBAAA,SAAS,EAAE,CAAC,gCAAgC,EAAE;AACjD,iBAAA;8BASqB,OAAO,EAAA,CAAA;sBAD1B,KAAK;uBAAC,gBAAgB;;;ACxCzB;;AAEG;;;;"}
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/locales/zh-hans.ts","../../../../projects/smallpearl/ngx-helper/mat-form-error/src/locales/zh-hant.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\n/**\n * Default error messages for form controls. These messages can be overridden\n * by providing custom messages using the {@link NGX_MAT_ERROR_ADDL_OPTIONS}\n * injection token. Typically, this is initialized in the root module\n * (or AppComponent) of the application, providing the app with a global set\n * of validation error messages.\n *\n * Messages specific to each form can be provided using the\n * {@link NGX_MAT_ERROR_ADDL_OPTIONS} injection token (see below).\n */\nexport const NGX_MAT_ERROR_DEFAULT_OPTIONS = new InjectionToken<\n ErrorMessages | Observable<ErrorMessages>\n>('NGX_MAT_ERROR_DEFAULT_OPTIONS');\n\n/**\n * Additional error messages to be merged with the default error messages.\n * These messages will override the default messages if the same key is\n * provided. This is useful for adding custom error messages specific to a\n * form, without having to redefine all the default messages.\n *\n * Typically, this is provided in the component or module where the form\n * is defined.\n */\nexport const NGX_MAT_ERROR_ADDL_OPTIONS = new InjectionToken<\n ErrorMessages | Observable<ErrorMessages>\n>('NGX_MAT_ERROR_ADDL_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 addlMessages$ = coerceToObservable(\n inject(NGX_MAT_ERROR_ADDL_OPTIONS, {optional: true}) ?? of({})\n );\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 this.addlMessages$,\n ]).pipe(\n map(([controlWithError, customErrorMessages, messages, addlMessages]) => {\n if (!controlWithError) {\n return;\n }\n const allMessages = { ...messages, ...addlMessages };\n const errors = controlWithError.errors!,\n errorsOrErrorDef = findErrorsForControl(\n controlWithError,\n allMessages,\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 = allMessages[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 { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\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 { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\n\nexport function errorMessagesZhHansFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `请输入大于或等于 ${error.min} 的数值。`,\n max: (error: MaxError) => `请输入小于或等于 ${error.max} 的数值。`,\n required: `此字段为必填。`,\n email: `请输入有效的电子邮件地址。`,\n minlength: (error: LengthError) =>\n `请至少输入 ${error.requiredLength} 个字符。`,\n maxlength: (error: LengthError) =>\n `请勿输入超过 ${error.requiredLength} 个字符。`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `请输入大于或等于 ${formatted ?? error.min} 的日期。`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `请输入小于或等于 ${formatted ?? error.max} 的日期。`;\n },\n matDatepickerParse: (error: ParseError) => `无效的日期格式。`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `开始日期不可晚于结束日期。`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `结束日期不可早于开始日期。`,\n matDatepickerFilter: '此日期不可选择。',\n matTimepickerParse: (error: ParseError) => `无效的时间格式。`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `请输入大于或等于 ${formatted ?? error.min} 的时间。`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `请输入小于或等于 ${formatted ?? error.max} 的时间。`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_ZH_HANS: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesZhHansFactory,\n deps: [LOCALE_ID],\n};\n","import { formatDate } from '@angular/common';\nimport { type FactoryProvider, LOCALE_ID } from '@angular/core';\nimport { NGX_MAT_ERROR_DEFAULT_OPTIONS } from '../ngx-mat-errors.component';\nimport type {\n EndDateError,\n ErrorMessages,\n LengthError,\n MaxError,\n MinError,\n ParseError,\n StartDateError,\n} from '../types';\n\nexport function errorMessagesZhHantFactory(\n locale: string,\n dateFormat = 'shortDate',\n timeFormat = 'shortTime'\n): ErrorMessages {\n return {\n min: (error: MinError) => `請輸入大於或等於 ${error.min} 的數值。`,\n max: (error: MaxError) => `請輸入小於或等於 ${error.max} 的數值。`,\n required: `此欄位為必填。`,\n email: `請輸入有效的電子郵件地址。`,\n minlength: (error: LengthError) =>\n `請至少輸入 ${error.requiredLength} 個字元。`,\n maxlength: (error: LengthError) =>\n `請勿輸入超過 ${error.requiredLength} 個字元。`,\n matDatepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, dateFormat, locale);\n return `請輸入大於或等於 ${formatted ?? error.min} 的日期。`;\n },\n matDatepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, dateFormat, locale);\n return `請輸入小於或等於 ${formatted ?? error.max} 的日期。`;\n },\n matDatepickerParse: (error: ParseError) => `無效的日期格式。`,\n matStartDateInvalid: (error: StartDateError<Date>) =>\n `開始日期不可晚於結束日期。`,\n matEndDateInvalid: (error: EndDateError<Date>) =>\n `結束日期不可早於開始日期。`,\n matDatepickerFilter: '此日期不可選取。',\n matTimepickerParse: (error: ParseError) => `無效的時間格式。`,\n matTimepickerMin: (error: MinError<Date>) => {\n const formatted = formatDate(error.min, timeFormat, locale);\n return `請輸入大於或等於 ${formatted ?? error.min} 的時間。`;\n },\n matTimepickerMax: (error: MaxError<Date>) => {\n const formatted = formatDate(error.max, timeFormat, locale);\n return `請輸入小於或等於 ${formatted ?? error.max} 的時間。`;\n },\n };\n}\n\nexport const NGX_MAT_ERROR_CONFIG_ZH_HANT: FactoryProvider = {\n provide: NGX_MAT_ERROR_DEFAULT_OPTIONS,\n useFactory: errorMessagesZhHantFactory,\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":[],"mappings":";;;;;;;;AAIA;;;AAGG;MAEU,kBAAkB,CAAA;IACV,YAAY,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrE,GAAG,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,YAAY,EAAE,QAAQ;;0HAHzB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;8HAAlB,kBAAkB,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B;;AAQD;;AAEG;SACa,gCAAgC,GAAA;IAC9C,OAAO;AACL,QAAA,OAAO,EAAE,kBAAkB;KAC5B;AACH;;ACCA;;AAEG;MACU,iBAAiB,GAAG,IAAI,cAAc,CACjD,mBAAmB;MAaR,cAAc,CAAA;AACzB;;;AAGG;AAII,IAAA,iBAAiB;AAExB;;;AAGG;IAEI,yBAAyB,GAIrB,SAAS;AACJ,IAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;AAC7B,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE;AAC3D,QAAA,QAAQ,EAAE,IAAI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AAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAM5B,YAAY,EAAA,UAAA,EAAA,CAAA;kBA3BxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kCAAkC;AAC5C,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;AAgBR,KAAA,CAAA;oBACF,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC;AACtC,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,gBAAgB;AAC1B,qBAAA;AACD,oBAAA,SAAS,EAAE,CAAC,gCAAgC,EAAE;AACjD,iBAAA;8BASqB,OAAO,EAAA,CAAA;sBAD1B,KAAK;uBAAC,gBAAgB;;;ACxCzB;;AAEG;;;;"}
@@ -3,9 +3,30 @@ import { type Observable } from 'rxjs';
3
3
  import { type INgxMatErrorDef } from './ngx-mat-error-def.directive';
4
4
  import type { ErrorMessages, ErrorTemplate, NgxMatErrorControls } from './types';
5
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Default error messages for form controls. These messages can be overridden
8
+ * by providing custom messages using the {@link NGX_MAT_ERROR_ADDL_OPTIONS}
9
+ * injection token. Typically, this is initialized in the root module
10
+ * (or AppComponent) of the application, providing the app with a global set
11
+ * of validation error messages.
12
+ *
13
+ * Messages specific to each form can be provided using the
14
+ * {@link NGX_MAT_ERROR_ADDL_OPTIONS} injection token (see below).
15
+ */
6
16
  export declare const NGX_MAT_ERROR_DEFAULT_OPTIONS: InjectionToken<ErrorMessages | Observable<ErrorMessages>>;
17
+ /**
18
+ * Additional error messages to be merged with the default error messages.
19
+ * These messages will override the default messages if the same key is
20
+ * provided. This is useful for adding custom error messages specific to a
21
+ * form, without having to redefine all the default messages.
22
+ *
23
+ * Typically, this is provided in the component or module where the form
24
+ * is defined.
25
+ */
26
+ export declare const NGX_MAT_ERROR_ADDL_OPTIONS: InjectionToken<ErrorMessages | Observable<ErrorMessages>>;
7
27
  export declare class NgxMatErrors implements OnDestroy {
8
28
  private readonly messages$;
29
+ private readonly addlMessages$;
9
30
  private readonly defaultControl;
10
31
  private readonly controlChangedSubject;
11
32
  protected error$: Observable<ErrorTemplate>;
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "path": "src/assets/i18n/"
7
7
  }
8
8
  ],
9
- "version": "0.32.5",
9
+ "version": "0.32.6",
10
10
  "peerDependencies": {
11
11
  "@angular/common": "^19.1.0",
12
12
  "@angular/core": "^19.1.0",
@@ -47,6 +47,10 @@
47
47
  "types": "./entity-field/index.d.ts",
48
48
  "default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
49
49
  },
50
+ "./forms": {
51
+ "types": "./forms/index.d.ts",
52
+ "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
53
+ },
50
54
  "./locale": {
51
55
  "types": "./locale/index.d.ts",
52
56
  "default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
@@ -55,10 +59,6 @@
55
59
  "types": "./hover-dropdown/index.d.ts",
56
60
  "default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
57
61
  },
58
- "./forms": {
59
- "types": "./forms/index.d.ts",
60
- "default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
61
- },
62
62
  "./mat-context-menu": {
63
63
  "types": "./mat-context-menu/index.d.ts",
64
64
  "default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"